/* Example: ---------- 1. ERROR in /home/stefan/JavaX-Caches/Temp/1642773472353/UserCode_1642773470538.java (at line 26) xg.fillRect(10, 10, 10, 10); ^^ xg cannot be resolved ---------- */ sclass ECJError { S file, error; int lineNr; S codeLine; IntRange colRange; toString { ret "Error on line " + lineNr + ": " + error; } } static L parseECJOutputForErrors(S text) { new L errors; LS lines = lines(text); for i over lines: { if (startsWith(lines.get(i), "---")) { S line = get(lines, i+1); //print(line); LS groups = regexpFirstGroups("^\\d+\\. ERROR in (.*?) \\(at line (\\d+)\\)$", line); if (groups != null) { //print(+groups); S codeLine = get(lines, i+2); S markLine = get(lines, i+3); S errorLine = get(lines, i+4); //print(+markLine); LS markGroups = regexpFirstGroups("^( *)(\\^+)", markLine); //print(+markGroups); new ECJError e; e.file = groups.get(0); e.error = errorLine; e.lineNr = parseInt(groups.get(1)); e.codeLine = codeLine; int col1 = l(first(markGroups)); int cols = l(second(markGroups)); e.colRange = intRangeWithLength(col1+1, cols); errors.add(e); } } } ret errors; }