rustc: Don't require a semicolon after an "alt" statement

This commit is contained in:
Patrick Walton 2010-11-24 16:29:44 -08:00
parent f075b10af2
commit 80d099c59a

View File

@ -771,6 +771,7 @@ impure fn parse_alt_expr(parser p) -> @ast.expr {
}
}
}
p.bump();
auto expr = ast.expr_alt(discriminant, arms, ast.ann_none);
auto hi = p.get_span();
@ -974,6 +975,11 @@ impure fn parse_stmt(parser p) -> @ast.stmt {
ret @spanned(lo, e.span, ast.stmt_expr(e));
}
case (token.ALT) {
auto e = parse_expr(p);
ret @spanned(lo, e.span, ast.stmt_expr(e));
}
case (token.LBRACE) {
auto e = parse_expr(p);
ret @spanned(lo, e.span, ast.stmt_expr(e));