private static Syntax prepare(String srcCode, String moduleCode) { Syntax res = null; try { res = SealTest.sealize("thorn", srcCode, SyntacticClass.STMT, moduleCode); // checkSealsOnAllIds(res); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (FisherException e) { // TODO Auto-generated catch block e.printStackTrace(); } if (SealTest.thereAreErrors()) { die("\n" + "\nThere were errors!\n " + Bard.sep(Compilation.current.messages, "\n")); } return res; }
private static void evalAndRun() { try { TestUtils.reset("--run--"); slurpModuleCode(); if (evalFile == null) die("No Thorn file specified."); if (!evalFile.exists()) die("Thorn file " + evalFile + " does not exist."); String srcCode = Bard.contentsOf(evalFile); Cmd cmd = (Cmd) SealTest.sealize("thorn", srcCode, SyntacticClass.STMT, moduleCode); if (SealTest.thereAreErrors()) { die("\n" + "\nThere were errors!\n " + Bard.sep(Compilation.current.messages, "\n")); } Thing res = Evaller.fullEval(cmd); if (printResultOfEval) { System.out.println(EvalUtil.toString(res)); } } catch (ParseException e) { e.printStackTrace(); } catch (FisherException e) { e.printStackTrace(); } }