pub trait VisitAstPath {
Show 23 methods
// Provided methods
fn visit_atom<'ast: 'r, 'r>(
&mut self,
node: &'ast Atom,
__ast_path: &mut AstNodePath<'r>,
) { ... }
fn visit_attribute<'ast: 'r, 'r>(
&mut self,
node: &'ast Attribute,
__ast_path: &mut AstNodePath<'r>,
) { ... }
fn visit_attribute_token<'ast: 'r, 'r>(
&mut self,
node: &'ast AttributeToken,
__ast_path: &mut AstNodePath<'r>,
) { ... }
fn visit_attribute_tokens<'ast: 'r, 'r>(
&mut self,
node: &'ast [AttributeToken],
__ast_path: &mut AstNodePath<'r>,
) { ... }
fn visit_attributes<'ast: 'r, 'r>(
&mut self,
node: &'ast [Attribute],
__ast_path: &mut AstNodePath<'r>,
) { ... }
fn visit_child<'ast: 'r, 'r>(
&mut self,
node: &'ast Child,
__ast_path: &mut AstNodePath<'r>,
) { ... }
fn visit_childs<'ast: 'r, 'r>(
&mut self,
node: &'ast [Child],
__ast_path: &mut AstNodePath<'r>,
) { ... }
fn visit_comment<'ast: 'r, 'r>(
&mut self,
node: &'ast Comment,
__ast_path: &mut AstNodePath<'r>,
) { ... }
fn visit_document<'ast: 'r, 'r>(
&mut self,
node: &'ast Document,
__ast_path: &mut AstNodePath<'r>,
) { ... }
fn visit_document_fragment<'ast: 'r, 'r>(
&mut self,
node: &'ast DocumentFragment,
__ast_path: &mut AstNodePath<'r>,
) { ... }
fn visit_document_mode<'ast: 'r, 'r>(
&mut self,
node: &'ast DocumentMode,
__ast_path: &mut AstNodePath<'r>,
) { ... }
fn visit_document_type<'ast: 'r, 'r>(
&mut self,
node: &'ast DocumentType,
__ast_path: &mut AstNodePath<'r>,
) { ... }
fn visit_element<'ast: 'r, 'r>(
&mut self,
node: &'ast Element,
__ast_path: &mut AstNodePath<'r>,
) { ... }
fn visit_namespace<'ast: 'r, 'r>(
&mut self,
node: &'ast Namespace,
__ast_path: &mut AstNodePath<'r>,
) { ... }
fn visit_opt_atom<'ast: 'r, 'r>(
&mut self,
node: &'ast Option<Atom>,
__ast_path: &mut AstNodePath<'r>,
) { ... }
fn visit_opt_document_fragment<'ast: 'r, 'r>(
&mut self,
node: &'ast Option<DocumentFragment>,
__ast_path: &mut AstNodePath<'r>,
) { ... }
fn visit_opt_namespace<'ast: 'r, 'r>(
&mut self,
node: &'ast Option<Namespace>,
__ast_path: &mut AstNodePath<'r>,
) { ... }
fn visit_opt_raw<'ast: 'r, 'r>(
&mut self,
node: &'ast Option<Raw>,
__ast_path: &mut AstNodePath<'r>,
) { ... }
fn visit_raw<'ast: 'r, 'r>(
&mut self,
node: &'ast Raw,
__ast_path: &mut AstNodePath<'r>,
) { ... }
fn visit_span<'ast: 'r, 'r>(
&mut self,
node: &'ast Span,
__ast_path: &mut AstNodePath<'r>,
) { ... }
fn visit_text<'ast: 'r, 'r>(
&mut self,
node: &'ast Text,
__ast_path: &mut AstNodePath<'r>,
) { ... }
fn visit_token<'ast: 'r, 'r>(
&mut self,
node: &'ast Token,
__ast_path: &mut AstNodePath<'r>,
) { ... }
fn visit_token_and_span<'ast: 'r, 'r>(
&mut self,
node: &'ast TokenAndSpan,
__ast_path: &mut AstNodePath<'r>,
) { ... }
}
path
only.Expand description
A visitor trait for traversing the AST.
Provided Methods§
sourcefn visit_atom<'ast: 'r, 'r>(
&mut self,
node: &'ast Atom,
__ast_path: &mut AstNodePath<'r>,
)
fn visit_atom<'ast: 'r, 'r>( &mut self, node: &'ast Atom, __ast_path: &mut AstNodePath<'r>, )
Visit a node of type swc_atoms :: Atom
.
By default, this method calls [swc_atoms :: Atom::visit_children_with_ast_path
]. If you want to recurse, you need to call it manually.
sourcefn visit_attribute<'ast: 'r, 'r>(
&mut self,
node: &'ast Attribute,
__ast_path: &mut AstNodePath<'r>,
)
fn visit_attribute<'ast: 'r, 'r>( &mut self, node: &'ast Attribute, __ast_path: &mut AstNodePath<'r>, )
Visit a node of type Attribute
.
By default, this method calls [Attribute::visit_children_with_ast_path
]. If you want to recurse, you need to call it manually.
sourcefn visit_attribute_token<'ast: 'r, 'r>(
&mut self,
node: &'ast AttributeToken,
__ast_path: &mut AstNodePath<'r>,
)
fn visit_attribute_token<'ast: 'r, 'r>( &mut self, node: &'ast AttributeToken, __ast_path: &mut AstNodePath<'r>, )
Visit a node of type AttributeToken
.
By default, this method calls [AttributeToken::visit_children_with_ast_path
]. If you want to recurse, you need to call it manually.
sourcefn visit_attribute_tokens<'ast: 'r, 'r>(
&mut self,
node: &'ast [AttributeToken],
__ast_path: &mut AstNodePath<'r>,
)
fn visit_attribute_tokens<'ast: 'r, 'r>( &mut self, node: &'ast [AttributeToken], __ast_path: &mut AstNodePath<'r>, )
Visit a node of type Vec < AttributeToken >
.
By default, this method calls [Vec < AttributeToken >::visit_children_with_ast_path
]. If you want to recurse, you need to call it manually.
sourcefn visit_attributes<'ast: 'r, 'r>(
&mut self,
node: &'ast [Attribute],
__ast_path: &mut AstNodePath<'r>,
)
fn visit_attributes<'ast: 'r, 'r>( &mut self, node: &'ast [Attribute], __ast_path: &mut AstNodePath<'r>, )
Visit a node of type Vec < Attribute >
.
By default, this method calls [Vec < Attribute >::visit_children_with_ast_path
]. If you want to recurse, you need to call it manually.
sourcefn visit_child<'ast: 'r, 'r>(
&mut self,
node: &'ast Child,
__ast_path: &mut AstNodePath<'r>,
)
fn visit_child<'ast: 'r, 'r>( &mut self, node: &'ast Child, __ast_path: &mut AstNodePath<'r>, )
Visit a node of type Child
.
By default, this method calls [Child::visit_children_with_ast_path
]. If you want to recurse, you need to call it manually.
sourcefn visit_childs<'ast: 'r, 'r>(
&mut self,
node: &'ast [Child],
__ast_path: &mut AstNodePath<'r>,
)
fn visit_childs<'ast: 'r, 'r>( &mut self, node: &'ast [Child], __ast_path: &mut AstNodePath<'r>, )
Visit a node of type Vec < Child >
.
By default, this method calls [Vec < Child >::visit_children_with_ast_path
]. If you want to recurse, you need to call it manually.
sourcefn visit_comment<'ast: 'r, 'r>(
&mut self,
node: &'ast Comment,
__ast_path: &mut AstNodePath<'r>,
)
fn visit_comment<'ast: 'r, 'r>( &mut self, node: &'ast Comment, __ast_path: &mut AstNodePath<'r>, )
Visit a node of type Comment
.
By default, this method calls [Comment::visit_children_with_ast_path
]. If you want to recurse, you need to call it manually.
sourcefn visit_document<'ast: 'r, 'r>(
&mut self,
node: &'ast Document,
__ast_path: &mut AstNodePath<'r>,
)
fn visit_document<'ast: 'r, 'r>( &mut self, node: &'ast Document, __ast_path: &mut AstNodePath<'r>, )
Visit a node of type Document
.
By default, this method calls [Document::visit_children_with_ast_path
]. If you want to recurse, you need to call it manually.
sourcefn visit_document_fragment<'ast: 'r, 'r>(
&mut self,
node: &'ast DocumentFragment,
__ast_path: &mut AstNodePath<'r>,
)
fn visit_document_fragment<'ast: 'r, 'r>( &mut self, node: &'ast DocumentFragment, __ast_path: &mut AstNodePath<'r>, )
Visit a node of type DocumentFragment
.
By default, this method calls [DocumentFragment::visit_children_with_ast_path
]. If you want to recurse, you need to call it manually.
sourcefn visit_document_mode<'ast: 'r, 'r>(
&mut self,
node: &'ast DocumentMode,
__ast_path: &mut AstNodePath<'r>,
)
fn visit_document_mode<'ast: 'r, 'r>( &mut self, node: &'ast DocumentMode, __ast_path: &mut AstNodePath<'r>, )
Visit a node of type DocumentMode
.
By default, this method calls [DocumentMode::visit_children_with_ast_path
]. If you want to recurse, you need to call it manually.
sourcefn visit_document_type<'ast: 'r, 'r>(
&mut self,
node: &'ast DocumentType,
__ast_path: &mut AstNodePath<'r>,
)
fn visit_document_type<'ast: 'r, 'r>( &mut self, node: &'ast DocumentType, __ast_path: &mut AstNodePath<'r>, )
Visit a node of type DocumentType
.
By default, this method calls [DocumentType::visit_children_with_ast_path
]. If you want to recurse, you need to call it manually.
sourcefn visit_element<'ast: 'r, 'r>(
&mut self,
node: &'ast Element,
__ast_path: &mut AstNodePath<'r>,
)
fn visit_element<'ast: 'r, 'r>( &mut self, node: &'ast Element, __ast_path: &mut AstNodePath<'r>, )
Visit a node of type Element
.
By default, this method calls [Element::visit_children_with_ast_path
]. If you want to recurse, you need to call it manually.
sourcefn visit_namespace<'ast: 'r, 'r>(
&mut self,
node: &'ast Namespace,
__ast_path: &mut AstNodePath<'r>,
)
fn visit_namespace<'ast: 'r, 'r>( &mut self, node: &'ast Namespace, __ast_path: &mut AstNodePath<'r>, )
Visit a node of type Namespace
.
By default, this method calls [Namespace::visit_children_with_ast_path
]. If you want to recurse, you need to call it manually.
sourcefn visit_opt_atom<'ast: 'r, 'r>(
&mut self,
node: &'ast Option<Atom>,
__ast_path: &mut AstNodePath<'r>,
)
fn visit_opt_atom<'ast: 'r, 'r>( &mut self, node: &'ast Option<Atom>, __ast_path: &mut AstNodePath<'r>, )
Visit a node of type Option < swc_atoms :: Atom >
.
By default, this method calls [Option < swc_atoms :: Atom >::visit_children_with_ast_path
]. If you want to recurse, you need to call it manually.
sourcefn visit_opt_document_fragment<'ast: 'r, 'r>(
&mut self,
node: &'ast Option<DocumentFragment>,
__ast_path: &mut AstNodePath<'r>,
)
fn visit_opt_document_fragment<'ast: 'r, 'r>( &mut self, node: &'ast Option<DocumentFragment>, __ast_path: &mut AstNodePath<'r>, )
Visit a node of type Option < DocumentFragment >
.
By default, this method calls [Option < DocumentFragment >::visit_children_with_ast_path
]. If you want to recurse, you need to call it manually.
sourcefn visit_opt_namespace<'ast: 'r, 'r>(
&mut self,
node: &'ast Option<Namespace>,
__ast_path: &mut AstNodePath<'r>,
)
fn visit_opt_namespace<'ast: 'r, 'r>( &mut self, node: &'ast Option<Namespace>, __ast_path: &mut AstNodePath<'r>, )
Visit a node of type Option < Namespace >
.
By default, this method calls [Option < Namespace >::visit_children_with_ast_path
]. If you want to recurse, you need to call it manually.
sourcefn visit_opt_raw<'ast: 'r, 'r>(
&mut self,
node: &'ast Option<Raw>,
__ast_path: &mut AstNodePath<'r>,
)
fn visit_opt_raw<'ast: 'r, 'r>( &mut self, node: &'ast Option<Raw>, __ast_path: &mut AstNodePath<'r>, )
Visit a node of type Option < Raw >
.
By default, this method calls [Option < Raw >::visit_children_with_ast_path
]. If you want to recurse, you need to call it manually.
sourcefn visit_raw<'ast: 'r, 'r>(
&mut self,
node: &'ast Raw,
__ast_path: &mut AstNodePath<'r>,
)
fn visit_raw<'ast: 'r, 'r>( &mut self, node: &'ast Raw, __ast_path: &mut AstNodePath<'r>, )
Visit a node of type Raw
.
By default, this method calls [Raw::visit_children_with_ast_path
]. If you want to recurse, you need to call it manually.
sourcefn visit_span<'ast: 'r, 'r>(
&mut self,
node: &'ast Span,
__ast_path: &mut AstNodePath<'r>,
)
fn visit_span<'ast: 'r, 'r>( &mut self, node: &'ast Span, __ast_path: &mut AstNodePath<'r>, )
Visit a node of type swc_common :: Span
.
By default, this method calls [swc_common :: Span::visit_children_with_ast_path
]. If you want to recurse, you need to call it manually.
sourcefn visit_text<'ast: 'r, 'r>(
&mut self,
node: &'ast Text,
__ast_path: &mut AstNodePath<'r>,
)
fn visit_text<'ast: 'r, 'r>( &mut self, node: &'ast Text, __ast_path: &mut AstNodePath<'r>, )
Visit a node of type Text
.
By default, this method calls [Text::visit_children_with_ast_path
]. If you want to recurse, you need to call it manually.
sourcefn visit_token<'ast: 'r, 'r>(
&mut self,
node: &'ast Token,
__ast_path: &mut AstNodePath<'r>,
)
fn visit_token<'ast: 'r, 'r>( &mut self, node: &'ast Token, __ast_path: &mut AstNodePath<'r>, )
Visit a node of type Token
.
By default, this method calls [Token::visit_children_with_ast_path
]. If you want to recurse, you need to call it manually.
sourcefn visit_token_and_span<'ast: 'r, 'r>(
&mut self,
node: &'ast TokenAndSpan,
__ast_path: &mut AstNodePath<'r>,
)
fn visit_token_and_span<'ast: 'r, 'r>( &mut self, node: &'ast TokenAndSpan, __ast_path: &mut AstNodePath<'r>, )
Visit a node of type TokenAndSpan
.
By default, this method calls [TokenAndSpan::visit_children_with_ast_path
]. If you want to recurse, you need to call it manually.