Don't require a newline at the end of a file.

This commit is contained in:
Bob Nystrom
2013-11-01 06:57:21 -07:00
parent 70f6d61cca
commit cfa65a6536
2 changed files with 2 additions and 2 deletions

View File

@ -244,8 +244,7 @@ ObjBlock* compileBlock(Parser* parser, Compiler* parent, TokenType endToken)
{
statement(&compiler);
consume(&compiler, TOKEN_LINE);
if (!match(&compiler, TOKEN_LINE)) break;
if (match(&compiler, endToken)) break;
// Discard the result of the previous expression.

View File

@ -0,0 +1 @@
io.write("ok") // expect: ok