diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-09-20 18:06:47 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-09-20 18:06:47 -0700 |
| commit | f809e2269779b5518e648cf63d9538399b00298e (patch) | |
| tree | c6cab9f354a64310b5274fb1e3e0aca9506fc5a0 /src/comp/syntax/parse | |
| parent | 7ae251789ccd0a647e5abfc8085a8bd42359de65 (diff) | |
| download | rust-f809e2269779b5518e648cf63d9538399b00298e.tar.gz rust-f809e2269779b5518e648cf63d9538399b00298e.zip | |
Represent unique creation as a unop in the AST instead of its own expr
Like the box unop. Issue #409
Diffstat (limited to 'src/comp/syntax/parse')
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index 3e559e1a2a9..6869dc6501d 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -886,9 +886,6 @@ fn parse_bottom_expr(p: parser) -> @ast::expr { } else if p.peek() == token::ELLIPSIS { p.bump(); ret mk_mac_expr(p, lo, p.get_hi_pos(), ast::mac_ellipsis); - } else if p.peek() == token::TILDE { - p.bump(); - ex = ast::expr_uniq(parse_expr(p)); } else if eat_word(p, "obj") { // Anonymous object @@ -1145,6 +1142,13 @@ fn parse_prefix_expr(p: parser) -> @ast::expr { hi = e.span.hi; ex = ast::expr_unary(ast::box(m), e); } + token::TILDE. { + p.bump(); + let m = parse_mutability(p); + let e = parse_prefix_expr(p); + hi = e.span.hi; + ex = ast::expr_unary(ast::uniq(m), e); + } _ { ret parse_dot_or_call_expr(p); } } ret mk_expr(p, lo, hi, ex); |
