mirror of https://github.com/rust-lang/rust.git
Parser fix: 'fail' was eating the next token that came after it.
This commit is contained in:
parent
f7df3696de
commit
1fdc75ee7c
|
@ -898,7 +898,6 @@ fn parse_bottom_expr(parser p) -> @ast::expr {
|
|||
ex = expand_syntax_ext(p, es.span, pth, es.node,
|
||||
none[str]);
|
||||
} else if (eat_word(p, "fail")) {
|
||||
p.bump();
|
||||
ex = ast::expr_fail(p.get_ann());
|
||||
} else if (eat_word(p, "log")) {
|
||||
auto e = parse_expr(p);
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
// -*- rust -*-
|
||||
|
||||
// error-pattern: after expression but found
|
||||
fn main() {
|
||||
fail @ ;
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
// -*- rust -*-
|
||||
|
||||
fn dont_call_me() {
|
||||
fail;
|
||||
log 1;
|
||||
}
|
||||
|
||||
fn main() {}
|
Loading…
Reference in New Issue