diff --git a/crates/oxc_ast/src/ast_kind_impl.rs b/crates/oxc_ast/src/ast_kind_impl.rs index 898dd8f2a97a4..7776ac671e2de 100644 --- a/crates/oxc_ast/src/ast_kind_impl.rs +++ b/crates/oxc_ast/src/ast_kind_impl.rs @@ -747,6 +747,20 @@ impl GetSpan for ModuleDeclarationKind<'_> { } } +impl GetAddress for ModuleDeclarationKind<'_> { + #[inline] // This should boil down to a single instruction + fn address(&self) -> Address { + match *self { + Self::Import(decl) => Address::from_ptr(decl), + Self::ExportAll(decl) => Address::from_ptr(decl), + Self::ExportNamed(decl) => Address::from_ptr(decl), + Self::ExportDefault(decl) => Address::from_ptr(decl), + Self::TSExportAssignment(decl) => Address::from_ptr(decl), + Self::TSNamespaceExport(decl) => Address::from_ptr(decl), + } + } +} + /// Property key types /// /// Represents different kinds of property keys in objects and classes. @@ -765,3 +779,13 @@ impl GetSpan for PropertyKeyKind<'_> { } } } + +impl GetAddress for PropertyKeyKind<'_> { + #[inline] // This should boil down to a single instruction + fn address(&self) -> Address { + match *self { + Self::Static(ident) => Address::from_ptr(ident), + Self::Private(ident) => Address::from_ptr(ident), + } + } +}