aboutsummaryrefslogtreecommitdiff
path: root/src/comp/front/parser.rs
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2011-02-14 17:58:32 -0800
committerGraydon Hoare <[email protected]>2011-02-14 17:58:32 -0800
commit15a01f5c3691a152793d8933a7be9d16a0fc7030 (patch)
treeef18ede583e4aae92360e5e2dc033f6c9ffc865f /src/comp/front/parser.rs
parentMove all non-decl/non-expr stmts to exprs. (diff)
downloadrust-15a01f5c3691a152793d8933a7be9d16a0fc7030.tar.xz
rust-15a01f5c3691a152793d8933a7be9d16a0fc7030.zip
Add basic front-end support for expr_put.
Diffstat (limited to 'src/comp/front/parser.rs')
-rw-r--r--src/comp/front/parser.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs
index 5ffaca19..a779d013 100644
--- a/src/comp/front/parser.rs
+++ b/src/comp/front/parser.rs
@@ -638,6 +638,20 @@ impure fn parse_bottom_expr(parser p) -> @ast.expr {
}
}
+ case (token.PUT) {
+ p.bump();
+ alt (p.peek()) {
+ case (token.SEMI) {
+ ex = ast.expr_put(none[@ast.expr]);
+ }
+ case (_) {
+ auto e = parse_expr(p);
+ hi = e.span;
+ ex = ast.expr_put(some[@ast.expr](e));
+ }
+ }
+ }
+
case (token.BE) {
p.bump();
auto e = parse_expr(p);
@@ -1420,6 +1434,7 @@ fn stmt_ends_with_semi(@ast.stmt stmt) -> bool {
case (ast.expr_path(_,_,_)) { ret true; }
case (ast.expr_fail) { ret true; }
case (ast.expr_ret(_)) { ret true; }
+ case (ast.expr_put(_)) { ret true; }
case (ast.expr_be(_)) { ret true; }
case (ast.expr_log(_)) { ret true; }
case (ast.expr_check_expr(_)) { ret true; }