use of ast.ErrorMessage.FinalResult in project L42 by ElvisResearchGroup.
the class TestL42SuperSlow method test17.
@Test
public void test17() throws IOException {
String s = TestHelper.multiLine("", "{reuse L42.is/microBase", "NList:Collections.list(N)", "Util:{()", " class method N max(NList that){", " if that.isEmpty() (error S\"Empty lists have no max\")", " var N candidate=that.top()", " with ei in that.vals() (", " if ei>candidate (candidate:=ei)", " )", " return candidate", " }", " }", "C:{", " list=NList[2N;0N;2N;0N;1N;3N;2N;0N;2N;0N;2N;0N;2N;0N;]", " if Util.max(list)==3N (return ExitCode.normal())", " return ExitCode.failure()", " }", "}");
try {
FinalResult res = L42.runSlow(null, s);
System.out.println(L42.record.toString());
if (res.getResult() != 0) {
System.out.println(res);
TestHelper.reportError(null);
}
} catch (ErrorMessage msg) {
System.out.println(L42.record.toString());
msg.printStackTrace();
TestHelper.reportError(msg);
}
}
use of ast.ErrorMessage.FinalResult in project L42 by ElvisResearchGroup.
the class BuildLibs method main.
public static void main(String[] arg) throws IOException {
L42.setRootPath(Paths.get("dummy"));
TestHelper.configureForTest();
try {
FinalResult res = L42.runSlow(null, TestHelper.multiLine("", //,"{reuse L42.is/nanoBase1"
"{reuse L42.is/deployMini", "Main:{", //," )"
" Deploy(", " fileName:S\"localhost/miniBase.L42\",", " code:{reuse L42.is/tinyBase1},", //," code:{reuse L42.is/nanoBase1},"
" node:S\"This0\")", " return ExitCode.normal()", " }", "}"));
System.out.println("------------------------------");
System.out.println("END: " + res.getErrCode());
} catch (ErrorMessage msg) {
//System.out.println(L42.record.toString());
msg.printStackTrace();
//Executor.reportError(msg);
System.out.println(ErrorFormatter.formatError(Program.empty(), msg).getErrorTxt());
}
}
Aggregations