Skip to content

Commit 80d099c

Browse files
committed
rustc: Don't require a semicolon after an "alt" statement
1 parent f075b10 commit 80d099c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/comp/front/parser.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,7 @@ impure fn parse_alt_expr(parser p) -> @ast.expr {
771771
}
772772
}
773773
}
774+
p.bump();
774775

775776
auto expr = ast.expr_alt(discriminant, arms, ast.ann_none);
776777
auto hi = p.get_span();
@@ -974,6 +975,11 @@ impure fn parse_stmt(parser p) -> @ast.stmt {
974975
ret @spanned(lo, e.span, ast.stmt_expr(e));
975976
}
976977

978+
case (token.ALT) {
979+
auto e = parse_expr(p);
980+
ret @spanned(lo, e.span, ast.stmt_expr(e));
981+
}
982+
977983
case (token.LBRACE) {
978984
auto e = parse_expr(p);
979985
ret @spanned(lo, e.span, ast.stmt_expr(e));

0 commit comments

Comments
 (0)