mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-10 21:58:48 +01:00
@ -1629,13 +1629,11 @@ static bool finishBlock(Compiler* compiler)
|
||||
do
|
||||
{
|
||||
definition(compiler);
|
||||
|
||||
// If we got into a weird error state, don't get stuck in a loop.
|
||||
if (peek(compiler) == TOKEN_EOF) return true;
|
||||
|
||||
consumeLine(compiler, "Expect newline after statement.");
|
||||
}
|
||||
while (!match(compiler, TOKEN_RIGHT_BRACE));
|
||||
while (peek(compiler) != TOKEN_RIGHT_BRACE && peek(compiler) != TOKEN_EOF);
|
||||
|
||||
consume(compiler, TOKEN_RIGHT_BRACE, "Expect '}' at end of block.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
6
test/regression/429.wren
Normal file
6
test/regression/429.wren
Normal file
@ -0,0 +1,6 @@
|
||||
// The missing "}" was not detected by the compiler and reported as an error,
|
||||
// so it then tried to run the resulting erroneous bytecode and crashed.
|
||||
|
||||
// expect error line 6
|
||||
{
|
||||
System
|
||||
Reference in New Issue
Block a user