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 @@ fn collect_expr_inner(&mut self, expr: ast::Expr) -> ExprId {
ast::Expr::BlockExpr(e) => self.collect_block(e),
ast::Expr::LoopExpr(e) => {
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 {
body,
label: e
@ -327,7 +329,9 @@ fn collect_expr_inner(&mut self, expr: ast::Expr) -> ExprId {
.map(|l| Name::new_lifetime(&l)),
},
syntax_ptr,
), body)
),
body
)
}
ast::Expr::WhileExpr(e) => {
let body = self.collect_block_opt(e.loop_body());
@ -350,7 +354,9 @@ fn collect_expr_inner(&mut self, expr: ast::Expr) -> ExprId {
];
let match_expr =
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 {
body: match_expr,
label: e
@ -359,12 +365,16 @@ fn collect_expr_inner(&mut self, expr: ast::Expr) -> ExprId {
.map(|l| Name::new_lifetime(&l)),
},
syntax_ptr,
), match_expr);
),
match_expr
);
}
},
};
track_parent!(self, self.alloc_expr(
track_parent!(
self,
self.alloc_expr(
Expr::While {
condition,
body,
@ -374,13 +384,18 @@ fn collect_expr_inner(&mut self, expr: ast::Expr) -> ExprId {
.map(|l| Name::new_lifetime(&l)),
},
syntax_ptr,
), body, condition)
),
body,
condition
)
}
ast::Expr::ForExpr(e) => {
let iterable = self.collect_expr_opt(e.iterable());
let pat = self.collect_pat_opt(e.pat());
let body = self.collect_block_opt(e.loop_body());
track_parent!(self, self.alloc_expr(
track_parent!(
self,
self.alloc_expr(
Expr::For {
iterable,
pat,
@ -391,7 +406,10 @@ fn collect_expr_inner(&mut self, expr: ast::Expr) -> ExprId {
.map(|l| Name::new_lifetime(&l)),
},
syntax_ptr,
), iterable, body)
),
iterable,
body
)
}
ast::Expr::CallExpr(e) => {
let callee = self.collect_expr_opt(e.expr());
@ -461,10 +479,10 @@ fn collect_expr_inner(&mut self, expr: ast::Expr) -> ExprId {
.unwrap_or(Expr::Missing);
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)) },
syntax_ptr,
), vec![]),
),
ast::Expr::BreakExpr(e) => {
let expr = e.expr().map(|e| self.collect_expr(e));
track_parent!(self, self.alloc_expr(