Fix bug with parsing empty statements.

This commit is contained in:
Stephen Chung 2021-02-09 14:08:17 +08:00
parent 58528db45c
commit e88e65f36e

View File

@ -2571,7 +2571,10 @@ fn parse_stmt(
match token { match token {
// ; - empty statement // ; - empty statement
Token::SemiColon => Ok(Stmt::Noop(settings.pos)), Token::SemiColon => {
eat_token(input, Token::SemiColon);
Ok(Stmt::Noop(settings.pos))
}
// { - statements block // { - statements block
Token::LeftBrace => Ok(parse_block(input, state, lib, settings.level_up())?), Token::LeftBrace => Ok(parse_block(input, state, lib, settings.level_up())?),