aboutsummaryrefslogtreecommitdiff
path: root/src/comp/front/parser.rs
diff options
context:
space:
mode:
authorBrian Anderson <[email protected]>2011-03-24 21:04:29 -0400
committerGraydon Hoare <[email protected]>2011-03-25 11:01:52 -0700
commit71f058499a0e551d2b8deb5d098bdb04387dc021 (patch)
tree4e14a52c8c0092f332c3c9477b85b97799310244 /src/comp/front/parser.rs
parentAdd test for local declarations with receive. XFAIL in rustc. (diff)
downloadrust-71f058499a0e551d2b8deb5d098bdb04387dc021.tar.xz
rust-71f058499a0e551d2b8deb5d098bdb04387dc021.zip
Refactor ast.local to make room for initialization via recv
Diffstat (limited to 'src/comp/front/parser.rs')
-rw-r--r--src/comp/front/parser.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs
index 063bc0e1..23b4a936 100644
--- a/src/comp/front/parser.rs
+++ b/src/comp/front/parser.rs
@@ -1364,13 +1364,14 @@ impure fn parse_expr_inner(parser p) -> @ast.expr {
}
}
-impure fn parse_initializer(parser p) -> option.t[@ast.expr] {
+impure fn parse_initializer(parser p) -> option.t[ast.initializer] {
if (p.peek() == token.EQ) {
p.bump();
- ret some(parse_expr(p));
+ ret some(rec(op = ast.init_assign,
+ expr = parse_expr(p)));
}
- ret none[@ast.expr];
+ ret none[ast.initializer];
}
impure fn parse_pat(parser p) -> @ast.pat {