Skip to main content

MutVisitor

Trait MutVisitor 

Source
pub trait MutVisitor {
    // Provided methods
    fn visit_statement(&mut self, _stmt: &mut Statement) -> VisitResult { ... }
    fn visit_expression(&mut self, _expr: &mut Expression) -> VisitResult { ... }
    fn visit_identifier(&mut self, _node: &mut Identifier) -> VisitResult { ... }
}
Expand description

Trait for mutating Babel AST nodes during traversal.

Override hooks to intercept and mutate specific node types. Return VisitResult::Stop from any hook to halt the walk. Hooks are called before the walker recurses into children, so returning Stop prevents child traversal.

Provided Methods§

Source

fn visit_statement(&mut self, _stmt: &mut Statement) -> VisitResult

Called for every statement before recursing into its children.

Source

fn visit_expression(&mut self, _expr: &mut Expression) -> VisitResult

Called for every expression before recursing into its children.

Source

fn visit_identifier(&mut self, _node: &mut Identifier) -> VisitResult

Called for identifiers in expression position.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§