diff --git a/src/ast/compiler/analyzer.rs b/src/ast/compiler/analyzer.rs index 2f2411e..090e6b4 100644 --- a/src/ast/compiler/analyzer.rs +++ b/src/ast/compiler/analyzer.rs @@ -369,7 +369,25 @@ impl NodeExt for NodeKind { NodeKind::Expansion { expanded, .. } => { f(expanded); } - _ => {} + NodeKind::Again { args } => { + f(args); + } + NodeKind::MacroDecl { params, body, .. } => { + f(params); + f(body); + } + NodeKind::Template(inner) + | NodeKind::Placeholder(inner) + | NodeKind::Splice(inner) => { + f(inner); + } + // Leaf nodes — no children to visit. + NodeKind::Nop + | NodeKind::Constant(_) + | NodeKind::Identifier { .. } + | NodeKind::FieldAccessor(_) + | NodeKind::Error + | NodeKind::Extension(_) => {} } } } diff --git a/src/ast/compiler/lambda_collector.rs b/src/ast/compiler/lambda_collector.rs index c76f064..80222c3 100644 --- a/src/ast/compiler/lambda_collector.rs +++ b/src/ast/compiler/lambda_collector.rs @@ -104,8 +104,28 @@ where NodeKind::Expansion { expanded, .. } => { self.visit(expanded); } - - _ => {} // Leaf nodes + NodeKind::GetField { rec, .. } => { + self.visit(rec); + } + NodeKind::Again { args } => { + self.visit(args); + } + NodeKind::MacroDecl { params, body, .. } => { + self.visit(params); + self.visit(body); + } + NodeKind::Template(inner) + | NodeKind::Placeholder(inner) + | NodeKind::Splice(inner) => { + self.visit(inner); + } + // Leaf nodes — no children to visit. + NodeKind::Nop + | NodeKind::Constant(_) + | NodeKind::Identifier { .. } + | NodeKind::FieldAccessor(_) + | NodeKind::Error + | NodeKind::Extension(_) => {} } } }