MCPcopy Create free account
hub / github.com/Whiley/WhileyCompiler / findSyntaxErrors

Method findSyntaxErrors

src/main/java/wyc/util/testing/Util.java:157–176  ·  view source on GitHub ↗

Following method is something of a kludge as no easy way at the moment to tell when a build has failed. @param item @param visited @return

(Syntactic.Item item, BitSet visited)

Source from the content-addressed store, hash-verified

155 * @return
156 */
157 public static boolean findSyntaxErrors(Syntactic.Item item, BitSet visited) {
158 int index = item.getIndex();
159 // Check whether already visited this item
160 if(!visited.get(index)) {
161 visited.set(index);
162 // Check whether this item has a marker associated with it.
163 if (item instanceof WyilFile.Attr.SyntaxError) {
164 // At least one marked associated with item.
165 return true;
166 }
167 // Recursive children looking for other syntactic markers
168 for (int i = 0; i != item.size(); ++i) {
169 if(findSyntaxErrors(item.get(i), visited)) {
170 return true;
171 }
172 }
173 }
174 //
175 return false;
176 }
177}

Callers

nothing calls this directly

Calls 4

getIndexMethod · 0.65
getMethod · 0.65
setMethod · 0.65
sizeMethod · 0.65

Tested by

no test coverage detected