@@ -34,10 +34,12 @@ } catch( LexException ) { // always EOF exception, so wait next return false; } catch( ParseException e ) { - if( find(e.msg, "EOF") ) // ultra ad-hoc + if( find(e.msg, "EOF")!="" ) // ultra ad-hoc return false; + buf = ""; + lineno = nextlineno; throw e; } return true; } @@ -56,11 +58,18 @@ } return true; } } + +version(unittest) { + bool success = false; + static ~this(){ if(!success){writeln("(press enter to exit)"); readln();} } +} void main( string[] args ) { + version(unittest) success=true; + if( args.length <= 1 ) { writeln("Welcome to Polemy 0.1.0"); for(auto r = new REPL; r.singleInteraction();) {}