mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-22 11:24:24 +00:00
fix: Simplify macro statement expansion handling
This commit is contained in:
parent
f8c416e1b9
commit
531e152390
10 changed files with 155 additions and 110 deletions
|
@ -199,7 +199,8 @@ pub enum Expr {
|
|||
body: ExprId,
|
||||
},
|
||||
MacroStmts {
|
||||
tail: ExprId,
|
||||
statements: Box<[Statement]>,
|
||||
tail: Option<ExprId>,
|
||||
},
|
||||
Array(Array),
|
||||
Literal(Literal),
|
||||
|
@ -254,7 +255,7 @@ impl Expr {
|
|||
Expr::Let { expr, .. } => {
|
||||
f(*expr);
|
||||
}
|
||||
Expr::Block { statements, tail, .. } => {
|
||||
Expr::MacroStmts { tail, statements } | Expr::Block { statements, tail, .. } => {
|
||||
for stmt in statements.iter() {
|
||||
match stmt {
|
||||
Statement::Let { initializer, .. } => {
|
||||
|
@ -344,7 +345,6 @@ impl Expr {
|
|||
f(*repeat)
|
||||
}
|
||||
},
|
||||
Expr::MacroStmts { tail } => f(*tail),
|
||||
Expr::Literal(_) => {}
|
||||
Expr::Underscore => {}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue