diff options
| author | Brian Anderson <[email protected]> | 2011-01-28 00:09:26 -0500 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-01-28 11:12:57 -0800 |
| commit | 6b7cab3602eae7893a4efcee760600ab69d75173 (patch) | |
| tree | 0e73b029562b16641daae1b11ddf6a4396948016 /src/comp/front/parser.rs | |
| parent | Correctly handle "import foo = bar.zed;". (diff) | |
| download | rust-6b7cab3602eae7893a4efcee760600ab69d75173.tar.xz rust-6b7cab3602eae7893a4efcee760600ab69d75173.zip | |
Teach rustc to fail
Diffstat (limited to 'src/comp/front/parser.rs')
| -rw-r--r-- | src/comp/front/parser.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs index 5c13ef86..bef37a3c 100644 --- a/src/comp/front/parser.rs +++ b/src/comp/front/parser.rs @@ -1158,6 +1158,11 @@ impure fn parse_stmt(parser p) -> @ast.stmt { } } + case (token.FAIL) { + p.bump(); + ret @spanned(lo, p.get_span(), ast.stmt_fail); + } + case (token.RET) { p.bump(); alt (p.peek()) { @@ -1315,6 +1320,7 @@ fn stmt_ends_with_semi(@ast.stmt stmt) -> bool { case (ast.stmt_ret(_)) { ret true; } case (ast.stmt_log(_)) { ret true; } case (ast.stmt_check_expr(_)) { ret true; } + case (ast.stmt_fail) { ret true; } case (ast.stmt_expr(?e)) { alt (e.node) { case (ast.expr_vec(_,_)) { ret true; } |