Parse extra semicolons as empty statements
This commit is contained in:
parent
a2ef543292
commit
d78e5d671e
@ -873,6 +873,11 @@ namespace Parser
|
|||||||
{
|
{
|
||||||
return ParseExpressionStatement();
|
return ParseExpressionStatement();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CurrentToken.Kind == TokenKind.Semicolon)
|
||||||
|
{
|
||||||
|
return Factory.ExpressionStatement(Factory.EmptyExpression(), Factory.Token(EatToken()));
|
||||||
|
}
|
||||||
throw new ParsingException($"Unexpected token: \"{CurrentToken.PureToken}\" at {CurrentToken.PureToken.Position}");
|
throw new ParsingException($"Unexpected token: \"{CurrentToken.PureToken}\" at {CurrentToken.PureToken.Position}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user