mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
rustc: Don't require a semicolon after an "alt" statement
This commit is contained in:
parent
f075b10af2
commit
80d099c59a
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user