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 {
// ; - empty statement
Token::SemiColon => Ok(Stmt::Noop(settings.pos)),
Token::SemiColon => {
eat_token(input, Token::SemiColon);
Ok(Stmt::Noop(settings.pos))
}
// { - statements block
Token::LeftBrace => Ok(parse_block(input, state, lib, settings.level_up())?),