Macro create_visitor

Source
macro_rules! create_visitor {
    (exact, $ast_path:expr, $name:ident, |$arg:ident: &mut $ty:ident| $b:block) => { ... };
    ($ast_path:expr, $name:ident, |$arg:ident: &mut $ty:ident| $b:block) => { ... };
    (__ $ast_path:expr, $name:ident, |$arg:ident: &mut $ty:ident| $b:block) => { ... };
}
Expand description

Creates a single-method visitor that will visit the AST nodes matching the provided path.

If you pass in exact, the visitor will only visit the nodes that match the path exactly. Otherwise, the visitor will visit the closest matching parent node in the path.

Refer to the [swc_core::ecma::visit::VisitMut] trait for a list of all possible visit methods.