Skip to main content

Module visitor

Module visitor 

Source
Expand description

AST visitor with automatic scope tracking.

Provides a Visitor trait with enter/leave hooks for specific node types, and an AstWalker that traverses the AST while tracking the active scope via the scope tree’s node_to_scope map.

Structs§

AstWalker
Walks the AST while tracking scope context via node_to_scope.

Enums§

VisitResult
Result from a mutable visitor hook.

Traits§

MutVisitor
Trait for mutating Babel AST nodes during traversal.
Visitor
Trait for visiting Babel AST nodes. All methods default to no-ops. Override specific methods to intercept nodes of interest.

Functions§

walk_expression_mut
Walk an expression mutably, calling visitor hooks and recursing into children.
walk_program_mut
Walk a program’s body mutably, calling visitor hooks for each node.
walk_statement_mut
Walk a single statement mutably, calling visitor hooks and recursing into children.