Fix issues caused during rebase

This commit is contained in:
Paul Daniel Faria 2020-06-02 18:04:23 -04:00
parent 2608a6fd3a
commit f78df42f81

View file

@ -318,7 +318,9 @@ impl ExprCollector<'_> {
ast::Expr::BlockExpr(e) => self.collect_block(e), ast::Expr::BlockExpr(e) => self.collect_block(e),
ast::Expr::LoopExpr(e) => { ast::Expr::LoopExpr(e) => {
let body = self.collect_block_opt(e.loop_body()); let body = self.collect_block_opt(e.loop_body());
track_parent!(self, self.alloc_expr(Expr::Loop { body }, syntax_ptr), vec![body]) track_parent!(
self,
self.alloc_expr(
Expr::Loop { Expr::Loop {
body, body,
label: e label: e
@ -327,7 +329,9 @@ impl ExprCollector<'_> {
.map(|l| Name::new_lifetime(&l)), .map(|l| Name::new_lifetime(&l)),
}, },
syntax_ptr, syntax_ptr,
), body) ),
body
)
} }
ast::Expr::WhileExpr(e) => { ast::Expr::WhileExpr(e) => {
let body = self.collect_block_opt(e.loop_body()); let body = self.collect_block_opt(e.loop_body());
@ -350,7 +354,9 @@ impl ExprCollector<'_> {
]; ];
let match_expr = let match_expr =
self.alloc_expr_desugared(Expr::Match { expr: match_expr, arms }); self.alloc_expr_desugared(Expr::Match { expr: match_expr, arms });
return track_parent!(self, self.alloc_expr( return track_parent!(
self,
self.alloc_expr(
Expr::Loop { Expr::Loop {
body: match_expr, body: match_expr,
label: e label: e
@ -359,12 +365,16 @@ impl ExprCollector<'_> {
.map(|l| Name::new_lifetime(&l)), .map(|l| Name::new_lifetime(&l)),
}, },
syntax_ptr, syntax_ptr,
), match_expr); ),
match_expr
);
} }
}, },
}; };
track_parent!(self, self.alloc_expr( track_parent!(
self,
self.alloc_expr(
Expr::While { Expr::While {
condition, condition,
body, body,
@ -374,13 +384,18 @@ impl ExprCollector<'_> {
.map(|l| Name::new_lifetime(&l)), .map(|l| Name::new_lifetime(&l)),
}, },
syntax_ptr, syntax_ptr,
), body, condition) ),
body,
condition
)
} }
ast::Expr::ForExpr(e) => { ast::Expr::ForExpr(e) => {
let iterable = self.collect_expr_opt(e.iterable()); let iterable = self.collect_expr_opt(e.iterable());
let pat = self.collect_pat_opt(e.pat()); let pat = self.collect_pat_opt(e.pat());
let body = self.collect_block_opt(e.loop_body()); let body = self.collect_block_opt(e.loop_body());
track_parent!(self, self.alloc_expr( track_parent!(
self,
self.alloc_expr(
Expr::For { Expr::For {
iterable, iterable,
pat, pat,
@ -391,7 +406,10 @@ impl ExprCollector<'_> {
.map(|l| Name::new_lifetime(&l)), .map(|l| Name::new_lifetime(&l)),
}, },
syntax_ptr, syntax_ptr,
), iterable, body) ),
iterable,
body
)
} }
ast::Expr::CallExpr(e) => { ast::Expr::CallExpr(e) => {
let callee = self.collect_expr_opt(e.expr()); let callee = self.collect_expr_opt(e.expr());
@ -461,10 +479,10 @@ impl ExprCollector<'_> {
.unwrap_or(Expr::Missing); .unwrap_or(Expr::Missing);
self.alloc_expr(path, syntax_ptr) self.alloc_expr(path, syntax_ptr)
} }
ast::Expr::ContinueExpr(e) => (self.alloc_expr( ast::Expr::ContinueExpr(e) => self.alloc_expr(
Expr::Continue { label: e.lifetime_token().map(|l| Name::new_lifetime(&l)) }, Expr::Continue { label: e.lifetime_token().map(|l| Name::new_lifetime(&l)) },
syntax_ptr, syntax_ptr,
), vec![]), ),
ast::Expr::BreakExpr(e) => { ast::Expr::BreakExpr(e) => {
let expr = e.expr().map(|e| self.collect_expr(e)); let expr = e.expr().map(|e| self.collect_expr(e));
track_parent!(self, self.alloc_expr( track_parent!(self, self.alloc_expr(