rustc: Change the address-of operator to an explicit production so that we can parse the mutability

This commit is contained in:
Patrick Walton 2012-03-08 16:34:36 -08:00
parent 0722786664
commit ddeaea2287
10 changed files with 97 additions and 55 deletions

View file

@ -1129,9 +1129,10 @@ fn parse_prefix_expr(p: parser) -> pexpr {
}
token::AND {
p.bump();
let m = parse_mutability(p);
let e = to_expr(parse_prefix_expr(p));
hi = e.span.hi;
ex = ast::expr_unary(ast::addr_of, e);
ex = ast::expr_addr_of(m, e);
}
_ { ret parse_dot_or_call_expr(p); }
}