AST refactor: make the place in ExprBox an option.

This is to allow us to migrate away from UnUniq in a followup commit,
and thus unify the code paths related to all forms of `box`.
This commit is contained in:
Felix S. Klock II 2014-12-16 14:30:30 +01:00
parent 41f5907fa6
commit 7d4e7f0795
11 changed files with 35 additions and 25 deletions

View file

@ -2888,7 +2888,7 @@ impl<'a> Parser<'a> {
}
let subexpression = self.parse_prefix_expr();
hi = subexpression.span.hi;
ex = ExprBox(place, subexpression);
ex = ExprBox(Some(place), subexpression);
return self.mk_expr(lo, hi, ex);
}
}
@ -2896,6 +2896,9 @@ impl<'a> Parser<'a> {
// Otherwise, we use the unique pointer default.
let subexpression = self.parse_prefix_expr();
hi = subexpression.span.hi;
// FIXME (pnkfelix): After working out kinks with box
// desugaring, should be `ExprBox(None, subexpression)`
// instead.
ex = self.mk_unary(UnUniq, subexpression);
}
_ => return self.parse_dot_or_call_expr()