diff options
| author | Graydon Hoare <[email protected]> | 2011-02-15 12:20:30 -0800 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-02-15 12:20:30 -0800 |
| commit | 9ae89bd404803be6b820189d8e0480b3395d05ee (patch) | |
| tree | bc9fb10220f1d2275f02731a866cf9a177abef3d /src/comp/front | |
| parent | Fix missing path in expr_ext. (diff) | |
| download | rust-9ae89bd404803be6b820189d8e0480b3395d05ee.tar.xz rust-9ae89bd404803be6b820189d8e0480b3395d05ee.zip | |
Add _mutable unop.
Diffstat (limited to 'src/comp/front')
| -rw-r--r-- | src/comp/front/ast.rs | 1 | ||||
| -rw-r--r-- | src/comp/front/parser.rs | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs index 520f5557..03ccc216 100644 --- a/src/comp/front/ast.rs +++ b/src/comp/front/ast.rs @@ -106,6 +106,7 @@ tag unop { bitnot; not; neg; + _mutable; } tag mode { diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs index 085255a4..8acc8897 100644 --- a/src/comp/front/parser.rs +++ b/src/comp/front/parser.rs @@ -811,6 +811,13 @@ impure fn parse_prefix_expr(parser p) -> @ast.expr { ex = ast.expr_unary(ast.box, e, ast.ann_none); } + case (token.MUTABLE) { + p.bump(); + auto e = parse_prefix_expr(p); + hi = e.span; + ex = ast.expr_unary(ast._mutable, e, ast.ann_none); + } + case (_) { ret parse_dot_or_call_expr(p); } |