diff options
Diffstat (limited to 'src/comp/front')
| -rw-r--r-- | src/comp/front/ast.rs | 1 | ||||
| -rw-r--r-- | src/comp/front/parser.rs | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs index 70da87dd..10bcd5c4 100644 --- a/src/comp/front/ast.rs +++ b/src/comp/front/ast.rs @@ -116,6 +116,7 @@ tag stmt_ { stmt_ret(option.t[@expr]); stmt_log(@expr); stmt_check_expr(@expr); + stmt_fail; stmt_expr(@expr); } 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; } |