diff --git a/crates/oxc_ast/src/generated/visit.rs b/crates/oxc_ast/src/generated/visit.rs index b953314fc94e6..79a63005754d4 100644 --- a/crates/oxc_ast/src/generated/visit.rs +++ b/crates/oxc_ast/src/generated/visit.rs @@ -27,10 +27,14 @@ use walk::*; /// Syntax tree traversal pub trait Visit<'a>: Sized { + #[inline] fn enter_node(&mut self, kind: AstKind<'a>) {} + #[inline] fn leave_node(&mut self, kind: AstKind<'a>) {} + #[inline] fn enter_scope(&mut self, flags: ScopeFlags, scope_id: &Cell>) {} + #[inline] fn leave_scope(&mut self) {} #[inline] diff --git a/crates/oxc_ast/src/generated/visit_mut.rs b/crates/oxc_ast/src/generated/visit_mut.rs index d0961c65f275d..37343df6f46fe 100644 --- a/crates/oxc_ast/src/generated/visit_mut.rs +++ b/crates/oxc_ast/src/generated/visit_mut.rs @@ -27,10 +27,14 @@ use walk_mut::*; /// Syntax tree traversal pub trait VisitMut<'a>: Sized { + #[inline] fn enter_node(&mut self, kind: AstType) {} + #[inline] fn leave_node(&mut self, kind: AstType) {} + #[inline] fn enter_scope(&mut self, flags: ScopeFlags, scope_id: &Cell>) {} + #[inline] fn leave_scope(&mut self) {} #[inline] diff --git a/tasks/ast_codegen/src/generators/visit.rs b/tasks/ast_codegen/src/generators/visit.rs index 67a988dcaee45..a912c5941022c 100644 --- a/tasks/ast_codegen/src/generators/visit.rs +++ b/tasks/ast_codegen/src/generators/visit.rs @@ -122,12 +122,16 @@ fn generate_visit(ctx: &CodegenCtx) -> TokenStream { /// Syntax tree traversal pub trait #trait_name <'a>: Sized { + #[inline] fn enter_node(&mut self, kind: #ast_kind_type #ast_kind_life) {} + #[inline] fn leave_node(&mut self, kind: #ast_kind_type #ast_kind_life) {} endl!(); + #[inline] fn enter_scope(&mut self, flags: ScopeFlags, scope_id: &Cell>) {} + #[inline] fn leave_scope(&mut self) {} endl!();