I recently came across what might be considered a bug in the interpreter.  When interpreting line comments (//), the parser blows up when the last line of source contains a line comment and is not terminated with a new-line character:

bsh % eval("print(\"hello world\")");
hello world
bsh % eval("print(\"hello world\") //this will blow up");
// Error: // Uncaught Exception: Method Invocation this.interpreter.eval : at Line: 73 : in file: /bsh/commands/eval.bsh : this .interpreter .eval ( expression , this .caller .namespace )

Called from method: eval : at Line: 2 : in file: <unknown file> : eval ( "print(\"hello world\") //this will blow up" )
Target exception: Parse error at line 1, column 41.  Encountered: <EOF>

bsh % eval("print(\"hello world\") //but this will work\n");
hello world



Alexey
2001 Honda CBR600F4i (CCS)
1992 Kawasaki EX500
http://azinger.blogspot.com
http://bsheet.sourceforge.net
http://wcollage.sourceforge.net


Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.