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

Method parseAction

src/main/java/wycc/util/testing/TestFile.java:335–351  ·  view source on GitHub ↗
(int i, List<String> lines, List<Action> actions)

Source from the content-addressed store, hash-verified

333 }
334
335 private static int parseAction(int i, List<String> lines, List<Action> actions) {
336 String ith = lines.get(i);
337 String[] split = ith.split(" ");
338 Action.Kind kind = parseKind(split[0]);
339 Trie filename = Trie.fromString(split[1]);
340 Range range = split.length > 2 ? parseRange(split[2]) : null;
341 ArrayList<String> text = new ArrayList<>();
342 while (++i < lines.size()) {
343 ith = lines.get(i);
344 if (ith.startsWith("---") || ith.startsWith("<<<") || ith.startsWith(">>>") || ith.startsWith("===")) {
345 break;
346 }
347 text.add(ith);
348 }
349 actions.add(new Action(kind, filename, range, text));
350 return i;
351 }
352
353 private static Action.Kind parseKind(String line) {
354 if(line.equals(">>>")) {

Callers 1

parseFrameMethod · 0.95

Calls 6

parseKindMethod · 0.95
fromStringMethod · 0.95
parseRangeMethod · 0.95
getMethod · 0.65
sizeMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected