Parse 'be' statement. Pass tailcall tests. No actual tailcalls yet.

This commit is contained in:
Brian Anderson 2011-01-30 17:18:19 -05:00 committed by Graydon Hoare
parent c0f997be21
commit 378c0087ca
6 changed files with 48 additions and 0 deletions

View file

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

View file

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