Parser fix: 'fail' was eating the next token that came after it.

This commit is contained in:
Paul Stansifer 2011-05-16 18:05:21 -07:00 committed by Graydon Hoare
parent f7df3696de
commit 1fdc75ee7c
3 changed files with 14 additions and 1 deletions

View File

@ -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);

View File

@ -0,0 +1,6 @@
// -*- rust -*-
// error-pattern: after expression but found
fn main() {
fail @ ;
}

View File

@ -0,0 +1,8 @@
// -*- rust -*-
fn dont_call_me() {
fail;
log 1;
}
fn main() {}