From 378c0087ca7572cd17726c704fe04d57bf4687af Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Sun, 30 Jan 2011 17:18:19 -0500 Subject: Parse 'be' statement. Pass tailcall tests. No actual tailcalls yet. --- src/comp/front/ast.rs | 1 + src/comp/front/parser.rs | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'src/comp/front') diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs index 5f315e58..756a7ad1 100644 --- a/src/comp/front/ast.rs +++ b/src/comp/front/ast.rs @@ -116,6 +116,7 @@ type stmt = spanned[stmt_]; tag stmt_ { stmt_decl(@decl); stmt_ret(option.t[@expr]); + stmt_be(@expr); stmt_log(@expr); stmt_check_expr(@expr); stmt_fail; diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs index 8d130935..a1b519ba 100644 --- a/src/comp/front/parser.rs +++ b/src/comp/front/parser.rs @@ -1200,6 +1200,12 @@ impure fn parse_stmt(parser p) -> @ast.stmt { } } + case (token.BE) { + p.bump(); + auto e = parse_expr(p); + ret @spanned(lo, e.span, ast.stmt_be(e)); + } + case (token.LET) { auto decl = parse_let(p); auto hi = p.get_span(); @@ -1340,6 +1346,7 @@ fn stmt_ends_with_semi(@ast.stmt stmt) -> bool { } } case (ast.stmt_ret(_)) { ret true; } + case (ast.stmt_be(_)) { ret true; } case (ast.stmt_log(_)) { ret true; } case (ast.stmt_check_expr(_)) { ret true; } case (ast.stmt_fail) { ret true; } -- cgit v1.2.3