mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
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);
|
||||
|
6
src/test/compile-fail/fail-simple.rs
Normal file
6
src/test/compile-fail/fail-simple.rs
Normal file
@ -0,0 +1,6 @@
|
||||
// -*- rust -*-
|
||||
|
||||
// error-pattern: after expression but found
|
||||
fn main() {
|
||||
fail @ ;
|
||||
}
|
8
src/test/run-pass/parse-fail.rs
Normal file
8
src/test/run-pass/parse-fail.rs
Normal file
@ -0,0 +1,8 @@
|
||||
// -*- rust -*-
|
||||
|
||||
fn dont_call_me() {
|
||||
fail;
|
||||
log 1;
|
||||
}
|
||||
|
||||
fn main() {}
|
Loading…
Reference in New Issue
Block a user