Don't get stuck in tuple exprs

This commit is contained in:
Aleksey Kladov 2018-09-08 10:35:05 +03:00
parent a0a347eac9
commit febbc9acdd
4 changed files with 484 additions and 96 deletions

View file

@ -108,6 +108,10 @@ fn tuple_expr(p: &mut Parser) -> CompletedMarker {
let mut saw_expr = false;
while !p.at(EOF) && !p.at(R_PAREN) {
saw_expr = true;
if !EXPR_FIRST.contains(p.current()) {
p.error("expected expression");
break;
}
expr(p);
if !p.at(R_PAREN) {
saw_comma = true;