Differences From Artifact [667427a12e5e3b09]:
- File
main.d
- 2010-11-09 14:59:36 - part of checkin [7465fcdd7f] on branch trunk - layered function invocation (user: kinaba) [annotate]
To Artifact [abae545f4409680b]:
- File
main.d
- 2010-11-10 12:38:54 - part of checkin [38fcc662be] on branch trunk - cleaned up documentation comments (user: kinaba) [annotate]
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");