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

Method parseFrame

src/main/java/wycc/util/testing/TestFile.java:308–333  ·  view source on GitHub ↗
(int i, List<String> lines, List<Frame> frames)

Source from the content-addressed store, hash-verified

306 }
307
308 private static int parseFrame(int i, List<String> lines, List<Frame> frames) {
309 ArrayList<Action> actions = new ArrayList<>();
310 while(i < lines.size()) {
311 String ith = lines.get(i);
312 if(ith.startsWith("===")) {
313 // No error markers in this frame
314 frames.add(new Frame(actions,Collections.emptyList()));
315 return i+1;
316 } else if(ith.startsWith("---")) {
317 i = i + 1;
318 break;
319 }
320 i = parseAction(i,lines,actions);
321 }
322 ArrayList<Error> errors = new ArrayList<>();
323 while(i < lines.size()) {
324 String ith = lines.get(i);
325 if(ith.startsWith("===")) {
326 i = i + 1;
327 break;
328 }
329 errors.add(parseError(lines.get(i++)));
330 }
331 frames.add(new Frame(actions,errors));
332 return i;
333 }
334
335 private static int parseAction(int i, List<String> lines, List<Action> actions) {
336 String ith = lines.get(i);

Callers 1

parseMethod · 0.95

Calls 5

parseActionMethod · 0.95
parseErrorMethod · 0.95
sizeMethod · 0.65
getMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected