mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 22:28:45 +01:00
Don't require a newline at the end of a file.
This commit is contained in:
@ -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.
|
||||
|
||||
1
test/no_trailing_newline.wren
Normal file
1
test/no_trailing_newline.wren
Normal file
@ -0,0 +1 @@
|
||||
io.write("ok") // expect: ok
|
||||
Reference in New Issue
Block a user