From a2337cd4cc32933ad09ef49b055646928f143042 Mon Sep 17 00:00:00 2001 From: rzvxa Date: Thu, 5 Sep 2024 01:32:50 +0330 Subject: [PATCH] update GetSpan and GetSpanMut derives. --- .../oxc_ast/src/generated/derive_get_span.rs | 1194 ++++++++--------- .../src/generated/derive_get_span_mut.rs | 1194 ++++++++--------- tasks/ast_tools/src/derives/get_span.rs | 82 +- 3 files changed, 1260 insertions(+), 1210 deletions(-) diff --git a/crates/oxc_ast/src/generated/derive_get_span.rs b/crates/oxc_ast/src/generated/derive_get_span.rs index 38cde1c2ec246d..8f00a0b7e87be8 100644 --- a/crates/oxc_ast/src/generated/derive_get_span.rs +++ b/crates/oxc_ast/src/generated/derive_get_span.rs @@ -69,48 +69,48 @@ impl<'a> GetSpan for Program<'a> { impl<'a> GetSpan for Expression<'a> { fn span(&self) -> Span { match self { - Self::BooleanLiteral(it) => it.span(), - Self::NullLiteral(it) => it.span(), - Self::NumericLiteral(it) => it.span(), - Self::BigIntLiteral(it) => it.span(), - Self::RegExpLiteral(it) => it.span(), - Self::StringLiteral(it) => it.span(), - Self::TemplateLiteral(it) => it.span(), - Self::Identifier(it) => it.span(), - Self::MetaProperty(it) => it.span(), - Self::Super(it) => it.span(), - Self::ArrayExpression(it) => it.span(), - Self::ArrowFunctionExpression(it) => it.span(), - Self::AssignmentExpression(it) => it.span(), - Self::AwaitExpression(it) => it.span(), - Self::BinaryExpression(it) => it.span(), - Self::CallExpression(it) => it.span(), - Self::ChainExpression(it) => it.span(), - Self::ClassExpression(it) => it.span(), - Self::ConditionalExpression(it) => it.span(), - Self::FunctionExpression(it) => it.span(), - Self::ImportExpression(it) => it.span(), - Self::LogicalExpression(it) => it.span(), - Self::NewExpression(it) => it.span(), - Self::ObjectExpression(it) => it.span(), - Self::ParenthesizedExpression(it) => it.span(), - Self::SequenceExpression(it) => it.span(), - Self::TaggedTemplateExpression(it) => it.span(), - Self::ThisExpression(it) => it.span(), - Self::UnaryExpression(it) => it.span(), - Self::UpdateExpression(it) => it.span(), - Self::YieldExpression(it) => it.span(), - Self::PrivateInExpression(it) => it.span(), - Self::JSXElement(it) => it.span(), - Self::JSXFragment(it) => it.span(), - Self::TSAsExpression(it) => it.span(), - Self::TSSatisfiesExpression(it) => it.span(), - Self::TSTypeAssertion(it) => it.span(), - Self::TSNonNullExpression(it) => it.span(), - Self::TSInstantiationExpression(it) => it.span(), - Self::ComputedMemberExpression(it) => it.span(), - Self::StaticMemberExpression(it) => it.span(), - Self::PrivateFieldExpression(it) => it.span(), + Self::BooleanLiteral(it) => GetSpan::span(it.as_ref()), + Self::NullLiteral(it) => GetSpan::span(it.as_ref()), + Self::NumericLiteral(it) => GetSpan::span(it.as_ref()), + Self::BigIntLiteral(it) => GetSpan::span(it.as_ref()), + Self::RegExpLiteral(it) => GetSpan::span(it.as_ref()), + Self::StringLiteral(it) => GetSpan::span(it.as_ref()), + Self::TemplateLiteral(it) => GetSpan::span(it.as_ref()), + Self::Identifier(it) => GetSpan::span(it.as_ref()), + Self::MetaProperty(it) => GetSpan::span(it.as_ref()), + Self::Super(it) => GetSpan::span(it.as_ref()), + Self::ArrayExpression(it) => GetSpan::span(it.as_ref()), + Self::ArrowFunctionExpression(it) => GetSpan::span(it.as_ref()), + Self::AssignmentExpression(it) => GetSpan::span(it.as_ref()), + Self::AwaitExpression(it) => GetSpan::span(it.as_ref()), + Self::BinaryExpression(it) => GetSpan::span(it.as_ref()), + Self::CallExpression(it) => GetSpan::span(it.as_ref()), + Self::ChainExpression(it) => GetSpan::span(it.as_ref()), + Self::ClassExpression(it) => GetSpan::span(it.as_ref()), + Self::ConditionalExpression(it) => GetSpan::span(it.as_ref()), + Self::FunctionExpression(it) => GetSpan::span(it.as_ref()), + Self::ImportExpression(it) => GetSpan::span(it.as_ref()), + Self::LogicalExpression(it) => GetSpan::span(it.as_ref()), + Self::NewExpression(it) => GetSpan::span(it.as_ref()), + Self::ObjectExpression(it) => GetSpan::span(it.as_ref()), + Self::ParenthesizedExpression(it) => GetSpan::span(it.as_ref()), + Self::SequenceExpression(it) => GetSpan::span(it.as_ref()), + Self::TaggedTemplateExpression(it) => GetSpan::span(it.as_ref()), + Self::ThisExpression(it) => GetSpan::span(it.as_ref()), + Self::UnaryExpression(it) => GetSpan::span(it.as_ref()), + Self::UpdateExpression(it) => GetSpan::span(it.as_ref()), + Self::YieldExpression(it) => GetSpan::span(it.as_ref()), + Self::PrivateInExpression(it) => GetSpan::span(it.as_ref()), + Self::JSXElement(it) => GetSpan::span(it.as_ref()), + Self::JSXFragment(it) => GetSpan::span(it.as_ref()), + Self::TSAsExpression(it) => GetSpan::span(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetSpan::span(it.as_ref()), + Self::TSTypeAssertion(it) => GetSpan::span(it.as_ref()), + Self::TSNonNullExpression(it) => GetSpan::span(it.as_ref()), + Self::TSInstantiationExpression(it) => GetSpan::span(it.as_ref()), + Self::ComputedMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::StaticMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::PrivateFieldExpression(it) => GetSpan::span(it.as_ref()), } } } @@ -160,50 +160,50 @@ impl<'a> GetSpan for ArrayExpression<'a> { impl<'a> GetSpan for ArrayExpressionElement<'a> { fn span(&self) -> Span { match self { - Self::SpreadElement(it) => it.span(), - Self::Elision(it) => it.span(), - Self::BooleanLiteral(it) => it.span(), - Self::NullLiteral(it) => it.span(), - Self::NumericLiteral(it) => it.span(), - Self::BigIntLiteral(it) => it.span(), - Self::RegExpLiteral(it) => it.span(), - Self::StringLiteral(it) => it.span(), - Self::TemplateLiteral(it) => it.span(), - Self::Identifier(it) => it.span(), - Self::MetaProperty(it) => it.span(), - Self::Super(it) => it.span(), - Self::ArrayExpression(it) => it.span(), - Self::ArrowFunctionExpression(it) => it.span(), - Self::AssignmentExpression(it) => it.span(), - Self::AwaitExpression(it) => it.span(), - Self::BinaryExpression(it) => it.span(), - Self::CallExpression(it) => it.span(), - Self::ChainExpression(it) => it.span(), - Self::ClassExpression(it) => it.span(), - Self::ConditionalExpression(it) => it.span(), - Self::FunctionExpression(it) => it.span(), - Self::ImportExpression(it) => it.span(), - Self::LogicalExpression(it) => it.span(), - Self::NewExpression(it) => it.span(), - Self::ObjectExpression(it) => it.span(), - Self::ParenthesizedExpression(it) => it.span(), - Self::SequenceExpression(it) => it.span(), - Self::TaggedTemplateExpression(it) => it.span(), - Self::ThisExpression(it) => it.span(), - Self::UnaryExpression(it) => it.span(), - Self::UpdateExpression(it) => it.span(), - Self::YieldExpression(it) => it.span(), - Self::PrivateInExpression(it) => it.span(), - Self::JSXElement(it) => it.span(), - Self::JSXFragment(it) => it.span(), - Self::TSAsExpression(it) => it.span(), - Self::TSSatisfiesExpression(it) => it.span(), - Self::TSTypeAssertion(it) => it.span(), - Self::TSNonNullExpression(it) => it.span(), - Self::TSInstantiationExpression(it) => it.span(), - Self::ComputedMemberExpression(it) => it.span(), - Self::StaticMemberExpression(it) => it.span(), - Self::PrivateFieldExpression(it) => it.span(), + Self::SpreadElement(it) => GetSpan::span(it.as_ref()), + Self::Elision(it) => GetSpan::span(it), + Self::BooleanLiteral(it) => GetSpan::span(it.as_ref()), + Self::NullLiteral(it) => GetSpan::span(it.as_ref()), + Self::NumericLiteral(it) => GetSpan::span(it.as_ref()), + Self::BigIntLiteral(it) => GetSpan::span(it.as_ref()), + Self::RegExpLiteral(it) => GetSpan::span(it.as_ref()), + Self::StringLiteral(it) => GetSpan::span(it.as_ref()), + Self::TemplateLiteral(it) => GetSpan::span(it.as_ref()), + Self::Identifier(it) => GetSpan::span(it.as_ref()), + Self::MetaProperty(it) => GetSpan::span(it.as_ref()), + Self::Super(it) => GetSpan::span(it.as_ref()), + Self::ArrayExpression(it) => GetSpan::span(it.as_ref()), + Self::ArrowFunctionExpression(it) => GetSpan::span(it.as_ref()), + Self::AssignmentExpression(it) => GetSpan::span(it.as_ref()), + Self::AwaitExpression(it) => GetSpan::span(it.as_ref()), + Self::BinaryExpression(it) => GetSpan::span(it.as_ref()), + Self::CallExpression(it) => GetSpan::span(it.as_ref()), + Self::ChainExpression(it) => GetSpan::span(it.as_ref()), + Self::ClassExpression(it) => GetSpan::span(it.as_ref()), + Self::ConditionalExpression(it) => GetSpan::span(it.as_ref()), + Self::FunctionExpression(it) => GetSpan::span(it.as_ref()), + Self::ImportExpression(it) => GetSpan::span(it.as_ref()), + Self::LogicalExpression(it) => GetSpan::span(it.as_ref()), + Self::NewExpression(it) => GetSpan::span(it.as_ref()), + Self::ObjectExpression(it) => GetSpan::span(it.as_ref()), + Self::ParenthesizedExpression(it) => GetSpan::span(it.as_ref()), + Self::SequenceExpression(it) => GetSpan::span(it.as_ref()), + Self::TaggedTemplateExpression(it) => GetSpan::span(it.as_ref()), + Self::ThisExpression(it) => GetSpan::span(it.as_ref()), + Self::UnaryExpression(it) => GetSpan::span(it.as_ref()), + Self::UpdateExpression(it) => GetSpan::span(it.as_ref()), + Self::YieldExpression(it) => GetSpan::span(it.as_ref()), + Self::PrivateInExpression(it) => GetSpan::span(it.as_ref()), + Self::JSXElement(it) => GetSpan::span(it.as_ref()), + Self::JSXFragment(it) => GetSpan::span(it.as_ref()), + Self::TSAsExpression(it) => GetSpan::span(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetSpan::span(it.as_ref()), + Self::TSTypeAssertion(it) => GetSpan::span(it.as_ref()), + Self::TSNonNullExpression(it) => GetSpan::span(it.as_ref()), + Self::TSInstantiationExpression(it) => GetSpan::span(it.as_ref()), + Self::ComputedMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::StaticMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::PrivateFieldExpression(it) => GetSpan::span(it.as_ref()), } } } @@ -225,8 +225,8 @@ impl<'a> GetSpan for ObjectExpression<'a> { impl<'a> GetSpan for ObjectPropertyKind<'a> { fn span(&self) -> Span { match self { - Self::ObjectProperty(it) => it.span(), - Self::SpreadProperty(it) => it.span(), + Self::ObjectProperty(it) => GetSpan::span(it.as_ref()), + Self::SpreadProperty(it) => GetSpan::span(it.as_ref()), } } } @@ -241,50 +241,50 @@ impl<'a> GetSpan for ObjectProperty<'a> { impl<'a> GetSpan for PropertyKey<'a> { fn span(&self) -> Span { match self { - Self::StaticIdentifier(it) => it.span(), - Self::PrivateIdentifier(it) => it.span(), - Self::BooleanLiteral(it) => it.span(), - Self::NullLiteral(it) => it.span(), - Self::NumericLiteral(it) => it.span(), - Self::BigIntLiteral(it) => it.span(), - Self::RegExpLiteral(it) => it.span(), - Self::StringLiteral(it) => it.span(), - Self::TemplateLiteral(it) => it.span(), - Self::Identifier(it) => it.span(), - Self::MetaProperty(it) => it.span(), - Self::Super(it) => it.span(), - Self::ArrayExpression(it) => it.span(), - Self::ArrowFunctionExpression(it) => it.span(), - Self::AssignmentExpression(it) => it.span(), - Self::AwaitExpression(it) => it.span(), - Self::BinaryExpression(it) => it.span(), - Self::CallExpression(it) => it.span(), - Self::ChainExpression(it) => it.span(), - Self::ClassExpression(it) => it.span(), - Self::ConditionalExpression(it) => it.span(), - Self::FunctionExpression(it) => it.span(), - Self::ImportExpression(it) => it.span(), - Self::LogicalExpression(it) => it.span(), - Self::NewExpression(it) => it.span(), - Self::ObjectExpression(it) => it.span(), - Self::ParenthesizedExpression(it) => it.span(), - Self::SequenceExpression(it) => it.span(), - Self::TaggedTemplateExpression(it) => it.span(), - Self::ThisExpression(it) => it.span(), - Self::UnaryExpression(it) => it.span(), - Self::UpdateExpression(it) => it.span(), - Self::YieldExpression(it) => it.span(), - Self::PrivateInExpression(it) => it.span(), - Self::JSXElement(it) => it.span(), - Self::JSXFragment(it) => it.span(), - Self::TSAsExpression(it) => it.span(), - Self::TSSatisfiesExpression(it) => it.span(), - Self::TSTypeAssertion(it) => it.span(), - Self::TSNonNullExpression(it) => it.span(), - Self::TSInstantiationExpression(it) => it.span(), - Self::ComputedMemberExpression(it) => it.span(), - Self::StaticMemberExpression(it) => it.span(), - Self::PrivateFieldExpression(it) => it.span(), + Self::StaticIdentifier(it) => GetSpan::span(it.as_ref()), + Self::PrivateIdentifier(it) => GetSpan::span(it.as_ref()), + Self::BooleanLiteral(it) => GetSpan::span(it.as_ref()), + Self::NullLiteral(it) => GetSpan::span(it.as_ref()), + Self::NumericLiteral(it) => GetSpan::span(it.as_ref()), + Self::BigIntLiteral(it) => GetSpan::span(it.as_ref()), + Self::RegExpLiteral(it) => GetSpan::span(it.as_ref()), + Self::StringLiteral(it) => GetSpan::span(it.as_ref()), + Self::TemplateLiteral(it) => GetSpan::span(it.as_ref()), + Self::Identifier(it) => GetSpan::span(it.as_ref()), + Self::MetaProperty(it) => GetSpan::span(it.as_ref()), + Self::Super(it) => GetSpan::span(it.as_ref()), + Self::ArrayExpression(it) => GetSpan::span(it.as_ref()), + Self::ArrowFunctionExpression(it) => GetSpan::span(it.as_ref()), + Self::AssignmentExpression(it) => GetSpan::span(it.as_ref()), + Self::AwaitExpression(it) => GetSpan::span(it.as_ref()), + Self::BinaryExpression(it) => GetSpan::span(it.as_ref()), + Self::CallExpression(it) => GetSpan::span(it.as_ref()), + Self::ChainExpression(it) => GetSpan::span(it.as_ref()), + Self::ClassExpression(it) => GetSpan::span(it.as_ref()), + Self::ConditionalExpression(it) => GetSpan::span(it.as_ref()), + Self::FunctionExpression(it) => GetSpan::span(it.as_ref()), + Self::ImportExpression(it) => GetSpan::span(it.as_ref()), + Self::LogicalExpression(it) => GetSpan::span(it.as_ref()), + Self::NewExpression(it) => GetSpan::span(it.as_ref()), + Self::ObjectExpression(it) => GetSpan::span(it.as_ref()), + Self::ParenthesizedExpression(it) => GetSpan::span(it.as_ref()), + Self::SequenceExpression(it) => GetSpan::span(it.as_ref()), + Self::TaggedTemplateExpression(it) => GetSpan::span(it.as_ref()), + Self::ThisExpression(it) => GetSpan::span(it.as_ref()), + Self::UnaryExpression(it) => GetSpan::span(it.as_ref()), + Self::UpdateExpression(it) => GetSpan::span(it.as_ref()), + Self::YieldExpression(it) => GetSpan::span(it.as_ref()), + Self::PrivateInExpression(it) => GetSpan::span(it.as_ref()), + Self::JSXElement(it) => GetSpan::span(it.as_ref()), + Self::JSXFragment(it) => GetSpan::span(it.as_ref()), + Self::TSAsExpression(it) => GetSpan::span(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetSpan::span(it.as_ref()), + Self::TSTypeAssertion(it) => GetSpan::span(it.as_ref()), + Self::TSNonNullExpression(it) => GetSpan::span(it.as_ref()), + Self::TSInstantiationExpression(it) => GetSpan::span(it.as_ref()), + Self::ComputedMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::StaticMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::PrivateFieldExpression(it) => GetSpan::span(it.as_ref()), } } } @@ -313,9 +313,9 @@ impl<'a> GetSpan for TemplateElement<'a> { impl<'a> GetSpan for MemberExpression<'a> { fn span(&self) -> Span { match self { - Self::ComputedMemberExpression(it) => it.span(), - Self::StaticMemberExpression(it) => it.span(), - Self::PrivateFieldExpression(it) => it.span(), + Self::ComputedMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::StaticMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::PrivateFieldExpression(it) => GetSpan::span(it.as_ref()), } } } @@ -372,49 +372,49 @@ impl<'a> GetSpan for SpreadElement<'a> { impl<'a> GetSpan for Argument<'a> { fn span(&self) -> Span { match self { - Self::SpreadElement(it) => it.span(), - Self::BooleanLiteral(it) => it.span(), - Self::NullLiteral(it) => it.span(), - Self::NumericLiteral(it) => it.span(), - Self::BigIntLiteral(it) => it.span(), - Self::RegExpLiteral(it) => it.span(), - Self::StringLiteral(it) => it.span(), - Self::TemplateLiteral(it) => it.span(), - Self::Identifier(it) => it.span(), - Self::MetaProperty(it) => it.span(), - Self::Super(it) => it.span(), - Self::ArrayExpression(it) => it.span(), - Self::ArrowFunctionExpression(it) => it.span(), - Self::AssignmentExpression(it) => it.span(), - Self::AwaitExpression(it) => it.span(), - Self::BinaryExpression(it) => it.span(), - Self::CallExpression(it) => it.span(), - Self::ChainExpression(it) => it.span(), - Self::ClassExpression(it) => it.span(), - Self::ConditionalExpression(it) => it.span(), - Self::FunctionExpression(it) => it.span(), - Self::ImportExpression(it) => it.span(), - Self::LogicalExpression(it) => it.span(), - Self::NewExpression(it) => it.span(), - Self::ObjectExpression(it) => it.span(), - Self::ParenthesizedExpression(it) => it.span(), - Self::SequenceExpression(it) => it.span(), - Self::TaggedTemplateExpression(it) => it.span(), - Self::ThisExpression(it) => it.span(), - Self::UnaryExpression(it) => it.span(), - Self::UpdateExpression(it) => it.span(), - Self::YieldExpression(it) => it.span(), - Self::PrivateInExpression(it) => it.span(), - Self::JSXElement(it) => it.span(), - Self::JSXFragment(it) => it.span(), - Self::TSAsExpression(it) => it.span(), - Self::TSSatisfiesExpression(it) => it.span(), - Self::TSTypeAssertion(it) => it.span(), - Self::TSNonNullExpression(it) => it.span(), - Self::TSInstantiationExpression(it) => it.span(), - Self::ComputedMemberExpression(it) => it.span(), - Self::StaticMemberExpression(it) => it.span(), - Self::PrivateFieldExpression(it) => it.span(), + Self::SpreadElement(it) => GetSpan::span(it.as_ref()), + Self::BooleanLiteral(it) => GetSpan::span(it.as_ref()), + Self::NullLiteral(it) => GetSpan::span(it.as_ref()), + Self::NumericLiteral(it) => GetSpan::span(it.as_ref()), + Self::BigIntLiteral(it) => GetSpan::span(it.as_ref()), + Self::RegExpLiteral(it) => GetSpan::span(it.as_ref()), + Self::StringLiteral(it) => GetSpan::span(it.as_ref()), + Self::TemplateLiteral(it) => GetSpan::span(it.as_ref()), + Self::Identifier(it) => GetSpan::span(it.as_ref()), + Self::MetaProperty(it) => GetSpan::span(it.as_ref()), + Self::Super(it) => GetSpan::span(it.as_ref()), + Self::ArrayExpression(it) => GetSpan::span(it.as_ref()), + Self::ArrowFunctionExpression(it) => GetSpan::span(it.as_ref()), + Self::AssignmentExpression(it) => GetSpan::span(it.as_ref()), + Self::AwaitExpression(it) => GetSpan::span(it.as_ref()), + Self::BinaryExpression(it) => GetSpan::span(it.as_ref()), + Self::CallExpression(it) => GetSpan::span(it.as_ref()), + Self::ChainExpression(it) => GetSpan::span(it.as_ref()), + Self::ClassExpression(it) => GetSpan::span(it.as_ref()), + Self::ConditionalExpression(it) => GetSpan::span(it.as_ref()), + Self::FunctionExpression(it) => GetSpan::span(it.as_ref()), + Self::ImportExpression(it) => GetSpan::span(it.as_ref()), + Self::LogicalExpression(it) => GetSpan::span(it.as_ref()), + Self::NewExpression(it) => GetSpan::span(it.as_ref()), + Self::ObjectExpression(it) => GetSpan::span(it.as_ref()), + Self::ParenthesizedExpression(it) => GetSpan::span(it.as_ref()), + Self::SequenceExpression(it) => GetSpan::span(it.as_ref()), + Self::TaggedTemplateExpression(it) => GetSpan::span(it.as_ref()), + Self::ThisExpression(it) => GetSpan::span(it.as_ref()), + Self::UnaryExpression(it) => GetSpan::span(it.as_ref()), + Self::UpdateExpression(it) => GetSpan::span(it.as_ref()), + Self::YieldExpression(it) => GetSpan::span(it.as_ref()), + Self::PrivateInExpression(it) => GetSpan::span(it.as_ref()), + Self::JSXElement(it) => GetSpan::span(it.as_ref()), + Self::JSXFragment(it) => GetSpan::span(it.as_ref()), + Self::TSAsExpression(it) => GetSpan::span(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetSpan::span(it.as_ref()), + Self::TSTypeAssertion(it) => GetSpan::span(it.as_ref()), + Self::TSNonNullExpression(it) => GetSpan::span(it.as_ref()), + Self::TSInstantiationExpression(it) => GetSpan::span(it.as_ref()), + Self::ComputedMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::StaticMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::PrivateFieldExpression(it) => GetSpan::span(it.as_ref()), } } } @@ -471,17 +471,17 @@ impl<'a> GetSpan for AssignmentExpression<'a> { impl<'a> GetSpan for AssignmentTarget<'a> { fn span(&self) -> Span { match self { - Self::AssignmentTargetIdentifier(it) => it.span(), - Self::TSAsExpression(it) => it.span(), - Self::TSSatisfiesExpression(it) => it.span(), - Self::TSNonNullExpression(it) => it.span(), - Self::TSTypeAssertion(it) => it.span(), - Self::TSInstantiationExpression(it) => it.span(), - Self::ComputedMemberExpression(it) => it.span(), - Self::StaticMemberExpression(it) => it.span(), - Self::PrivateFieldExpression(it) => it.span(), - Self::ArrayAssignmentTarget(it) => it.span(), - Self::ObjectAssignmentTarget(it) => it.span(), + Self::AssignmentTargetIdentifier(it) => GetSpan::span(it.as_ref()), + Self::TSAsExpression(it) => GetSpan::span(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetSpan::span(it.as_ref()), + Self::TSNonNullExpression(it) => GetSpan::span(it.as_ref()), + Self::TSTypeAssertion(it) => GetSpan::span(it.as_ref()), + Self::TSInstantiationExpression(it) => GetSpan::span(it.as_ref()), + Self::ComputedMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::StaticMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::PrivateFieldExpression(it) => GetSpan::span(it.as_ref()), + Self::ArrayAssignmentTarget(it) => GetSpan::span(it.as_ref()), + Self::ObjectAssignmentTarget(it) => GetSpan::span(it.as_ref()), } } } @@ -489,15 +489,15 @@ impl<'a> GetSpan for AssignmentTarget<'a> { impl<'a> GetSpan for SimpleAssignmentTarget<'a> { fn span(&self) -> Span { match self { - Self::AssignmentTargetIdentifier(it) => it.span(), - Self::TSAsExpression(it) => it.span(), - Self::TSSatisfiesExpression(it) => it.span(), - Self::TSNonNullExpression(it) => it.span(), - Self::TSTypeAssertion(it) => it.span(), - Self::TSInstantiationExpression(it) => it.span(), - Self::ComputedMemberExpression(it) => it.span(), - Self::StaticMemberExpression(it) => it.span(), - Self::PrivateFieldExpression(it) => it.span(), + Self::AssignmentTargetIdentifier(it) => GetSpan::span(it.as_ref()), + Self::TSAsExpression(it) => GetSpan::span(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetSpan::span(it.as_ref()), + Self::TSNonNullExpression(it) => GetSpan::span(it.as_ref()), + Self::TSTypeAssertion(it) => GetSpan::span(it.as_ref()), + Self::TSInstantiationExpression(it) => GetSpan::span(it.as_ref()), + Self::ComputedMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::StaticMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::PrivateFieldExpression(it) => GetSpan::span(it.as_ref()), } } } @@ -505,8 +505,8 @@ impl<'a> GetSpan for SimpleAssignmentTarget<'a> { impl<'a> GetSpan for AssignmentTargetPattern<'a> { fn span(&self) -> Span { match self { - Self::ArrayAssignmentTarget(it) => it.span(), - Self::ObjectAssignmentTarget(it) => it.span(), + Self::ArrayAssignmentTarget(it) => GetSpan::span(it.as_ref()), + Self::ObjectAssignmentTarget(it) => GetSpan::span(it.as_ref()), } } } @@ -535,18 +535,18 @@ impl<'a> GetSpan for AssignmentTargetRest<'a> { impl<'a> GetSpan for AssignmentTargetMaybeDefault<'a> { fn span(&self) -> Span { match self { - Self::AssignmentTargetWithDefault(it) => it.span(), - Self::AssignmentTargetIdentifier(it) => it.span(), - Self::TSAsExpression(it) => it.span(), - Self::TSSatisfiesExpression(it) => it.span(), - Self::TSNonNullExpression(it) => it.span(), - Self::TSTypeAssertion(it) => it.span(), - Self::TSInstantiationExpression(it) => it.span(), - Self::ComputedMemberExpression(it) => it.span(), - Self::StaticMemberExpression(it) => it.span(), - Self::PrivateFieldExpression(it) => it.span(), - Self::ArrayAssignmentTarget(it) => it.span(), - Self::ObjectAssignmentTarget(it) => it.span(), + Self::AssignmentTargetWithDefault(it) => GetSpan::span(it.as_ref()), + Self::AssignmentTargetIdentifier(it) => GetSpan::span(it.as_ref()), + Self::TSAsExpression(it) => GetSpan::span(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetSpan::span(it.as_ref()), + Self::TSNonNullExpression(it) => GetSpan::span(it.as_ref()), + Self::TSTypeAssertion(it) => GetSpan::span(it.as_ref()), + Self::TSInstantiationExpression(it) => GetSpan::span(it.as_ref()), + Self::ComputedMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::StaticMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::PrivateFieldExpression(it) => GetSpan::span(it.as_ref()), + Self::ArrayAssignmentTarget(it) => GetSpan::span(it.as_ref()), + Self::ObjectAssignmentTarget(it) => GetSpan::span(it.as_ref()), } } } @@ -561,8 +561,8 @@ impl<'a> GetSpan for AssignmentTargetWithDefault<'a> { impl<'a> GetSpan for AssignmentTargetProperty<'a> { fn span(&self) -> Span { match self { - Self::AssignmentTargetPropertyIdentifier(it) => it.span(), - Self::AssignmentTargetPropertyProperty(it) => it.span(), + Self::AssignmentTargetPropertyIdentifier(it) => GetSpan::span(it.as_ref()), + Self::AssignmentTargetPropertyProperty(it) => GetSpan::span(it.as_ref()), } } } @@ -612,10 +612,10 @@ impl<'a> GetSpan for ChainExpression<'a> { impl<'a> GetSpan for ChainElement<'a> { fn span(&self) -> Span { match self { - Self::CallExpression(it) => it.span(), - Self::ComputedMemberExpression(it) => it.span(), - Self::StaticMemberExpression(it) => it.span(), - Self::PrivateFieldExpression(it) => it.span(), + Self::CallExpression(it) => GetSpan::span(it.as_ref()), + Self::ComputedMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::StaticMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::PrivateFieldExpression(it) => GetSpan::span(it.as_ref()), } } } @@ -630,38 +630,38 @@ impl<'a> GetSpan for ParenthesizedExpression<'a> { impl<'a> GetSpan for Statement<'a> { fn span(&self) -> Span { match self { - Self::BlockStatement(it) => it.span(), - Self::BreakStatement(it) => it.span(), - Self::ContinueStatement(it) => it.span(), - Self::DebuggerStatement(it) => it.span(), - Self::DoWhileStatement(it) => it.span(), - Self::EmptyStatement(it) => it.span(), - Self::ExpressionStatement(it) => it.span(), - Self::ForInStatement(it) => it.span(), - Self::ForOfStatement(it) => it.span(), - Self::ForStatement(it) => it.span(), - Self::IfStatement(it) => it.span(), - Self::LabeledStatement(it) => it.span(), - Self::ReturnStatement(it) => it.span(), - Self::SwitchStatement(it) => it.span(), - Self::ThrowStatement(it) => it.span(), - Self::TryStatement(it) => it.span(), - Self::WhileStatement(it) => it.span(), - Self::WithStatement(it) => it.span(), - Self::VariableDeclaration(it) => it.span(), - Self::FunctionDeclaration(it) => it.span(), - Self::ClassDeclaration(it) => it.span(), - Self::TSTypeAliasDeclaration(it) => it.span(), - Self::TSInterfaceDeclaration(it) => it.span(), - Self::TSEnumDeclaration(it) => it.span(), - Self::TSModuleDeclaration(it) => it.span(), - Self::TSImportEqualsDeclaration(it) => it.span(), - Self::ImportDeclaration(it) => it.span(), - Self::ExportAllDeclaration(it) => it.span(), - Self::ExportDefaultDeclaration(it) => it.span(), - Self::ExportNamedDeclaration(it) => it.span(), - Self::TSExportAssignment(it) => it.span(), - Self::TSNamespaceExportDeclaration(it) => it.span(), + Self::BlockStatement(it) => GetSpan::span(it.as_ref()), + Self::BreakStatement(it) => GetSpan::span(it.as_ref()), + Self::ContinueStatement(it) => GetSpan::span(it.as_ref()), + Self::DebuggerStatement(it) => GetSpan::span(it.as_ref()), + Self::DoWhileStatement(it) => GetSpan::span(it.as_ref()), + Self::EmptyStatement(it) => GetSpan::span(it.as_ref()), + Self::ExpressionStatement(it) => GetSpan::span(it.as_ref()), + Self::ForInStatement(it) => GetSpan::span(it.as_ref()), + Self::ForOfStatement(it) => GetSpan::span(it.as_ref()), + Self::ForStatement(it) => GetSpan::span(it.as_ref()), + Self::IfStatement(it) => GetSpan::span(it.as_ref()), + Self::LabeledStatement(it) => GetSpan::span(it.as_ref()), + Self::ReturnStatement(it) => GetSpan::span(it.as_ref()), + Self::SwitchStatement(it) => GetSpan::span(it.as_ref()), + Self::ThrowStatement(it) => GetSpan::span(it.as_ref()), + Self::TryStatement(it) => GetSpan::span(it.as_ref()), + Self::WhileStatement(it) => GetSpan::span(it.as_ref()), + Self::WithStatement(it) => GetSpan::span(it.as_ref()), + Self::VariableDeclaration(it) => GetSpan::span(it.as_ref()), + Self::FunctionDeclaration(it) => GetSpan::span(it.as_ref()), + Self::ClassDeclaration(it) => GetSpan::span(it.as_ref()), + Self::TSTypeAliasDeclaration(it) => GetSpan::span(it.as_ref()), + Self::TSInterfaceDeclaration(it) => GetSpan::span(it.as_ref()), + Self::TSEnumDeclaration(it) => GetSpan::span(it.as_ref()), + Self::TSModuleDeclaration(it) => GetSpan::span(it.as_ref()), + Self::TSImportEqualsDeclaration(it) => GetSpan::span(it.as_ref()), + Self::ImportDeclaration(it) => GetSpan::span(it.as_ref()), + Self::ExportAllDeclaration(it) => GetSpan::span(it.as_ref()), + Self::ExportDefaultDeclaration(it) => GetSpan::span(it.as_ref()), + Self::ExportNamedDeclaration(it) => GetSpan::span(it.as_ref()), + Self::TSExportAssignment(it) => GetSpan::span(it.as_ref()), + Self::TSNamespaceExportDeclaration(it) => GetSpan::span(it.as_ref()), } } } @@ -690,14 +690,14 @@ impl<'a> GetSpan for BlockStatement<'a> { impl<'a> GetSpan for Declaration<'a> { fn span(&self) -> Span { match self { - Self::VariableDeclaration(it) => it.span(), - Self::FunctionDeclaration(it) => it.span(), - Self::ClassDeclaration(it) => it.span(), - Self::TSTypeAliasDeclaration(it) => it.span(), - Self::TSInterfaceDeclaration(it) => it.span(), - Self::TSEnumDeclaration(it) => it.span(), - Self::TSModuleDeclaration(it) => it.span(), - Self::TSImportEqualsDeclaration(it) => it.span(), + Self::VariableDeclaration(it) => GetSpan::span(it.as_ref()), + Self::FunctionDeclaration(it) => GetSpan::span(it.as_ref()), + Self::ClassDeclaration(it) => GetSpan::span(it.as_ref()), + Self::TSTypeAliasDeclaration(it) => GetSpan::span(it.as_ref()), + Self::TSInterfaceDeclaration(it) => GetSpan::span(it.as_ref()), + Self::TSEnumDeclaration(it) => GetSpan::span(it.as_ref()), + Self::TSModuleDeclaration(it) => GetSpan::span(it.as_ref()), + Self::TSImportEqualsDeclaration(it) => GetSpan::span(it.as_ref()), } } } @@ -761,49 +761,49 @@ impl<'a> GetSpan for ForStatement<'a> { impl<'a> GetSpan for ForStatementInit<'a> { fn span(&self) -> Span { match self { - Self::VariableDeclaration(it) => it.span(), - Self::BooleanLiteral(it) => it.span(), - Self::NullLiteral(it) => it.span(), - Self::NumericLiteral(it) => it.span(), - Self::BigIntLiteral(it) => it.span(), - Self::RegExpLiteral(it) => it.span(), - Self::StringLiteral(it) => it.span(), - Self::TemplateLiteral(it) => it.span(), - Self::Identifier(it) => it.span(), - Self::MetaProperty(it) => it.span(), - Self::Super(it) => it.span(), - Self::ArrayExpression(it) => it.span(), - Self::ArrowFunctionExpression(it) => it.span(), - Self::AssignmentExpression(it) => it.span(), - Self::AwaitExpression(it) => it.span(), - Self::BinaryExpression(it) => it.span(), - Self::CallExpression(it) => it.span(), - Self::ChainExpression(it) => it.span(), - Self::ClassExpression(it) => it.span(), - Self::ConditionalExpression(it) => it.span(), - Self::FunctionExpression(it) => it.span(), - Self::ImportExpression(it) => it.span(), - Self::LogicalExpression(it) => it.span(), - Self::NewExpression(it) => it.span(), - Self::ObjectExpression(it) => it.span(), - Self::ParenthesizedExpression(it) => it.span(), - Self::SequenceExpression(it) => it.span(), - Self::TaggedTemplateExpression(it) => it.span(), - Self::ThisExpression(it) => it.span(), - Self::UnaryExpression(it) => it.span(), - Self::UpdateExpression(it) => it.span(), - Self::YieldExpression(it) => it.span(), - Self::PrivateInExpression(it) => it.span(), - Self::JSXElement(it) => it.span(), - Self::JSXFragment(it) => it.span(), - Self::TSAsExpression(it) => it.span(), - Self::TSSatisfiesExpression(it) => it.span(), - Self::TSTypeAssertion(it) => it.span(), - Self::TSNonNullExpression(it) => it.span(), - Self::TSInstantiationExpression(it) => it.span(), - Self::ComputedMemberExpression(it) => it.span(), - Self::StaticMemberExpression(it) => it.span(), - Self::PrivateFieldExpression(it) => it.span(), + Self::VariableDeclaration(it) => GetSpan::span(it.as_ref()), + Self::BooleanLiteral(it) => GetSpan::span(it.as_ref()), + Self::NullLiteral(it) => GetSpan::span(it.as_ref()), + Self::NumericLiteral(it) => GetSpan::span(it.as_ref()), + Self::BigIntLiteral(it) => GetSpan::span(it.as_ref()), + Self::RegExpLiteral(it) => GetSpan::span(it.as_ref()), + Self::StringLiteral(it) => GetSpan::span(it.as_ref()), + Self::TemplateLiteral(it) => GetSpan::span(it.as_ref()), + Self::Identifier(it) => GetSpan::span(it.as_ref()), + Self::MetaProperty(it) => GetSpan::span(it.as_ref()), + Self::Super(it) => GetSpan::span(it.as_ref()), + Self::ArrayExpression(it) => GetSpan::span(it.as_ref()), + Self::ArrowFunctionExpression(it) => GetSpan::span(it.as_ref()), + Self::AssignmentExpression(it) => GetSpan::span(it.as_ref()), + Self::AwaitExpression(it) => GetSpan::span(it.as_ref()), + Self::BinaryExpression(it) => GetSpan::span(it.as_ref()), + Self::CallExpression(it) => GetSpan::span(it.as_ref()), + Self::ChainExpression(it) => GetSpan::span(it.as_ref()), + Self::ClassExpression(it) => GetSpan::span(it.as_ref()), + Self::ConditionalExpression(it) => GetSpan::span(it.as_ref()), + Self::FunctionExpression(it) => GetSpan::span(it.as_ref()), + Self::ImportExpression(it) => GetSpan::span(it.as_ref()), + Self::LogicalExpression(it) => GetSpan::span(it.as_ref()), + Self::NewExpression(it) => GetSpan::span(it.as_ref()), + Self::ObjectExpression(it) => GetSpan::span(it.as_ref()), + Self::ParenthesizedExpression(it) => GetSpan::span(it.as_ref()), + Self::SequenceExpression(it) => GetSpan::span(it.as_ref()), + Self::TaggedTemplateExpression(it) => GetSpan::span(it.as_ref()), + Self::ThisExpression(it) => GetSpan::span(it.as_ref()), + Self::UnaryExpression(it) => GetSpan::span(it.as_ref()), + Self::UpdateExpression(it) => GetSpan::span(it.as_ref()), + Self::YieldExpression(it) => GetSpan::span(it.as_ref()), + Self::PrivateInExpression(it) => GetSpan::span(it.as_ref()), + Self::JSXElement(it) => GetSpan::span(it.as_ref()), + Self::JSXFragment(it) => GetSpan::span(it.as_ref()), + Self::TSAsExpression(it) => GetSpan::span(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetSpan::span(it.as_ref()), + Self::TSTypeAssertion(it) => GetSpan::span(it.as_ref()), + Self::TSNonNullExpression(it) => GetSpan::span(it.as_ref()), + Self::TSInstantiationExpression(it) => GetSpan::span(it.as_ref()), + Self::ComputedMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::StaticMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::PrivateFieldExpression(it) => GetSpan::span(it.as_ref()), } } } @@ -818,18 +818,18 @@ impl<'a> GetSpan for ForInStatement<'a> { impl<'a> GetSpan for ForStatementLeft<'a> { fn span(&self) -> Span { match self { - Self::VariableDeclaration(it) => it.span(), - Self::AssignmentTargetIdentifier(it) => it.span(), - Self::TSAsExpression(it) => it.span(), - Self::TSSatisfiesExpression(it) => it.span(), - Self::TSNonNullExpression(it) => it.span(), - Self::TSTypeAssertion(it) => it.span(), - Self::TSInstantiationExpression(it) => it.span(), - Self::ComputedMemberExpression(it) => it.span(), - Self::StaticMemberExpression(it) => it.span(), - Self::PrivateFieldExpression(it) => it.span(), - Self::ArrayAssignmentTarget(it) => it.span(), - Self::ObjectAssignmentTarget(it) => it.span(), + Self::VariableDeclaration(it) => GetSpan::span(it.as_ref()), + Self::AssignmentTargetIdentifier(it) => GetSpan::span(it.as_ref()), + Self::TSAsExpression(it) => GetSpan::span(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetSpan::span(it.as_ref()), + Self::TSNonNullExpression(it) => GetSpan::span(it.as_ref()), + Self::TSTypeAssertion(it) => GetSpan::span(it.as_ref()), + Self::TSInstantiationExpression(it) => GetSpan::span(it.as_ref()), + Self::ComputedMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::StaticMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::PrivateFieldExpression(it) => GetSpan::span(it.as_ref()), + Self::ArrayAssignmentTarget(it) => GetSpan::span(it.as_ref()), + Self::ObjectAssignmentTarget(it) => GetSpan::span(it.as_ref()), } } } @@ -928,17 +928,17 @@ impl GetSpan for DebuggerStatement { impl<'a> GetSpan for BindingPattern<'a> { #[inline] fn span(&self) -> Span { - self.kind.span() + GetSpan::span(&self.kind) } } impl<'a> GetSpan for BindingPatternKind<'a> { fn span(&self) -> Span { match self { - Self::BindingIdentifier(it) => it.span(), - Self::ObjectPattern(it) => it.span(), - Self::ArrayPattern(it) => it.span(), - Self::AssignmentPattern(it) => it.span(), + Self::BindingIdentifier(it) => GetSpan::span(it.as_ref()), + Self::ObjectPattern(it) => GetSpan::span(it.as_ref()), + Self::ArrayPattern(it) => GetSpan::span(it.as_ref()), + Self::AssignmentPattern(it) => GetSpan::span(it.as_ref()), } } } @@ -1037,11 +1037,11 @@ impl<'a> GetSpan for ClassBody<'a> { impl<'a> GetSpan for ClassElement<'a> { fn span(&self) -> Span { match self { - Self::StaticBlock(it) => it.span(), - Self::MethodDefinition(it) => it.span(), - Self::PropertyDefinition(it) => it.span(), - Self::AccessorProperty(it) => it.span(), - Self::TSIndexSignature(it) => it.span(), + Self::StaticBlock(it) => GetSpan::span(it.as_ref()), + Self::MethodDefinition(it) => GetSpan::span(it.as_ref()), + Self::PropertyDefinition(it) => GetSpan::span(it.as_ref()), + Self::AccessorProperty(it) => GetSpan::span(it.as_ref()), + Self::TSIndexSignature(it) => GetSpan::span(it.as_ref()), } } } @@ -1077,12 +1077,12 @@ impl<'a> GetSpan for StaticBlock<'a> { impl<'a> GetSpan for ModuleDeclaration<'a> { fn span(&self) -> Span { match self { - Self::ImportDeclaration(it) => it.span(), - Self::ExportAllDeclaration(it) => it.span(), - Self::ExportDefaultDeclaration(it) => it.span(), - Self::ExportNamedDeclaration(it) => it.span(), - Self::TSExportAssignment(it) => it.span(), - Self::TSNamespaceExportDeclaration(it) => it.span(), + Self::ImportDeclaration(it) => GetSpan::span(it.as_ref()), + Self::ExportAllDeclaration(it) => GetSpan::span(it.as_ref()), + Self::ExportDefaultDeclaration(it) => GetSpan::span(it.as_ref()), + Self::ExportNamedDeclaration(it) => GetSpan::span(it.as_ref()), + Self::TSExportAssignment(it) => GetSpan::span(it.as_ref()), + Self::TSNamespaceExportDeclaration(it) => GetSpan::span(it.as_ref()), } } } @@ -1111,9 +1111,9 @@ impl<'a> GetSpan for ImportDeclaration<'a> { impl<'a> GetSpan for ImportDeclarationSpecifier<'a> { fn span(&self) -> Span { match self { - Self::ImportSpecifier(it) => it.span(), - Self::ImportDefaultSpecifier(it) => it.span(), - Self::ImportNamespaceSpecifier(it) => it.span(), + Self::ImportSpecifier(it) => GetSpan::span(it.as_ref()), + Self::ImportDefaultSpecifier(it) => GetSpan::span(it.as_ref()), + Self::ImportNamespaceSpecifier(it) => GetSpan::span(it.as_ref()), } } } @@ -1156,8 +1156,8 @@ impl<'a> GetSpan for ImportAttribute<'a> { impl<'a> GetSpan for ImportAttributeKey<'a> { fn span(&self) -> Span { match self { - Self::Identifier(it) => it.span(), - Self::StringLiteral(it) => it.span(), + Self::Identifier(it) => GetSpan::span(it), + Self::StringLiteral(it) => GetSpan::span(it), } } } @@ -1193,51 +1193,51 @@ impl<'a> GetSpan for ExportSpecifier<'a> { impl<'a> GetSpan for ExportDefaultDeclarationKind<'a> { fn span(&self) -> Span { match self { - Self::FunctionDeclaration(it) => it.span(), - Self::ClassDeclaration(it) => it.span(), - Self::TSInterfaceDeclaration(it) => it.span(), - Self::BooleanLiteral(it) => it.span(), - Self::NullLiteral(it) => it.span(), - Self::NumericLiteral(it) => it.span(), - Self::BigIntLiteral(it) => it.span(), - Self::RegExpLiteral(it) => it.span(), - Self::StringLiteral(it) => it.span(), - Self::TemplateLiteral(it) => it.span(), - Self::Identifier(it) => it.span(), - Self::MetaProperty(it) => it.span(), - Self::Super(it) => it.span(), - Self::ArrayExpression(it) => it.span(), - Self::ArrowFunctionExpression(it) => it.span(), - Self::AssignmentExpression(it) => it.span(), - Self::AwaitExpression(it) => it.span(), - Self::BinaryExpression(it) => it.span(), - Self::CallExpression(it) => it.span(), - Self::ChainExpression(it) => it.span(), - Self::ClassExpression(it) => it.span(), - Self::ConditionalExpression(it) => it.span(), - Self::FunctionExpression(it) => it.span(), - Self::ImportExpression(it) => it.span(), - Self::LogicalExpression(it) => it.span(), - Self::NewExpression(it) => it.span(), - Self::ObjectExpression(it) => it.span(), - Self::ParenthesizedExpression(it) => it.span(), - Self::SequenceExpression(it) => it.span(), - Self::TaggedTemplateExpression(it) => it.span(), - Self::ThisExpression(it) => it.span(), - Self::UnaryExpression(it) => it.span(), - Self::UpdateExpression(it) => it.span(), - Self::YieldExpression(it) => it.span(), - Self::PrivateInExpression(it) => it.span(), - Self::JSXElement(it) => it.span(), - Self::JSXFragment(it) => it.span(), - Self::TSAsExpression(it) => it.span(), - Self::TSSatisfiesExpression(it) => it.span(), - Self::TSTypeAssertion(it) => it.span(), - Self::TSNonNullExpression(it) => it.span(), - Self::TSInstantiationExpression(it) => it.span(), - Self::ComputedMemberExpression(it) => it.span(), - Self::StaticMemberExpression(it) => it.span(), - Self::PrivateFieldExpression(it) => it.span(), + Self::FunctionDeclaration(it) => GetSpan::span(it.as_ref()), + Self::ClassDeclaration(it) => GetSpan::span(it.as_ref()), + Self::TSInterfaceDeclaration(it) => GetSpan::span(it.as_ref()), + Self::BooleanLiteral(it) => GetSpan::span(it.as_ref()), + Self::NullLiteral(it) => GetSpan::span(it.as_ref()), + Self::NumericLiteral(it) => GetSpan::span(it.as_ref()), + Self::BigIntLiteral(it) => GetSpan::span(it.as_ref()), + Self::RegExpLiteral(it) => GetSpan::span(it.as_ref()), + Self::StringLiteral(it) => GetSpan::span(it.as_ref()), + Self::TemplateLiteral(it) => GetSpan::span(it.as_ref()), + Self::Identifier(it) => GetSpan::span(it.as_ref()), + Self::MetaProperty(it) => GetSpan::span(it.as_ref()), + Self::Super(it) => GetSpan::span(it.as_ref()), + Self::ArrayExpression(it) => GetSpan::span(it.as_ref()), + Self::ArrowFunctionExpression(it) => GetSpan::span(it.as_ref()), + Self::AssignmentExpression(it) => GetSpan::span(it.as_ref()), + Self::AwaitExpression(it) => GetSpan::span(it.as_ref()), + Self::BinaryExpression(it) => GetSpan::span(it.as_ref()), + Self::CallExpression(it) => GetSpan::span(it.as_ref()), + Self::ChainExpression(it) => GetSpan::span(it.as_ref()), + Self::ClassExpression(it) => GetSpan::span(it.as_ref()), + Self::ConditionalExpression(it) => GetSpan::span(it.as_ref()), + Self::FunctionExpression(it) => GetSpan::span(it.as_ref()), + Self::ImportExpression(it) => GetSpan::span(it.as_ref()), + Self::LogicalExpression(it) => GetSpan::span(it.as_ref()), + Self::NewExpression(it) => GetSpan::span(it.as_ref()), + Self::ObjectExpression(it) => GetSpan::span(it.as_ref()), + Self::ParenthesizedExpression(it) => GetSpan::span(it.as_ref()), + Self::SequenceExpression(it) => GetSpan::span(it.as_ref()), + Self::TaggedTemplateExpression(it) => GetSpan::span(it.as_ref()), + Self::ThisExpression(it) => GetSpan::span(it.as_ref()), + Self::UnaryExpression(it) => GetSpan::span(it.as_ref()), + Self::UpdateExpression(it) => GetSpan::span(it.as_ref()), + Self::YieldExpression(it) => GetSpan::span(it.as_ref()), + Self::PrivateInExpression(it) => GetSpan::span(it.as_ref()), + Self::JSXElement(it) => GetSpan::span(it.as_ref()), + Self::JSXFragment(it) => GetSpan::span(it.as_ref()), + Self::TSAsExpression(it) => GetSpan::span(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetSpan::span(it.as_ref()), + Self::TSTypeAssertion(it) => GetSpan::span(it.as_ref()), + Self::TSNonNullExpression(it) => GetSpan::span(it.as_ref()), + Self::TSInstantiationExpression(it) => GetSpan::span(it.as_ref()), + Self::ComputedMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::StaticMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::PrivateFieldExpression(it) => GetSpan::span(it.as_ref()), } } } @@ -1245,9 +1245,9 @@ impl<'a> GetSpan for ExportDefaultDeclarationKind<'a> { impl<'a> GetSpan for ModuleExportName<'a> { fn span(&self) -> Span { match self { - Self::IdentifierName(it) => it.span(), - Self::IdentifierReference(it) => it.span(), - Self::StringLiteral(it) => it.span(), + Self::IdentifierName(it) => GetSpan::span(it), + Self::IdentifierReference(it) => GetSpan::span(it), + Self::StringLiteral(it) => GetSpan::span(it), } } } @@ -1276,52 +1276,52 @@ impl<'a> GetSpan for TSEnumMember<'a> { impl<'a> GetSpan for TSEnumMemberName<'a> { fn span(&self) -> Span { match self { - Self::StaticIdentifier(it) => it.span(), - Self::StaticStringLiteral(it) => it.span(), - Self::StaticTemplateLiteral(it) => it.span(), - Self::StaticNumericLiteral(it) => it.span(), - Self::BooleanLiteral(it) => it.span(), - Self::NullLiteral(it) => it.span(), - Self::NumericLiteral(it) => it.span(), - Self::BigIntLiteral(it) => it.span(), - Self::RegExpLiteral(it) => it.span(), - Self::StringLiteral(it) => it.span(), - Self::TemplateLiteral(it) => it.span(), - Self::Identifier(it) => it.span(), - Self::MetaProperty(it) => it.span(), - Self::Super(it) => it.span(), - Self::ArrayExpression(it) => it.span(), - Self::ArrowFunctionExpression(it) => it.span(), - Self::AssignmentExpression(it) => it.span(), - Self::AwaitExpression(it) => it.span(), - Self::BinaryExpression(it) => it.span(), - Self::CallExpression(it) => it.span(), - Self::ChainExpression(it) => it.span(), - Self::ClassExpression(it) => it.span(), - Self::ConditionalExpression(it) => it.span(), - Self::FunctionExpression(it) => it.span(), - Self::ImportExpression(it) => it.span(), - Self::LogicalExpression(it) => it.span(), - Self::NewExpression(it) => it.span(), - Self::ObjectExpression(it) => it.span(), - Self::ParenthesizedExpression(it) => it.span(), - Self::SequenceExpression(it) => it.span(), - Self::TaggedTemplateExpression(it) => it.span(), - Self::ThisExpression(it) => it.span(), - Self::UnaryExpression(it) => it.span(), - Self::UpdateExpression(it) => it.span(), - Self::YieldExpression(it) => it.span(), - Self::PrivateInExpression(it) => it.span(), - Self::JSXElement(it) => it.span(), - Self::JSXFragment(it) => it.span(), - Self::TSAsExpression(it) => it.span(), - Self::TSSatisfiesExpression(it) => it.span(), - Self::TSTypeAssertion(it) => it.span(), - Self::TSNonNullExpression(it) => it.span(), - Self::TSInstantiationExpression(it) => it.span(), - Self::ComputedMemberExpression(it) => it.span(), - Self::StaticMemberExpression(it) => it.span(), - Self::PrivateFieldExpression(it) => it.span(), + Self::StaticIdentifier(it) => GetSpan::span(it.as_ref()), + Self::StaticStringLiteral(it) => GetSpan::span(it.as_ref()), + Self::StaticTemplateLiteral(it) => GetSpan::span(it.as_ref()), + Self::StaticNumericLiteral(it) => GetSpan::span(it.as_ref()), + Self::BooleanLiteral(it) => GetSpan::span(it.as_ref()), + Self::NullLiteral(it) => GetSpan::span(it.as_ref()), + Self::NumericLiteral(it) => GetSpan::span(it.as_ref()), + Self::BigIntLiteral(it) => GetSpan::span(it.as_ref()), + Self::RegExpLiteral(it) => GetSpan::span(it.as_ref()), + Self::StringLiteral(it) => GetSpan::span(it.as_ref()), + Self::TemplateLiteral(it) => GetSpan::span(it.as_ref()), + Self::Identifier(it) => GetSpan::span(it.as_ref()), + Self::MetaProperty(it) => GetSpan::span(it.as_ref()), + Self::Super(it) => GetSpan::span(it.as_ref()), + Self::ArrayExpression(it) => GetSpan::span(it.as_ref()), + Self::ArrowFunctionExpression(it) => GetSpan::span(it.as_ref()), + Self::AssignmentExpression(it) => GetSpan::span(it.as_ref()), + Self::AwaitExpression(it) => GetSpan::span(it.as_ref()), + Self::BinaryExpression(it) => GetSpan::span(it.as_ref()), + Self::CallExpression(it) => GetSpan::span(it.as_ref()), + Self::ChainExpression(it) => GetSpan::span(it.as_ref()), + Self::ClassExpression(it) => GetSpan::span(it.as_ref()), + Self::ConditionalExpression(it) => GetSpan::span(it.as_ref()), + Self::FunctionExpression(it) => GetSpan::span(it.as_ref()), + Self::ImportExpression(it) => GetSpan::span(it.as_ref()), + Self::LogicalExpression(it) => GetSpan::span(it.as_ref()), + Self::NewExpression(it) => GetSpan::span(it.as_ref()), + Self::ObjectExpression(it) => GetSpan::span(it.as_ref()), + Self::ParenthesizedExpression(it) => GetSpan::span(it.as_ref()), + Self::SequenceExpression(it) => GetSpan::span(it.as_ref()), + Self::TaggedTemplateExpression(it) => GetSpan::span(it.as_ref()), + Self::ThisExpression(it) => GetSpan::span(it.as_ref()), + Self::UnaryExpression(it) => GetSpan::span(it.as_ref()), + Self::UpdateExpression(it) => GetSpan::span(it.as_ref()), + Self::YieldExpression(it) => GetSpan::span(it.as_ref()), + Self::PrivateInExpression(it) => GetSpan::span(it.as_ref()), + Self::JSXElement(it) => GetSpan::span(it.as_ref()), + Self::JSXFragment(it) => GetSpan::span(it.as_ref()), + Self::TSAsExpression(it) => GetSpan::span(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetSpan::span(it.as_ref()), + Self::TSTypeAssertion(it) => GetSpan::span(it.as_ref()), + Self::TSNonNullExpression(it) => GetSpan::span(it.as_ref()), + Self::TSInstantiationExpression(it) => GetSpan::span(it.as_ref()), + Self::ComputedMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::StaticMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::PrivateFieldExpression(it) => GetSpan::span(it.as_ref()), } } } @@ -1343,14 +1343,14 @@ impl<'a> GetSpan for TSLiteralType<'a> { impl<'a> GetSpan for TSLiteral<'a> { fn span(&self) -> Span { match self { - Self::BooleanLiteral(it) => it.span(), - Self::NullLiteral(it) => it.span(), - Self::NumericLiteral(it) => it.span(), - Self::BigIntLiteral(it) => it.span(), - Self::RegExpLiteral(it) => it.span(), - Self::StringLiteral(it) => it.span(), - Self::TemplateLiteral(it) => it.span(), - Self::UnaryExpression(it) => it.span(), + Self::BooleanLiteral(it) => GetSpan::span(it.as_ref()), + Self::NullLiteral(it) => GetSpan::span(it.as_ref()), + Self::NumericLiteral(it) => GetSpan::span(it.as_ref()), + Self::BigIntLiteral(it) => GetSpan::span(it.as_ref()), + Self::RegExpLiteral(it) => GetSpan::span(it.as_ref()), + Self::StringLiteral(it) => GetSpan::span(it.as_ref()), + Self::TemplateLiteral(it) => GetSpan::span(it.as_ref()), + Self::UnaryExpression(it) => GetSpan::span(it.as_ref()), } } } @@ -1358,44 +1358,44 @@ impl<'a> GetSpan for TSLiteral<'a> { impl<'a> GetSpan for TSType<'a> { fn span(&self) -> Span { match self { - Self::TSAnyKeyword(it) => it.span(), - Self::TSBigIntKeyword(it) => it.span(), - Self::TSBooleanKeyword(it) => it.span(), - Self::TSIntrinsicKeyword(it) => it.span(), - Self::TSNeverKeyword(it) => it.span(), - Self::TSNullKeyword(it) => it.span(), - Self::TSNumberKeyword(it) => it.span(), - Self::TSObjectKeyword(it) => it.span(), - Self::TSStringKeyword(it) => it.span(), - Self::TSSymbolKeyword(it) => it.span(), - Self::TSUndefinedKeyword(it) => it.span(), - Self::TSUnknownKeyword(it) => it.span(), - Self::TSVoidKeyword(it) => it.span(), - Self::TSArrayType(it) => it.span(), - Self::TSConditionalType(it) => it.span(), - Self::TSConstructorType(it) => it.span(), - Self::TSFunctionType(it) => it.span(), - Self::TSImportType(it) => it.span(), - Self::TSIndexedAccessType(it) => it.span(), - Self::TSInferType(it) => it.span(), - Self::TSIntersectionType(it) => it.span(), - Self::TSLiteralType(it) => it.span(), - Self::TSMappedType(it) => it.span(), - Self::TSNamedTupleMember(it) => it.span(), - Self::TSQualifiedName(it) => it.span(), - Self::TSTemplateLiteralType(it) => it.span(), - Self::TSThisType(it) => it.span(), - Self::TSTupleType(it) => it.span(), - Self::TSTypeLiteral(it) => it.span(), - Self::TSTypeOperatorType(it) => it.span(), - Self::TSTypePredicate(it) => it.span(), - Self::TSTypeQuery(it) => it.span(), - Self::TSTypeReference(it) => it.span(), - Self::TSUnionType(it) => it.span(), - Self::TSParenthesizedType(it) => it.span(), - Self::JSDocNullableType(it) => it.span(), - Self::JSDocNonNullableType(it) => it.span(), - Self::JSDocUnknownType(it) => it.span(), + Self::TSAnyKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSBigIntKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSBooleanKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSIntrinsicKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSNeverKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSNullKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSNumberKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSObjectKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSStringKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSSymbolKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSUndefinedKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSUnknownKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSVoidKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSArrayType(it) => GetSpan::span(it.as_ref()), + Self::TSConditionalType(it) => GetSpan::span(it.as_ref()), + Self::TSConstructorType(it) => GetSpan::span(it.as_ref()), + Self::TSFunctionType(it) => GetSpan::span(it.as_ref()), + Self::TSImportType(it) => GetSpan::span(it.as_ref()), + Self::TSIndexedAccessType(it) => GetSpan::span(it.as_ref()), + Self::TSInferType(it) => GetSpan::span(it.as_ref()), + Self::TSIntersectionType(it) => GetSpan::span(it.as_ref()), + Self::TSLiteralType(it) => GetSpan::span(it.as_ref()), + Self::TSMappedType(it) => GetSpan::span(it.as_ref()), + Self::TSNamedTupleMember(it) => GetSpan::span(it.as_ref()), + Self::TSQualifiedName(it) => GetSpan::span(it.as_ref()), + Self::TSTemplateLiteralType(it) => GetSpan::span(it.as_ref()), + Self::TSThisType(it) => GetSpan::span(it.as_ref()), + Self::TSTupleType(it) => GetSpan::span(it.as_ref()), + Self::TSTypeLiteral(it) => GetSpan::span(it.as_ref()), + Self::TSTypeOperatorType(it) => GetSpan::span(it.as_ref()), + Self::TSTypePredicate(it) => GetSpan::span(it.as_ref()), + Self::TSTypeQuery(it) => GetSpan::span(it.as_ref()), + Self::TSTypeReference(it) => GetSpan::span(it.as_ref()), + Self::TSUnionType(it) => GetSpan::span(it.as_ref()), + Self::TSParenthesizedType(it) => GetSpan::span(it.as_ref()), + Self::JSDocNullableType(it) => GetSpan::span(it.as_ref()), + Self::JSDocNonNullableType(it) => GetSpan::span(it.as_ref()), + Self::JSDocUnknownType(it) => GetSpan::span(it.as_ref()), } } } @@ -1480,46 +1480,46 @@ impl<'a> GetSpan for TSRestType<'a> { impl<'a> GetSpan for TSTupleElement<'a> { fn span(&self) -> Span { match self { - Self::TSOptionalType(it) => it.span(), - Self::TSRestType(it) => it.span(), - Self::TSAnyKeyword(it) => it.span(), - Self::TSBigIntKeyword(it) => it.span(), - Self::TSBooleanKeyword(it) => it.span(), - Self::TSIntrinsicKeyword(it) => it.span(), - Self::TSNeverKeyword(it) => it.span(), - Self::TSNullKeyword(it) => it.span(), - Self::TSNumberKeyword(it) => it.span(), - Self::TSObjectKeyword(it) => it.span(), - Self::TSStringKeyword(it) => it.span(), - Self::TSSymbolKeyword(it) => it.span(), - Self::TSUndefinedKeyword(it) => it.span(), - Self::TSUnknownKeyword(it) => it.span(), - Self::TSVoidKeyword(it) => it.span(), - Self::TSArrayType(it) => it.span(), - Self::TSConditionalType(it) => it.span(), - Self::TSConstructorType(it) => it.span(), - Self::TSFunctionType(it) => it.span(), - Self::TSImportType(it) => it.span(), - Self::TSIndexedAccessType(it) => it.span(), - Self::TSInferType(it) => it.span(), - Self::TSIntersectionType(it) => it.span(), - Self::TSLiteralType(it) => it.span(), - Self::TSMappedType(it) => it.span(), - Self::TSNamedTupleMember(it) => it.span(), - Self::TSQualifiedName(it) => it.span(), - Self::TSTemplateLiteralType(it) => it.span(), - Self::TSThisType(it) => it.span(), - Self::TSTupleType(it) => it.span(), - Self::TSTypeLiteral(it) => it.span(), - Self::TSTypeOperatorType(it) => it.span(), - Self::TSTypePredicate(it) => it.span(), - Self::TSTypeQuery(it) => it.span(), - Self::TSTypeReference(it) => it.span(), - Self::TSUnionType(it) => it.span(), - Self::TSParenthesizedType(it) => it.span(), - Self::JSDocNullableType(it) => it.span(), - Self::JSDocNonNullableType(it) => it.span(), - Self::JSDocUnknownType(it) => it.span(), + Self::TSOptionalType(it) => GetSpan::span(it.as_ref()), + Self::TSRestType(it) => GetSpan::span(it.as_ref()), + Self::TSAnyKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSBigIntKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSBooleanKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSIntrinsicKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSNeverKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSNullKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSNumberKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSObjectKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSStringKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSSymbolKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSUndefinedKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSUnknownKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSVoidKeyword(it) => GetSpan::span(it.as_ref()), + Self::TSArrayType(it) => GetSpan::span(it.as_ref()), + Self::TSConditionalType(it) => GetSpan::span(it.as_ref()), + Self::TSConstructorType(it) => GetSpan::span(it.as_ref()), + Self::TSFunctionType(it) => GetSpan::span(it.as_ref()), + Self::TSImportType(it) => GetSpan::span(it.as_ref()), + Self::TSIndexedAccessType(it) => GetSpan::span(it.as_ref()), + Self::TSInferType(it) => GetSpan::span(it.as_ref()), + Self::TSIntersectionType(it) => GetSpan::span(it.as_ref()), + Self::TSLiteralType(it) => GetSpan::span(it.as_ref()), + Self::TSMappedType(it) => GetSpan::span(it.as_ref()), + Self::TSNamedTupleMember(it) => GetSpan::span(it.as_ref()), + Self::TSQualifiedName(it) => GetSpan::span(it.as_ref()), + Self::TSTemplateLiteralType(it) => GetSpan::span(it.as_ref()), + Self::TSThisType(it) => GetSpan::span(it.as_ref()), + Self::TSTupleType(it) => GetSpan::span(it.as_ref()), + Self::TSTypeLiteral(it) => GetSpan::span(it.as_ref()), + Self::TSTypeOperatorType(it) => GetSpan::span(it.as_ref()), + Self::TSTypePredicate(it) => GetSpan::span(it.as_ref()), + Self::TSTypeQuery(it) => GetSpan::span(it.as_ref()), + Self::TSTypeReference(it) => GetSpan::span(it.as_ref()), + Self::TSUnionType(it) => GetSpan::span(it.as_ref()), + Self::TSParenthesizedType(it) => GetSpan::span(it.as_ref()), + Self::JSDocNullableType(it) => GetSpan::span(it.as_ref()), + Self::JSDocNonNullableType(it) => GetSpan::span(it.as_ref()), + Self::JSDocUnknownType(it) => GetSpan::span(it.as_ref()), } } } @@ -1632,8 +1632,8 @@ impl<'a> GetSpan for TSTypeReference<'a> { impl<'a> GetSpan for TSTypeName<'a> { fn span(&self) -> Span { match self { - Self::IdentifierReference(it) => it.span(), - Self::QualifiedName(it) => it.span(), + Self::IdentifierReference(it) => GetSpan::span(it.as_ref()), + Self::QualifiedName(it) => GetSpan::span(it.as_ref()), } } } @@ -1704,11 +1704,11 @@ impl<'a> GetSpan for TSPropertySignature<'a> { impl<'a> GetSpan for TSSignature<'a> { fn span(&self) -> Span { match self { - Self::TSIndexSignature(it) => it.span(), - Self::TSPropertySignature(it) => it.span(), - Self::TSCallSignatureDeclaration(it) => it.span(), - Self::TSConstructSignatureDeclaration(it) => it.span(), - Self::TSMethodSignature(it) => it.span(), + Self::TSIndexSignature(it) => GetSpan::span(it.as_ref()), + Self::TSPropertySignature(it) => GetSpan::span(it.as_ref()), + Self::TSCallSignatureDeclaration(it) => GetSpan::span(it.as_ref()), + Self::TSConstructSignatureDeclaration(it) => GetSpan::span(it.as_ref()), + Self::TSMethodSignature(it) => GetSpan::span(it.as_ref()), } } } @@ -1765,8 +1765,8 @@ impl<'a> GetSpan for TSTypePredicate<'a> { impl<'a> GetSpan for TSTypePredicateName<'a> { fn span(&self) -> Span { match self { - Self::Identifier(it) => it.span(), - Self::This(it) => it.span(), + Self::Identifier(it) => GetSpan::span(it.as_ref()), + Self::This(it) => GetSpan::span(it), } } } @@ -1781,8 +1781,8 @@ impl<'a> GetSpan for TSModuleDeclaration<'a> { impl<'a> GetSpan for TSModuleDeclarationName<'a> { fn span(&self) -> Span { match self { - Self::Identifier(it) => it.span(), - Self::StringLiteral(it) => it.span(), + Self::Identifier(it) => GetSpan::span(it), + Self::StringLiteral(it) => GetSpan::span(it), } } } @@ -1790,8 +1790,8 @@ impl<'a> GetSpan for TSModuleDeclarationName<'a> { impl<'a> GetSpan for TSModuleDeclarationBody<'a> { fn span(&self) -> Span { match self { - Self::TSModuleDeclaration(it) => it.span(), - Self::TSModuleBlock(it) => it.span(), + Self::TSModuleDeclaration(it) => GetSpan::span(it.as_ref()), + Self::TSModuleBlock(it) => GetSpan::span(it.as_ref()), } } } @@ -1827,9 +1827,9 @@ impl<'a> GetSpan for TSTypeQuery<'a> { impl<'a> GetSpan for TSTypeQueryExprName<'a> { fn span(&self) -> Span { match self { - Self::TSImportType(it) => it.span(), - Self::IdentifierReference(it) => it.span(), - Self::QualifiedName(it) => it.span(), + Self::TSImportType(it) => GetSpan::span(it.as_ref()), + Self::IdentifierReference(it) => GetSpan::span(it.as_ref()), + Self::QualifiedName(it) => GetSpan::span(it.as_ref()), } } } @@ -1858,8 +1858,8 @@ impl<'a> GetSpan for TSImportAttribute<'a> { impl<'a> GetSpan for TSImportAttributeName<'a> { fn span(&self) -> Span { match self { - Self::Identifier(it) => it.span(), - Self::StringLiteral(it) => it.span(), + Self::Identifier(it) => GetSpan::span(it), + Self::StringLiteral(it) => GetSpan::span(it), } } } @@ -1923,9 +1923,9 @@ impl<'a> GetSpan for TSImportEqualsDeclaration<'a> { impl<'a> GetSpan for TSModuleReference<'a> { fn span(&self) -> Span { match self { - Self::ExternalModuleReference(it) => it.span(), - Self::IdentifierReference(it) => it.span(), - Self::QualifiedName(it) => it.span(), + Self::ExternalModuleReference(it) => GetSpan::span(it.as_ref()), + Self::IdentifierReference(it) => GetSpan::span(it.as_ref()), + Self::QualifiedName(it) => GetSpan::span(it.as_ref()), } } } @@ -2038,10 +2038,10 @@ impl GetSpan for JSXClosingFragment { impl<'a> GetSpan for JSXElementName<'a> { fn span(&self) -> Span { match self { - Self::Identifier(it) => it.span(), - Self::IdentifierReference(it) => it.span(), - Self::NamespacedName(it) => it.span(), - Self::MemberExpression(it) => it.span(), + Self::Identifier(it) => GetSpan::span(it.as_ref()), + Self::IdentifierReference(it) => GetSpan::span(it.as_ref()), + Self::NamespacedName(it) => GetSpan::span(it.as_ref()), + Self::MemberExpression(it) => GetSpan::span(it.as_ref()), } } } @@ -2063,8 +2063,8 @@ impl<'a> GetSpan for JSXMemberExpression<'a> { impl<'a> GetSpan for JSXMemberExpressionObject<'a> { fn span(&self) -> Span { match self { - Self::IdentifierReference(it) => it.span(), - Self::MemberExpression(it) => it.span(), + Self::IdentifierReference(it) => GetSpan::span(it.as_ref()), + Self::MemberExpression(it) => GetSpan::span(it.as_ref()), } } } @@ -2079,49 +2079,49 @@ impl<'a> GetSpan for JSXExpressionContainer<'a> { impl<'a> GetSpan for JSXExpression<'a> { fn span(&self) -> Span { match self { - Self::EmptyExpression(it) => it.span(), - Self::BooleanLiteral(it) => it.span(), - Self::NullLiteral(it) => it.span(), - Self::NumericLiteral(it) => it.span(), - Self::BigIntLiteral(it) => it.span(), - Self::RegExpLiteral(it) => it.span(), - Self::StringLiteral(it) => it.span(), - Self::TemplateLiteral(it) => it.span(), - Self::Identifier(it) => it.span(), - Self::MetaProperty(it) => it.span(), - Self::Super(it) => it.span(), - Self::ArrayExpression(it) => it.span(), - Self::ArrowFunctionExpression(it) => it.span(), - Self::AssignmentExpression(it) => it.span(), - Self::AwaitExpression(it) => it.span(), - Self::BinaryExpression(it) => it.span(), - Self::CallExpression(it) => it.span(), - Self::ChainExpression(it) => it.span(), - Self::ClassExpression(it) => it.span(), - Self::ConditionalExpression(it) => it.span(), - Self::FunctionExpression(it) => it.span(), - Self::ImportExpression(it) => it.span(), - Self::LogicalExpression(it) => it.span(), - Self::NewExpression(it) => it.span(), - Self::ObjectExpression(it) => it.span(), - Self::ParenthesizedExpression(it) => it.span(), - Self::SequenceExpression(it) => it.span(), - Self::TaggedTemplateExpression(it) => it.span(), - Self::ThisExpression(it) => it.span(), - Self::UnaryExpression(it) => it.span(), - Self::UpdateExpression(it) => it.span(), - Self::YieldExpression(it) => it.span(), - Self::PrivateInExpression(it) => it.span(), - Self::JSXElement(it) => it.span(), - Self::JSXFragment(it) => it.span(), - Self::TSAsExpression(it) => it.span(), - Self::TSSatisfiesExpression(it) => it.span(), - Self::TSTypeAssertion(it) => it.span(), - Self::TSNonNullExpression(it) => it.span(), - Self::TSInstantiationExpression(it) => it.span(), - Self::ComputedMemberExpression(it) => it.span(), - Self::StaticMemberExpression(it) => it.span(), - Self::PrivateFieldExpression(it) => it.span(), + Self::EmptyExpression(it) => GetSpan::span(it), + Self::BooleanLiteral(it) => GetSpan::span(it.as_ref()), + Self::NullLiteral(it) => GetSpan::span(it.as_ref()), + Self::NumericLiteral(it) => GetSpan::span(it.as_ref()), + Self::BigIntLiteral(it) => GetSpan::span(it.as_ref()), + Self::RegExpLiteral(it) => GetSpan::span(it.as_ref()), + Self::StringLiteral(it) => GetSpan::span(it.as_ref()), + Self::TemplateLiteral(it) => GetSpan::span(it.as_ref()), + Self::Identifier(it) => GetSpan::span(it.as_ref()), + Self::MetaProperty(it) => GetSpan::span(it.as_ref()), + Self::Super(it) => GetSpan::span(it.as_ref()), + Self::ArrayExpression(it) => GetSpan::span(it.as_ref()), + Self::ArrowFunctionExpression(it) => GetSpan::span(it.as_ref()), + Self::AssignmentExpression(it) => GetSpan::span(it.as_ref()), + Self::AwaitExpression(it) => GetSpan::span(it.as_ref()), + Self::BinaryExpression(it) => GetSpan::span(it.as_ref()), + Self::CallExpression(it) => GetSpan::span(it.as_ref()), + Self::ChainExpression(it) => GetSpan::span(it.as_ref()), + Self::ClassExpression(it) => GetSpan::span(it.as_ref()), + Self::ConditionalExpression(it) => GetSpan::span(it.as_ref()), + Self::FunctionExpression(it) => GetSpan::span(it.as_ref()), + Self::ImportExpression(it) => GetSpan::span(it.as_ref()), + Self::LogicalExpression(it) => GetSpan::span(it.as_ref()), + Self::NewExpression(it) => GetSpan::span(it.as_ref()), + Self::ObjectExpression(it) => GetSpan::span(it.as_ref()), + Self::ParenthesizedExpression(it) => GetSpan::span(it.as_ref()), + Self::SequenceExpression(it) => GetSpan::span(it.as_ref()), + Self::TaggedTemplateExpression(it) => GetSpan::span(it.as_ref()), + Self::ThisExpression(it) => GetSpan::span(it.as_ref()), + Self::UnaryExpression(it) => GetSpan::span(it.as_ref()), + Self::UpdateExpression(it) => GetSpan::span(it.as_ref()), + Self::YieldExpression(it) => GetSpan::span(it.as_ref()), + Self::PrivateInExpression(it) => GetSpan::span(it.as_ref()), + Self::JSXElement(it) => GetSpan::span(it.as_ref()), + Self::JSXFragment(it) => GetSpan::span(it.as_ref()), + Self::TSAsExpression(it) => GetSpan::span(it.as_ref()), + Self::TSSatisfiesExpression(it) => GetSpan::span(it.as_ref()), + Self::TSTypeAssertion(it) => GetSpan::span(it.as_ref()), + Self::TSNonNullExpression(it) => GetSpan::span(it.as_ref()), + Self::TSInstantiationExpression(it) => GetSpan::span(it.as_ref()), + Self::ComputedMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::StaticMemberExpression(it) => GetSpan::span(it.as_ref()), + Self::PrivateFieldExpression(it) => GetSpan::span(it.as_ref()), } } } @@ -2136,8 +2136,8 @@ impl GetSpan for JSXEmptyExpression { impl<'a> GetSpan for JSXAttributeItem<'a> { fn span(&self) -> Span { match self { - Self::Attribute(it) => it.span(), - Self::SpreadAttribute(it) => it.span(), + Self::Attribute(it) => GetSpan::span(it.as_ref()), + Self::SpreadAttribute(it) => GetSpan::span(it.as_ref()), } } } @@ -2159,8 +2159,8 @@ impl<'a> GetSpan for JSXSpreadAttribute<'a> { impl<'a> GetSpan for JSXAttributeName<'a> { fn span(&self) -> Span { match self { - Self::Identifier(it) => it.span(), - Self::NamespacedName(it) => it.span(), + Self::Identifier(it) => GetSpan::span(it.as_ref()), + Self::NamespacedName(it) => GetSpan::span(it.as_ref()), } } } @@ -2168,10 +2168,10 @@ impl<'a> GetSpan for JSXAttributeName<'a> { impl<'a> GetSpan for JSXAttributeValue<'a> { fn span(&self) -> Span { match self { - Self::StringLiteral(it) => it.span(), - Self::ExpressionContainer(it) => it.span(), - Self::Element(it) => it.span(), - Self::Fragment(it) => it.span(), + Self::StringLiteral(it) => GetSpan::span(it.as_ref()), + Self::ExpressionContainer(it) => GetSpan::span(it.as_ref()), + Self::Element(it) => GetSpan::span(it.as_ref()), + Self::Fragment(it) => GetSpan::span(it.as_ref()), } } } @@ -2186,11 +2186,11 @@ impl<'a> GetSpan for JSXIdentifier<'a> { impl<'a> GetSpan for JSXChild<'a> { fn span(&self) -> Span { match self { - Self::Text(it) => it.span(), - Self::Element(it) => it.span(), - Self::Fragment(it) => it.span(), - Self::ExpressionContainer(it) => it.span(), - Self::Spread(it) => it.span(), + Self::Text(it) => GetSpan::span(it.as_ref()), + Self::Element(it) => GetSpan::span(it.as_ref()), + Self::Fragment(it) => GetSpan::span(it.as_ref()), + Self::ExpressionContainer(it) => GetSpan::span(it.as_ref()), + Self::Spread(it) => GetSpan::span(it.as_ref()), } } } diff --git a/crates/oxc_ast/src/generated/derive_get_span_mut.rs b/crates/oxc_ast/src/generated/derive_get_span_mut.rs index a3c4f418cc03cc..f253049b5cc53b 100644 --- a/crates/oxc_ast/src/generated/derive_get_span_mut.rs +++ b/crates/oxc_ast/src/generated/derive_get_span_mut.rs @@ -69,48 +69,48 @@ impl<'a> GetSpanMut for Program<'a> { impl<'a> GetSpanMut for Expression<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::BooleanLiteral(it) => it.span_mut(), - Self::NullLiteral(it) => it.span_mut(), - Self::NumericLiteral(it) => it.span_mut(), - Self::BigIntLiteral(it) => it.span_mut(), - Self::RegExpLiteral(it) => it.span_mut(), - Self::StringLiteral(it) => it.span_mut(), - Self::TemplateLiteral(it) => it.span_mut(), - Self::Identifier(it) => it.span_mut(), - Self::MetaProperty(it) => it.span_mut(), - Self::Super(it) => it.span_mut(), - Self::ArrayExpression(it) => it.span_mut(), - Self::ArrowFunctionExpression(it) => it.span_mut(), - Self::AssignmentExpression(it) => it.span_mut(), - Self::AwaitExpression(it) => it.span_mut(), - Self::BinaryExpression(it) => it.span_mut(), - Self::CallExpression(it) => it.span_mut(), - Self::ChainExpression(it) => it.span_mut(), - Self::ClassExpression(it) => it.span_mut(), - Self::ConditionalExpression(it) => it.span_mut(), - Self::FunctionExpression(it) => it.span_mut(), - Self::ImportExpression(it) => it.span_mut(), - Self::LogicalExpression(it) => it.span_mut(), - Self::NewExpression(it) => it.span_mut(), - Self::ObjectExpression(it) => it.span_mut(), - Self::ParenthesizedExpression(it) => it.span_mut(), - Self::SequenceExpression(it) => it.span_mut(), - Self::TaggedTemplateExpression(it) => it.span_mut(), - Self::ThisExpression(it) => it.span_mut(), - Self::UnaryExpression(it) => it.span_mut(), - Self::UpdateExpression(it) => it.span_mut(), - Self::YieldExpression(it) => it.span_mut(), - Self::PrivateInExpression(it) => it.span_mut(), - Self::JSXElement(it) => it.span_mut(), - Self::JSXFragment(it) => it.span_mut(), - Self::TSAsExpression(it) => it.span_mut(), - Self::TSSatisfiesExpression(it) => it.span_mut(), - Self::TSTypeAssertion(it) => it.span_mut(), - Self::TSNonNullExpression(it) => it.span_mut(), - Self::TSInstantiationExpression(it) => it.span_mut(), - Self::ComputedMemberExpression(it) => it.span_mut(), - Self::StaticMemberExpression(it) => it.span_mut(), - Self::PrivateFieldExpression(it) => it.span_mut(), + Self::BooleanLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::NullLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::NumericLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::BigIntLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::RegExpLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::StringLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::TemplateLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::Identifier(it) => GetSpanMut::span_mut(&mut **it), + Self::MetaProperty(it) => GetSpanMut::span_mut(&mut **it), + Self::Super(it) => GetSpanMut::span_mut(&mut **it), + Self::ArrayExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ArrowFunctionExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::AssignmentExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::AwaitExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::BinaryExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::CallExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ChainExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ClassExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ConditionalExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::FunctionExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ImportExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::LogicalExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::NewExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ObjectExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ParenthesizedExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::SequenceExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TaggedTemplateExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ThisExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::UnaryExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::UpdateExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::YieldExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::PrivateInExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::JSXElement(it) => GetSpanMut::span_mut(&mut **it), + Self::JSXFragment(it) => GetSpanMut::span_mut(&mut **it), + Self::TSAsExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypeAssertion(it) => GetSpanMut::span_mut(&mut **it), + Self::TSNonNullExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::StaticMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -160,50 +160,50 @@ impl<'a> GetSpanMut for ArrayExpression<'a> { impl<'a> GetSpanMut for ArrayExpressionElement<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::SpreadElement(it) => it.span_mut(), - Self::Elision(it) => it.span_mut(), - Self::BooleanLiteral(it) => it.span_mut(), - Self::NullLiteral(it) => it.span_mut(), - Self::NumericLiteral(it) => it.span_mut(), - Self::BigIntLiteral(it) => it.span_mut(), - Self::RegExpLiteral(it) => it.span_mut(), - Self::StringLiteral(it) => it.span_mut(), - Self::TemplateLiteral(it) => it.span_mut(), - Self::Identifier(it) => it.span_mut(), - Self::MetaProperty(it) => it.span_mut(), - Self::Super(it) => it.span_mut(), - Self::ArrayExpression(it) => it.span_mut(), - Self::ArrowFunctionExpression(it) => it.span_mut(), - Self::AssignmentExpression(it) => it.span_mut(), - Self::AwaitExpression(it) => it.span_mut(), - Self::BinaryExpression(it) => it.span_mut(), - Self::CallExpression(it) => it.span_mut(), - Self::ChainExpression(it) => it.span_mut(), - Self::ClassExpression(it) => it.span_mut(), - Self::ConditionalExpression(it) => it.span_mut(), - Self::FunctionExpression(it) => it.span_mut(), - Self::ImportExpression(it) => it.span_mut(), - Self::LogicalExpression(it) => it.span_mut(), - Self::NewExpression(it) => it.span_mut(), - Self::ObjectExpression(it) => it.span_mut(), - Self::ParenthesizedExpression(it) => it.span_mut(), - Self::SequenceExpression(it) => it.span_mut(), - Self::TaggedTemplateExpression(it) => it.span_mut(), - Self::ThisExpression(it) => it.span_mut(), - Self::UnaryExpression(it) => it.span_mut(), - Self::UpdateExpression(it) => it.span_mut(), - Self::YieldExpression(it) => it.span_mut(), - Self::PrivateInExpression(it) => it.span_mut(), - Self::JSXElement(it) => it.span_mut(), - Self::JSXFragment(it) => it.span_mut(), - Self::TSAsExpression(it) => it.span_mut(), - Self::TSSatisfiesExpression(it) => it.span_mut(), - Self::TSTypeAssertion(it) => it.span_mut(), - Self::TSNonNullExpression(it) => it.span_mut(), - Self::TSInstantiationExpression(it) => it.span_mut(), - Self::ComputedMemberExpression(it) => it.span_mut(), - Self::StaticMemberExpression(it) => it.span_mut(), - Self::PrivateFieldExpression(it) => it.span_mut(), + Self::SpreadElement(it) => GetSpanMut::span_mut(&mut **it), + Self::Elision(it) => GetSpanMut::span_mut(it), + Self::BooleanLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::NullLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::NumericLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::BigIntLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::RegExpLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::StringLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::TemplateLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::Identifier(it) => GetSpanMut::span_mut(&mut **it), + Self::MetaProperty(it) => GetSpanMut::span_mut(&mut **it), + Self::Super(it) => GetSpanMut::span_mut(&mut **it), + Self::ArrayExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ArrowFunctionExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::AssignmentExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::AwaitExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::BinaryExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::CallExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ChainExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ClassExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ConditionalExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::FunctionExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ImportExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::LogicalExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::NewExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ObjectExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ParenthesizedExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::SequenceExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TaggedTemplateExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ThisExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::UnaryExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::UpdateExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::YieldExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::PrivateInExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::JSXElement(it) => GetSpanMut::span_mut(&mut **it), + Self::JSXFragment(it) => GetSpanMut::span_mut(&mut **it), + Self::TSAsExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypeAssertion(it) => GetSpanMut::span_mut(&mut **it), + Self::TSNonNullExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::StaticMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -225,8 +225,8 @@ impl<'a> GetSpanMut for ObjectExpression<'a> { impl<'a> GetSpanMut for ObjectPropertyKind<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::ObjectProperty(it) => it.span_mut(), - Self::SpreadProperty(it) => it.span_mut(), + Self::ObjectProperty(it) => GetSpanMut::span_mut(&mut **it), + Self::SpreadProperty(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -241,50 +241,50 @@ impl<'a> GetSpanMut for ObjectProperty<'a> { impl<'a> GetSpanMut for PropertyKey<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::StaticIdentifier(it) => it.span_mut(), - Self::PrivateIdentifier(it) => it.span_mut(), - Self::BooleanLiteral(it) => it.span_mut(), - Self::NullLiteral(it) => it.span_mut(), - Self::NumericLiteral(it) => it.span_mut(), - Self::BigIntLiteral(it) => it.span_mut(), - Self::RegExpLiteral(it) => it.span_mut(), - Self::StringLiteral(it) => it.span_mut(), - Self::TemplateLiteral(it) => it.span_mut(), - Self::Identifier(it) => it.span_mut(), - Self::MetaProperty(it) => it.span_mut(), - Self::Super(it) => it.span_mut(), - Self::ArrayExpression(it) => it.span_mut(), - Self::ArrowFunctionExpression(it) => it.span_mut(), - Self::AssignmentExpression(it) => it.span_mut(), - Self::AwaitExpression(it) => it.span_mut(), - Self::BinaryExpression(it) => it.span_mut(), - Self::CallExpression(it) => it.span_mut(), - Self::ChainExpression(it) => it.span_mut(), - Self::ClassExpression(it) => it.span_mut(), - Self::ConditionalExpression(it) => it.span_mut(), - Self::FunctionExpression(it) => it.span_mut(), - Self::ImportExpression(it) => it.span_mut(), - Self::LogicalExpression(it) => it.span_mut(), - Self::NewExpression(it) => it.span_mut(), - Self::ObjectExpression(it) => it.span_mut(), - Self::ParenthesizedExpression(it) => it.span_mut(), - Self::SequenceExpression(it) => it.span_mut(), - Self::TaggedTemplateExpression(it) => it.span_mut(), - Self::ThisExpression(it) => it.span_mut(), - Self::UnaryExpression(it) => it.span_mut(), - Self::UpdateExpression(it) => it.span_mut(), - Self::YieldExpression(it) => it.span_mut(), - Self::PrivateInExpression(it) => it.span_mut(), - Self::JSXElement(it) => it.span_mut(), - Self::JSXFragment(it) => it.span_mut(), - Self::TSAsExpression(it) => it.span_mut(), - Self::TSSatisfiesExpression(it) => it.span_mut(), - Self::TSTypeAssertion(it) => it.span_mut(), - Self::TSNonNullExpression(it) => it.span_mut(), - Self::TSInstantiationExpression(it) => it.span_mut(), - Self::ComputedMemberExpression(it) => it.span_mut(), - Self::StaticMemberExpression(it) => it.span_mut(), - Self::PrivateFieldExpression(it) => it.span_mut(), + Self::StaticIdentifier(it) => GetSpanMut::span_mut(&mut **it), + Self::PrivateIdentifier(it) => GetSpanMut::span_mut(&mut **it), + Self::BooleanLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::NullLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::NumericLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::BigIntLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::RegExpLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::StringLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::TemplateLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::Identifier(it) => GetSpanMut::span_mut(&mut **it), + Self::MetaProperty(it) => GetSpanMut::span_mut(&mut **it), + Self::Super(it) => GetSpanMut::span_mut(&mut **it), + Self::ArrayExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ArrowFunctionExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::AssignmentExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::AwaitExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::BinaryExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::CallExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ChainExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ClassExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ConditionalExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::FunctionExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ImportExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::LogicalExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::NewExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ObjectExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ParenthesizedExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::SequenceExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TaggedTemplateExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ThisExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::UnaryExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::UpdateExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::YieldExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::PrivateInExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::JSXElement(it) => GetSpanMut::span_mut(&mut **it), + Self::JSXFragment(it) => GetSpanMut::span_mut(&mut **it), + Self::TSAsExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypeAssertion(it) => GetSpanMut::span_mut(&mut **it), + Self::TSNonNullExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::StaticMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -313,9 +313,9 @@ impl<'a> GetSpanMut for TemplateElement<'a> { impl<'a> GetSpanMut for MemberExpression<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::ComputedMemberExpression(it) => it.span_mut(), - Self::StaticMemberExpression(it) => it.span_mut(), - Self::PrivateFieldExpression(it) => it.span_mut(), + Self::ComputedMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::StaticMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -372,49 +372,49 @@ impl<'a> GetSpanMut for SpreadElement<'a> { impl<'a> GetSpanMut for Argument<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::SpreadElement(it) => it.span_mut(), - Self::BooleanLiteral(it) => it.span_mut(), - Self::NullLiteral(it) => it.span_mut(), - Self::NumericLiteral(it) => it.span_mut(), - Self::BigIntLiteral(it) => it.span_mut(), - Self::RegExpLiteral(it) => it.span_mut(), - Self::StringLiteral(it) => it.span_mut(), - Self::TemplateLiteral(it) => it.span_mut(), - Self::Identifier(it) => it.span_mut(), - Self::MetaProperty(it) => it.span_mut(), - Self::Super(it) => it.span_mut(), - Self::ArrayExpression(it) => it.span_mut(), - Self::ArrowFunctionExpression(it) => it.span_mut(), - Self::AssignmentExpression(it) => it.span_mut(), - Self::AwaitExpression(it) => it.span_mut(), - Self::BinaryExpression(it) => it.span_mut(), - Self::CallExpression(it) => it.span_mut(), - Self::ChainExpression(it) => it.span_mut(), - Self::ClassExpression(it) => it.span_mut(), - Self::ConditionalExpression(it) => it.span_mut(), - Self::FunctionExpression(it) => it.span_mut(), - Self::ImportExpression(it) => it.span_mut(), - Self::LogicalExpression(it) => it.span_mut(), - Self::NewExpression(it) => it.span_mut(), - Self::ObjectExpression(it) => it.span_mut(), - Self::ParenthesizedExpression(it) => it.span_mut(), - Self::SequenceExpression(it) => it.span_mut(), - Self::TaggedTemplateExpression(it) => it.span_mut(), - Self::ThisExpression(it) => it.span_mut(), - Self::UnaryExpression(it) => it.span_mut(), - Self::UpdateExpression(it) => it.span_mut(), - Self::YieldExpression(it) => it.span_mut(), - Self::PrivateInExpression(it) => it.span_mut(), - Self::JSXElement(it) => it.span_mut(), - Self::JSXFragment(it) => it.span_mut(), - Self::TSAsExpression(it) => it.span_mut(), - Self::TSSatisfiesExpression(it) => it.span_mut(), - Self::TSTypeAssertion(it) => it.span_mut(), - Self::TSNonNullExpression(it) => it.span_mut(), - Self::TSInstantiationExpression(it) => it.span_mut(), - Self::ComputedMemberExpression(it) => it.span_mut(), - Self::StaticMemberExpression(it) => it.span_mut(), - Self::PrivateFieldExpression(it) => it.span_mut(), + Self::SpreadElement(it) => GetSpanMut::span_mut(&mut **it), + Self::BooleanLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::NullLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::NumericLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::BigIntLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::RegExpLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::StringLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::TemplateLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::Identifier(it) => GetSpanMut::span_mut(&mut **it), + Self::MetaProperty(it) => GetSpanMut::span_mut(&mut **it), + Self::Super(it) => GetSpanMut::span_mut(&mut **it), + Self::ArrayExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ArrowFunctionExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::AssignmentExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::AwaitExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::BinaryExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::CallExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ChainExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ClassExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ConditionalExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::FunctionExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ImportExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::LogicalExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::NewExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ObjectExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ParenthesizedExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::SequenceExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TaggedTemplateExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ThisExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::UnaryExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::UpdateExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::YieldExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::PrivateInExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::JSXElement(it) => GetSpanMut::span_mut(&mut **it), + Self::JSXFragment(it) => GetSpanMut::span_mut(&mut **it), + Self::TSAsExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypeAssertion(it) => GetSpanMut::span_mut(&mut **it), + Self::TSNonNullExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::StaticMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -471,17 +471,17 @@ impl<'a> GetSpanMut for AssignmentExpression<'a> { impl<'a> GetSpanMut for AssignmentTarget<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::AssignmentTargetIdentifier(it) => it.span_mut(), - Self::TSAsExpression(it) => it.span_mut(), - Self::TSSatisfiesExpression(it) => it.span_mut(), - Self::TSNonNullExpression(it) => it.span_mut(), - Self::TSTypeAssertion(it) => it.span_mut(), - Self::TSInstantiationExpression(it) => it.span_mut(), - Self::ComputedMemberExpression(it) => it.span_mut(), - Self::StaticMemberExpression(it) => it.span_mut(), - Self::PrivateFieldExpression(it) => it.span_mut(), - Self::ArrayAssignmentTarget(it) => it.span_mut(), - Self::ObjectAssignmentTarget(it) => it.span_mut(), + Self::AssignmentTargetIdentifier(it) => GetSpanMut::span_mut(&mut **it), + Self::TSAsExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSNonNullExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypeAssertion(it) => GetSpanMut::span_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::StaticMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ArrayAssignmentTarget(it) => GetSpanMut::span_mut(&mut **it), + Self::ObjectAssignmentTarget(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -489,15 +489,15 @@ impl<'a> GetSpanMut for AssignmentTarget<'a> { impl<'a> GetSpanMut for SimpleAssignmentTarget<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::AssignmentTargetIdentifier(it) => it.span_mut(), - Self::TSAsExpression(it) => it.span_mut(), - Self::TSSatisfiesExpression(it) => it.span_mut(), - Self::TSNonNullExpression(it) => it.span_mut(), - Self::TSTypeAssertion(it) => it.span_mut(), - Self::TSInstantiationExpression(it) => it.span_mut(), - Self::ComputedMemberExpression(it) => it.span_mut(), - Self::StaticMemberExpression(it) => it.span_mut(), - Self::PrivateFieldExpression(it) => it.span_mut(), + Self::AssignmentTargetIdentifier(it) => GetSpanMut::span_mut(&mut **it), + Self::TSAsExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSNonNullExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypeAssertion(it) => GetSpanMut::span_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::StaticMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -505,8 +505,8 @@ impl<'a> GetSpanMut for SimpleAssignmentTarget<'a> { impl<'a> GetSpanMut for AssignmentTargetPattern<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::ArrayAssignmentTarget(it) => it.span_mut(), - Self::ObjectAssignmentTarget(it) => it.span_mut(), + Self::ArrayAssignmentTarget(it) => GetSpanMut::span_mut(&mut **it), + Self::ObjectAssignmentTarget(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -535,18 +535,18 @@ impl<'a> GetSpanMut for AssignmentTargetRest<'a> { impl<'a> GetSpanMut for AssignmentTargetMaybeDefault<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::AssignmentTargetWithDefault(it) => it.span_mut(), - Self::AssignmentTargetIdentifier(it) => it.span_mut(), - Self::TSAsExpression(it) => it.span_mut(), - Self::TSSatisfiesExpression(it) => it.span_mut(), - Self::TSNonNullExpression(it) => it.span_mut(), - Self::TSTypeAssertion(it) => it.span_mut(), - Self::TSInstantiationExpression(it) => it.span_mut(), - Self::ComputedMemberExpression(it) => it.span_mut(), - Self::StaticMemberExpression(it) => it.span_mut(), - Self::PrivateFieldExpression(it) => it.span_mut(), - Self::ArrayAssignmentTarget(it) => it.span_mut(), - Self::ObjectAssignmentTarget(it) => it.span_mut(), + Self::AssignmentTargetWithDefault(it) => GetSpanMut::span_mut(&mut **it), + Self::AssignmentTargetIdentifier(it) => GetSpanMut::span_mut(&mut **it), + Self::TSAsExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSNonNullExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypeAssertion(it) => GetSpanMut::span_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::StaticMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ArrayAssignmentTarget(it) => GetSpanMut::span_mut(&mut **it), + Self::ObjectAssignmentTarget(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -561,8 +561,8 @@ impl<'a> GetSpanMut for AssignmentTargetWithDefault<'a> { impl<'a> GetSpanMut for AssignmentTargetProperty<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::AssignmentTargetPropertyIdentifier(it) => it.span_mut(), - Self::AssignmentTargetPropertyProperty(it) => it.span_mut(), + Self::AssignmentTargetPropertyIdentifier(it) => GetSpanMut::span_mut(&mut **it), + Self::AssignmentTargetPropertyProperty(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -612,10 +612,10 @@ impl<'a> GetSpanMut for ChainExpression<'a> { impl<'a> GetSpanMut for ChainElement<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::CallExpression(it) => it.span_mut(), - Self::ComputedMemberExpression(it) => it.span_mut(), - Self::StaticMemberExpression(it) => it.span_mut(), - Self::PrivateFieldExpression(it) => it.span_mut(), + Self::CallExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::StaticMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -630,38 +630,38 @@ impl<'a> GetSpanMut for ParenthesizedExpression<'a> { impl<'a> GetSpanMut for Statement<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::BlockStatement(it) => it.span_mut(), - Self::BreakStatement(it) => it.span_mut(), - Self::ContinueStatement(it) => it.span_mut(), - Self::DebuggerStatement(it) => it.span_mut(), - Self::DoWhileStatement(it) => it.span_mut(), - Self::EmptyStatement(it) => it.span_mut(), - Self::ExpressionStatement(it) => it.span_mut(), - Self::ForInStatement(it) => it.span_mut(), - Self::ForOfStatement(it) => it.span_mut(), - Self::ForStatement(it) => it.span_mut(), - Self::IfStatement(it) => it.span_mut(), - Self::LabeledStatement(it) => it.span_mut(), - Self::ReturnStatement(it) => it.span_mut(), - Self::SwitchStatement(it) => it.span_mut(), - Self::ThrowStatement(it) => it.span_mut(), - Self::TryStatement(it) => it.span_mut(), - Self::WhileStatement(it) => it.span_mut(), - Self::WithStatement(it) => it.span_mut(), - Self::VariableDeclaration(it) => it.span_mut(), - Self::FunctionDeclaration(it) => it.span_mut(), - Self::ClassDeclaration(it) => it.span_mut(), - Self::TSTypeAliasDeclaration(it) => it.span_mut(), - Self::TSInterfaceDeclaration(it) => it.span_mut(), - Self::TSEnumDeclaration(it) => it.span_mut(), - Self::TSModuleDeclaration(it) => it.span_mut(), - Self::TSImportEqualsDeclaration(it) => it.span_mut(), - Self::ImportDeclaration(it) => it.span_mut(), - Self::ExportAllDeclaration(it) => it.span_mut(), - Self::ExportDefaultDeclaration(it) => it.span_mut(), - Self::ExportNamedDeclaration(it) => it.span_mut(), - Self::TSExportAssignment(it) => it.span_mut(), - Self::TSNamespaceExportDeclaration(it) => it.span_mut(), + Self::BlockStatement(it) => GetSpanMut::span_mut(&mut **it), + Self::BreakStatement(it) => GetSpanMut::span_mut(&mut **it), + Self::ContinueStatement(it) => GetSpanMut::span_mut(&mut **it), + Self::DebuggerStatement(it) => GetSpanMut::span_mut(&mut **it), + Self::DoWhileStatement(it) => GetSpanMut::span_mut(&mut **it), + Self::EmptyStatement(it) => GetSpanMut::span_mut(&mut **it), + Self::ExpressionStatement(it) => GetSpanMut::span_mut(&mut **it), + Self::ForInStatement(it) => GetSpanMut::span_mut(&mut **it), + Self::ForOfStatement(it) => GetSpanMut::span_mut(&mut **it), + Self::ForStatement(it) => GetSpanMut::span_mut(&mut **it), + Self::IfStatement(it) => GetSpanMut::span_mut(&mut **it), + Self::LabeledStatement(it) => GetSpanMut::span_mut(&mut **it), + Self::ReturnStatement(it) => GetSpanMut::span_mut(&mut **it), + Self::SwitchStatement(it) => GetSpanMut::span_mut(&mut **it), + Self::ThrowStatement(it) => GetSpanMut::span_mut(&mut **it), + Self::TryStatement(it) => GetSpanMut::span_mut(&mut **it), + Self::WhileStatement(it) => GetSpanMut::span_mut(&mut **it), + Self::WithStatement(it) => GetSpanMut::span_mut(&mut **it), + Self::VariableDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::FunctionDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::ClassDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypeAliasDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::TSInterfaceDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::TSEnumDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::TSModuleDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::TSImportEqualsDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::ImportDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::ExportAllDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::ExportDefaultDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::ExportNamedDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::TSExportAssignment(it) => GetSpanMut::span_mut(&mut **it), + Self::TSNamespaceExportDeclaration(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -690,14 +690,14 @@ impl<'a> GetSpanMut for BlockStatement<'a> { impl<'a> GetSpanMut for Declaration<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::VariableDeclaration(it) => it.span_mut(), - Self::FunctionDeclaration(it) => it.span_mut(), - Self::ClassDeclaration(it) => it.span_mut(), - Self::TSTypeAliasDeclaration(it) => it.span_mut(), - Self::TSInterfaceDeclaration(it) => it.span_mut(), - Self::TSEnumDeclaration(it) => it.span_mut(), - Self::TSModuleDeclaration(it) => it.span_mut(), - Self::TSImportEqualsDeclaration(it) => it.span_mut(), + Self::VariableDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::FunctionDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::ClassDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypeAliasDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::TSInterfaceDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::TSEnumDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::TSModuleDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::TSImportEqualsDeclaration(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -761,49 +761,49 @@ impl<'a> GetSpanMut for ForStatement<'a> { impl<'a> GetSpanMut for ForStatementInit<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::VariableDeclaration(it) => it.span_mut(), - Self::BooleanLiteral(it) => it.span_mut(), - Self::NullLiteral(it) => it.span_mut(), - Self::NumericLiteral(it) => it.span_mut(), - Self::BigIntLiteral(it) => it.span_mut(), - Self::RegExpLiteral(it) => it.span_mut(), - Self::StringLiteral(it) => it.span_mut(), - Self::TemplateLiteral(it) => it.span_mut(), - Self::Identifier(it) => it.span_mut(), - Self::MetaProperty(it) => it.span_mut(), - Self::Super(it) => it.span_mut(), - Self::ArrayExpression(it) => it.span_mut(), - Self::ArrowFunctionExpression(it) => it.span_mut(), - Self::AssignmentExpression(it) => it.span_mut(), - Self::AwaitExpression(it) => it.span_mut(), - Self::BinaryExpression(it) => it.span_mut(), - Self::CallExpression(it) => it.span_mut(), - Self::ChainExpression(it) => it.span_mut(), - Self::ClassExpression(it) => it.span_mut(), - Self::ConditionalExpression(it) => it.span_mut(), - Self::FunctionExpression(it) => it.span_mut(), - Self::ImportExpression(it) => it.span_mut(), - Self::LogicalExpression(it) => it.span_mut(), - Self::NewExpression(it) => it.span_mut(), - Self::ObjectExpression(it) => it.span_mut(), - Self::ParenthesizedExpression(it) => it.span_mut(), - Self::SequenceExpression(it) => it.span_mut(), - Self::TaggedTemplateExpression(it) => it.span_mut(), - Self::ThisExpression(it) => it.span_mut(), - Self::UnaryExpression(it) => it.span_mut(), - Self::UpdateExpression(it) => it.span_mut(), - Self::YieldExpression(it) => it.span_mut(), - Self::PrivateInExpression(it) => it.span_mut(), - Self::JSXElement(it) => it.span_mut(), - Self::JSXFragment(it) => it.span_mut(), - Self::TSAsExpression(it) => it.span_mut(), - Self::TSSatisfiesExpression(it) => it.span_mut(), - Self::TSTypeAssertion(it) => it.span_mut(), - Self::TSNonNullExpression(it) => it.span_mut(), - Self::TSInstantiationExpression(it) => it.span_mut(), - Self::ComputedMemberExpression(it) => it.span_mut(), - Self::StaticMemberExpression(it) => it.span_mut(), - Self::PrivateFieldExpression(it) => it.span_mut(), + Self::VariableDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::BooleanLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::NullLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::NumericLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::BigIntLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::RegExpLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::StringLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::TemplateLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::Identifier(it) => GetSpanMut::span_mut(&mut **it), + Self::MetaProperty(it) => GetSpanMut::span_mut(&mut **it), + Self::Super(it) => GetSpanMut::span_mut(&mut **it), + Self::ArrayExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ArrowFunctionExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::AssignmentExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::AwaitExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::BinaryExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::CallExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ChainExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ClassExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ConditionalExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::FunctionExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ImportExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::LogicalExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::NewExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ObjectExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ParenthesizedExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::SequenceExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TaggedTemplateExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ThisExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::UnaryExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::UpdateExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::YieldExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::PrivateInExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::JSXElement(it) => GetSpanMut::span_mut(&mut **it), + Self::JSXFragment(it) => GetSpanMut::span_mut(&mut **it), + Self::TSAsExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypeAssertion(it) => GetSpanMut::span_mut(&mut **it), + Self::TSNonNullExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::StaticMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -818,18 +818,18 @@ impl<'a> GetSpanMut for ForInStatement<'a> { impl<'a> GetSpanMut for ForStatementLeft<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::VariableDeclaration(it) => it.span_mut(), - Self::AssignmentTargetIdentifier(it) => it.span_mut(), - Self::TSAsExpression(it) => it.span_mut(), - Self::TSSatisfiesExpression(it) => it.span_mut(), - Self::TSNonNullExpression(it) => it.span_mut(), - Self::TSTypeAssertion(it) => it.span_mut(), - Self::TSInstantiationExpression(it) => it.span_mut(), - Self::ComputedMemberExpression(it) => it.span_mut(), - Self::StaticMemberExpression(it) => it.span_mut(), - Self::PrivateFieldExpression(it) => it.span_mut(), - Self::ArrayAssignmentTarget(it) => it.span_mut(), - Self::ObjectAssignmentTarget(it) => it.span_mut(), + Self::VariableDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::AssignmentTargetIdentifier(it) => GetSpanMut::span_mut(&mut **it), + Self::TSAsExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSNonNullExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypeAssertion(it) => GetSpanMut::span_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::StaticMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ArrayAssignmentTarget(it) => GetSpanMut::span_mut(&mut **it), + Self::ObjectAssignmentTarget(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -928,17 +928,17 @@ impl GetSpanMut for DebuggerStatement { impl<'a> GetSpanMut for BindingPattern<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { - self.kind.span_mut() + GetSpanMut::span_mut(&mut self.kind) } } impl<'a> GetSpanMut for BindingPatternKind<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::BindingIdentifier(it) => it.span_mut(), - Self::ObjectPattern(it) => it.span_mut(), - Self::ArrayPattern(it) => it.span_mut(), - Self::AssignmentPattern(it) => it.span_mut(), + Self::BindingIdentifier(it) => GetSpanMut::span_mut(&mut **it), + Self::ObjectPattern(it) => GetSpanMut::span_mut(&mut **it), + Self::ArrayPattern(it) => GetSpanMut::span_mut(&mut **it), + Self::AssignmentPattern(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -1037,11 +1037,11 @@ impl<'a> GetSpanMut for ClassBody<'a> { impl<'a> GetSpanMut for ClassElement<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::StaticBlock(it) => it.span_mut(), - Self::MethodDefinition(it) => it.span_mut(), - Self::PropertyDefinition(it) => it.span_mut(), - Self::AccessorProperty(it) => it.span_mut(), - Self::TSIndexSignature(it) => it.span_mut(), + Self::StaticBlock(it) => GetSpanMut::span_mut(&mut **it), + Self::MethodDefinition(it) => GetSpanMut::span_mut(&mut **it), + Self::PropertyDefinition(it) => GetSpanMut::span_mut(&mut **it), + Self::AccessorProperty(it) => GetSpanMut::span_mut(&mut **it), + Self::TSIndexSignature(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -1077,12 +1077,12 @@ impl<'a> GetSpanMut for StaticBlock<'a> { impl<'a> GetSpanMut for ModuleDeclaration<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::ImportDeclaration(it) => it.span_mut(), - Self::ExportAllDeclaration(it) => it.span_mut(), - Self::ExportDefaultDeclaration(it) => it.span_mut(), - Self::ExportNamedDeclaration(it) => it.span_mut(), - Self::TSExportAssignment(it) => it.span_mut(), - Self::TSNamespaceExportDeclaration(it) => it.span_mut(), + Self::ImportDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::ExportAllDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::ExportDefaultDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::ExportNamedDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::TSExportAssignment(it) => GetSpanMut::span_mut(&mut **it), + Self::TSNamespaceExportDeclaration(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -1111,9 +1111,9 @@ impl<'a> GetSpanMut for ImportDeclaration<'a> { impl<'a> GetSpanMut for ImportDeclarationSpecifier<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::ImportSpecifier(it) => it.span_mut(), - Self::ImportDefaultSpecifier(it) => it.span_mut(), - Self::ImportNamespaceSpecifier(it) => it.span_mut(), + Self::ImportSpecifier(it) => GetSpanMut::span_mut(&mut **it), + Self::ImportDefaultSpecifier(it) => GetSpanMut::span_mut(&mut **it), + Self::ImportNamespaceSpecifier(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -1156,8 +1156,8 @@ impl<'a> GetSpanMut for ImportAttribute<'a> { impl<'a> GetSpanMut for ImportAttributeKey<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::Identifier(it) => it.span_mut(), - Self::StringLiteral(it) => it.span_mut(), + Self::Identifier(it) => GetSpanMut::span_mut(it), + Self::StringLiteral(it) => GetSpanMut::span_mut(it), } } } @@ -1193,51 +1193,51 @@ impl<'a> GetSpanMut for ExportSpecifier<'a> { impl<'a> GetSpanMut for ExportDefaultDeclarationKind<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::FunctionDeclaration(it) => it.span_mut(), - Self::ClassDeclaration(it) => it.span_mut(), - Self::TSInterfaceDeclaration(it) => it.span_mut(), - Self::BooleanLiteral(it) => it.span_mut(), - Self::NullLiteral(it) => it.span_mut(), - Self::NumericLiteral(it) => it.span_mut(), - Self::BigIntLiteral(it) => it.span_mut(), - Self::RegExpLiteral(it) => it.span_mut(), - Self::StringLiteral(it) => it.span_mut(), - Self::TemplateLiteral(it) => it.span_mut(), - Self::Identifier(it) => it.span_mut(), - Self::MetaProperty(it) => it.span_mut(), - Self::Super(it) => it.span_mut(), - Self::ArrayExpression(it) => it.span_mut(), - Self::ArrowFunctionExpression(it) => it.span_mut(), - Self::AssignmentExpression(it) => it.span_mut(), - Self::AwaitExpression(it) => it.span_mut(), - Self::BinaryExpression(it) => it.span_mut(), - Self::CallExpression(it) => it.span_mut(), - Self::ChainExpression(it) => it.span_mut(), - Self::ClassExpression(it) => it.span_mut(), - Self::ConditionalExpression(it) => it.span_mut(), - Self::FunctionExpression(it) => it.span_mut(), - Self::ImportExpression(it) => it.span_mut(), - Self::LogicalExpression(it) => it.span_mut(), - Self::NewExpression(it) => it.span_mut(), - Self::ObjectExpression(it) => it.span_mut(), - Self::ParenthesizedExpression(it) => it.span_mut(), - Self::SequenceExpression(it) => it.span_mut(), - Self::TaggedTemplateExpression(it) => it.span_mut(), - Self::ThisExpression(it) => it.span_mut(), - Self::UnaryExpression(it) => it.span_mut(), - Self::UpdateExpression(it) => it.span_mut(), - Self::YieldExpression(it) => it.span_mut(), - Self::PrivateInExpression(it) => it.span_mut(), - Self::JSXElement(it) => it.span_mut(), - Self::JSXFragment(it) => it.span_mut(), - Self::TSAsExpression(it) => it.span_mut(), - Self::TSSatisfiesExpression(it) => it.span_mut(), - Self::TSTypeAssertion(it) => it.span_mut(), - Self::TSNonNullExpression(it) => it.span_mut(), - Self::TSInstantiationExpression(it) => it.span_mut(), - Self::ComputedMemberExpression(it) => it.span_mut(), - Self::StaticMemberExpression(it) => it.span_mut(), - Self::PrivateFieldExpression(it) => it.span_mut(), + Self::FunctionDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::ClassDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::TSInterfaceDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::BooleanLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::NullLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::NumericLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::BigIntLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::RegExpLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::StringLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::TemplateLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::Identifier(it) => GetSpanMut::span_mut(&mut **it), + Self::MetaProperty(it) => GetSpanMut::span_mut(&mut **it), + Self::Super(it) => GetSpanMut::span_mut(&mut **it), + Self::ArrayExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ArrowFunctionExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::AssignmentExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::AwaitExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::BinaryExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::CallExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ChainExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ClassExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ConditionalExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::FunctionExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ImportExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::LogicalExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::NewExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ObjectExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ParenthesizedExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::SequenceExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TaggedTemplateExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ThisExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::UnaryExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::UpdateExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::YieldExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::PrivateInExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::JSXElement(it) => GetSpanMut::span_mut(&mut **it), + Self::JSXFragment(it) => GetSpanMut::span_mut(&mut **it), + Self::TSAsExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypeAssertion(it) => GetSpanMut::span_mut(&mut **it), + Self::TSNonNullExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::StaticMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -1245,9 +1245,9 @@ impl<'a> GetSpanMut for ExportDefaultDeclarationKind<'a> { impl<'a> GetSpanMut for ModuleExportName<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::IdentifierName(it) => it.span_mut(), - Self::IdentifierReference(it) => it.span_mut(), - Self::StringLiteral(it) => it.span_mut(), + Self::IdentifierName(it) => GetSpanMut::span_mut(it), + Self::IdentifierReference(it) => GetSpanMut::span_mut(it), + Self::StringLiteral(it) => GetSpanMut::span_mut(it), } } } @@ -1276,52 +1276,52 @@ impl<'a> GetSpanMut for TSEnumMember<'a> { impl<'a> GetSpanMut for TSEnumMemberName<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::StaticIdentifier(it) => it.span_mut(), - Self::StaticStringLiteral(it) => it.span_mut(), - Self::StaticTemplateLiteral(it) => it.span_mut(), - Self::StaticNumericLiteral(it) => it.span_mut(), - Self::BooleanLiteral(it) => it.span_mut(), - Self::NullLiteral(it) => it.span_mut(), - Self::NumericLiteral(it) => it.span_mut(), - Self::BigIntLiteral(it) => it.span_mut(), - Self::RegExpLiteral(it) => it.span_mut(), - Self::StringLiteral(it) => it.span_mut(), - Self::TemplateLiteral(it) => it.span_mut(), - Self::Identifier(it) => it.span_mut(), - Self::MetaProperty(it) => it.span_mut(), - Self::Super(it) => it.span_mut(), - Self::ArrayExpression(it) => it.span_mut(), - Self::ArrowFunctionExpression(it) => it.span_mut(), - Self::AssignmentExpression(it) => it.span_mut(), - Self::AwaitExpression(it) => it.span_mut(), - Self::BinaryExpression(it) => it.span_mut(), - Self::CallExpression(it) => it.span_mut(), - Self::ChainExpression(it) => it.span_mut(), - Self::ClassExpression(it) => it.span_mut(), - Self::ConditionalExpression(it) => it.span_mut(), - Self::FunctionExpression(it) => it.span_mut(), - Self::ImportExpression(it) => it.span_mut(), - Self::LogicalExpression(it) => it.span_mut(), - Self::NewExpression(it) => it.span_mut(), - Self::ObjectExpression(it) => it.span_mut(), - Self::ParenthesizedExpression(it) => it.span_mut(), - Self::SequenceExpression(it) => it.span_mut(), - Self::TaggedTemplateExpression(it) => it.span_mut(), - Self::ThisExpression(it) => it.span_mut(), - Self::UnaryExpression(it) => it.span_mut(), - Self::UpdateExpression(it) => it.span_mut(), - Self::YieldExpression(it) => it.span_mut(), - Self::PrivateInExpression(it) => it.span_mut(), - Self::JSXElement(it) => it.span_mut(), - Self::JSXFragment(it) => it.span_mut(), - Self::TSAsExpression(it) => it.span_mut(), - Self::TSSatisfiesExpression(it) => it.span_mut(), - Self::TSTypeAssertion(it) => it.span_mut(), - Self::TSNonNullExpression(it) => it.span_mut(), - Self::TSInstantiationExpression(it) => it.span_mut(), - Self::ComputedMemberExpression(it) => it.span_mut(), - Self::StaticMemberExpression(it) => it.span_mut(), - Self::PrivateFieldExpression(it) => it.span_mut(), + Self::StaticIdentifier(it) => GetSpanMut::span_mut(&mut **it), + Self::StaticStringLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::StaticTemplateLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::StaticNumericLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::BooleanLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::NullLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::NumericLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::BigIntLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::RegExpLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::StringLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::TemplateLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::Identifier(it) => GetSpanMut::span_mut(&mut **it), + Self::MetaProperty(it) => GetSpanMut::span_mut(&mut **it), + Self::Super(it) => GetSpanMut::span_mut(&mut **it), + Self::ArrayExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ArrowFunctionExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::AssignmentExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::AwaitExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::BinaryExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::CallExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ChainExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ClassExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ConditionalExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::FunctionExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ImportExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::LogicalExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::NewExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ObjectExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ParenthesizedExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::SequenceExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TaggedTemplateExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ThisExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::UnaryExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::UpdateExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::YieldExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::PrivateInExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::JSXElement(it) => GetSpanMut::span_mut(&mut **it), + Self::JSXFragment(it) => GetSpanMut::span_mut(&mut **it), + Self::TSAsExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypeAssertion(it) => GetSpanMut::span_mut(&mut **it), + Self::TSNonNullExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::StaticMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -1343,14 +1343,14 @@ impl<'a> GetSpanMut for TSLiteralType<'a> { impl<'a> GetSpanMut for TSLiteral<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::BooleanLiteral(it) => it.span_mut(), - Self::NullLiteral(it) => it.span_mut(), - Self::NumericLiteral(it) => it.span_mut(), - Self::BigIntLiteral(it) => it.span_mut(), - Self::RegExpLiteral(it) => it.span_mut(), - Self::StringLiteral(it) => it.span_mut(), - Self::TemplateLiteral(it) => it.span_mut(), - Self::UnaryExpression(it) => it.span_mut(), + Self::BooleanLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::NullLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::NumericLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::BigIntLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::RegExpLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::StringLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::TemplateLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::UnaryExpression(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -1358,44 +1358,44 @@ impl<'a> GetSpanMut for TSLiteral<'a> { impl<'a> GetSpanMut for TSType<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::TSAnyKeyword(it) => it.span_mut(), - Self::TSBigIntKeyword(it) => it.span_mut(), - Self::TSBooleanKeyword(it) => it.span_mut(), - Self::TSIntrinsicKeyword(it) => it.span_mut(), - Self::TSNeverKeyword(it) => it.span_mut(), - Self::TSNullKeyword(it) => it.span_mut(), - Self::TSNumberKeyword(it) => it.span_mut(), - Self::TSObjectKeyword(it) => it.span_mut(), - Self::TSStringKeyword(it) => it.span_mut(), - Self::TSSymbolKeyword(it) => it.span_mut(), - Self::TSUndefinedKeyword(it) => it.span_mut(), - Self::TSUnknownKeyword(it) => it.span_mut(), - Self::TSVoidKeyword(it) => it.span_mut(), - Self::TSArrayType(it) => it.span_mut(), - Self::TSConditionalType(it) => it.span_mut(), - Self::TSConstructorType(it) => it.span_mut(), - Self::TSFunctionType(it) => it.span_mut(), - Self::TSImportType(it) => it.span_mut(), - Self::TSIndexedAccessType(it) => it.span_mut(), - Self::TSInferType(it) => it.span_mut(), - Self::TSIntersectionType(it) => it.span_mut(), - Self::TSLiteralType(it) => it.span_mut(), - Self::TSMappedType(it) => it.span_mut(), - Self::TSNamedTupleMember(it) => it.span_mut(), - Self::TSQualifiedName(it) => it.span_mut(), - Self::TSTemplateLiteralType(it) => it.span_mut(), - Self::TSThisType(it) => it.span_mut(), - Self::TSTupleType(it) => it.span_mut(), - Self::TSTypeLiteral(it) => it.span_mut(), - Self::TSTypeOperatorType(it) => it.span_mut(), - Self::TSTypePredicate(it) => it.span_mut(), - Self::TSTypeQuery(it) => it.span_mut(), - Self::TSTypeReference(it) => it.span_mut(), - Self::TSUnionType(it) => it.span_mut(), - Self::TSParenthesizedType(it) => it.span_mut(), - Self::JSDocNullableType(it) => it.span_mut(), - Self::JSDocNonNullableType(it) => it.span_mut(), - Self::JSDocUnknownType(it) => it.span_mut(), + Self::TSAnyKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSBigIntKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSBooleanKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSIntrinsicKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSNeverKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSNullKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSNumberKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSObjectKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSStringKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSSymbolKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSUndefinedKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSUnknownKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSVoidKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSArrayType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSConditionalType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSConstructorType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSFunctionType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSImportType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSIndexedAccessType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSInferType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSIntersectionType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSLiteralType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSMappedType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSNamedTupleMember(it) => GetSpanMut::span_mut(&mut **it), + Self::TSQualifiedName(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTemplateLiteralType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSThisType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTupleType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypeLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypeOperatorType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypePredicate(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypeQuery(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypeReference(it) => GetSpanMut::span_mut(&mut **it), + Self::TSUnionType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSParenthesizedType(it) => GetSpanMut::span_mut(&mut **it), + Self::JSDocNullableType(it) => GetSpanMut::span_mut(&mut **it), + Self::JSDocNonNullableType(it) => GetSpanMut::span_mut(&mut **it), + Self::JSDocUnknownType(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -1480,46 +1480,46 @@ impl<'a> GetSpanMut for TSRestType<'a> { impl<'a> GetSpanMut for TSTupleElement<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::TSOptionalType(it) => it.span_mut(), - Self::TSRestType(it) => it.span_mut(), - Self::TSAnyKeyword(it) => it.span_mut(), - Self::TSBigIntKeyword(it) => it.span_mut(), - Self::TSBooleanKeyword(it) => it.span_mut(), - Self::TSIntrinsicKeyword(it) => it.span_mut(), - Self::TSNeverKeyword(it) => it.span_mut(), - Self::TSNullKeyword(it) => it.span_mut(), - Self::TSNumberKeyword(it) => it.span_mut(), - Self::TSObjectKeyword(it) => it.span_mut(), - Self::TSStringKeyword(it) => it.span_mut(), - Self::TSSymbolKeyword(it) => it.span_mut(), - Self::TSUndefinedKeyword(it) => it.span_mut(), - Self::TSUnknownKeyword(it) => it.span_mut(), - Self::TSVoidKeyword(it) => it.span_mut(), - Self::TSArrayType(it) => it.span_mut(), - Self::TSConditionalType(it) => it.span_mut(), - Self::TSConstructorType(it) => it.span_mut(), - Self::TSFunctionType(it) => it.span_mut(), - Self::TSImportType(it) => it.span_mut(), - Self::TSIndexedAccessType(it) => it.span_mut(), - Self::TSInferType(it) => it.span_mut(), - Self::TSIntersectionType(it) => it.span_mut(), - Self::TSLiteralType(it) => it.span_mut(), - Self::TSMappedType(it) => it.span_mut(), - Self::TSNamedTupleMember(it) => it.span_mut(), - Self::TSQualifiedName(it) => it.span_mut(), - Self::TSTemplateLiteralType(it) => it.span_mut(), - Self::TSThisType(it) => it.span_mut(), - Self::TSTupleType(it) => it.span_mut(), - Self::TSTypeLiteral(it) => it.span_mut(), - Self::TSTypeOperatorType(it) => it.span_mut(), - Self::TSTypePredicate(it) => it.span_mut(), - Self::TSTypeQuery(it) => it.span_mut(), - Self::TSTypeReference(it) => it.span_mut(), - Self::TSUnionType(it) => it.span_mut(), - Self::TSParenthesizedType(it) => it.span_mut(), - Self::JSDocNullableType(it) => it.span_mut(), - Self::JSDocNonNullableType(it) => it.span_mut(), - Self::JSDocUnknownType(it) => it.span_mut(), + Self::TSOptionalType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSRestType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSAnyKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSBigIntKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSBooleanKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSIntrinsicKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSNeverKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSNullKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSNumberKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSObjectKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSStringKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSSymbolKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSUndefinedKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSUnknownKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSVoidKeyword(it) => GetSpanMut::span_mut(&mut **it), + Self::TSArrayType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSConditionalType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSConstructorType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSFunctionType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSImportType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSIndexedAccessType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSInferType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSIntersectionType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSLiteralType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSMappedType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSNamedTupleMember(it) => GetSpanMut::span_mut(&mut **it), + Self::TSQualifiedName(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTemplateLiteralType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSThisType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTupleType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypeLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypeOperatorType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypePredicate(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypeQuery(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypeReference(it) => GetSpanMut::span_mut(&mut **it), + Self::TSUnionType(it) => GetSpanMut::span_mut(&mut **it), + Self::TSParenthesizedType(it) => GetSpanMut::span_mut(&mut **it), + Self::JSDocNullableType(it) => GetSpanMut::span_mut(&mut **it), + Self::JSDocNonNullableType(it) => GetSpanMut::span_mut(&mut **it), + Self::JSDocUnknownType(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -1632,8 +1632,8 @@ impl<'a> GetSpanMut for TSTypeReference<'a> { impl<'a> GetSpanMut for TSTypeName<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::IdentifierReference(it) => it.span_mut(), - Self::QualifiedName(it) => it.span_mut(), + Self::IdentifierReference(it) => GetSpanMut::span_mut(&mut **it), + Self::QualifiedName(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -1704,11 +1704,11 @@ impl<'a> GetSpanMut for TSPropertySignature<'a> { impl<'a> GetSpanMut for TSSignature<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::TSIndexSignature(it) => it.span_mut(), - Self::TSPropertySignature(it) => it.span_mut(), - Self::TSCallSignatureDeclaration(it) => it.span_mut(), - Self::TSConstructSignatureDeclaration(it) => it.span_mut(), - Self::TSMethodSignature(it) => it.span_mut(), + Self::TSIndexSignature(it) => GetSpanMut::span_mut(&mut **it), + Self::TSPropertySignature(it) => GetSpanMut::span_mut(&mut **it), + Self::TSCallSignatureDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::TSConstructSignatureDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::TSMethodSignature(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -1765,8 +1765,8 @@ impl<'a> GetSpanMut for TSTypePredicate<'a> { impl<'a> GetSpanMut for TSTypePredicateName<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::Identifier(it) => it.span_mut(), - Self::This(it) => it.span_mut(), + Self::Identifier(it) => GetSpanMut::span_mut(&mut **it), + Self::This(it) => GetSpanMut::span_mut(it), } } } @@ -1781,8 +1781,8 @@ impl<'a> GetSpanMut for TSModuleDeclaration<'a> { impl<'a> GetSpanMut for TSModuleDeclarationName<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::Identifier(it) => it.span_mut(), - Self::StringLiteral(it) => it.span_mut(), + Self::Identifier(it) => GetSpanMut::span_mut(it), + Self::StringLiteral(it) => GetSpanMut::span_mut(it), } } } @@ -1790,8 +1790,8 @@ impl<'a> GetSpanMut for TSModuleDeclarationName<'a> { impl<'a> GetSpanMut for TSModuleDeclarationBody<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::TSModuleDeclaration(it) => it.span_mut(), - Self::TSModuleBlock(it) => it.span_mut(), + Self::TSModuleDeclaration(it) => GetSpanMut::span_mut(&mut **it), + Self::TSModuleBlock(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -1827,9 +1827,9 @@ impl<'a> GetSpanMut for TSTypeQuery<'a> { impl<'a> GetSpanMut for TSTypeQueryExprName<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::TSImportType(it) => it.span_mut(), - Self::IdentifierReference(it) => it.span_mut(), - Self::QualifiedName(it) => it.span_mut(), + Self::TSImportType(it) => GetSpanMut::span_mut(&mut **it), + Self::IdentifierReference(it) => GetSpanMut::span_mut(&mut **it), + Self::QualifiedName(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -1858,8 +1858,8 @@ impl<'a> GetSpanMut for TSImportAttribute<'a> { impl<'a> GetSpanMut for TSImportAttributeName<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::Identifier(it) => it.span_mut(), - Self::StringLiteral(it) => it.span_mut(), + Self::Identifier(it) => GetSpanMut::span_mut(it), + Self::StringLiteral(it) => GetSpanMut::span_mut(it), } } } @@ -1923,9 +1923,9 @@ impl<'a> GetSpanMut for TSImportEqualsDeclaration<'a> { impl<'a> GetSpanMut for TSModuleReference<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::ExternalModuleReference(it) => it.span_mut(), - Self::IdentifierReference(it) => it.span_mut(), - Self::QualifiedName(it) => it.span_mut(), + Self::ExternalModuleReference(it) => GetSpanMut::span_mut(&mut **it), + Self::IdentifierReference(it) => GetSpanMut::span_mut(&mut **it), + Self::QualifiedName(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -2038,10 +2038,10 @@ impl GetSpanMut for JSXClosingFragment { impl<'a> GetSpanMut for JSXElementName<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::Identifier(it) => it.span_mut(), - Self::IdentifierReference(it) => it.span_mut(), - Self::NamespacedName(it) => it.span_mut(), - Self::MemberExpression(it) => it.span_mut(), + Self::Identifier(it) => GetSpanMut::span_mut(&mut **it), + Self::IdentifierReference(it) => GetSpanMut::span_mut(&mut **it), + Self::NamespacedName(it) => GetSpanMut::span_mut(&mut **it), + Self::MemberExpression(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -2063,8 +2063,8 @@ impl<'a> GetSpanMut for JSXMemberExpression<'a> { impl<'a> GetSpanMut for JSXMemberExpressionObject<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::IdentifierReference(it) => it.span_mut(), - Self::MemberExpression(it) => it.span_mut(), + Self::IdentifierReference(it) => GetSpanMut::span_mut(&mut **it), + Self::MemberExpression(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -2079,49 +2079,49 @@ impl<'a> GetSpanMut for JSXExpressionContainer<'a> { impl<'a> GetSpanMut for JSXExpression<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::EmptyExpression(it) => it.span_mut(), - Self::BooleanLiteral(it) => it.span_mut(), - Self::NullLiteral(it) => it.span_mut(), - Self::NumericLiteral(it) => it.span_mut(), - Self::BigIntLiteral(it) => it.span_mut(), - Self::RegExpLiteral(it) => it.span_mut(), - Self::StringLiteral(it) => it.span_mut(), - Self::TemplateLiteral(it) => it.span_mut(), - Self::Identifier(it) => it.span_mut(), - Self::MetaProperty(it) => it.span_mut(), - Self::Super(it) => it.span_mut(), - Self::ArrayExpression(it) => it.span_mut(), - Self::ArrowFunctionExpression(it) => it.span_mut(), - Self::AssignmentExpression(it) => it.span_mut(), - Self::AwaitExpression(it) => it.span_mut(), - Self::BinaryExpression(it) => it.span_mut(), - Self::CallExpression(it) => it.span_mut(), - Self::ChainExpression(it) => it.span_mut(), - Self::ClassExpression(it) => it.span_mut(), - Self::ConditionalExpression(it) => it.span_mut(), - Self::FunctionExpression(it) => it.span_mut(), - Self::ImportExpression(it) => it.span_mut(), - Self::LogicalExpression(it) => it.span_mut(), - Self::NewExpression(it) => it.span_mut(), - Self::ObjectExpression(it) => it.span_mut(), - Self::ParenthesizedExpression(it) => it.span_mut(), - Self::SequenceExpression(it) => it.span_mut(), - Self::TaggedTemplateExpression(it) => it.span_mut(), - Self::ThisExpression(it) => it.span_mut(), - Self::UnaryExpression(it) => it.span_mut(), - Self::UpdateExpression(it) => it.span_mut(), - Self::YieldExpression(it) => it.span_mut(), - Self::PrivateInExpression(it) => it.span_mut(), - Self::JSXElement(it) => it.span_mut(), - Self::JSXFragment(it) => it.span_mut(), - Self::TSAsExpression(it) => it.span_mut(), - Self::TSSatisfiesExpression(it) => it.span_mut(), - Self::TSTypeAssertion(it) => it.span_mut(), - Self::TSNonNullExpression(it) => it.span_mut(), - Self::TSInstantiationExpression(it) => it.span_mut(), - Self::ComputedMemberExpression(it) => it.span_mut(), - Self::StaticMemberExpression(it) => it.span_mut(), - Self::PrivateFieldExpression(it) => it.span_mut(), + Self::EmptyExpression(it) => GetSpanMut::span_mut(it), + Self::BooleanLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::NullLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::NumericLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::BigIntLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::RegExpLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::StringLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::TemplateLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::Identifier(it) => GetSpanMut::span_mut(&mut **it), + Self::MetaProperty(it) => GetSpanMut::span_mut(&mut **it), + Self::Super(it) => GetSpanMut::span_mut(&mut **it), + Self::ArrayExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ArrowFunctionExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::AssignmentExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::AwaitExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::BinaryExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::CallExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ChainExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ClassExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ConditionalExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::FunctionExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ImportExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::LogicalExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::NewExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ObjectExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ParenthesizedExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::SequenceExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TaggedTemplateExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ThisExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::UnaryExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::UpdateExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::YieldExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::PrivateInExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::JSXElement(it) => GetSpanMut::span_mut(&mut **it), + Self::JSXFragment(it) => GetSpanMut::span_mut(&mut **it), + Self::TSAsExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSSatisfiesExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSTypeAssertion(it) => GetSpanMut::span_mut(&mut **it), + Self::TSNonNullExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::TSInstantiationExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::ComputedMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::StaticMemberExpression(it) => GetSpanMut::span_mut(&mut **it), + Self::PrivateFieldExpression(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -2136,8 +2136,8 @@ impl GetSpanMut for JSXEmptyExpression { impl<'a> GetSpanMut for JSXAttributeItem<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::Attribute(it) => it.span_mut(), - Self::SpreadAttribute(it) => it.span_mut(), + Self::Attribute(it) => GetSpanMut::span_mut(&mut **it), + Self::SpreadAttribute(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -2159,8 +2159,8 @@ impl<'a> GetSpanMut for JSXSpreadAttribute<'a> { impl<'a> GetSpanMut for JSXAttributeName<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::Identifier(it) => it.span_mut(), - Self::NamespacedName(it) => it.span_mut(), + Self::Identifier(it) => GetSpanMut::span_mut(&mut **it), + Self::NamespacedName(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -2168,10 +2168,10 @@ impl<'a> GetSpanMut for JSXAttributeName<'a> { impl<'a> GetSpanMut for JSXAttributeValue<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::StringLiteral(it) => it.span_mut(), - Self::ExpressionContainer(it) => it.span_mut(), - Self::Element(it) => it.span_mut(), - Self::Fragment(it) => it.span_mut(), + Self::StringLiteral(it) => GetSpanMut::span_mut(&mut **it), + Self::ExpressionContainer(it) => GetSpanMut::span_mut(&mut **it), + Self::Element(it) => GetSpanMut::span_mut(&mut **it), + Self::Fragment(it) => GetSpanMut::span_mut(&mut **it), } } } @@ -2186,11 +2186,11 @@ impl<'a> GetSpanMut for JSXIdentifier<'a> { impl<'a> GetSpanMut for JSXChild<'a> { fn span_mut(&mut self) -> &mut Span { match self { - Self::Text(it) => it.span_mut(), - Self::Element(it) => it.span_mut(), - Self::Fragment(it) => it.span_mut(), - Self::ExpressionContainer(it) => it.span_mut(), - Self::Spread(it) => it.span_mut(), + Self::Text(it) => GetSpanMut::span_mut(&mut **it), + Self::Element(it) => GetSpanMut::span_mut(&mut **it), + Self::Fragment(it) => GetSpanMut::span_mut(&mut **it), + Self::ExpressionContainer(it) => GetSpanMut::span_mut(&mut **it), + Self::Spread(it) => GetSpanMut::span_mut(&mut **it), } } } diff --git a/tasks/ast_tools/src/derives/get_span.rs b/tasks/ast_tools/src/derives/get_span.rs index 2eb0d9840d1d21..4d44c969acdd7b 100644 --- a/tasks/ast_tools/src/derives/get_span.rs +++ b/tasks/ast_tools/src/derives/get_span.rs @@ -5,7 +5,7 @@ use syn::Ident; use crate::{ codegen::LateCtx, schema::{EnumDef, GetGenerics, StructDef, ToType, TypeDef}, - util::ToIdent, + util::{ToIdent, TypeWrapper}, }; use super::{define_derive, Derive, DeriveOutput}; @@ -23,8 +23,19 @@ impl Derive for DeriveGetSpan { let self_type = quote!(&self); let result_type = quote!(Span); let result_expr = quote!(self.span); - - derive(Self::trait_name(), "span", &self_type, &result_type, &result_expr, def) + let unbox = |it| quote!(#it.as_ref()); + let reference = |it| quote!(&#it); + + derive( + Self::trait_name(), + "span", + &self_type, + &result_type, + &result_expr, + def, + unbox, + reference, + ) } fn prelude() -> TokenStream { @@ -50,8 +61,19 @@ impl Derive for DeriveGetSpanMut { let self_type = quote!(&mut self); let result_type = quote!(&mut Span); let result_expr = quote!(&mut self.span); - - derive(Self::trait_name(), "span_mut", &self_type, &result_type, &result_expr, def) + let unbox = |it| quote!(&mut **#it); + let reference = |it| quote!(&mut #it); + + derive( + Self::trait_name(), + "span_mut", + &self_type, + &result_type, + &result_expr, + def, + unbox, + reference, + ) } fn prelude() -> TokenStream { @@ -64,37 +86,60 @@ impl Derive for DeriveGetSpanMut { } } -fn derive( +#[allow(clippy::too_many_arguments)] +fn derive( trait_name: &str, method_name: &str, self_type: &TokenStream, result_type: &TokenStream, result_expr: &TokenStream, def: &TypeDef, -) -> TokenStream { + unbox: U, + reference: R, +) -> TokenStream +where + U: Fn(TokenStream) -> TokenStream, + R: Fn(TokenStream) -> TokenStream, +{ let trait_ident = trait_name.to_ident(); let method_ident = method_name.to_ident(); match &def { - TypeDef::Enum(def) => derive_enum(def, &trait_ident, &method_ident, self_type, result_type), - TypeDef::Struct(def) => { - derive_struct(def, &trait_ident, &method_ident, self_type, result_type, result_expr) + TypeDef::Enum(def) => { + derive_enum(def, &trait_ident, &method_ident, self_type, result_type, unbox) } + TypeDef::Struct(def) => derive_struct( + def, + &trait_ident, + &method_ident, + self_type, + result_type, + result_expr, + reference, + ), } } -fn derive_enum( +fn derive_enum( def: &EnumDef, trait_name: &Ident, method_name: &Ident, self_type: &TokenStream, result_type: &TokenStream, -) -> TokenStream { + unbox: U, +) -> TokenStream +where + U: Fn(TokenStream) -> TokenStream, +{ let target_type = def.to_type(); let generics = def.generics(); let matches = def.all_variants().map(|var| { let ident = var.ident(); - quote!(Self :: #ident(it) => it.#method_name()) + let mut it = quote!(it); + if var.fields.first().is_some_and(|it| it.typ.analysis().wrapper == TypeWrapper::Box) { + it = unbox(it); + } + quote!(Self :: #ident(it) => #trait_name :: #method_name(#it)) }); quote! { @@ -108,21 +153,26 @@ fn derive_enum( } } -fn derive_struct( +fn derive_struct( def: &StructDef, trait_name: &Ident, method_name: &Ident, self_type: &TokenStream, result_type: &TokenStream, result_expr: &TokenStream, -) -> TokenStream { + reference: R, +) -> TokenStream +where + R: Fn(TokenStream) -> TokenStream, +{ let target_type = def.to_type(); let generics = def.generics(); let span_field = def.fields.iter().find(|field| field.markers.span); let result_expr = if let Some(span_field) = span_field { let ident = span_field.name.as_ref().map(ToIdent::to_ident).unwrap(); - quote!(self.#ident.#method_name()) + let reference = reference(quote!(self.#ident)); + quote!(#trait_name :: #method_name (#reference)) } else { result_expr.clone() };