From 41cd11dcada38db17013e0547f7f61a1caaf6407 Mon Sep 17 00:00:00 2001 From: rzvxa Date: Sun, 15 Sep 2024 02:04:35 +0330 Subject: [PATCH 1/2] feat(ast, syntax, ast_tools): Introduce `GetNodeId` trait. --- .github/.generated_ast_watch_list.yml | 1 + crates/oxc_ast/src/ast/js.rs | 233 +- crates/oxc_ast/src/ast/jsx.rs | 41 +- crates/oxc_ast/src/ast/literal.rs | 17 +- crates/oxc_ast/src/ast/ts.rs | 170 +- .../src/generated/derive_get_node_id.rs | 3700 +++++++++++++++++ crates/oxc_ast/src/lib.rs | 1 + crates/oxc_ast_macros/src/lib.rs | 2 + crates/oxc_syntax/src/node.rs | 5 + tasks/ast_tools/src/derives/get_node_id.rs | 96 + tasks/ast_tools/src/derives/mod.rs | 2 + tasks/ast_tools/src/main.rs | 6 +- 12 files changed, 4045 insertions(+), 229 deletions(-) create mode 100644 crates/oxc_ast/src/generated/derive_get_node_id.rs create mode 100644 tasks/ast_tools/src/derives/get_node_id.rs diff --git a/.github/.generated_ast_watch_list.yml b/.github/.generated_ast_watch_list.yml index 819464d78c5de..c1969b49be17c 100644 --- a/.github/.generated_ast_watch_list.yml +++ b/.github/.generated_ast_watch_list.yml @@ -15,6 +15,7 @@ src: - 'crates/oxc_ast/src/generated/derive_clone_in.rs' - 'crates/oxc_regular_expression/src/generated/derive_clone_in.rs' - 'crates/oxc_syntax/src/generated/derive_clone_in.rs' + - 'crates/oxc_ast/src/generated/derive_get_node_id.rs' - 'crates/oxc_ast/src/generated/derive_get_span.rs' - 'crates/oxc_ast/src/generated/derive_get_span_mut.rs' - 'crates/oxc_ast/src/generated/derive_content_eq.rs' diff --git a/crates/oxc_ast/src/ast/js.rs b/crates/oxc_ast/src/ast/js.rs index cca85e2b93de0..6ad1ac343105a 100644 --- a/crates/oxc_ast/src/ast/js.rs +++ b/crates/oxc_ast/src/ast/js.rs @@ -11,6 +11,7 @@ use oxc_allocator::{Box, CloneIn, Vec}; use oxc_ast_macros::ast; use oxc_span::{cmp::ContentEq, hash::ContentHash, Atom, GetSpan, GetSpanMut, SourceType, Span}; use oxc_syntax::{ + node::GetNodeId, operator::{ AssignmentOperator, BinaryOperator, LogicalOperator, UnaryOperator, UpdateOperator, }, @@ -32,7 +33,7 @@ use super::{macros::inherit_variants, *}; strict_if(self.source_type.is_strict() || self.directives.iter().any(Directive::is_use_strict)), )] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct Program<'a> { @@ -55,7 +56,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum Expression<'a> { @@ -205,7 +206,7 @@ pub use match_expression; /// Fundamental syntactic structure used for naming variables, functions, and properties. It must start with a Unicode letter (including $ and _) and can be followed by Unicode letters, digits, $, or _. #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[serde(tag = "type", rename = "Identifier")] pub struct IdentifierName<'a> { @@ -221,7 +222,7 @@ pub struct IdentifierName<'a> { /// See: [13.1 Identifiers](https://tc39.es/ecma262/#sec-identifiers) #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[serde(tag = "type", rename = "Identifier")] pub struct IdentifierReference<'a> { @@ -246,7 +247,7 @@ pub struct IdentifierReference<'a> { /// See: [13.1 Identifiers](https://tc39.es/ecma262/#sec-identifiers) #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[serde(tag = "type", rename = "Identifier")] pub struct BindingIdentifier<'a> { @@ -272,7 +273,7 @@ pub struct BindingIdentifier<'a> { /// See: [13.1 Identifiers](https://tc39.es/ecma262/#sec-identifiers) #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[serde(tag = "type", rename = "Identifier")] pub struct LabelIdentifier<'a> { @@ -286,7 +287,7 @@ pub struct LabelIdentifier<'a> { /// Represents a `this` expression, which is a reference to the current object. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ThisExpression { @@ -299,7 +300,7 @@ pub struct ThisExpression { /// Represents an array literal, which can include elements, spread elements, or null values. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct ArrayExpression<'a> { @@ -321,7 +322,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[serde(untagged)] pub enum ArrayExpressionElement<'a> { @@ -343,7 +344,7 @@ pub enum ArrayExpressionElement<'a> { /// Serialized as `null` in JSON AST. See `serialize.rs`. #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] pub struct Elision { pub span: Span, } @@ -353,7 +354,7 @@ pub struct Elision { /// Represents an object literal, which can include properties, spread properties, or computed properties and trailing comma. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ObjectExpression<'a> { @@ -368,7 +369,7 @@ pub struct ObjectExpression<'a> { /// Represents a property in an object literal. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum ObjectPropertyKind<'a> { @@ -383,7 +384,7 @@ pub enum ObjectPropertyKind<'a> { /// Represents a property in an object literal. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ObjectProperty<'a> { @@ -406,7 +407,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum PropertyKey<'a> { @@ -439,7 +440,7 @@ pub enum PropertyKind { /// Represents a template literal, which can include quasi elements and expression elements. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TemplateLiteral<'a> { @@ -454,7 +455,7 @@ pub struct TemplateLiteral<'a> { /// Represents a tagged template expression, which can include a tag and a quasi. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TaggedTemplateExpression<'a> { @@ -470,7 +471,7 @@ pub struct TaggedTemplateExpression<'a> { /// Represents a quasi element in a template literal. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TemplateElement<'a> { @@ -502,7 +503,7 @@ pub struct TemplateElementValue<'a> { /// #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum MemberExpression<'a> { @@ -530,7 +531,7 @@ pub use match_member_expression; /// Represents a computed member access expression, which can include an object and an expression. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ComputedMemberExpression<'a> { @@ -546,7 +547,7 @@ pub struct ComputedMemberExpression<'a> { /// Represents a static member access expression, which can include an object and a property. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct StaticMemberExpression<'a> { @@ -562,7 +563,7 @@ pub struct StaticMemberExpression<'a> { /// Represents a private field access expression, which can include an object and a private identifier. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct PrivateFieldExpression<'a> { @@ -591,7 +592,7 @@ pub struct PrivateFieldExpression<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct CallExpression<'a> { @@ -617,7 +618,7 @@ pub struct CallExpression<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct NewExpression<'a> { @@ -633,7 +634,7 @@ pub struct NewExpression<'a> { /// Represents a meta property. The following syntaxes are supported. `import.meta`, `new.target`. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct MetaProperty<'a> { @@ -648,7 +649,7 @@ pub struct MetaProperty<'a> { /// Represents a spread element, which can include an argument. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct SpreadElement<'a> { @@ -666,7 +667,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum Argument<'a> { @@ -682,7 +683,7 @@ pub enum Argument<'a> { /// Represents an update expression, which can include an operator and an argument. The following syntaxes are supported. `++a`, `a++`, `--a`, `a--` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct UpdateExpression<'a> { @@ -698,7 +699,7 @@ pub struct UpdateExpression<'a> { /// Represents a unary expression, which can include an operator and an argument. The following syntaxes are supported. `+a`, `-a`, `~a`, `!a`, `delete a`, `void a`, `typeof a` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct UnaryExpression<'a> { @@ -713,7 +714,7 @@ pub struct UnaryExpression<'a> { /// Represents a binary expression, which can include a left expression, an operator, and a right expression. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct BinaryExpression<'a> { @@ -729,7 +730,7 @@ pub struct BinaryExpression<'a> { /// Represents a private in expression, which can include a private identifier, an operator, and a expression. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct PrivateInExpression<'a> { @@ -745,7 +746,7 @@ pub struct PrivateInExpression<'a> { /// Represents a logical expression, which can include a left expression, an operator, and a right expression. The following syntaxes are supported. `||`, `&&` and `??` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct LogicalExpression<'a> { @@ -761,7 +762,7 @@ pub struct LogicalExpression<'a> { /// Represents a conditional expression, which can include a test, a consequent, and an alternate. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ConditionalExpression<'a> { @@ -777,7 +778,7 @@ pub struct ConditionalExpression<'a> { /// Represents an assignment expression, which can include an operator, a target, and a expression. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct AssignmentExpression<'a> { @@ -797,7 +798,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum AssignmentTarget<'a> { @@ -816,7 +817,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum SimpleAssignmentTarget<'a> { @@ -871,7 +872,7 @@ pub use match_simple_assignment_target; #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum AssignmentTargetPattern<'a> { @@ -893,7 +894,7 @@ pub use match_assignment_target_pattern; /// Represents an array assignment target, which can include elements and a rest element. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Tsify))] #[serde(tag = "type")] pub struct ArrayAssignmentTarget<'a> { @@ -912,7 +913,7 @@ pub struct ArrayAssignmentTarget<'a> { /// Represents an object assignment target, which can include properties and a rest element. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Tsify))] #[serde(tag = "type")] pub struct ObjectAssignmentTarget<'a> { @@ -929,7 +930,7 @@ pub struct ObjectAssignmentTarget<'a> { /// Represents a rest element in an array assignment target, which can include a target. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[serde(tag = "type", rename = "RestElement")] pub struct AssignmentTargetRest<'a> { @@ -947,7 +948,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum AssignmentTargetMaybeDefault<'a> { @@ -959,7 +960,7 @@ pub enum AssignmentTargetMaybeDefault<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct AssignmentTargetWithDefault<'a> { @@ -971,7 +972,7 @@ pub struct AssignmentTargetWithDefault<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum AssignmentTargetProperty<'a> { @@ -984,7 +985,7 @@ pub enum AssignmentTargetProperty<'a> { /// Represents an assignment target property identifier, which can include a binding and an init expression. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct AssignmentTargetPropertyIdentifier<'a> { @@ -999,7 +1000,7 @@ pub struct AssignmentTargetPropertyIdentifier<'a> { /// Represents an assignment target property property, which can include a name and a binding. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct AssignmentTargetPropertyProperty<'a> { @@ -1014,7 +1015,7 @@ pub struct AssignmentTargetPropertyProperty<'a> { /// Represents a sequence expression, which can include expressions. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct SequenceExpression<'a> { @@ -1028,7 +1029,7 @@ pub struct SequenceExpression<'a> { /// Represents a super expression. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct Super { @@ -1041,7 +1042,7 @@ pub struct Super { /// Represents an await expression, which can include an argument. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct AwaitExpression<'a> { @@ -1055,7 +1056,7 @@ pub struct AwaitExpression<'a> { /// Represents a chain expression, which can include an expression. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ChainExpression<'a> { @@ -1072,7 +1073,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum ChainElement<'a> { @@ -1087,7 +1088,7 @@ pub enum ChainElement<'a> { /// Represents a parenthesized expression, which can include an expression. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ParenthesizedExpression<'a> { @@ -1105,7 +1106,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum Statement<'a> { @@ -1140,7 +1141,7 @@ pub enum Statement<'a> { /// Represents a directive statement, which can include a string literal. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct Directive<'a> { @@ -1157,7 +1158,7 @@ pub struct Directive<'a> { /// Represents a hashbang directive, which can include a value. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct Hashbang<'a> { @@ -1172,7 +1173,7 @@ pub struct Hashbang<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct BlockStatement<'a> { @@ -1187,7 +1188,7 @@ pub struct BlockStatement<'a> { /// Declarations and the Variable Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum Declaration<'a> { @@ -1224,7 +1225,7 @@ pub use match_declaration; /// Represents a variable declaration, which can include a kind, declarations, and modifiers. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct VariableDeclaration<'a> { @@ -1251,7 +1252,7 @@ pub enum VariableDeclarationKind { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct VariableDeclarator<'a> { @@ -1267,7 +1268,7 @@ pub struct VariableDeclarator<'a> { /// Empty Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct EmptyStatement { @@ -1278,7 +1279,7 @@ pub struct EmptyStatement { /// Expression Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ExpressionStatement<'a> { @@ -1290,7 +1291,7 @@ pub struct ExpressionStatement<'a> { /// If Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct IfStatement<'a> { @@ -1304,7 +1305,7 @@ pub struct IfStatement<'a> { /// Do-While Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct DoWhileStatement<'a> { @@ -1317,7 +1318,7 @@ pub struct DoWhileStatement<'a> { /// While Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct WhileStatement<'a> { @@ -1331,7 +1332,7 @@ pub struct WhileStatement<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ForStatement<'a> { @@ -1354,7 +1355,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum ForStatementInit<'a> { @@ -1368,7 +1369,7 @@ pub enum ForStatementInit<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ForInStatement<'a> { @@ -1390,7 +1391,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum ForStatementLeft<'a> { @@ -1403,7 +1404,7 @@ pub enum ForStatementLeft<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ForOfStatement<'a> { @@ -1421,7 +1422,7 @@ pub struct ForOfStatement<'a> { /// Continue Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ContinueStatement<'a> { @@ -1433,7 +1434,7 @@ pub struct ContinueStatement<'a> { /// Break Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct BreakStatement<'a> { @@ -1445,7 +1446,7 @@ pub struct BreakStatement<'a> { /// Return Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ReturnStatement<'a> { @@ -1457,7 +1458,7 @@ pub struct ReturnStatement<'a> { /// With Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct WithStatement<'a> { @@ -1471,7 +1472,7 @@ pub struct WithStatement<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct SwitchStatement<'a> { @@ -1487,7 +1488,7 @@ pub struct SwitchStatement<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct SwitchCase<'a> { @@ -1500,7 +1501,7 @@ pub struct SwitchCase<'a> { /// Labelled Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct LabeledStatement<'a> { @@ -1513,7 +1514,7 @@ pub struct LabeledStatement<'a> { /// Throw Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ThrowStatement<'a> { @@ -1525,7 +1526,7 @@ pub struct ThrowStatement<'a> { /// Try Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TryStatement<'a> { @@ -1540,7 +1541,7 @@ pub struct TryStatement<'a> { #[ast(visit)] #[scope(flags(ScopeFlags::CatchClause))] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct CatchClause<'a> { @@ -1555,7 +1556,7 @@ pub struct CatchClause<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct CatchParameter<'a> { @@ -1567,7 +1568,7 @@ pub struct CatchParameter<'a> { /// Debugger Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct DebuggerStatement { @@ -1579,7 +1580,7 @@ pub struct DebuggerStatement { /// * #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(rename_all = "camelCase")] pub struct BindingPattern<'a> { @@ -1594,7 +1595,7 @@ pub struct BindingPattern<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum BindingPatternKind<'a> { @@ -1613,7 +1614,7 @@ pub enum BindingPatternKind<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct AssignmentPattern<'a> { @@ -1626,7 +1627,7 @@ pub struct AssignmentPattern<'a> { // See serializer in serialize.rs #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Tsify))] #[serde(tag = "type")] pub struct ObjectPattern<'a> { @@ -1640,7 +1641,7 @@ pub struct ObjectPattern<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct BindingProperty<'a> { @@ -1655,7 +1656,7 @@ pub struct BindingProperty<'a> { // See serializer in serialize.rs #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Tsify))] #[serde(tag = "type")] pub struct ArrayPattern<'a> { @@ -1669,7 +1670,7 @@ pub struct ArrayPattern<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[serde(tag = "type", rename = "RestElement")] pub struct BindingRestElement<'a> { @@ -1686,7 +1687,7 @@ pub struct BindingRestElement<'a> { strict_if(self.is_strict()), )] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(rename_all = "camelCase")] pub struct Function<'a> { @@ -1738,7 +1739,7 @@ pub enum FunctionType { // See serializer in serialize.rs #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Tsify))] #[serde(tag = "type")] pub struct FormalParameters<'a> { @@ -1753,7 +1754,7 @@ pub struct FormalParameters<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct FormalParameter<'a> { @@ -1784,7 +1785,7 @@ pub enum FormalParameterKind { /// #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct FunctionBody<'a> { @@ -1801,7 +1802,7 @@ pub struct FunctionBody<'a> { strict_if(self.body.has_use_strict_directive()), )] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct ArrowFunctionExpression<'a> { @@ -1823,7 +1824,7 @@ pub struct ArrowFunctionExpression<'a> { /// Generator Function Definitions #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct YieldExpression<'a> { @@ -1837,7 +1838,7 @@ pub struct YieldExpression<'a> { #[ast(visit)] #[scope(flags(ScopeFlags::StrictMode))] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(rename_all = "camelCase")] pub struct Class<'a> { @@ -1928,7 +1929,7 @@ pub enum ClassType { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ClassBody<'a> { @@ -1957,7 +1958,7 @@ pub struct ClassBody<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum ClassElement<'a> { @@ -1981,7 +1982,7 @@ pub enum ClassElement<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(rename_all = "camelCase")] pub struct MethodDefinition<'a> { @@ -2019,7 +2020,7 @@ pub enum MethodDefinitionType { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(rename_all = "camelCase")] pub struct PropertyDefinition<'a> { @@ -2129,7 +2130,7 @@ pub enum MethodDefinitionKind { /// See: [MDN - Private class fields](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields) #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct PrivateIdentifier<'a> { @@ -2154,7 +2155,7 @@ pub struct PrivateIdentifier<'a> { #[ast(visit)] #[scope(flags(ScopeFlags::ClassStaticBlock))] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct StaticBlock<'a> { @@ -2191,7 +2192,7 @@ pub struct StaticBlock<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum ModuleDeclaration<'a> { @@ -2245,7 +2246,7 @@ pub enum AccessorPropertyType { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(rename_all = "camelCase")] pub struct AccessorProperty<'a> { @@ -2289,7 +2290,7 @@ pub struct AccessorProperty<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ImportExpression<'a> { @@ -2301,7 +2302,7 @@ pub struct ImportExpression<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct ImportDeclaration<'a> { @@ -2318,7 +2319,7 @@ pub struct ImportDeclaration<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum ImportDeclarationSpecifier<'a> { @@ -2335,7 +2336,7 @@ pub enum ImportDeclarationSpecifier<'a> { // import {imported as local} from "source" #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct ImportSpecifier<'a> { @@ -2366,7 +2367,7 @@ pub struct ImportSpecifier<'a> { /// #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ImportDefaultSpecifier<'a> { @@ -2384,7 +2385,7 @@ pub struct ImportDefaultSpecifier<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ImportNamespaceSpecifier<'a> { @@ -2395,7 +2396,7 @@ pub struct ImportNamespaceSpecifier<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct WithClause<'a> { @@ -2407,7 +2408,7 @@ pub struct WithClause<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ImportAttribute<'a> { @@ -2419,7 +2420,7 @@ pub struct ImportAttribute<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum ImportAttributeKey<'a> { @@ -2440,7 +2441,7 @@ pub enum ImportAttributeKey<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct ExportNamedDeclaration<'a> { @@ -2466,7 +2467,7 @@ pub struct ExportNamedDeclaration<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ExportDefaultDeclaration<'a> { @@ -2487,7 +2488,7 @@ pub struct ExportDefaultDeclaration<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct ExportAllDeclaration<'a> { @@ -2514,7 +2515,7 @@ pub struct ExportAllDeclaration<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct ExportSpecifier<'a> { @@ -2533,7 +2534,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum ExportDefaultDeclarationKind<'a> { @@ -2557,7 +2558,7 @@ pub enum ExportDefaultDeclarationKind<'a> { /// * #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum ModuleExportName<'a> { diff --git a/crates/oxc_ast/src/ast/jsx.rs b/crates/oxc_ast/src/ast/jsx.rs index bd28dffde6769..0aadbc6c03721 100644 --- a/crates/oxc_ast/src/ast/jsx.rs +++ b/crates/oxc_ast/src/ast/jsx.rs @@ -10,6 +10,7 @@ use oxc_allocator::{Box, CloneIn, Vec}; use oxc_ast_macros::ast; use oxc_span::{cmp::ContentEq, hash::ContentHash, Atom, GetSpan, GetSpanMut, Span}; +use oxc_syntax::node::GetNodeId; #[cfg(feature = "serialize")] use serde::Serialize; #[cfg(feature = "serialize")] @@ -38,7 +39,7 @@ use super::{inherit_variants, js::*, literal::*, ts::*}; /// See: [JSX Syntax](https://facebook.github.io/jsx/) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct JSXElement<'a> { @@ -69,7 +70,7 @@ pub struct JSXElement<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct JSXOpeningElement<'a> { @@ -103,7 +104,7 @@ pub struct JSXOpeningElement<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct JSXClosingElement<'a> { @@ -122,7 +123,7 @@ pub struct JSXClosingElement<'a> { /// See: [`React.Fragment`](https://react.dev/reference/react/Fragment) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct JSXFragment<'a> { @@ -161,7 +162,7 @@ pub struct JSXClosingFragment { /// JSX Element Name #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum JSXElementName<'a> { @@ -186,7 +187,7 @@ pub enum JSXElementName<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct JSXNamespacedName<'a> { @@ -215,7 +216,7 @@ pub struct JSXNamespacedName<'a> { /// [`member expression`]: JSXMemberExpressionObject::MemberExpression #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct JSXMemberExpression<'a> { @@ -229,7 +230,7 @@ pub struct JSXMemberExpression<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum JSXMemberExpressionObject<'a> { @@ -253,7 +254,7 @@ pub enum JSXMemberExpressionObject<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct JSXExpressionContainer<'a> { @@ -272,7 +273,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum JSXExpression<'a> { @@ -285,7 +286,7 @@ pub enum JSXExpression<'a> { /// An empty JSX expression (`{}`) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct JSXEmptyExpression { @@ -306,7 +307,7 @@ pub struct JSXEmptyExpression { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum JSXAttributeItem<'a> { @@ -329,7 +330,7 @@ pub enum JSXAttributeItem<'a> { /// // name ^^^ ^^^^ value #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct JSXAttribute<'a> { @@ -352,7 +353,7 @@ pub struct JSXAttribute<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct JSXSpreadAttribute<'a> { @@ -378,7 +379,7 @@ pub struct JSXSpreadAttribute<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum JSXAttributeName<'a> { @@ -408,7 +409,7 @@ pub enum JSXAttributeName<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum JSXAttributeValue<'a> { @@ -425,7 +426,7 @@ pub enum JSXAttributeValue<'a> { /// [`IdentifierName`]: super::IdentifierName #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct JSXIdentifier<'a> { @@ -442,7 +443,7 @@ pub struct JSXIdentifier<'a> { /// Part of a [`JSXElement`]. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum JSXChild<'a> { @@ -463,7 +464,7 @@ pub enum JSXChild<'a> { /// Variant of [`JSXChild`] that represents an object spread (`{...expression}`). #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct JSXSpreadChild<'a> { @@ -485,7 +486,7 @@ pub struct JSXSpreadChild<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct JSXText<'a> { diff --git a/crates/oxc_ast/src/ast/literal.rs b/crates/oxc_ast/src/ast/literal.rs index c4fe6200de64f..9df45fa30124f 100644 --- a/crates/oxc_ast/src/ast/literal.rs +++ b/crates/oxc_ast/src/ast/literal.rs @@ -14,7 +14,10 @@ use oxc_allocator::{Box, CloneIn}; use oxc_ast_macros::ast; use oxc_regular_expression::ast::Pattern; use oxc_span::{cmp::ContentEq, hash::ContentHash, Atom, GetSpan, GetSpanMut, Span}; -use oxc_syntax::number::{BigintBase, NumberBase}; +use oxc_syntax::{ + node::GetNodeId, + number::{BigintBase, NumberBase}, +}; #[cfg(feature = "serialize")] use serde::Serialize; #[cfg(feature = "serialize")] @@ -25,7 +28,7 @@ use tsify::Tsify; /// #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct BooleanLiteral { @@ -39,7 +42,7 @@ pub struct BooleanLiteral { /// #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct NullLiteral { @@ -52,7 +55,7 @@ pub struct NullLiteral { /// #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct NumericLiteral<'a> { @@ -70,7 +73,7 @@ pub struct NumericLiteral<'a> { /// BigInt literal #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct BigIntLiteral<'a> { @@ -88,7 +91,7 @@ pub struct BigIntLiteral<'a> { /// #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct RegExpLiteral<'a> { @@ -144,7 +147,7 @@ pub struct EmptyObject; /// #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct StringLiteral<'a> { diff --git a/crates/oxc_ast/src/ast/ts.rs b/crates/oxc_ast/src/ast/ts.rs index a20b54f31aadd..8aea968dec057 100644 --- a/crates/oxc_ast/src/ast/ts.rs +++ b/crates/oxc_ast/src/ast/ts.rs @@ -15,7 +15,7 @@ use std::cell::Cell; use oxc_allocator::{Box, CloneIn, Vec}; use oxc_ast_macros::ast; use oxc_span::{cmp::ContentEq, hash::ContentHash, Atom, GetSpan, GetSpanMut, Span}; -use oxc_syntax::scope::ScopeId; +use oxc_syntax::{node::GetNodeId, scope::ScopeId}; #[cfg(feature = "serialize")] use serde::Serialize; #[cfg(feature = "serialize")] @@ -35,7 +35,7 @@ export interface TSIndexSignatureName extends Span { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSThisParameter<'a> { @@ -65,7 +65,7 @@ pub struct TSThisParameter<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSEnumDeclaration<'a> { @@ -96,7 +96,7 @@ pub struct TSEnumDeclaration<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSEnumMember<'a> { @@ -114,7 +114,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum TSEnumMemberName<'a> { @@ -143,7 +143,7 @@ pub enum TSEnumMemberName<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTypeAnnotation<'a> { @@ -169,7 +169,7 @@ pub struct TSTypeAnnotation<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSLiteralType<'a> { @@ -180,7 +180,7 @@ pub struct TSLiteralType<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged, rename_all = "camelCase")] pub enum TSLiteral<'a> { @@ -200,7 +200,7 @@ pub enum TSLiteral<'a> { /// expressions. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged, rename_all = "camelCase")] pub enum TSType<'a> { @@ -305,7 +305,7 @@ pub use match_ts_type; #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSConditionalType<'a> { @@ -331,7 +331,7 @@ pub struct TSConditionalType<'a> { /// #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSUnionType<'a> { @@ -345,7 +345,7 @@ pub struct TSUnionType<'a> { /// #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSIntersectionType<'a> { @@ -356,7 +356,7 @@ pub struct TSIntersectionType<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSParenthesizedType<'a> { @@ -375,7 +375,7 @@ pub struct TSParenthesizedType<'a> { /// #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTypeOperator<'a> { @@ -409,7 +409,7 @@ pub enum TSTypeOperatorOperator { /// #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSArrayType<'a> { @@ -431,7 +431,7 @@ pub struct TSArrayType<'a> { /// #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSIndexedAccessType<'a> { @@ -452,7 +452,7 @@ pub struct TSIndexedAccessType<'a> { /// #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTupleType<'a> { @@ -463,7 +463,7 @@ pub struct TSTupleType<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSNamedTupleMember<'a> { @@ -476,7 +476,7 @@ pub struct TSNamedTupleMember<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSOptionalType<'a> { @@ -487,7 +487,7 @@ pub struct TSOptionalType<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSRestType<'a> { @@ -506,7 +506,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged, rename_all = "camelCase")] pub enum TSTupleElement<'a> { @@ -521,7 +521,7 @@ pub enum TSTupleElement<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSAnyKeyword { @@ -531,7 +531,7 @@ pub struct TSAnyKeyword { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSStringKeyword { @@ -541,7 +541,7 @@ pub struct TSStringKeyword { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSBooleanKeyword { @@ -551,7 +551,7 @@ pub struct TSBooleanKeyword { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSNumberKeyword { @@ -561,7 +561,7 @@ pub struct TSNumberKeyword { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSNeverKeyword { @@ -572,7 +572,7 @@ pub struct TSNeverKeyword { /// `type Uppercase = intrinsic;` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSIntrinsicKeyword { @@ -582,7 +582,7 @@ pub struct TSIntrinsicKeyword { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSUnknownKeyword { @@ -592,7 +592,7 @@ pub struct TSUnknownKeyword { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSNullKeyword { @@ -602,7 +602,7 @@ pub struct TSNullKeyword { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSUndefinedKeyword { @@ -612,7 +612,7 @@ pub struct TSUndefinedKeyword { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSVoidKeyword { @@ -622,7 +622,7 @@ pub struct TSVoidKeyword { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSSymbolKeyword { @@ -632,7 +632,7 @@ pub struct TSSymbolKeyword { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSThisType { @@ -642,7 +642,7 @@ pub struct TSThisType { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSObjectKeyword { @@ -652,7 +652,7 @@ pub struct TSObjectKeyword { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSBigIntKeyword { @@ -665,7 +665,7 @@ pub struct TSBigIntKeyword { /// type E = D.c.b.a; #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTypeReference<'a> { @@ -680,7 +680,7 @@ pub struct TSTypeReference<'a> { /// NamespaceName . IdentifierReference #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum TSTypeName<'a> { @@ -699,7 +699,7 @@ pub use match_ts_type_name; #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSQualifiedName<'a> { @@ -711,7 +711,7 @@ pub struct TSQualifiedName<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTypeParameterInstantiation<'a> { @@ -722,7 +722,7 @@ pub struct TSTypeParameterInstantiation<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTypeParameter<'a> { @@ -738,7 +738,7 @@ pub struct TSTypeParameter<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTypeParameterDeclaration<'a> { @@ -750,7 +750,7 @@ pub struct TSTypeParameterDeclaration<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTypeAliasDeclaration<'a> { @@ -779,7 +779,7 @@ pub enum TSAccessibility { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSClassImplements<'a> { @@ -795,7 +795,7 @@ pub struct TSClassImplements<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSInterfaceDeclaration<'a> { @@ -815,7 +815,7 @@ pub struct TSInterfaceDeclaration<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSInterfaceBody<'a> { @@ -826,7 +826,7 @@ pub struct TSInterfaceBody<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSPropertySignature<'a> { @@ -841,7 +841,7 @@ pub struct TSPropertySignature<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged, rename_all = "camelCase")] pub enum TSSignature<'a> { @@ -865,7 +865,7 @@ pub enum TSSignature<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSIndexSignature<'a> { @@ -878,7 +878,7 @@ pub struct TSIndexSignature<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSCallSignatureDeclaration<'a> { @@ -904,7 +904,7 @@ pub enum TSMethodSignatureKind { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSMethodSignature<'a> { @@ -926,7 +926,7 @@ pub struct TSMethodSignature<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSConstructSignatureDeclaration<'a> { @@ -942,7 +942,7 @@ pub struct TSConstructSignatureDeclaration<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[serde(tag = "type", rename = "Identifier", rename_all = "camelCase")] pub struct TSIndexSignatureName<'a> { @@ -954,7 +954,7 @@ pub struct TSIndexSignatureName<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSInterfaceHeritage<'a> { @@ -966,7 +966,7 @@ pub struct TSInterfaceHeritage<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTypePredicate<'a> { @@ -979,7 +979,7 @@ pub struct TSTypePredicate<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged, rename_all = "camelCase")] pub enum TSTypePredicateName<'a> { @@ -993,7 +993,7 @@ pub enum TSTypePredicateName<'a> { strict_if(self.body.as_ref().is_some_and(TSModuleDeclarationBody::is_strict)), )] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSModuleDeclaration<'a> { @@ -1037,7 +1037,7 @@ impl TSModuleDeclarationKind { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum TSModuleDeclarationName<'a> { @@ -1047,7 +1047,7 @@ pub enum TSModuleDeclarationName<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum TSModuleDeclarationBody<'a> { @@ -1058,7 +1058,7 @@ pub enum TSModuleDeclarationBody<'a> { // See serializer in serialize.rs #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSModuleBlock<'a> { @@ -1071,7 +1071,7 @@ pub struct TSModuleBlock<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTypeLiteral<'a> { @@ -1082,7 +1082,7 @@ pub struct TSTypeLiteral<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSInferType<'a> { @@ -1093,7 +1093,7 @@ pub struct TSInferType<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTypeQuery<'a> { @@ -1111,7 +1111,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum TSTypeQueryExprName<'a> { @@ -1123,7 +1123,7 @@ pub enum TSTypeQueryExprName<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSImportType<'a> { @@ -1138,7 +1138,7 @@ pub struct TSImportType<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSImportAttributes<'a> { @@ -1150,7 +1150,7 @@ pub struct TSImportAttributes<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSImportAttribute<'a> { @@ -1162,7 +1162,7 @@ pub struct TSImportAttribute<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum TSImportAttributeName<'a> { @@ -1172,7 +1172,7 @@ pub enum TSImportAttributeName<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSFunctionType<'a> { @@ -1186,7 +1186,7 @@ pub struct TSFunctionType<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSConstructorType<'a> { @@ -1201,7 +1201,7 @@ pub struct TSConstructorType<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSMappedType<'a> { @@ -1233,7 +1233,7 @@ pub enum TSMappedTypeModifierOperator { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTemplateLiteralType<'a> { @@ -1245,7 +1245,7 @@ pub struct TSTemplateLiteralType<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSAsExpression<'a> { @@ -1257,7 +1257,7 @@ pub struct TSAsExpression<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSSatisfiesExpression<'a> { @@ -1269,7 +1269,7 @@ pub struct TSSatisfiesExpression<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTypeAssertion<'a> { @@ -1281,7 +1281,7 @@ pub struct TSTypeAssertion<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSImportEqualsDeclaration<'a> { @@ -1300,7 +1300,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged, rename_all = "camelCase")] pub enum TSModuleReference<'a> { @@ -1312,7 +1312,7 @@ pub enum TSModuleReference<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSExternalModuleReference<'a> { @@ -1323,7 +1323,7 @@ pub struct TSExternalModuleReference<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSNonNullExpression<'a> { @@ -1358,7 +1358,7 @@ pub struct TSNonNullExpression<'a> { /// [`CallExpression`]: crate::ast::js::CallExpression #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct Decorator<'a> { @@ -1372,7 +1372,7 @@ pub struct Decorator<'a> { /// `export = foo` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSExportAssignment<'a> { @@ -1386,7 +1386,7 @@ pub struct TSExportAssignment<'a> { /// `export as namespace foo` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSNamespaceExportDeclaration<'a> { @@ -1397,7 +1397,7 @@ pub struct TSNamespaceExportDeclaration<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSInstantiationExpression<'a> { @@ -1425,7 +1425,7 @@ pub enum ImportOrExportKind { /// `type foo = ty?` or `type foo = ?ty` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct JSDocNullableType<'a> { @@ -1439,7 +1439,7 @@ pub struct JSDocNullableType<'a> { /// `type foo = ty!` or `type foo = !ty` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct JSDocNonNullableType<'a> { @@ -1451,7 +1451,7 @@ pub struct JSDocNonNullableType<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)] +#[generate_derive(CloneIn, GetNodeId, GetSpan, GetSpanMut, ContentEq, ContentHash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct JSDocUnknownType { diff --git a/crates/oxc_ast/src/generated/derive_get_node_id.rs b/crates/oxc_ast/src/generated/derive_get_node_id.rs new file mode 100644 index 0000000000000..d7c54a7c5398e --- /dev/null +++ b/crates/oxc_ast/src/generated/derive_get_node_id.rs @@ -0,0 +1,3700 @@ +// Auto-generated code, DO NOT EDIT DIRECTLY! +// To edit this generated file you have to edit `tasks/ast_tools/src/derives/get_node_id.rs` + +#![allow(clippy::match_same_arms)] + +use oxc_syntax::node::{GetNodeId, NodeId}; + +#[allow(clippy::wildcard_imports)] +use crate::ast::js::*; + +#[allow(clippy::wildcard_imports)] +use crate::ast::jsx::*; + +#[allow(clippy::wildcard_imports)] +use crate::ast::literal::*; + +#[allow(clippy::wildcard_imports)] +use crate::ast::ts::*; + +impl GetNodeId for BooleanLiteral { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl GetNodeId for NullLiteral { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for NumericLiteral<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for BigIntLiteral<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for RegExpLiteral<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for StringLiteral<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for Program<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for Expression<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::BooleanLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::NullLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::NumericLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::BigIntLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::RegExpLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::StringLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::TemplateLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::Identifier(it) => GetNodeId::node_id(it.as_ref()), + Self::MetaProperty(it) => GetNodeId::node_id(it.as_ref()), + Self::Super(it) => GetNodeId::node_id(it.as_ref()), + Self::ArrayExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ArrowFunctionExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::AssignmentExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::AwaitExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::BinaryExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::CallExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ChainExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ClassExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ConditionalExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::FunctionExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ImportExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::LogicalExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::NewExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ObjectExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ParenthesizedExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::SequenceExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TaggedTemplateExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ThisExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::UnaryExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::UpdateExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::YieldExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::PrivateInExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::JSXElement(it) => GetNodeId::node_id(it.as_ref()), + Self::JSXFragment(it) => GetNodeId::node_id(it.as_ref()), + Self::TSAsExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypeAssertion(it) => GetNodeId::node_id(it.as_ref()), + Self::TSNonNullExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSInstantiationExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ComputedMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::StaticMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::BooleanLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::NullLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::NumericLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::BigIntLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::RegExpLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::StringLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::TemplateLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::Identifier(it) => GetNodeId::node_id_mut(&mut **it), + Self::MetaProperty(it) => GetNodeId::node_id_mut(&mut **it), + Self::Super(it) => GetNodeId::node_id_mut(&mut **it), + Self::ArrayExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ArrowFunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::AssignmentExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::AwaitExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::BinaryExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::CallExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ChainExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ClassExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ConditionalExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::FunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ImportExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::LogicalExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::NewExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ObjectExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ParenthesizedExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::SequenceExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TaggedTemplateExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ThisExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::UnaryExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::UpdateExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::YieldExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::PrivateInExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::JSXElement(it) => GetNodeId::node_id_mut(&mut **it), + Self::JSXFragment(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for IdentifierName<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for IdentifierReference<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for BindingIdentifier<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for LabelIdentifier<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl GetNodeId for ThisExpression { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ArrayExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ArrayExpressionElement<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::SpreadElement(it) => GetNodeId::node_id(it.as_ref()), + Self::Elision(it) => GetNodeId::node_id(it), + Self::BooleanLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::NullLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::NumericLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::BigIntLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::RegExpLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::StringLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::TemplateLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::Identifier(it) => GetNodeId::node_id(it.as_ref()), + Self::MetaProperty(it) => GetNodeId::node_id(it.as_ref()), + Self::Super(it) => GetNodeId::node_id(it.as_ref()), + Self::ArrayExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ArrowFunctionExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::AssignmentExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::AwaitExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::BinaryExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::CallExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ChainExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ClassExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ConditionalExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::FunctionExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ImportExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::LogicalExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::NewExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ObjectExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ParenthesizedExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::SequenceExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TaggedTemplateExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ThisExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::UnaryExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::UpdateExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::YieldExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::PrivateInExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::JSXElement(it) => GetNodeId::node_id(it.as_ref()), + Self::JSXFragment(it) => GetNodeId::node_id(it.as_ref()), + Self::TSAsExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypeAssertion(it) => GetNodeId::node_id(it.as_ref()), + Self::TSNonNullExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSInstantiationExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ComputedMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::StaticMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::SpreadElement(it) => GetNodeId::node_id_mut(&mut **it), + Self::Elision(it) => GetNodeId::node_id_mut(it), + Self::BooleanLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::NullLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::NumericLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::BigIntLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::RegExpLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::StringLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::TemplateLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::Identifier(it) => GetNodeId::node_id_mut(&mut **it), + Self::MetaProperty(it) => GetNodeId::node_id_mut(&mut **it), + Self::Super(it) => GetNodeId::node_id_mut(&mut **it), + Self::ArrayExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ArrowFunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::AssignmentExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::AwaitExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::BinaryExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::CallExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ChainExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ClassExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ConditionalExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::FunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ImportExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::LogicalExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::NewExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ObjectExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ParenthesizedExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::SequenceExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TaggedTemplateExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ThisExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::UnaryExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::UpdateExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::YieldExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::PrivateInExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::JSXElement(it) => GetNodeId::node_id_mut(&mut **it), + Self::JSXFragment(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl GetNodeId for Elision { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ObjectExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ObjectPropertyKind<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::ObjectProperty(it) => GetNodeId::node_id(it.as_ref()), + Self::SpreadProperty(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::ObjectProperty(it) => GetNodeId::node_id_mut(&mut **it), + Self::SpreadProperty(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for ObjectProperty<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for PropertyKey<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::StaticIdentifier(it) => GetNodeId::node_id(it.as_ref()), + Self::PrivateIdentifier(it) => GetNodeId::node_id(it.as_ref()), + Self::BooleanLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::NullLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::NumericLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::BigIntLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::RegExpLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::StringLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::TemplateLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::Identifier(it) => GetNodeId::node_id(it.as_ref()), + Self::MetaProperty(it) => GetNodeId::node_id(it.as_ref()), + Self::Super(it) => GetNodeId::node_id(it.as_ref()), + Self::ArrayExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ArrowFunctionExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::AssignmentExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::AwaitExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::BinaryExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::CallExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ChainExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ClassExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ConditionalExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::FunctionExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ImportExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::LogicalExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::NewExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ObjectExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ParenthesizedExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::SequenceExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TaggedTemplateExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ThisExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::UnaryExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::UpdateExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::YieldExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::PrivateInExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::JSXElement(it) => GetNodeId::node_id(it.as_ref()), + Self::JSXFragment(it) => GetNodeId::node_id(it.as_ref()), + Self::TSAsExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypeAssertion(it) => GetNodeId::node_id(it.as_ref()), + Self::TSNonNullExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSInstantiationExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ComputedMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::StaticMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::StaticIdentifier(it) => GetNodeId::node_id_mut(&mut **it), + Self::PrivateIdentifier(it) => GetNodeId::node_id_mut(&mut **it), + Self::BooleanLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::NullLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::NumericLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::BigIntLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::RegExpLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::StringLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::TemplateLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::Identifier(it) => GetNodeId::node_id_mut(&mut **it), + Self::MetaProperty(it) => GetNodeId::node_id_mut(&mut **it), + Self::Super(it) => GetNodeId::node_id_mut(&mut **it), + Self::ArrayExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ArrowFunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::AssignmentExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::AwaitExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::BinaryExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::CallExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ChainExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ClassExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ConditionalExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::FunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ImportExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::LogicalExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::NewExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ObjectExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ParenthesizedExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::SequenceExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TaggedTemplateExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ThisExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::UnaryExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::UpdateExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::YieldExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::PrivateInExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::JSXElement(it) => GetNodeId::node_id_mut(&mut **it), + Self::JSXFragment(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for TemplateLiteral<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TaggedTemplateExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TemplateElement<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for MemberExpression<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::ComputedMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::StaticMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for ComputedMemberExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for StaticMemberExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for PrivateFieldExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for CallExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for NewExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for MetaProperty<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for SpreadElement<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for Argument<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::SpreadElement(it) => GetNodeId::node_id(it.as_ref()), + Self::BooleanLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::NullLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::NumericLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::BigIntLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::RegExpLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::StringLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::TemplateLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::Identifier(it) => GetNodeId::node_id(it.as_ref()), + Self::MetaProperty(it) => GetNodeId::node_id(it.as_ref()), + Self::Super(it) => GetNodeId::node_id(it.as_ref()), + Self::ArrayExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ArrowFunctionExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::AssignmentExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::AwaitExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::BinaryExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::CallExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ChainExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ClassExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ConditionalExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::FunctionExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ImportExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::LogicalExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::NewExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ObjectExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ParenthesizedExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::SequenceExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TaggedTemplateExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ThisExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::UnaryExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::UpdateExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::YieldExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::PrivateInExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::JSXElement(it) => GetNodeId::node_id(it.as_ref()), + Self::JSXFragment(it) => GetNodeId::node_id(it.as_ref()), + Self::TSAsExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypeAssertion(it) => GetNodeId::node_id(it.as_ref()), + Self::TSNonNullExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSInstantiationExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ComputedMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::StaticMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::SpreadElement(it) => GetNodeId::node_id_mut(&mut **it), + Self::BooleanLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::NullLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::NumericLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::BigIntLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::RegExpLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::StringLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::TemplateLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::Identifier(it) => GetNodeId::node_id_mut(&mut **it), + Self::MetaProperty(it) => GetNodeId::node_id_mut(&mut **it), + Self::Super(it) => GetNodeId::node_id_mut(&mut **it), + Self::ArrayExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ArrowFunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::AssignmentExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::AwaitExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::BinaryExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::CallExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ChainExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ClassExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ConditionalExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::FunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ImportExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::LogicalExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::NewExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ObjectExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ParenthesizedExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::SequenceExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TaggedTemplateExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ThisExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::UnaryExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::UpdateExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::YieldExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::PrivateInExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::JSXElement(it) => GetNodeId::node_id_mut(&mut **it), + Self::JSXFragment(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for UpdateExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for UnaryExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for BinaryExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for PrivateInExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for LogicalExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ConditionalExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for AssignmentExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for AssignmentTarget<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::AssignmentTargetIdentifier(it) => GetNodeId::node_id(it.as_ref()), + Self::TSAsExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSNonNullExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypeAssertion(it) => GetNodeId::node_id(it.as_ref()), + Self::TSInstantiationExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ComputedMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::StaticMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ArrayAssignmentTarget(it) => GetNodeId::node_id(it.as_ref()), + Self::ObjectAssignmentTarget(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::AssignmentTargetIdentifier(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ArrayAssignmentTarget(it) => GetNodeId::node_id_mut(&mut **it), + Self::ObjectAssignmentTarget(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for SimpleAssignmentTarget<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::AssignmentTargetIdentifier(it) => GetNodeId::node_id(it.as_ref()), + Self::TSAsExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSNonNullExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypeAssertion(it) => GetNodeId::node_id(it.as_ref()), + Self::TSInstantiationExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ComputedMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::StaticMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::AssignmentTargetIdentifier(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for AssignmentTargetPattern<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::ArrayAssignmentTarget(it) => GetNodeId::node_id(it.as_ref()), + Self::ObjectAssignmentTarget(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::ArrayAssignmentTarget(it) => GetNodeId::node_id_mut(&mut **it), + Self::ObjectAssignmentTarget(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for ArrayAssignmentTarget<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ObjectAssignmentTarget<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for AssignmentTargetRest<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for AssignmentTargetMaybeDefault<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::AssignmentTargetWithDefault(it) => GetNodeId::node_id(it.as_ref()), + Self::AssignmentTargetIdentifier(it) => GetNodeId::node_id(it.as_ref()), + Self::TSAsExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSNonNullExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypeAssertion(it) => GetNodeId::node_id(it.as_ref()), + Self::TSInstantiationExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ComputedMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::StaticMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ArrayAssignmentTarget(it) => GetNodeId::node_id(it.as_ref()), + Self::ObjectAssignmentTarget(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::AssignmentTargetWithDefault(it) => GetNodeId::node_id_mut(&mut **it), + Self::AssignmentTargetIdentifier(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ArrayAssignmentTarget(it) => GetNodeId::node_id_mut(&mut **it), + Self::ObjectAssignmentTarget(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for AssignmentTargetWithDefault<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for AssignmentTargetProperty<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::AssignmentTargetPropertyIdentifier(it) => GetNodeId::node_id(it.as_ref()), + Self::AssignmentTargetPropertyProperty(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::AssignmentTargetPropertyIdentifier(it) => GetNodeId::node_id_mut(&mut **it), + Self::AssignmentTargetPropertyProperty(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for AssignmentTargetPropertyIdentifier<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for AssignmentTargetPropertyProperty<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for SequenceExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl GetNodeId for Super { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for AwaitExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ChainExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ChainElement<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::CallExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ComputedMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::StaticMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::CallExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for ParenthesizedExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for Statement<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::BlockStatement(it) => GetNodeId::node_id(it.as_ref()), + Self::BreakStatement(it) => GetNodeId::node_id(it.as_ref()), + Self::ContinueStatement(it) => GetNodeId::node_id(it.as_ref()), + Self::DebuggerStatement(it) => GetNodeId::node_id(it.as_ref()), + Self::DoWhileStatement(it) => GetNodeId::node_id(it.as_ref()), + Self::EmptyStatement(it) => GetNodeId::node_id(it.as_ref()), + Self::ExpressionStatement(it) => GetNodeId::node_id(it.as_ref()), + Self::ForInStatement(it) => GetNodeId::node_id(it.as_ref()), + Self::ForOfStatement(it) => GetNodeId::node_id(it.as_ref()), + Self::ForStatement(it) => GetNodeId::node_id(it.as_ref()), + Self::IfStatement(it) => GetNodeId::node_id(it.as_ref()), + Self::LabeledStatement(it) => GetNodeId::node_id(it.as_ref()), + Self::ReturnStatement(it) => GetNodeId::node_id(it.as_ref()), + Self::SwitchStatement(it) => GetNodeId::node_id(it.as_ref()), + Self::ThrowStatement(it) => GetNodeId::node_id(it.as_ref()), + Self::TryStatement(it) => GetNodeId::node_id(it.as_ref()), + Self::WhileStatement(it) => GetNodeId::node_id(it.as_ref()), + Self::WithStatement(it) => GetNodeId::node_id(it.as_ref()), + Self::VariableDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::FunctionDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::ClassDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypeAliasDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::TSInterfaceDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::TSEnumDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::TSModuleDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::TSImportEqualsDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::ImportDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::ExportAllDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::ExportDefaultDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::ExportNamedDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::TSExportAssignment(it) => GetNodeId::node_id(it.as_ref()), + Self::TSNamespaceExportDeclaration(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::BlockStatement(it) => GetNodeId::node_id_mut(&mut **it), + Self::BreakStatement(it) => GetNodeId::node_id_mut(&mut **it), + Self::ContinueStatement(it) => GetNodeId::node_id_mut(&mut **it), + Self::DebuggerStatement(it) => GetNodeId::node_id_mut(&mut **it), + Self::DoWhileStatement(it) => GetNodeId::node_id_mut(&mut **it), + Self::EmptyStatement(it) => GetNodeId::node_id_mut(&mut **it), + Self::ExpressionStatement(it) => GetNodeId::node_id_mut(&mut **it), + Self::ForInStatement(it) => GetNodeId::node_id_mut(&mut **it), + Self::ForOfStatement(it) => GetNodeId::node_id_mut(&mut **it), + Self::ForStatement(it) => GetNodeId::node_id_mut(&mut **it), + Self::IfStatement(it) => GetNodeId::node_id_mut(&mut **it), + Self::LabeledStatement(it) => GetNodeId::node_id_mut(&mut **it), + Self::ReturnStatement(it) => GetNodeId::node_id_mut(&mut **it), + Self::SwitchStatement(it) => GetNodeId::node_id_mut(&mut **it), + Self::ThrowStatement(it) => GetNodeId::node_id_mut(&mut **it), + Self::TryStatement(it) => GetNodeId::node_id_mut(&mut **it), + Self::WhileStatement(it) => GetNodeId::node_id_mut(&mut **it), + Self::WithStatement(it) => GetNodeId::node_id_mut(&mut **it), + Self::VariableDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::FunctionDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::ClassDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypeAliasDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSInterfaceDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSEnumDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSModuleDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSImportEqualsDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::ImportDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::ExportAllDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::ExportDefaultDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::ExportNamedDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSExportAssignment(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSNamespaceExportDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for Directive<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for Hashbang<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for BlockStatement<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for Declaration<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::VariableDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::FunctionDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::ClassDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypeAliasDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::TSInterfaceDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::TSEnumDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::TSModuleDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::TSImportEqualsDeclaration(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::VariableDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::FunctionDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::ClassDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypeAliasDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSInterfaceDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSEnumDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSModuleDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSImportEqualsDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for VariableDeclaration<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for VariableDeclarator<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl GetNodeId for EmptyStatement { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ExpressionStatement<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for IfStatement<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for DoWhileStatement<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for WhileStatement<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ForStatement<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ForStatementInit<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::VariableDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::BooleanLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::NullLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::NumericLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::BigIntLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::RegExpLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::StringLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::TemplateLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::Identifier(it) => GetNodeId::node_id(it.as_ref()), + Self::MetaProperty(it) => GetNodeId::node_id(it.as_ref()), + Self::Super(it) => GetNodeId::node_id(it.as_ref()), + Self::ArrayExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ArrowFunctionExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::AssignmentExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::AwaitExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::BinaryExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::CallExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ChainExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ClassExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ConditionalExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::FunctionExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ImportExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::LogicalExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::NewExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ObjectExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ParenthesizedExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::SequenceExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TaggedTemplateExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ThisExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::UnaryExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::UpdateExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::YieldExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::PrivateInExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::JSXElement(it) => GetNodeId::node_id(it.as_ref()), + Self::JSXFragment(it) => GetNodeId::node_id(it.as_ref()), + Self::TSAsExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypeAssertion(it) => GetNodeId::node_id(it.as_ref()), + Self::TSNonNullExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSInstantiationExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ComputedMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::StaticMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::VariableDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::BooleanLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::NullLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::NumericLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::BigIntLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::RegExpLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::StringLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::TemplateLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::Identifier(it) => GetNodeId::node_id_mut(&mut **it), + Self::MetaProperty(it) => GetNodeId::node_id_mut(&mut **it), + Self::Super(it) => GetNodeId::node_id_mut(&mut **it), + Self::ArrayExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ArrowFunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::AssignmentExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::AwaitExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::BinaryExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::CallExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ChainExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ClassExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ConditionalExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::FunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ImportExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::LogicalExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::NewExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ObjectExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ParenthesizedExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::SequenceExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TaggedTemplateExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ThisExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::UnaryExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::UpdateExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::YieldExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::PrivateInExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::JSXElement(it) => GetNodeId::node_id_mut(&mut **it), + Self::JSXFragment(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for ForInStatement<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ForStatementLeft<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::VariableDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::AssignmentTargetIdentifier(it) => GetNodeId::node_id(it.as_ref()), + Self::TSAsExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSNonNullExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypeAssertion(it) => GetNodeId::node_id(it.as_ref()), + Self::TSInstantiationExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ComputedMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::StaticMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ArrayAssignmentTarget(it) => GetNodeId::node_id(it.as_ref()), + Self::ObjectAssignmentTarget(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::VariableDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::AssignmentTargetIdentifier(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ArrayAssignmentTarget(it) => GetNodeId::node_id_mut(&mut **it), + Self::ObjectAssignmentTarget(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for ForOfStatement<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ContinueStatement<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for BreakStatement<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ReturnStatement<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for WithStatement<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for SwitchStatement<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for SwitchCase<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for LabeledStatement<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ThrowStatement<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TryStatement<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for CatchClause<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for CatchParameter<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl GetNodeId for DebuggerStatement { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for BindingPattern<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for BindingPatternKind<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::BindingIdentifier(it) => GetNodeId::node_id(it.as_ref()), + Self::ObjectPattern(it) => GetNodeId::node_id(it.as_ref()), + Self::ArrayPattern(it) => GetNodeId::node_id(it.as_ref()), + Self::AssignmentPattern(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::BindingIdentifier(it) => GetNodeId::node_id_mut(&mut **it), + Self::ObjectPattern(it) => GetNodeId::node_id_mut(&mut **it), + Self::ArrayPattern(it) => GetNodeId::node_id_mut(&mut **it), + Self::AssignmentPattern(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for AssignmentPattern<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ObjectPattern<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for BindingProperty<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ArrayPattern<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for BindingRestElement<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for Function<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for FormalParameters<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for FormalParameter<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for FunctionBody<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ArrowFunctionExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for YieldExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for Class<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ClassBody<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ClassElement<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::StaticBlock(it) => GetNodeId::node_id(it.as_ref()), + Self::MethodDefinition(it) => GetNodeId::node_id(it.as_ref()), + Self::PropertyDefinition(it) => GetNodeId::node_id(it.as_ref()), + Self::AccessorProperty(it) => GetNodeId::node_id(it.as_ref()), + Self::TSIndexSignature(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::StaticBlock(it) => GetNodeId::node_id_mut(&mut **it), + Self::MethodDefinition(it) => GetNodeId::node_id_mut(&mut **it), + Self::PropertyDefinition(it) => GetNodeId::node_id_mut(&mut **it), + Self::AccessorProperty(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSIndexSignature(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for MethodDefinition<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for PropertyDefinition<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for PrivateIdentifier<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for StaticBlock<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ModuleDeclaration<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::ImportDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::ExportAllDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::ExportDefaultDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::ExportNamedDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::TSExportAssignment(it) => GetNodeId::node_id(it.as_ref()), + Self::TSNamespaceExportDeclaration(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::ImportDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::ExportAllDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::ExportDefaultDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::ExportNamedDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSExportAssignment(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSNamespaceExportDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for AccessorProperty<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ImportExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ImportDeclaration<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ImportDeclarationSpecifier<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::ImportSpecifier(it) => GetNodeId::node_id(it.as_ref()), + Self::ImportDefaultSpecifier(it) => GetNodeId::node_id(it.as_ref()), + Self::ImportNamespaceSpecifier(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::ImportSpecifier(it) => GetNodeId::node_id_mut(&mut **it), + Self::ImportDefaultSpecifier(it) => GetNodeId::node_id_mut(&mut **it), + Self::ImportNamespaceSpecifier(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for ImportSpecifier<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ImportDefaultSpecifier<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ImportNamespaceSpecifier<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for WithClause<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ImportAttribute<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ImportAttributeKey<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::Identifier(it) => GetNodeId::node_id(it), + Self::StringLiteral(it) => GetNodeId::node_id(it), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::Identifier(it) => GetNodeId::node_id_mut(it), + Self::StringLiteral(it) => GetNodeId::node_id_mut(it), + } + } +} + +impl<'a> GetNodeId for ExportNamedDeclaration<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ExportDefaultDeclaration<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ExportAllDeclaration<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ExportSpecifier<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for ExportDefaultDeclarationKind<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::FunctionDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::ClassDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::TSInterfaceDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::BooleanLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::NullLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::NumericLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::BigIntLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::RegExpLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::StringLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::TemplateLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::Identifier(it) => GetNodeId::node_id(it.as_ref()), + Self::MetaProperty(it) => GetNodeId::node_id(it.as_ref()), + Self::Super(it) => GetNodeId::node_id(it.as_ref()), + Self::ArrayExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ArrowFunctionExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::AssignmentExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::AwaitExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::BinaryExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::CallExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ChainExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ClassExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ConditionalExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::FunctionExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ImportExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::LogicalExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::NewExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ObjectExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ParenthesizedExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::SequenceExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TaggedTemplateExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ThisExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::UnaryExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::UpdateExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::YieldExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::PrivateInExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::JSXElement(it) => GetNodeId::node_id(it.as_ref()), + Self::JSXFragment(it) => GetNodeId::node_id(it.as_ref()), + Self::TSAsExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypeAssertion(it) => GetNodeId::node_id(it.as_ref()), + Self::TSNonNullExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSInstantiationExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ComputedMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::StaticMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::FunctionDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::ClassDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSInterfaceDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::BooleanLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::NullLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::NumericLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::BigIntLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::RegExpLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::StringLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::TemplateLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::Identifier(it) => GetNodeId::node_id_mut(&mut **it), + Self::MetaProperty(it) => GetNodeId::node_id_mut(&mut **it), + Self::Super(it) => GetNodeId::node_id_mut(&mut **it), + Self::ArrayExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ArrowFunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::AssignmentExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::AwaitExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::BinaryExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::CallExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ChainExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ClassExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ConditionalExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::FunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ImportExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::LogicalExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::NewExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ObjectExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ParenthesizedExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::SequenceExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TaggedTemplateExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ThisExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::UnaryExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::UpdateExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::YieldExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::PrivateInExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::JSXElement(it) => GetNodeId::node_id_mut(&mut **it), + Self::JSXFragment(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for ModuleExportName<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::IdentifierName(it) => GetNodeId::node_id(it), + Self::IdentifierReference(it) => GetNodeId::node_id(it), + Self::StringLiteral(it) => GetNodeId::node_id(it), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::IdentifierName(it) => GetNodeId::node_id_mut(it), + Self::IdentifierReference(it) => GetNodeId::node_id_mut(it), + Self::StringLiteral(it) => GetNodeId::node_id_mut(it), + } + } +} + +impl<'a> GetNodeId for TSThisParameter<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSEnumDeclaration<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSEnumMember<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSEnumMemberName<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::StaticIdentifier(it) => GetNodeId::node_id(it.as_ref()), + Self::StaticStringLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::StaticTemplateLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::StaticNumericLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::BooleanLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::NullLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::NumericLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::BigIntLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::RegExpLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::StringLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::TemplateLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::Identifier(it) => GetNodeId::node_id(it.as_ref()), + Self::MetaProperty(it) => GetNodeId::node_id(it.as_ref()), + Self::Super(it) => GetNodeId::node_id(it.as_ref()), + Self::ArrayExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ArrowFunctionExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::AssignmentExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::AwaitExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::BinaryExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::CallExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ChainExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ClassExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ConditionalExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::FunctionExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ImportExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::LogicalExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::NewExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ObjectExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ParenthesizedExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::SequenceExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TaggedTemplateExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ThisExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::UnaryExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::UpdateExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::YieldExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::PrivateInExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::JSXElement(it) => GetNodeId::node_id(it.as_ref()), + Self::JSXFragment(it) => GetNodeId::node_id(it.as_ref()), + Self::TSAsExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypeAssertion(it) => GetNodeId::node_id(it.as_ref()), + Self::TSNonNullExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSInstantiationExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ComputedMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::StaticMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::StaticIdentifier(it) => GetNodeId::node_id_mut(&mut **it), + Self::StaticStringLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::StaticTemplateLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::StaticNumericLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::BooleanLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::NullLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::NumericLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::BigIntLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::RegExpLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::StringLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::TemplateLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::Identifier(it) => GetNodeId::node_id_mut(&mut **it), + Self::MetaProperty(it) => GetNodeId::node_id_mut(&mut **it), + Self::Super(it) => GetNodeId::node_id_mut(&mut **it), + Self::ArrayExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ArrowFunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::AssignmentExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::AwaitExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::BinaryExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::CallExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ChainExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ClassExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ConditionalExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::FunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ImportExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::LogicalExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::NewExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ObjectExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ParenthesizedExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::SequenceExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TaggedTemplateExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ThisExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::UnaryExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::UpdateExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::YieldExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::PrivateInExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::JSXElement(it) => GetNodeId::node_id_mut(&mut **it), + Self::JSXFragment(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for TSTypeAnnotation<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSLiteralType<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSLiteral<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::BooleanLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::NullLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::NumericLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::BigIntLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::RegExpLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::StringLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::TemplateLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::UnaryExpression(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::BooleanLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::NullLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::NumericLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::BigIntLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::RegExpLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::StringLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::TemplateLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::UnaryExpression(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for TSType<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::TSAnyKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSBigIntKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSBooleanKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSIntrinsicKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSNeverKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSNullKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSNumberKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSObjectKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSStringKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSSymbolKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSUndefinedKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSUnknownKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSVoidKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSArrayType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSConditionalType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSConstructorType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSFunctionType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSImportType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSIndexedAccessType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSInferType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSIntersectionType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSLiteralType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSMappedType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSNamedTupleMember(it) => GetNodeId::node_id(it.as_ref()), + Self::TSQualifiedName(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTemplateLiteralType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSThisType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTupleType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypeLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypeOperatorType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypePredicate(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypeQuery(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypeReference(it) => GetNodeId::node_id(it.as_ref()), + Self::TSUnionType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSParenthesizedType(it) => GetNodeId::node_id(it.as_ref()), + Self::JSDocNullableType(it) => GetNodeId::node_id(it.as_ref()), + Self::JSDocNonNullableType(it) => GetNodeId::node_id(it.as_ref()), + Self::JSDocUnknownType(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::TSAnyKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSBigIntKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSBooleanKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSIntrinsicKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSNeverKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSNullKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSNumberKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSObjectKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSStringKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSSymbolKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSUndefinedKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSUnknownKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSVoidKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSArrayType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSConditionalType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSConstructorType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSFunctionType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSImportType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSIndexedAccessType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSInferType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSIntersectionType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSLiteralType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSMappedType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSNamedTupleMember(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSQualifiedName(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTemplateLiteralType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSThisType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTupleType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypeLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypeOperatorType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypePredicate(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypeQuery(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypeReference(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSUnionType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSParenthesizedType(it) => GetNodeId::node_id_mut(&mut **it), + Self::JSDocNullableType(it) => GetNodeId::node_id_mut(&mut **it), + Self::JSDocNonNullableType(it) => GetNodeId::node_id_mut(&mut **it), + Self::JSDocUnknownType(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for TSConditionalType<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSUnionType<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSIntersectionType<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSParenthesizedType<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSTypeOperator<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSArrayType<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSIndexedAccessType<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSTupleType<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSNamedTupleMember<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSOptionalType<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSRestType<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSTupleElement<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::TSOptionalType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSRestType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSAnyKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSBigIntKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSBooleanKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSIntrinsicKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSNeverKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSNullKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSNumberKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSObjectKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSStringKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSSymbolKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSUndefinedKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSUnknownKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSVoidKeyword(it) => GetNodeId::node_id(it.as_ref()), + Self::TSArrayType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSConditionalType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSConstructorType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSFunctionType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSImportType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSIndexedAccessType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSInferType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSIntersectionType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSLiteralType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSMappedType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSNamedTupleMember(it) => GetNodeId::node_id(it.as_ref()), + Self::TSQualifiedName(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTemplateLiteralType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSThisType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTupleType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypeLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypeOperatorType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypePredicate(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypeQuery(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypeReference(it) => GetNodeId::node_id(it.as_ref()), + Self::TSUnionType(it) => GetNodeId::node_id(it.as_ref()), + Self::TSParenthesizedType(it) => GetNodeId::node_id(it.as_ref()), + Self::JSDocNullableType(it) => GetNodeId::node_id(it.as_ref()), + Self::JSDocNonNullableType(it) => GetNodeId::node_id(it.as_ref()), + Self::JSDocUnknownType(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::TSOptionalType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSRestType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSAnyKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSBigIntKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSBooleanKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSIntrinsicKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSNeverKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSNullKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSNumberKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSObjectKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSStringKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSSymbolKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSUndefinedKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSUnknownKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSVoidKeyword(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSArrayType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSConditionalType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSConstructorType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSFunctionType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSImportType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSIndexedAccessType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSInferType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSIntersectionType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSLiteralType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSMappedType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSNamedTupleMember(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSQualifiedName(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTemplateLiteralType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSThisType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTupleType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypeLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypeOperatorType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypePredicate(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypeQuery(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypeReference(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSUnionType(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSParenthesizedType(it) => GetNodeId::node_id_mut(&mut **it), + Self::JSDocNullableType(it) => GetNodeId::node_id_mut(&mut **it), + Self::JSDocNonNullableType(it) => GetNodeId::node_id_mut(&mut **it), + Self::JSDocUnknownType(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl GetNodeId for TSAnyKeyword { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl GetNodeId for TSStringKeyword { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl GetNodeId for TSBooleanKeyword { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl GetNodeId for TSNumberKeyword { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl GetNodeId for TSNeverKeyword { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl GetNodeId for TSIntrinsicKeyword { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl GetNodeId for TSUnknownKeyword { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl GetNodeId for TSNullKeyword { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl GetNodeId for TSUndefinedKeyword { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl GetNodeId for TSVoidKeyword { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl GetNodeId for TSSymbolKeyword { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl GetNodeId for TSThisType { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl GetNodeId for TSObjectKeyword { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl GetNodeId for TSBigIntKeyword { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSTypeReference<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSTypeName<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::IdentifierReference(it) => GetNodeId::node_id(it.as_ref()), + Self::QualifiedName(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::IdentifierReference(it) => GetNodeId::node_id_mut(&mut **it), + Self::QualifiedName(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for TSQualifiedName<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSTypeParameterInstantiation<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSTypeParameter<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSTypeParameterDeclaration<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSTypeAliasDeclaration<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSClassImplements<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSInterfaceDeclaration<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSInterfaceBody<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSPropertySignature<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSSignature<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::TSIndexSignature(it) => GetNodeId::node_id(it.as_ref()), + Self::TSPropertySignature(it) => GetNodeId::node_id(it.as_ref()), + Self::TSCallSignatureDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::TSConstructSignatureDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::TSMethodSignature(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::TSIndexSignature(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSPropertySignature(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSCallSignatureDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSConstructSignatureDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSMethodSignature(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for TSIndexSignature<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSCallSignatureDeclaration<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSMethodSignature<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSConstructSignatureDeclaration<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSIndexSignatureName<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSInterfaceHeritage<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSTypePredicate<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSTypePredicateName<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::Identifier(it) => GetNodeId::node_id(it.as_ref()), + Self::This(it) => GetNodeId::node_id(it), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::Identifier(it) => GetNodeId::node_id_mut(&mut **it), + Self::This(it) => GetNodeId::node_id_mut(it), + } + } +} + +impl<'a> GetNodeId for TSModuleDeclaration<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSModuleDeclarationName<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::Identifier(it) => GetNodeId::node_id(it), + Self::StringLiteral(it) => GetNodeId::node_id(it), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::Identifier(it) => GetNodeId::node_id_mut(it), + Self::StringLiteral(it) => GetNodeId::node_id_mut(it), + } + } +} + +impl<'a> GetNodeId for TSModuleDeclarationBody<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::TSModuleDeclaration(it) => GetNodeId::node_id(it.as_ref()), + Self::TSModuleBlock(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::TSModuleDeclaration(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSModuleBlock(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for TSModuleBlock<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSTypeLiteral<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSInferType<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSTypeQuery<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSTypeQueryExprName<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::TSImportType(it) => GetNodeId::node_id(it.as_ref()), + Self::IdentifierReference(it) => GetNodeId::node_id(it.as_ref()), + Self::QualifiedName(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::TSImportType(it) => GetNodeId::node_id_mut(&mut **it), + Self::IdentifierReference(it) => GetNodeId::node_id_mut(&mut **it), + Self::QualifiedName(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for TSImportType<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSImportAttributes<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSImportAttribute<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSImportAttributeName<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::Identifier(it) => GetNodeId::node_id(it), + Self::StringLiteral(it) => GetNodeId::node_id(it), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::Identifier(it) => GetNodeId::node_id_mut(it), + Self::StringLiteral(it) => GetNodeId::node_id_mut(it), + } + } +} + +impl<'a> GetNodeId for TSFunctionType<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSConstructorType<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSMappedType<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSTemplateLiteralType<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSAsExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSSatisfiesExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSTypeAssertion<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSImportEqualsDeclaration<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSModuleReference<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::ExternalModuleReference(it) => GetNodeId::node_id(it.as_ref()), + Self::IdentifierReference(it) => GetNodeId::node_id(it.as_ref()), + Self::QualifiedName(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::ExternalModuleReference(it) => GetNodeId::node_id_mut(&mut **it), + Self::IdentifierReference(it) => GetNodeId::node_id_mut(&mut **it), + Self::QualifiedName(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for TSExternalModuleReference<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSNonNullExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for Decorator<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSExportAssignment<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSNamespaceExportDeclaration<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for TSInstantiationExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for JSDocNullableType<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for JSDocNonNullableType<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl GetNodeId for JSDocUnknownType { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for JSXElement<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for JSXOpeningElement<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for JSXClosingElement<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for JSXFragment<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for JSXElementName<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::Identifier(it) => GetNodeId::node_id(it.as_ref()), + Self::IdentifierReference(it) => GetNodeId::node_id(it.as_ref()), + Self::NamespacedName(it) => GetNodeId::node_id(it.as_ref()), + Self::MemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ThisExpression(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::Identifier(it) => GetNodeId::node_id_mut(&mut **it), + Self::IdentifierReference(it) => GetNodeId::node_id_mut(&mut **it), + Self::NamespacedName(it) => GetNodeId::node_id_mut(&mut **it), + Self::MemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ThisExpression(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for JSXNamespacedName<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for JSXMemberExpression<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for JSXMemberExpressionObject<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::IdentifierReference(it) => GetNodeId::node_id(it.as_ref()), + Self::MemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ThisExpression(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::IdentifierReference(it) => GetNodeId::node_id_mut(&mut **it), + Self::MemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ThisExpression(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for JSXExpressionContainer<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for JSXExpression<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::EmptyExpression(it) => GetNodeId::node_id(it), + Self::BooleanLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::NullLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::NumericLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::BigIntLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::RegExpLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::StringLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::TemplateLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::Identifier(it) => GetNodeId::node_id(it.as_ref()), + Self::MetaProperty(it) => GetNodeId::node_id(it.as_ref()), + Self::Super(it) => GetNodeId::node_id(it.as_ref()), + Self::ArrayExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ArrowFunctionExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::AssignmentExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::AwaitExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::BinaryExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::CallExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ChainExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ClassExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ConditionalExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::FunctionExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ImportExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::LogicalExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::NewExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ObjectExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ParenthesizedExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::SequenceExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TaggedTemplateExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ThisExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::UnaryExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::UpdateExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::YieldExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::PrivateInExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::JSXElement(it) => GetNodeId::node_id(it.as_ref()), + Self::JSXFragment(it) => GetNodeId::node_id(it.as_ref()), + Self::TSAsExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSTypeAssertion(it) => GetNodeId::node_id(it.as_ref()), + Self::TSNonNullExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::TSInstantiationExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::ComputedMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::StaticMemberExpression(it) => GetNodeId::node_id(it.as_ref()), + Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::EmptyExpression(it) => GetNodeId::node_id_mut(it), + Self::BooleanLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::NullLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::NumericLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::BigIntLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::RegExpLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::StringLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::TemplateLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::Identifier(it) => GetNodeId::node_id_mut(&mut **it), + Self::MetaProperty(it) => GetNodeId::node_id_mut(&mut **it), + Self::Super(it) => GetNodeId::node_id_mut(&mut **it), + Self::ArrayExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ArrowFunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::AssignmentExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::AwaitExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::BinaryExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::CallExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ChainExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ClassExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ConditionalExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::FunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ImportExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::LogicalExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::NewExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ObjectExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ParenthesizedExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::SequenceExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TaggedTemplateExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ThisExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::UnaryExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::UpdateExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::YieldExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::PrivateInExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::JSXElement(it) => GetNodeId::node_id_mut(&mut **it), + Self::JSXFragment(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl GetNodeId for JSXEmptyExpression { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for JSXAttributeItem<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::Attribute(it) => GetNodeId::node_id(it.as_ref()), + Self::SpreadAttribute(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::Attribute(it) => GetNodeId::node_id_mut(&mut **it), + Self::SpreadAttribute(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for JSXAttribute<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for JSXSpreadAttribute<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for JSXAttributeName<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::Identifier(it) => GetNodeId::node_id(it.as_ref()), + Self::NamespacedName(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::Identifier(it) => GetNodeId::node_id_mut(&mut **it), + Self::NamespacedName(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for JSXAttributeValue<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::StringLiteral(it) => GetNodeId::node_id(it.as_ref()), + Self::ExpressionContainer(it) => GetNodeId::node_id(it.as_ref()), + Self::Element(it) => GetNodeId::node_id(it.as_ref()), + Self::Fragment(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::StringLiteral(it) => GetNodeId::node_id_mut(&mut **it), + Self::ExpressionContainer(it) => GetNodeId::node_id_mut(&mut **it), + Self::Element(it) => GetNodeId::node_id_mut(&mut **it), + Self::Fragment(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for JSXIdentifier<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for JSXChild<'a> { + fn node_id(&self) -> NodeId { + match self { + Self::Text(it) => GetNodeId::node_id(it.as_ref()), + Self::Element(it) => GetNodeId::node_id(it.as_ref()), + Self::Fragment(it) => GetNodeId::node_id(it.as_ref()), + Self::ExpressionContainer(it) => GetNodeId::node_id(it.as_ref()), + Self::Spread(it) => GetNodeId::node_id(it.as_ref()), + } + } + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + Self::Text(it) => GetNodeId::node_id_mut(&mut **it), + Self::Element(it) => GetNodeId::node_id_mut(&mut **it), + Self::Fragment(it) => GetNodeId::node_id_mut(&mut **it), + Self::ExpressionContainer(it) => GetNodeId::node_id_mut(&mut **it), + Self::Spread(it) => GetNodeId::node_id_mut(&mut **it), + } + } +} + +impl<'a> GetNodeId for JSXSpreadChild<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} + +impl<'a> GetNodeId for JSXText<'a> { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } +} diff --git a/crates/oxc_ast/src/lib.rs b/crates/oxc_ast/src/lib.rs index 84fe417b50ae2..f4c121bee928d 100644 --- a/crates/oxc_ast/src/lib.rs +++ b/crates/oxc_ast/src/lib.rs @@ -44,6 +44,7 @@ mod generated { pub mod derive_clone_in; pub mod derive_content_eq; pub mod derive_content_hash; + pub mod derive_get_node_id; pub mod derive_get_span; pub mod derive_get_span_mut; pub mod visit; diff --git a/crates/oxc_ast_macros/src/lib.rs b/crates/oxc_ast_macros/src/lib.rs index a3f7e6870eed5..928be071105b6 100644 --- a/crates/oxc_ast_macros/src/lib.rs +++ b/crates/oxc_ast_macros/src/lib.rs @@ -54,6 +54,8 @@ fn assert_generated_derives(attrs: &[syn::Attribute]) -> TokenStream2 { if ident == "CloneIn" { (quote!(::oxc_allocator::CloneIn), quote!(<'static>)) + } else if ident == "GetNodeId" { + (quote!(::oxc_syntax::node::GetNodeId), TokenStream2::default()) } else if ident == "GetSpan" { (quote!(::oxc_span::GetSpan), TokenStream2::default()) } else if ident == "GetSpanMut" { diff --git a/crates/oxc_syntax/src/node.rs b/crates/oxc_syntax/src/node.rs index 1ef86f407ecf2..f834ce300080a 100644 --- a/crates/oxc_syntax/src/node.rs +++ b/crates/oxc_syntax/src/node.rs @@ -6,6 +6,11 @@ use oxc_index::Idx; #[cfg(feature = "serialize")] use serde::{Serialize, Serializer}; +pub trait GetNodeId { + fn node_id(&self) -> NodeId; + fn node_id_mut(&mut self) -> &mut NodeId; +} + #[ast] #[derive(Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash)] pub struct NodeId(NonMaxU32); diff --git a/tasks/ast_tools/src/derives/get_node_id.rs b/tasks/ast_tools/src/derives/get_node_id.rs new file mode 100644 index 0000000000000..ba5faf82648a0 --- /dev/null +++ b/tasks/ast_tools/src/derives/get_node_id.rs @@ -0,0 +1,96 @@ +use proc_macro2::TokenStream; +use quote::quote; + +use super::{define_derive, Derive, DeriveOutput}; +use crate::{ + codegen::LateCtx, + schema::{EnumDef, GetGenerics, StructDef, ToType, TypeDef}, + util::TypeWrapper, +}; + +define_derive! { + pub struct DeriveGetNodeId; +} + +impl Derive for DeriveGetNodeId { + fn trait_name() -> &'static str { + "GetNodeId" + } + + fn derive(&mut self, def: &TypeDef, _: &LateCtx) -> TokenStream { + match &def { + TypeDef::Enum(def) => derive_enum(def), + TypeDef::Struct(def) => derive_struct(def), + } + } + + fn prelude() -> TokenStream { + quote! { + #![allow(clippy::match_same_arms)] + + ///@@line_break + use oxc_syntax::node::{NodeId, GetNodeId}; + } + } +} + +fn derive_enum(def: &EnumDef) -> TokenStream { + let target_type = def.to_type(); + let generics = def.generics(); + + let (matches, matches_mut) = def + .all_variants() + .map(|var| { + let ident = var.ident(); + let it = quote!(it); + let (it, it_mut) = if var + .fields + .first() + .is_some_and(|it| it.typ.analysis().wrapper == TypeWrapper::Box) + { + ("e!(it.as_ref()), "e!(&mut **it)) + } else { + (&it, &it) + }; + ( + quote!(Self :: #ident(it) => GetNodeId::node_id(#it)), + quote!(Self :: #ident(it) => GetNodeId::node_id_mut(#it_mut)), + ) + }) + .collect::<(Vec<_>, Vec<_>)>(); + + quote! { + impl #generics GetNodeId for #target_type { + fn node_id(&self) -> NodeId { + match self { + #(#matches),* + } + } + + fn node_id_mut(&mut self) -> &mut NodeId { + match self { + #(#matches_mut),* + } + } + } + } +} + +fn derive_struct(def: &StructDef) -> TokenStream { + let target_type = def.to_type(); + let generics = def.generics(); + + quote! { + impl #generics GetNodeId for #target_type { + #[inline] + fn node_id(&self) -> NodeId { + self.node_id + } + + #[inline] + fn node_id_mut(&mut self) -> &mut NodeId { + &mut self.node_id + } + } + } +} diff --git a/tasks/ast_tools/src/derives/mod.rs b/tasks/ast_tools/src/derives/mod.rs index 555667a474e62..75c76d8d576ee 100644 --- a/tasks/ast_tools/src/derives/mod.rs +++ b/tasks/ast_tools/src/derives/mod.rs @@ -7,11 +7,13 @@ use crate::{codegen::LateCtx, schema::TypeDef}; mod clone_in; mod content_eq; mod content_hash; +mod get_node_id; mod get_span; pub use clone_in::DeriveCloneIn; pub use content_eq::DeriveContentEq; pub use content_hash::DeriveContentHash; +pub use get_node_id::DeriveGetNodeId; pub use get_span::{DeriveGetSpan, DeriveGetSpanMut}; pub trait Derive { diff --git a/tasks/ast_tools/src/main.rs b/tasks/ast_tools/src/main.rs index 7bd448847c446..331321d34575b 100644 --- a/tasks/ast_tools/src/main.rs +++ b/tasks/ast_tools/src/main.rs @@ -17,7 +17,10 @@ mod rust_ast; mod schema; mod util; -use derives::{DeriveCloneIn, DeriveContentEq, DeriveContentHash, DeriveGetSpan, DeriveGetSpanMut}; +use derives::{ + DeriveCloneIn, DeriveContentEq, DeriveContentHash, DeriveGetNodeId, DeriveGetSpan, + DeriveGetSpanMut, +}; use fmt::cargo_fmt; use generators::{ AssertLayouts, AstBuilderGenerator, AstKindGenerator, Generator, GeneratorOutput, @@ -72,6 +75,7 @@ fn main() -> std::result::Result<(), Box> { .pass(FakeNodeId) .pass(CalcLayout) .derive(DeriveCloneIn) + .derive(DeriveGetNodeId) .derive(DeriveGetSpan) .derive(DeriveGetSpanMut) .derive(DeriveContentEq) From 97285a5b34856a5b02f9ae3fa8fb6bdf51727a62 Mon Sep 17 00:00:00 2001 From: rzvxa Date: Mon, 16 Sep 2024 22:14:22 +0330 Subject: [PATCH 2/2] refactor: remove `node_id_mut`. --- .../src/generated/derive_get_node_id.rs | 1502 ----------------- crates/oxc_syntax/src/node.rs | 1 - tasks/ast_tools/src/derives/get_node_id.rs | 27 +- 3 files changed, 7 insertions(+), 1523 deletions(-) diff --git a/crates/oxc_ast/src/generated/derive_get_node_id.rs b/crates/oxc_ast/src/generated/derive_get_node_id.rs index d7c54a7c5398e..97232e1ae6cc6 100644 --- a/crates/oxc_ast/src/generated/derive_get_node_id.rs +++ b/crates/oxc_ast/src/generated/derive_get_node_id.rs @@ -22,10 +22,6 @@ impl GetNodeId for BooleanLiteral { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl GetNodeId for NullLiteral { @@ -33,10 +29,6 @@ impl GetNodeId for NullLiteral { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for NumericLiteral<'a> { @@ -44,10 +36,6 @@ impl<'a> GetNodeId for NumericLiteral<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for BigIntLiteral<'a> { @@ -55,10 +43,6 @@ impl<'a> GetNodeId for BigIntLiteral<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for RegExpLiteral<'a> { @@ -66,10 +50,6 @@ impl<'a> GetNodeId for RegExpLiteral<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for StringLiteral<'a> { @@ -77,10 +57,6 @@ impl<'a> GetNodeId for StringLiteral<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for Program<'a> { @@ -88,10 +64,6 @@ impl<'a> GetNodeId for Program<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for Expression<'a> { @@ -141,52 +113,6 @@ impl<'a> GetNodeId for Expression<'a> { Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::BooleanLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::NullLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::NumericLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::BigIntLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::RegExpLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::StringLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::TemplateLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::Identifier(it) => GetNodeId::node_id_mut(&mut **it), - Self::MetaProperty(it) => GetNodeId::node_id_mut(&mut **it), - Self::Super(it) => GetNodeId::node_id_mut(&mut **it), - Self::ArrayExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ArrowFunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::AssignmentExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::AwaitExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::BinaryExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::CallExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ChainExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ClassExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ConditionalExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::FunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ImportExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::LogicalExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::NewExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ObjectExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ParenthesizedExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::SequenceExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TaggedTemplateExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ThisExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::UnaryExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::UpdateExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::YieldExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::PrivateInExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::JSXElement(it) => GetNodeId::node_id_mut(&mut **it), - Self::JSXFragment(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for IdentifierName<'a> { @@ -194,10 +120,6 @@ impl<'a> GetNodeId for IdentifierName<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for IdentifierReference<'a> { @@ -205,10 +127,6 @@ impl<'a> GetNodeId for IdentifierReference<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for BindingIdentifier<'a> { @@ -216,10 +134,6 @@ impl<'a> GetNodeId for BindingIdentifier<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for LabelIdentifier<'a> { @@ -227,10 +141,6 @@ impl<'a> GetNodeId for LabelIdentifier<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl GetNodeId for ThisExpression { @@ -238,10 +148,6 @@ impl GetNodeId for ThisExpression { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ArrayExpression<'a> { @@ -249,10 +155,6 @@ impl<'a> GetNodeId for ArrayExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ArrayExpressionElement<'a> { @@ -304,54 +206,6 @@ impl<'a> GetNodeId for ArrayExpressionElement<'a> { Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::SpreadElement(it) => GetNodeId::node_id_mut(&mut **it), - Self::Elision(it) => GetNodeId::node_id_mut(it), - Self::BooleanLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::NullLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::NumericLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::BigIntLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::RegExpLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::StringLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::TemplateLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::Identifier(it) => GetNodeId::node_id_mut(&mut **it), - Self::MetaProperty(it) => GetNodeId::node_id_mut(&mut **it), - Self::Super(it) => GetNodeId::node_id_mut(&mut **it), - Self::ArrayExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ArrowFunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::AssignmentExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::AwaitExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::BinaryExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::CallExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ChainExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ClassExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ConditionalExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::FunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ImportExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::LogicalExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::NewExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ObjectExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ParenthesizedExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::SequenceExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TaggedTemplateExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ThisExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::UnaryExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::UpdateExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::YieldExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::PrivateInExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::JSXElement(it) => GetNodeId::node_id_mut(&mut **it), - Self::JSXFragment(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl GetNodeId for Elision { @@ -359,10 +213,6 @@ impl GetNodeId for Elision { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ObjectExpression<'a> { @@ -370,10 +220,6 @@ impl<'a> GetNodeId for ObjectExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ObjectPropertyKind<'a> { @@ -383,12 +229,6 @@ impl<'a> GetNodeId for ObjectPropertyKind<'a> { Self::SpreadProperty(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::ObjectProperty(it) => GetNodeId::node_id_mut(&mut **it), - Self::SpreadProperty(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for ObjectProperty<'a> { @@ -396,10 +236,6 @@ impl<'a> GetNodeId for ObjectProperty<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for PropertyKey<'a> { @@ -451,54 +287,6 @@ impl<'a> GetNodeId for PropertyKey<'a> { Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::StaticIdentifier(it) => GetNodeId::node_id_mut(&mut **it), - Self::PrivateIdentifier(it) => GetNodeId::node_id_mut(&mut **it), - Self::BooleanLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::NullLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::NumericLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::BigIntLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::RegExpLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::StringLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::TemplateLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::Identifier(it) => GetNodeId::node_id_mut(&mut **it), - Self::MetaProperty(it) => GetNodeId::node_id_mut(&mut **it), - Self::Super(it) => GetNodeId::node_id_mut(&mut **it), - Self::ArrayExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ArrowFunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::AssignmentExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::AwaitExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::BinaryExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::CallExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ChainExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ClassExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ConditionalExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::FunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ImportExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::LogicalExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::NewExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ObjectExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ParenthesizedExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::SequenceExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TaggedTemplateExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ThisExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::UnaryExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::UpdateExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::YieldExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::PrivateInExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::JSXElement(it) => GetNodeId::node_id_mut(&mut **it), - Self::JSXFragment(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for TemplateLiteral<'a> { @@ -506,10 +294,6 @@ impl<'a> GetNodeId for TemplateLiteral<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TaggedTemplateExpression<'a> { @@ -517,10 +301,6 @@ impl<'a> GetNodeId for TaggedTemplateExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TemplateElement<'a> { @@ -528,10 +308,6 @@ impl<'a> GetNodeId for TemplateElement<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for MemberExpression<'a> { @@ -542,13 +318,6 @@ impl<'a> GetNodeId for MemberExpression<'a> { Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for ComputedMemberExpression<'a> { @@ -556,10 +325,6 @@ impl<'a> GetNodeId for ComputedMemberExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for StaticMemberExpression<'a> { @@ -567,10 +332,6 @@ impl<'a> GetNodeId for StaticMemberExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for PrivateFieldExpression<'a> { @@ -578,10 +339,6 @@ impl<'a> GetNodeId for PrivateFieldExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for CallExpression<'a> { @@ -589,10 +346,6 @@ impl<'a> GetNodeId for CallExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for NewExpression<'a> { @@ -600,10 +353,6 @@ impl<'a> GetNodeId for NewExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for MetaProperty<'a> { @@ -611,10 +360,6 @@ impl<'a> GetNodeId for MetaProperty<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for SpreadElement<'a> { @@ -622,10 +367,6 @@ impl<'a> GetNodeId for SpreadElement<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for Argument<'a> { @@ -676,53 +417,6 @@ impl<'a> GetNodeId for Argument<'a> { Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::SpreadElement(it) => GetNodeId::node_id_mut(&mut **it), - Self::BooleanLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::NullLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::NumericLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::BigIntLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::RegExpLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::StringLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::TemplateLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::Identifier(it) => GetNodeId::node_id_mut(&mut **it), - Self::MetaProperty(it) => GetNodeId::node_id_mut(&mut **it), - Self::Super(it) => GetNodeId::node_id_mut(&mut **it), - Self::ArrayExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ArrowFunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::AssignmentExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::AwaitExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::BinaryExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::CallExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ChainExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ClassExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ConditionalExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::FunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ImportExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::LogicalExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::NewExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ObjectExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ParenthesizedExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::SequenceExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TaggedTemplateExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ThisExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::UnaryExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::UpdateExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::YieldExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::PrivateInExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::JSXElement(it) => GetNodeId::node_id_mut(&mut **it), - Self::JSXFragment(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for UpdateExpression<'a> { @@ -730,10 +424,6 @@ impl<'a> GetNodeId for UpdateExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for UnaryExpression<'a> { @@ -741,10 +431,6 @@ impl<'a> GetNodeId for UnaryExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for BinaryExpression<'a> { @@ -752,10 +438,6 @@ impl<'a> GetNodeId for BinaryExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for PrivateInExpression<'a> { @@ -763,10 +445,6 @@ impl<'a> GetNodeId for PrivateInExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for LogicalExpression<'a> { @@ -774,10 +452,6 @@ impl<'a> GetNodeId for LogicalExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ConditionalExpression<'a> { @@ -785,10 +459,6 @@ impl<'a> GetNodeId for ConditionalExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for AssignmentExpression<'a> { @@ -796,10 +466,6 @@ impl<'a> GetNodeId for AssignmentExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for AssignmentTarget<'a> { @@ -818,21 +484,6 @@ impl<'a> GetNodeId for AssignmentTarget<'a> { Self::ObjectAssignmentTarget(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::AssignmentTargetIdentifier(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ArrayAssignmentTarget(it) => GetNodeId::node_id_mut(&mut **it), - Self::ObjectAssignmentTarget(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for SimpleAssignmentTarget<'a> { @@ -849,19 +500,6 @@ impl<'a> GetNodeId for SimpleAssignmentTarget<'a> { Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::AssignmentTargetIdentifier(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for AssignmentTargetPattern<'a> { @@ -871,12 +509,6 @@ impl<'a> GetNodeId for AssignmentTargetPattern<'a> { Self::ObjectAssignmentTarget(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::ArrayAssignmentTarget(it) => GetNodeId::node_id_mut(&mut **it), - Self::ObjectAssignmentTarget(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for ArrayAssignmentTarget<'a> { @@ -884,10 +516,6 @@ impl<'a> GetNodeId for ArrayAssignmentTarget<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ObjectAssignmentTarget<'a> { @@ -895,10 +523,6 @@ impl<'a> GetNodeId for ObjectAssignmentTarget<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for AssignmentTargetRest<'a> { @@ -906,10 +530,6 @@ impl<'a> GetNodeId for AssignmentTargetRest<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for AssignmentTargetMaybeDefault<'a> { @@ -929,22 +549,6 @@ impl<'a> GetNodeId for AssignmentTargetMaybeDefault<'a> { Self::ObjectAssignmentTarget(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::AssignmentTargetWithDefault(it) => GetNodeId::node_id_mut(&mut **it), - Self::AssignmentTargetIdentifier(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ArrayAssignmentTarget(it) => GetNodeId::node_id_mut(&mut **it), - Self::ObjectAssignmentTarget(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for AssignmentTargetWithDefault<'a> { @@ -952,10 +556,6 @@ impl<'a> GetNodeId for AssignmentTargetWithDefault<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for AssignmentTargetProperty<'a> { @@ -965,12 +565,6 @@ impl<'a> GetNodeId for AssignmentTargetProperty<'a> { Self::AssignmentTargetPropertyProperty(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::AssignmentTargetPropertyIdentifier(it) => GetNodeId::node_id_mut(&mut **it), - Self::AssignmentTargetPropertyProperty(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for AssignmentTargetPropertyIdentifier<'a> { @@ -978,10 +572,6 @@ impl<'a> GetNodeId for AssignmentTargetPropertyIdentifier<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for AssignmentTargetPropertyProperty<'a> { @@ -989,10 +579,6 @@ impl<'a> GetNodeId for AssignmentTargetPropertyProperty<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for SequenceExpression<'a> { @@ -1000,10 +586,6 @@ impl<'a> GetNodeId for SequenceExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl GetNodeId for Super { @@ -1011,10 +593,6 @@ impl GetNodeId for Super { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for AwaitExpression<'a> { @@ -1022,10 +600,6 @@ impl<'a> GetNodeId for AwaitExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ChainExpression<'a> { @@ -1033,10 +607,6 @@ impl<'a> GetNodeId for ChainExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ChainElement<'a> { @@ -1048,14 +618,6 @@ impl<'a> GetNodeId for ChainElement<'a> { Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::CallExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for ParenthesizedExpression<'a> { @@ -1063,10 +625,6 @@ impl<'a> GetNodeId for ParenthesizedExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for Statement<'a> { @@ -1106,42 +664,6 @@ impl<'a> GetNodeId for Statement<'a> { Self::TSNamespaceExportDeclaration(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::BlockStatement(it) => GetNodeId::node_id_mut(&mut **it), - Self::BreakStatement(it) => GetNodeId::node_id_mut(&mut **it), - Self::ContinueStatement(it) => GetNodeId::node_id_mut(&mut **it), - Self::DebuggerStatement(it) => GetNodeId::node_id_mut(&mut **it), - Self::DoWhileStatement(it) => GetNodeId::node_id_mut(&mut **it), - Self::EmptyStatement(it) => GetNodeId::node_id_mut(&mut **it), - Self::ExpressionStatement(it) => GetNodeId::node_id_mut(&mut **it), - Self::ForInStatement(it) => GetNodeId::node_id_mut(&mut **it), - Self::ForOfStatement(it) => GetNodeId::node_id_mut(&mut **it), - Self::ForStatement(it) => GetNodeId::node_id_mut(&mut **it), - Self::IfStatement(it) => GetNodeId::node_id_mut(&mut **it), - Self::LabeledStatement(it) => GetNodeId::node_id_mut(&mut **it), - Self::ReturnStatement(it) => GetNodeId::node_id_mut(&mut **it), - Self::SwitchStatement(it) => GetNodeId::node_id_mut(&mut **it), - Self::ThrowStatement(it) => GetNodeId::node_id_mut(&mut **it), - Self::TryStatement(it) => GetNodeId::node_id_mut(&mut **it), - Self::WhileStatement(it) => GetNodeId::node_id_mut(&mut **it), - Self::WithStatement(it) => GetNodeId::node_id_mut(&mut **it), - Self::VariableDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::FunctionDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::ClassDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypeAliasDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSInterfaceDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSEnumDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSModuleDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSImportEqualsDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::ImportDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::ExportAllDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::ExportDefaultDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::ExportNamedDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSExportAssignment(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSNamespaceExportDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for Directive<'a> { @@ -1149,10 +671,6 @@ impl<'a> GetNodeId for Directive<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for Hashbang<'a> { @@ -1160,10 +678,6 @@ impl<'a> GetNodeId for Hashbang<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for BlockStatement<'a> { @@ -1171,10 +685,6 @@ impl<'a> GetNodeId for BlockStatement<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for Declaration<'a> { @@ -1190,18 +700,6 @@ impl<'a> GetNodeId for Declaration<'a> { Self::TSImportEqualsDeclaration(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::VariableDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::FunctionDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::ClassDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypeAliasDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSInterfaceDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSEnumDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSModuleDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSImportEqualsDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for VariableDeclaration<'a> { @@ -1209,10 +707,6 @@ impl<'a> GetNodeId for VariableDeclaration<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for VariableDeclarator<'a> { @@ -1220,10 +714,6 @@ impl<'a> GetNodeId for VariableDeclarator<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl GetNodeId for EmptyStatement { @@ -1231,10 +721,6 @@ impl GetNodeId for EmptyStatement { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ExpressionStatement<'a> { @@ -1242,10 +728,6 @@ impl<'a> GetNodeId for ExpressionStatement<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for IfStatement<'a> { @@ -1253,10 +735,6 @@ impl<'a> GetNodeId for IfStatement<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for DoWhileStatement<'a> { @@ -1264,10 +742,6 @@ impl<'a> GetNodeId for DoWhileStatement<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for WhileStatement<'a> { @@ -1275,10 +749,6 @@ impl<'a> GetNodeId for WhileStatement<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ForStatement<'a> { @@ -1286,10 +756,6 @@ impl<'a> GetNodeId for ForStatement<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ForStatementInit<'a> { @@ -1340,53 +806,6 @@ impl<'a> GetNodeId for ForStatementInit<'a> { Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::VariableDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::BooleanLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::NullLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::NumericLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::BigIntLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::RegExpLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::StringLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::TemplateLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::Identifier(it) => GetNodeId::node_id_mut(&mut **it), - Self::MetaProperty(it) => GetNodeId::node_id_mut(&mut **it), - Self::Super(it) => GetNodeId::node_id_mut(&mut **it), - Self::ArrayExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ArrowFunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::AssignmentExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::AwaitExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::BinaryExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::CallExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ChainExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ClassExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ConditionalExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::FunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ImportExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::LogicalExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::NewExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ObjectExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ParenthesizedExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::SequenceExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TaggedTemplateExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ThisExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::UnaryExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::UpdateExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::YieldExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::PrivateInExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::JSXElement(it) => GetNodeId::node_id_mut(&mut **it), - Self::JSXFragment(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for ForInStatement<'a> { @@ -1394,10 +813,6 @@ impl<'a> GetNodeId for ForInStatement<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ForStatementLeft<'a> { @@ -1417,22 +832,6 @@ impl<'a> GetNodeId for ForStatementLeft<'a> { Self::ObjectAssignmentTarget(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::VariableDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::AssignmentTargetIdentifier(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ArrayAssignmentTarget(it) => GetNodeId::node_id_mut(&mut **it), - Self::ObjectAssignmentTarget(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for ForOfStatement<'a> { @@ -1440,10 +839,6 @@ impl<'a> GetNodeId for ForOfStatement<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ContinueStatement<'a> { @@ -1451,10 +846,6 @@ impl<'a> GetNodeId for ContinueStatement<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for BreakStatement<'a> { @@ -1462,10 +853,6 @@ impl<'a> GetNodeId for BreakStatement<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ReturnStatement<'a> { @@ -1473,10 +860,6 @@ impl<'a> GetNodeId for ReturnStatement<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for WithStatement<'a> { @@ -1484,10 +867,6 @@ impl<'a> GetNodeId for WithStatement<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for SwitchStatement<'a> { @@ -1495,10 +874,6 @@ impl<'a> GetNodeId for SwitchStatement<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for SwitchCase<'a> { @@ -1506,10 +881,6 @@ impl<'a> GetNodeId for SwitchCase<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for LabeledStatement<'a> { @@ -1517,10 +888,6 @@ impl<'a> GetNodeId for LabeledStatement<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ThrowStatement<'a> { @@ -1528,10 +895,6 @@ impl<'a> GetNodeId for ThrowStatement<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TryStatement<'a> { @@ -1539,10 +902,6 @@ impl<'a> GetNodeId for TryStatement<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for CatchClause<'a> { @@ -1550,10 +909,6 @@ impl<'a> GetNodeId for CatchClause<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for CatchParameter<'a> { @@ -1561,10 +916,6 @@ impl<'a> GetNodeId for CatchParameter<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl GetNodeId for DebuggerStatement { @@ -1572,10 +923,6 @@ impl GetNodeId for DebuggerStatement { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for BindingPattern<'a> { @@ -1583,10 +930,6 @@ impl<'a> GetNodeId for BindingPattern<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for BindingPatternKind<'a> { @@ -1598,14 +941,6 @@ impl<'a> GetNodeId for BindingPatternKind<'a> { Self::AssignmentPattern(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::BindingIdentifier(it) => GetNodeId::node_id_mut(&mut **it), - Self::ObjectPattern(it) => GetNodeId::node_id_mut(&mut **it), - Self::ArrayPattern(it) => GetNodeId::node_id_mut(&mut **it), - Self::AssignmentPattern(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for AssignmentPattern<'a> { @@ -1613,10 +948,6 @@ impl<'a> GetNodeId for AssignmentPattern<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ObjectPattern<'a> { @@ -1624,10 +955,6 @@ impl<'a> GetNodeId for ObjectPattern<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for BindingProperty<'a> { @@ -1635,10 +962,6 @@ impl<'a> GetNodeId for BindingProperty<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ArrayPattern<'a> { @@ -1646,10 +969,6 @@ impl<'a> GetNodeId for ArrayPattern<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for BindingRestElement<'a> { @@ -1657,10 +976,6 @@ impl<'a> GetNodeId for BindingRestElement<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for Function<'a> { @@ -1668,10 +983,6 @@ impl<'a> GetNodeId for Function<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for FormalParameters<'a> { @@ -1679,10 +990,6 @@ impl<'a> GetNodeId for FormalParameters<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for FormalParameter<'a> { @@ -1690,10 +997,6 @@ impl<'a> GetNodeId for FormalParameter<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for FunctionBody<'a> { @@ -1701,10 +1004,6 @@ impl<'a> GetNodeId for FunctionBody<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ArrowFunctionExpression<'a> { @@ -1712,10 +1011,6 @@ impl<'a> GetNodeId for ArrowFunctionExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for YieldExpression<'a> { @@ -1723,10 +1018,6 @@ impl<'a> GetNodeId for YieldExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for Class<'a> { @@ -1734,10 +1025,6 @@ impl<'a> GetNodeId for Class<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ClassBody<'a> { @@ -1745,10 +1032,6 @@ impl<'a> GetNodeId for ClassBody<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ClassElement<'a> { @@ -1761,15 +1044,6 @@ impl<'a> GetNodeId for ClassElement<'a> { Self::TSIndexSignature(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::StaticBlock(it) => GetNodeId::node_id_mut(&mut **it), - Self::MethodDefinition(it) => GetNodeId::node_id_mut(&mut **it), - Self::PropertyDefinition(it) => GetNodeId::node_id_mut(&mut **it), - Self::AccessorProperty(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSIndexSignature(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for MethodDefinition<'a> { @@ -1777,10 +1051,6 @@ impl<'a> GetNodeId for MethodDefinition<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for PropertyDefinition<'a> { @@ -1788,10 +1058,6 @@ impl<'a> GetNodeId for PropertyDefinition<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for PrivateIdentifier<'a> { @@ -1799,10 +1065,6 @@ impl<'a> GetNodeId for PrivateIdentifier<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for StaticBlock<'a> { @@ -1810,10 +1072,6 @@ impl<'a> GetNodeId for StaticBlock<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ModuleDeclaration<'a> { @@ -1827,16 +1085,6 @@ impl<'a> GetNodeId for ModuleDeclaration<'a> { Self::TSNamespaceExportDeclaration(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::ImportDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::ExportAllDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::ExportDefaultDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::ExportNamedDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSExportAssignment(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSNamespaceExportDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for AccessorProperty<'a> { @@ -1844,10 +1092,6 @@ impl<'a> GetNodeId for AccessorProperty<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ImportExpression<'a> { @@ -1855,10 +1099,6 @@ impl<'a> GetNodeId for ImportExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ImportDeclaration<'a> { @@ -1866,10 +1106,6 @@ impl<'a> GetNodeId for ImportDeclaration<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ImportDeclarationSpecifier<'a> { @@ -1880,13 +1116,6 @@ impl<'a> GetNodeId for ImportDeclarationSpecifier<'a> { Self::ImportNamespaceSpecifier(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::ImportSpecifier(it) => GetNodeId::node_id_mut(&mut **it), - Self::ImportDefaultSpecifier(it) => GetNodeId::node_id_mut(&mut **it), - Self::ImportNamespaceSpecifier(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for ImportSpecifier<'a> { @@ -1894,10 +1123,6 @@ impl<'a> GetNodeId for ImportSpecifier<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ImportDefaultSpecifier<'a> { @@ -1905,10 +1130,6 @@ impl<'a> GetNodeId for ImportDefaultSpecifier<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ImportNamespaceSpecifier<'a> { @@ -1916,10 +1137,6 @@ impl<'a> GetNodeId for ImportNamespaceSpecifier<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for WithClause<'a> { @@ -1927,10 +1144,6 @@ impl<'a> GetNodeId for WithClause<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ImportAttribute<'a> { @@ -1938,10 +1151,6 @@ impl<'a> GetNodeId for ImportAttribute<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ImportAttributeKey<'a> { @@ -1951,12 +1160,6 @@ impl<'a> GetNodeId for ImportAttributeKey<'a> { Self::StringLiteral(it) => GetNodeId::node_id(it), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::Identifier(it) => GetNodeId::node_id_mut(it), - Self::StringLiteral(it) => GetNodeId::node_id_mut(it), - } - } } impl<'a> GetNodeId for ExportNamedDeclaration<'a> { @@ -1964,10 +1167,6 @@ impl<'a> GetNodeId for ExportNamedDeclaration<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ExportDefaultDeclaration<'a> { @@ -1975,10 +1174,6 @@ impl<'a> GetNodeId for ExportDefaultDeclaration<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ExportAllDeclaration<'a> { @@ -1986,10 +1181,6 @@ impl<'a> GetNodeId for ExportAllDeclaration<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ExportSpecifier<'a> { @@ -1997,10 +1188,6 @@ impl<'a> GetNodeId for ExportSpecifier<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for ExportDefaultDeclarationKind<'a> { @@ -2053,55 +1240,6 @@ impl<'a> GetNodeId for ExportDefaultDeclarationKind<'a> { Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::FunctionDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::ClassDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSInterfaceDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::BooleanLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::NullLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::NumericLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::BigIntLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::RegExpLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::StringLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::TemplateLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::Identifier(it) => GetNodeId::node_id_mut(&mut **it), - Self::MetaProperty(it) => GetNodeId::node_id_mut(&mut **it), - Self::Super(it) => GetNodeId::node_id_mut(&mut **it), - Self::ArrayExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ArrowFunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::AssignmentExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::AwaitExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::BinaryExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::CallExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ChainExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ClassExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ConditionalExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::FunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ImportExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::LogicalExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::NewExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ObjectExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ParenthesizedExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::SequenceExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TaggedTemplateExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ThisExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::UnaryExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::UpdateExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::YieldExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::PrivateInExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::JSXElement(it) => GetNodeId::node_id_mut(&mut **it), - Self::JSXFragment(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for ModuleExportName<'a> { @@ -2112,13 +1250,6 @@ impl<'a> GetNodeId for ModuleExportName<'a> { Self::StringLiteral(it) => GetNodeId::node_id(it), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::IdentifierName(it) => GetNodeId::node_id_mut(it), - Self::IdentifierReference(it) => GetNodeId::node_id_mut(it), - Self::StringLiteral(it) => GetNodeId::node_id_mut(it), - } - } } impl<'a> GetNodeId for TSThisParameter<'a> { @@ -2126,10 +1257,6 @@ impl<'a> GetNodeId for TSThisParameter<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSEnumDeclaration<'a> { @@ -2137,10 +1264,6 @@ impl<'a> GetNodeId for TSEnumDeclaration<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSEnumMember<'a> { @@ -2148,10 +1271,6 @@ impl<'a> GetNodeId for TSEnumMember<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSEnumMemberName<'a> { @@ -2205,56 +1324,6 @@ impl<'a> GetNodeId for TSEnumMemberName<'a> { Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::StaticIdentifier(it) => GetNodeId::node_id_mut(&mut **it), - Self::StaticStringLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::StaticTemplateLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::StaticNumericLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::BooleanLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::NullLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::NumericLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::BigIntLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::RegExpLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::StringLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::TemplateLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::Identifier(it) => GetNodeId::node_id_mut(&mut **it), - Self::MetaProperty(it) => GetNodeId::node_id_mut(&mut **it), - Self::Super(it) => GetNodeId::node_id_mut(&mut **it), - Self::ArrayExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ArrowFunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::AssignmentExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::AwaitExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::BinaryExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::CallExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ChainExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ClassExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ConditionalExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::FunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ImportExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::LogicalExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::NewExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ObjectExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ParenthesizedExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::SequenceExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TaggedTemplateExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ThisExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::UnaryExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::UpdateExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::YieldExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::PrivateInExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::JSXElement(it) => GetNodeId::node_id_mut(&mut **it), - Self::JSXFragment(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for TSTypeAnnotation<'a> { @@ -2262,10 +1331,6 @@ impl<'a> GetNodeId for TSTypeAnnotation<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSLiteralType<'a> { @@ -2273,10 +1338,6 @@ impl<'a> GetNodeId for TSLiteralType<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSLiteral<'a> { @@ -2292,18 +1353,6 @@ impl<'a> GetNodeId for TSLiteral<'a> { Self::UnaryExpression(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::BooleanLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::NullLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::NumericLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::BigIntLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::RegExpLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::StringLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::TemplateLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::UnaryExpression(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for TSType<'a> { @@ -2349,48 +1398,6 @@ impl<'a> GetNodeId for TSType<'a> { Self::JSDocUnknownType(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::TSAnyKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSBigIntKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSBooleanKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSIntrinsicKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSNeverKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSNullKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSNumberKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSObjectKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSStringKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSSymbolKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSUndefinedKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSUnknownKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSVoidKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSArrayType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSConditionalType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSConstructorType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSFunctionType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSImportType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSIndexedAccessType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSInferType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSIntersectionType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSLiteralType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSMappedType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSNamedTupleMember(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSQualifiedName(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTemplateLiteralType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSThisType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTupleType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypeLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypeOperatorType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypePredicate(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypeQuery(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypeReference(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSUnionType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSParenthesizedType(it) => GetNodeId::node_id_mut(&mut **it), - Self::JSDocNullableType(it) => GetNodeId::node_id_mut(&mut **it), - Self::JSDocNonNullableType(it) => GetNodeId::node_id_mut(&mut **it), - Self::JSDocUnknownType(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for TSConditionalType<'a> { @@ -2398,10 +1405,6 @@ impl<'a> GetNodeId for TSConditionalType<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSUnionType<'a> { @@ -2409,10 +1412,6 @@ impl<'a> GetNodeId for TSUnionType<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSIntersectionType<'a> { @@ -2420,10 +1419,6 @@ impl<'a> GetNodeId for TSIntersectionType<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSParenthesizedType<'a> { @@ -2431,10 +1426,6 @@ impl<'a> GetNodeId for TSParenthesizedType<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSTypeOperator<'a> { @@ -2442,10 +1433,6 @@ impl<'a> GetNodeId for TSTypeOperator<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSArrayType<'a> { @@ -2453,10 +1440,6 @@ impl<'a> GetNodeId for TSArrayType<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSIndexedAccessType<'a> { @@ -2464,10 +1447,6 @@ impl<'a> GetNodeId for TSIndexedAccessType<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSTupleType<'a> { @@ -2475,10 +1454,6 @@ impl<'a> GetNodeId for TSTupleType<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSNamedTupleMember<'a> { @@ -2486,10 +1461,6 @@ impl<'a> GetNodeId for TSNamedTupleMember<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSOptionalType<'a> { @@ -2497,10 +1468,6 @@ impl<'a> GetNodeId for TSOptionalType<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSRestType<'a> { @@ -2508,10 +1475,6 @@ impl<'a> GetNodeId for TSRestType<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSTupleElement<'a> { @@ -2559,50 +1522,6 @@ impl<'a> GetNodeId for TSTupleElement<'a> { Self::JSDocUnknownType(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::TSOptionalType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSRestType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSAnyKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSBigIntKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSBooleanKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSIntrinsicKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSNeverKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSNullKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSNumberKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSObjectKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSStringKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSSymbolKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSUndefinedKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSUnknownKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSVoidKeyword(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSArrayType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSConditionalType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSConstructorType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSFunctionType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSImportType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSIndexedAccessType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSInferType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSIntersectionType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSLiteralType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSMappedType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSNamedTupleMember(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSQualifiedName(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTemplateLiteralType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSThisType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTupleType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypeLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypeOperatorType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypePredicate(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypeQuery(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypeReference(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSUnionType(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSParenthesizedType(it) => GetNodeId::node_id_mut(&mut **it), - Self::JSDocNullableType(it) => GetNodeId::node_id_mut(&mut **it), - Self::JSDocNonNullableType(it) => GetNodeId::node_id_mut(&mut **it), - Self::JSDocUnknownType(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl GetNodeId for TSAnyKeyword { @@ -2610,10 +1529,6 @@ impl GetNodeId for TSAnyKeyword { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl GetNodeId for TSStringKeyword { @@ -2621,10 +1536,6 @@ impl GetNodeId for TSStringKeyword { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl GetNodeId for TSBooleanKeyword { @@ -2632,10 +1543,6 @@ impl GetNodeId for TSBooleanKeyword { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl GetNodeId for TSNumberKeyword { @@ -2643,10 +1550,6 @@ impl GetNodeId for TSNumberKeyword { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl GetNodeId for TSNeverKeyword { @@ -2654,10 +1557,6 @@ impl GetNodeId for TSNeverKeyword { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl GetNodeId for TSIntrinsicKeyword { @@ -2665,10 +1564,6 @@ impl GetNodeId for TSIntrinsicKeyword { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl GetNodeId for TSUnknownKeyword { @@ -2676,10 +1571,6 @@ impl GetNodeId for TSUnknownKeyword { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl GetNodeId for TSNullKeyword { @@ -2687,10 +1578,6 @@ impl GetNodeId for TSNullKeyword { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl GetNodeId for TSUndefinedKeyword { @@ -2698,10 +1585,6 @@ impl GetNodeId for TSUndefinedKeyword { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl GetNodeId for TSVoidKeyword { @@ -2709,10 +1592,6 @@ impl GetNodeId for TSVoidKeyword { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl GetNodeId for TSSymbolKeyword { @@ -2720,10 +1599,6 @@ impl GetNodeId for TSSymbolKeyword { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl GetNodeId for TSThisType { @@ -2731,10 +1606,6 @@ impl GetNodeId for TSThisType { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl GetNodeId for TSObjectKeyword { @@ -2742,10 +1613,6 @@ impl GetNodeId for TSObjectKeyword { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl GetNodeId for TSBigIntKeyword { @@ -2753,10 +1620,6 @@ impl GetNodeId for TSBigIntKeyword { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSTypeReference<'a> { @@ -2764,10 +1627,6 @@ impl<'a> GetNodeId for TSTypeReference<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSTypeName<'a> { @@ -2777,12 +1636,6 @@ impl<'a> GetNodeId for TSTypeName<'a> { Self::QualifiedName(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::IdentifierReference(it) => GetNodeId::node_id_mut(&mut **it), - Self::QualifiedName(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for TSQualifiedName<'a> { @@ -2790,10 +1643,6 @@ impl<'a> GetNodeId for TSQualifiedName<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSTypeParameterInstantiation<'a> { @@ -2801,10 +1650,6 @@ impl<'a> GetNodeId for TSTypeParameterInstantiation<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSTypeParameter<'a> { @@ -2812,10 +1657,6 @@ impl<'a> GetNodeId for TSTypeParameter<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSTypeParameterDeclaration<'a> { @@ -2823,10 +1664,6 @@ impl<'a> GetNodeId for TSTypeParameterDeclaration<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSTypeAliasDeclaration<'a> { @@ -2834,10 +1671,6 @@ impl<'a> GetNodeId for TSTypeAliasDeclaration<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSClassImplements<'a> { @@ -2845,10 +1678,6 @@ impl<'a> GetNodeId for TSClassImplements<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSInterfaceDeclaration<'a> { @@ -2856,10 +1685,6 @@ impl<'a> GetNodeId for TSInterfaceDeclaration<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSInterfaceBody<'a> { @@ -2867,10 +1692,6 @@ impl<'a> GetNodeId for TSInterfaceBody<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSPropertySignature<'a> { @@ -2878,10 +1699,6 @@ impl<'a> GetNodeId for TSPropertySignature<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSSignature<'a> { @@ -2894,15 +1711,6 @@ impl<'a> GetNodeId for TSSignature<'a> { Self::TSMethodSignature(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::TSIndexSignature(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSPropertySignature(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSCallSignatureDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSConstructSignatureDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSMethodSignature(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for TSIndexSignature<'a> { @@ -2910,10 +1718,6 @@ impl<'a> GetNodeId for TSIndexSignature<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSCallSignatureDeclaration<'a> { @@ -2921,10 +1725,6 @@ impl<'a> GetNodeId for TSCallSignatureDeclaration<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSMethodSignature<'a> { @@ -2932,10 +1732,6 @@ impl<'a> GetNodeId for TSMethodSignature<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSConstructSignatureDeclaration<'a> { @@ -2943,10 +1739,6 @@ impl<'a> GetNodeId for TSConstructSignatureDeclaration<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSIndexSignatureName<'a> { @@ -2954,10 +1746,6 @@ impl<'a> GetNodeId for TSIndexSignatureName<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSInterfaceHeritage<'a> { @@ -2965,10 +1753,6 @@ impl<'a> GetNodeId for TSInterfaceHeritage<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSTypePredicate<'a> { @@ -2976,10 +1760,6 @@ impl<'a> GetNodeId for TSTypePredicate<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSTypePredicateName<'a> { @@ -2989,12 +1769,6 @@ impl<'a> GetNodeId for TSTypePredicateName<'a> { Self::This(it) => GetNodeId::node_id(it), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::Identifier(it) => GetNodeId::node_id_mut(&mut **it), - Self::This(it) => GetNodeId::node_id_mut(it), - } - } } impl<'a> GetNodeId for TSModuleDeclaration<'a> { @@ -3002,10 +1776,6 @@ impl<'a> GetNodeId for TSModuleDeclaration<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSModuleDeclarationName<'a> { @@ -3015,12 +1785,6 @@ impl<'a> GetNodeId for TSModuleDeclarationName<'a> { Self::StringLiteral(it) => GetNodeId::node_id(it), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::Identifier(it) => GetNodeId::node_id_mut(it), - Self::StringLiteral(it) => GetNodeId::node_id_mut(it), - } - } } impl<'a> GetNodeId for TSModuleDeclarationBody<'a> { @@ -3030,12 +1794,6 @@ impl<'a> GetNodeId for TSModuleDeclarationBody<'a> { Self::TSModuleBlock(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::TSModuleDeclaration(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSModuleBlock(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for TSModuleBlock<'a> { @@ -3043,10 +1801,6 @@ impl<'a> GetNodeId for TSModuleBlock<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSTypeLiteral<'a> { @@ -3054,10 +1808,6 @@ impl<'a> GetNodeId for TSTypeLiteral<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSInferType<'a> { @@ -3065,10 +1815,6 @@ impl<'a> GetNodeId for TSInferType<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSTypeQuery<'a> { @@ -3076,10 +1822,6 @@ impl<'a> GetNodeId for TSTypeQuery<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSTypeQueryExprName<'a> { @@ -3090,13 +1832,6 @@ impl<'a> GetNodeId for TSTypeQueryExprName<'a> { Self::QualifiedName(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::TSImportType(it) => GetNodeId::node_id_mut(&mut **it), - Self::IdentifierReference(it) => GetNodeId::node_id_mut(&mut **it), - Self::QualifiedName(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for TSImportType<'a> { @@ -3104,10 +1839,6 @@ impl<'a> GetNodeId for TSImportType<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSImportAttributes<'a> { @@ -3115,10 +1846,6 @@ impl<'a> GetNodeId for TSImportAttributes<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSImportAttribute<'a> { @@ -3126,10 +1853,6 @@ impl<'a> GetNodeId for TSImportAttribute<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSImportAttributeName<'a> { @@ -3139,12 +1862,6 @@ impl<'a> GetNodeId for TSImportAttributeName<'a> { Self::StringLiteral(it) => GetNodeId::node_id(it), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::Identifier(it) => GetNodeId::node_id_mut(it), - Self::StringLiteral(it) => GetNodeId::node_id_mut(it), - } - } } impl<'a> GetNodeId for TSFunctionType<'a> { @@ -3152,10 +1869,6 @@ impl<'a> GetNodeId for TSFunctionType<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSConstructorType<'a> { @@ -3163,10 +1876,6 @@ impl<'a> GetNodeId for TSConstructorType<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSMappedType<'a> { @@ -3174,10 +1883,6 @@ impl<'a> GetNodeId for TSMappedType<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSTemplateLiteralType<'a> { @@ -3185,10 +1890,6 @@ impl<'a> GetNodeId for TSTemplateLiteralType<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSAsExpression<'a> { @@ -3196,10 +1897,6 @@ impl<'a> GetNodeId for TSAsExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSSatisfiesExpression<'a> { @@ -3207,10 +1904,6 @@ impl<'a> GetNodeId for TSSatisfiesExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSTypeAssertion<'a> { @@ -3218,10 +1911,6 @@ impl<'a> GetNodeId for TSTypeAssertion<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSImportEqualsDeclaration<'a> { @@ -3229,10 +1918,6 @@ impl<'a> GetNodeId for TSImportEqualsDeclaration<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSModuleReference<'a> { @@ -3243,13 +1928,6 @@ impl<'a> GetNodeId for TSModuleReference<'a> { Self::QualifiedName(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::ExternalModuleReference(it) => GetNodeId::node_id_mut(&mut **it), - Self::IdentifierReference(it) => GetNodeId::node_id_mut(&mut **it), - Self::QualifiedName(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for TSExternalModuleReference<'a> { @@ -3257,10 +1935,6 @@ impl<'a> GetNodeId for TSExternalModuleReference<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSNonNullExpression<'a> { @@ -3268,10 +1942,6 @@ impl<'a> GetNodeId for TSNonNullExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for Decorator<'a> { @@ -3279,10 +1949,6 @@ impl<'a> GetNodeId for Decorator<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSExportAssignment<'a> { @@ -3290,10 +1956,6 @@ impl<'a> GetNodeId for TSExportAssignment<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSNamespaceExportDeclaration<'a> { @@ -3301,10 +1963,6 @@ impl<'a> GetNodeId for TSNamespaceExportDeclaration<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for TSInstantiationExpression<'a> { @@ -3312,10 +1970,6 @@ impl<'a> GetNodeId for TSInstantiationExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for JSDocNullableType<'a> { @@ -3323,10 +1977,6 @@ impl<'a> GetNodeId for JSDocNullableType<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for JSDocNonNullableType<'a> { @@ -3334,10 +1984,6 @@ impl<'a> GetNodeId for JSDocNonNullableType<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl GetNodeId for JSDocUnknownType { @@ -3345,10 +1991,6 @@ impl GetNodeId for JSDocUnknownType { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for JSXElement<'a> { @@ -3356,10 +1998,6 @@ impl<'a> GetNodeId for JSXElement<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for JSXOpeningElement<'a> { @@ -3367,10 +2005,6 @@ impl<'a> GetNodeId for JSXOpeningElement<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for JSXClosingElement<'a> { @@ -3378,10 +2012,6 @@ impl<'a> GetNodeId for JSXClosingElement<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for JSXFragment<'a> { @@ -3389,10 +2019,6 @@ impl<'a> GetNodeId for JSXFragment<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for JSXElementName<'a> { @@ -3405,15 +2031,6 @@ impl<'a> GetNodeId for JSXElementName<'a> { Self::ThisExpression(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::Identifier(it) => GetNodeId::node_id_mut(&mut **it), - Self::IdentifierReference(it) => GetNodeId::node_id_mut(&mut **it), - Self::NamespacedName(it) => GetNodeId::node_id_mut(&mut **it), - Self::MemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ThisExpression(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for JSXNamespacedName<'a> { @@ -3421,10 +2038,6 @@ impl<'a> GetNodeId for JSXNamespacedName<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for JSXMemberExpression<'a> { @@ -3432,10 +2045,6 @@ impl<'a> GetNodeId for JSXMemberExpression<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for JSXMemberExpressionObject<'a> { @@ -3446,13 +2055,6 @@ impl<'a> GetNodeId for JSXMemberExpressionObject<'a> { Self::ThisExpression(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::IdentifierReference(it) => GetNodeId::node_id_mut(&mut **it), - Self::MemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ThisExpression(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for JSXExpressionContainer<'a> { @@ -3460,10 +2062,6 @@ impl<'a> GetNodeId for JSXExpressionContainer<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for JSXExpression<'a> { @@ -3514,53 +2112,6 @@ impl<'a> GetNodeId for JSXExpression<'a> { Self::PrivateFieldExpression(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::EmptyExpression(it) => GetNodeId::node_id_mut(it), - Self::BooleanLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::NullLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::NumericLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::BigIntLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::RegExpLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::StringLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::TemplateLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::Identifier(it) => GetNodeId::node_id_mut(&mut **it), - Self::MetaProperty(it) => GetNodeId::node_id_mut(&mut **it), - Self::Super(it) => GetNodeId::node_id_mut(&mut **it), - Self::ArrayExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ArrowFunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::AssignmentExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::AwaitExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::BinaryExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::CallExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ChainExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ClassExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ConditionalExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::FunctionExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ImportExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::LogicalExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::NewExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ObjectExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ParenthesizedExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::SequenceExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TaggedTemplateExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ThisExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::UnaryExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::UpdateExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::YieldExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::PrivateInExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::JSXElement(it) => GetNodeId::node_id_mut(&mut **it), - Self::JSXFragment(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSAsExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSSatisfiesExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSTypeAssertion(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSNonNullExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::TSInstantiationExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::ComputedMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::StaticMemberExpression(it) => GetNodeId::node_id_mut(&mut **it), - Self::PrivateFieldExpression(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl GetNodeId for JSXEmptyExpression { @@ -3568,10 +2119,6 @@ impl GetNodeId for JSXEmptyExpression { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for JSXAttributeItem<'a> { @@ -3581,12 +2128,6 @@ impl<'a> GetNodeId for JSXAttributeItem<'a> { Self::SpreadAttribute(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::Attribute(it) => GetNodeId::node_id_mut(&mut **it), - Self::SpreadAttribute(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for JSXAttribute<'a> { @@ -3594,10 +2135,6 @@ impl<'a> GetNodeId for JSXAttribute<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for JSXSpreadAttribute<'a> { @@ -3605,10 +2142,6 @@ impl<'a> GetNodeId for JSXSpreadAttribute<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for JSXAttributeName<'a> { @@ -3618,12 +2151,6 @@ impl<'a> GetNodeId for JSXAttributeName<'a> { Self::NamespacedName(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::Identifier(it) => GetNodeId::node_id_mut(&mut **it), - Self::NamespacedName(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for JSXAttributeValue<'a> { @@ -3635,14 +2162,6 @@ impl<'a> GetNodeId for JSXAttributeValue<'a> { Self::Fragment(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::StringLiteral(it) => GetNodeId::node_id_mut(&mut **it), - Self::ExpressionContainer(it) => GetNodeId::node_id_mut(&mut **it), - Self::Element(it) => GetNodeId::node_id_mut(&mut **it), - Self::Fragment(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for JSXIdentifier<'a> { @@ -3650,10 +2169,6 @@ impl<'a> GetNodeId for JSXIdentifier<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for JSXChild<'a> { @@ -3666,15 +2181,6 @@ impl<'a> GetNodeId for JSXChild<'a> { Self::Spread(it) => GetNodeId::node_id(it.as_ref()), } } - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - Self::Text(it) => GetNodeId::node_id_mut(&mut **it), - Self::Element(it) => GetNodeId::node_id_mut(&mut **it), - Self::Fragment(it) => GetNodeId::node_id_mut(&mut **it), - Self::ExpressionContainer(it) => GetNodeId::node_id_mut(&mut **it), - Self::Spread(it) => GetNodeId::node_id_mut(&mut **it), - } - } } impl<'a> GetNodeId for JSXSpreadChild<'a> { @@ -3682,10 +2188,6 @@ impl<'a> GetNodeId for JSXSpreadChild<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } impl<'a> GetNodeId for JSXText<'a> { @@ -3693,8 +2195,4 @@ impl<'a> GetNodeId for JSXText<'a> { fn node_id(&self) -> NodeId { self.node_id } - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } diff --git a/crates/oxc_syntax/src/node.rs b/crates/oxc_syntax/src/node.rs index f834ce300080a..b6742fd94c551 100644 --- a/crates/oxc_syntax/src/node.rs +++ b/crates/oxc_syntax/src/node.rs @@ -8,7 +8,6 @@ use serde::{Serialize, Serializer}; pub trait GetNodeId { fn node_id(&self) -> NodeId; - fn node_id_mut(&mut self) -> &mut NodeId; } #[ast] diff --git a/tasks/ast_tools/src/derives/get_node_id.rs b/tasks/ast_tools/src/derives/get_node_id.rs index ba5faf82648a0..e10cf0bd05cd4 100644 --- a/tasks/ast_tools/src/derives/get_node_id.rs +++ b/tasks/ast_tools/src/derives/get_node_id.rs @@ -1,3 +1,4 @@ +use itertools::Itertools; use proc_macro2::TokenStream; use quote::quote; @@ -38,26 +39,23 @@ fn derive_enum(def: &EnumDef) -> TokenStream { let target_type = def.to_type(); let generics = def.generics(); - let (matches, matches_mut) = def + let matches = def .all_variants() .map(|var| { let ident = var.ident(); let it = quote!(it); - let (it, it_mut) = if var + let it = if var .fields .first() .is_some_and(|it| it.typ.analysis().wrapper == TypeWrapper::Box) { - ("e!(it.as_ref()), "e!(&mut **it)) + "e!(it.as_ref()) } else { - (&it, &it) + &it }; - ( - quote!(Self :: #ident(it) => GetNodeId::node_id(#it)), - quote!(Self :: #ident(it) => GetNodeId::node_id_mut(#it_mut)), - ) + quote!(Self :: #ident(it) => GetNodeId::node_id(#it)) }) - .collect::<(Vec<_>, Vec<_>)>(); + .collect_vec(); quote! { impl #generics GetNodeId for #target_type { @@ -66,12 +64,6 @@ fn derive_enum(def: &EnumDef) -> TokenStream { #(#matches),* } } - - fn node_id_mut(&mut self) -> &mut NodeId { - match self { - #(#matches_mut),* - } - } } } } @@ -86,11 +78,6 @@ fn derive_struct(def: &StructDef) -> TokenStream { fn node_id(&self) -> NodeId { self.node_id } - - #[inline] - fn node_id_mut(&mut self) -> &mut NodeId { - &mut self.node_id - } } } }