Skip to content

Commit

Permalink
refactor(ast): rename visit_enum to visit_ts_enum_declaration.
Browse files Browse the repository at this point in the history
  • Loading branch information
rzvxa committed Jul 2, 2024
1 parent cf3cc16 commit a741772
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions crates/oxc_ast/src/visit/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,8 @@ pub trait Visit<'a>: Sized {
walk_enum_member(self, member);
}

fn visit_enum(&mut self, decl: &TSEnumDeclaration<'a>) {
walk_enum(self, decl);
fn visit_ts_enum_declaration(&mut self, decl: &TSEnumDeclaration<'a>) {
walk_ts_enum_declaration(self, decl);
}

fn visit_declaration(&mut self, decl: &Declaration<'a>) {
Expand Down Expand Up @@ -2547,7 +2547,7 @@ pub mod walk {
visitor.leave_node(kind);
}

pub fn walk_enum<'a, V: Visit<'a>>(visitor: &mut V, decl: &TSEnumDeclaration<'a>) {
pub fn walk_ts_enum_declaration<'a, V: Visit<'a>>(visitor: &mut V, decl: &TSEnumDeclaration<'a>) {
let kind = AstKind::TSEnumDeclaration(visitor.alloc(decl));
visitor.enter_node(kind);
visitor.visit_binding_identifier(&decl.id);
Expand All @@ -2574,7 +2574,7 @@ pub mod walk {
Declaration::TSTypeAliasDeclaration(decl) => {
visitor.visit_ts_type_alias_declaration(decl);
}
Declaration::TSEnumDeclaration(decl) => visitor.visit_enum(decl),
Declaration::TSEnumDeclaration(decl) => visitor.visit_ts_enum_declaration(decl),
Declaration::TSImportEqualsDeclaration(decl) => {
visitor.visit_ts_import_equals_declaration(decl);
}
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_semantic/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1589,7 +1589,7 @@ impl<'a> Visit<'a> for SemanticBuilder<'a> {
self.leave_scope();
}

fn visit_enum(&mut self, decl: &TSEnumDeclaration<'a>) {
fn visit_ts_enum_declaration(&mut self, decl: &TSEnumDeclaration<'a>) {
let kind = AstKind::TSEnumDeclaration(self.alloc(decl));
self.enter_node(kind);
self.visit_binding_identifier(&decl.id);
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_traverse/src/context/scoping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ impl<'a> Visit<'a> for ChildScopeCollector {
self.scope_ids.push(expr.scope_id.get().unwrap());
}

fn visit_enum(&mut self, decl: &TSEnumDeclaration<'a>) {
fn visit_ts_enum_declaration(&mut self, decl: &TSEnumDeclaration<'a>) {
self.scope_ids.push(decl.scope_id.get().unwrap());
}

Expand Down

0 comments on commit a741772

Please sign in to comment.