aboutsummaryrefslogtreecommitdiff
path: root/src/comp/front/parser.rs
diff options
context:
space:
mode:
authorBrian Anderson <[email protected]>2011-02-09 22:36:37 -0500
committerGraydon Hoare <[email protected]>2011-02-10 12:12:10 -0800
commitf17a3421e01399bcc1a6f8540273d7b4440397a1 (patch)
treedc17d7b517a90121f09f400014e6c38d94f52b0a /src/comp/front/parser.rs
parentAdd compile-fail tests for tail calls (diff)
downloadrust-f17a3421e01399bcc1a6f8540273d7b4440397a1.tar.xz
rust-f17a3421e01399bcc1a6f8540273d7b4440397a1.zip
Cleanup for 'be' statement and comments about future typestate
Diffstat (limited to 'src/comp/front/parser.rs')
-rw-r--r--src/comp/front/parser.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs
index a1b519ba..ea4cf12c 100644
--- a/src/comp/front/parser.rs
+++ b/src/comp/front/parser.rs
@@ -1203,7 +1203,13 @@ 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));
+ // FIXME: Is this the right place for this check?
+ if /*check*/ (ast.is_call_expr(e)) {
+ ret @spanned(lo, e.span, ast.stmt_be(e));
+ }
+ else {
+ p.err("Non-call expression in tail call");
+ }
}
case (token.LET) {