check for leading { while parsing a block

This commit is contained in:
SparkyPotato
2023-01-31 21:19:08 +05:30
committed by Teodor Tanasoaia
parent 16be1a9237
commit bb20ae8e79

View File

@@ -1776,7 +1776,7 @@ impl Parser {
ctx.local_table.push_scope();
let _ = lexer.next();
lexer.expect(Token::Paren('{'))?;
let mut statements = ast::Block::default();
while !lexer.skip(Token::Paren('}')) {
self.statement(lexer, ctx.reborrow(), &mut statements)?;