コード例 #1
0
 @Override
 public Thing apply(Thing[] args, Framelike ignoredFrame, Evaller evaller, Syntax src)
     throws FisherException {
   for (Thing thing : args) {
     System.out.print(EvalUtil.toString(thing));
   }
   String s = inscanner.nextLine();
   return StringTh.of(s);
 }
コード例 #2
0
 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();
   }
 }