Diff
Not logged in

Differences From Artifact [667427a12e5e3b09]:

To Artifact [abae545f4409680b]:


9 import std.algorithm; 9 import std.algorithm; 10 import polemy.value; 10 import polemy.value; 11 import polemy.lex; 11 import polemy.lex; 12 import polemy.parse; 12 import polemy.parse; 13 import polemy.ast; 13 import polemy.ast; 14 import polemy.eval; 14 import polemy.eval; 15 15 > 16 /// Tenuki Read-Eval-Print-Loop 16 class REPL 17 class REPL 17 { 18 { 18 Table ctx; 19 Table ctx; 19 string buf; 20 string buf; 20 Value lastVal; 21 Value lastVal; 21 int lineno = 1; 22 int lineno = 1; 22 int nextlineno = 1; 23 int nextlineno = 1; ................................................................................................................................................................................ 55 } 56 } 56 57 57 version(unittest) { 58 version(unittest) { 58 bool success = false; 59 bool success = false; 59 static ~this(){ if(!success){writeln("(press enter to exit)"); readln(); 60 static ~this(){ if(!success){writeln("(press enter to exit)"); readln(); 60 } 61 } 61 62 > 63 /// Entry point. If args.length==1, invoke REPL. > 64 /// Otherwise interpret the argument as a filename. 62 void main( string[] args ) 65 void main( string[] args ) 63 { 66 { 64 version(unittest) success=true; 67 version(unittest) success=true; 65 68 66 if( args.length <= 1 ) 69 if( args.length <= 1 ) 67 { 70 { 68 writeln("Welcome to Polemy 0.1.0"); 71 writeln("Welcome to Polemy 0.1.0");