Fix extract_function with macro arg

This commit is contained in:
Daiki Ihara 2021-06-25 22:14:42 +09:00 committed by Lukas Wirth
parent 535f0726f1
commit 4d005e529b
2 changed files with 69 additions and 28 deletions

View file

@ -77,6 +77,11 @@ impl ast::Expr {
}
// Don't skip subtree since we want to process the expression child next
Some(ast::Stmt::ExprStmt(_)) => (),
// This might be an expression
Some(ast::Stmt::Item(ast::Item::MacroCall(mcall))) => {
cb(WalkEvent::Enter(ast::Expr::MacroCall(mcall)));
preorder.skip_subtree();
}
// skip inner items which might have their own expressions
Some(ast::Stmt::Item(_)) => preorder.skip_subtree(),
None => {