diff --git a/crates/oxc_ast/src/ast/js.rs b/crates/oxc_ast/src/ast/js.rs index 4164bd740628c..8bb7148d8e8fe 100644 --- a/crates/oxc_ast/src/ast/js.rs +++ b/crates/oxc_ast/src/ast/js.rs @@ -34,7 +34,7 @@ use tsify::Tsify; strict_if(self.source_type.is_strict() || self.directives.iter().any(Directive::is_use_strict)), )] #[derive(Debug)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct Program<'a> { @@ -55,7 +55,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum Expression<'a> { @@ -205,7 +205,7 @@ pub use match_expression; /// Fundamental syntactic structure used for naming variables, functions, and properties. It must start with a Unicode letter (including $ and _) and can be followed by Unicode letters, digits, $, or _. #[ast(visit)] #[derive(Debug, Clone, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[serde(tag = "type", rename = "Identifier")] pub struct IdentifierName<'a> { @@ -221,7 +221,7 @@ pub struct IdentifierName<'a> { /// See: [13.1 Identifiers](https://tc39.es/ecma262/#sec-identifiers) #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[serde(tag = "type", rename = "Identifier")] pub struct IdentifierReference<'a> { @@ -251,7 +251,7 @@ pub struct IdentifierReference<'a> { /// See: [13.1 Identifiers](https://tc39.es/ecma262/#sec-identifiers) #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[serde(tag = "type", rename = "Identifier")] pub struct BindingIdentifier<'a> { @@ -276,7 +276,7 @@ pub struct BindingIdentifier<'a> { /// See: [13.1 Identifiers](https://tc39.es/ecma262/#sec-identifiers) #[ast(visit)] #[derive(Debug, Clone, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[serde(tag = "type", rename = "Identifier")] pub struct LabelIdentifier<'a> { @@ -290,7 +290,7 @@ pub struct LabelIdentifier<'a> { /// Represents a `this` expression, which is a reference to the current object. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ThisExpression { @@ -303,7 +303,7 @@ pub struct ThisExpression { /// Represents an array literal, which can include elements, spread elements, or null values. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct ArrayExpression<'a> { @@ -325,7 +325,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[serde(untagged)] pub enum ArrayExpressionElement<'a> { @@ -347,7 +347,7 @@ pub enum ArrayExpressionElement<'a> { /// Serialized as `null` in JSON AST. See `serialize.rs`. #[ast(visit)] #[derive(Debug, Clone, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] pub struct Elision { pub span: Span, } @@ -357,7 +357,7 @@ pub struct Elision { /// Represents an object literal, which can include properties, spread properties, or computed properties and trailing comma. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ObjectExpression<'a> { @@ -372,7 +372,7 @@ pub struct ObjectExpression<'a> { /// Represents a property in an object literal. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum ObjectPropertyKind<'a> { @@ -387,7 +387,7 @@ pub enum ObjectPropertyKind<'a> { /// Represents a property in an object literal. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ObjectProperty<'a> { @@ -410,7 +410,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum PropertyKey<'a> { @@ -426,7 +426,7 @@ pub enum PropertyKey<'a> { /// Represents the kind of property in an object literal or class. #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(rename_all = "camelCase")] pub enum PropertyKind { @@ -443,7 +443,7 @@ pub enum PropertyKind { /// Represents a template literal, which can include quasi elements and expression elements. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TemplateLiteral<'a> { @@ -458,7 +458,7 @@ pub struct TemplateLiteral<'a> { /// Represents a tagged template expression, which can include a tag and a quasi. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TaggedTemplateExpression<'a> { @@ -474,7 +474,7 @@ pub struct TaggedTemplateExpression<'a> { /// Represents a quasi element in a template literal. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TemplateElement<'a> { @@ -487,7 +487,7 @@ pub struct TemplateElement<'a> { /// See [template-strings-cooked-vs-raw](https://exploringjs.com/js/book/ch_template-literals.html#template-strings-cooked-vs-raw) #[ast] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] pub struct TemplateElementValue<'a> { /// A raw interpretation where backslashes do not have special meaning. @@ -506,7 +506,7 @@ pub struct TemplateElementValue<'a> { /// #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum MemberExpression<'a> { @@ -534,7 +534,7 @@ pub use match_member_expression; /// Represents a computed member access expression, which can include an object and an expression. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ComputedMemberExpression<'a> { @@ -550,7 +550,7 @@ pub struct ComputedMemberExpression<'a> { /// Represents a static member access expression, which can include an object and a property. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct StaticMemberExpression<'a> { @@ -566,7 +566,7 @@ pub struct StaticMemberExpression<'a> { /// Represents a private field access expression, which can include an object and a private identifier. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct PrivateFieldExpression<'a> { @@ -595,7 +595,7 @@ pub struct PrivateFieldExpression<'a> { /// ``` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct CallExpression<'a> { @@ -621,7 +621,7 @@ pub struct CallExpression<'a> { /// ``` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct NewExpression<'a> { @@ -637,7 +637,7 @@ pub struct NewExpression<'a> { /// Represents a meta property. The following syntaxes are supported. `import.meta`, `new.target`. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct MetaProperty<'a> { @@ -652,7 +652,7 @@ pub struct MetaProperty<'a> { /// Represents a spread element, which can include an argument. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct SpreadElement<'a> { @@ -670,7 +670,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum Argument<'a> { @@ -686,7 +686,7 @@ pub enum Argument<'a> { /// Represents an update expression, which can include an operator and an argument. The following syntaxes are supported. `++a`, `a++`, `--a`, `a--` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct UpdateExpression<'a> { @@ -702,7 +702,7 @@ pub struct UpdateExpression<'a> { /// Represents a unary expression, which can include an operator and an argument. The following syntaxes are supported. `+a`, `-a`, `~a`, `!a`, `delete a`, `void a`, `typeof a` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct UnaryExpression<'a> { @@ -717,7 +717,7 @@ pub struct UnaryExpression<'a> { /// Represents a binary expression, which can include a left expression, an operator, and a right expression. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct BinaryExpression<'a> { @@ -733,7 +733,7 @@ pub struct BinaryExpression<'a> { /// Represents a private in expression, which can include a private identifier, an operator, and a expression. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct PrivateInExpression<'a> { @@ -749,7 +749,7 @@ pub struct PrivateInExpression<'a> { /// Represents a logical expression, which can include a left expression, an operator, and a right expression. The following syntaxes are supported. `||`, `&&` and `??` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct LogicalExpression<'a> { @@ -765,7 +765,7 @@ pub struct LogicalExpression<'a> { /// Represents a conditional expression, which can include a test, a consequent, and an alternate. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ConditionalExpression<'a> { @@ -781,7 +781,7 @@ pub struct ConditionalExpression<'a> { /// Represents an assignment expression, which can include an operator, a target, and a expression. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct AssignmentExpression<'a> { @@ -801,7 +801,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum AssignmentTarget<'a> { @@ -820,7 +820,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum SimpleAssignmentTarget<'a> { @@ -875,7 +875,7 @@ pub use match_simple_assignment_target; #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum AssignmentTargetPattern<'a> { @@ -897,7 +897,7 @@ pub use match_assignment_target_pattern; /// Represents an array assignment target, which can include elements and a rest element. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Tsify))] #[serde(tag = "type")] pub struct ArrayAssignmentTarget<'a> { @@ -916,7 +916,7 @@ pub struct ArrayAssignmentTarget<'a> { /// Represents an object assignment target, which can include properties and a rest element. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Tsify))] #[serde(tag = "type")] pub struct ObjectAssignmentTarget<'a> { @@ -933,7 +933,7 @@ pub struct ObjectAssignmentTarget<'a> { /// Represents a rest element in an array assignment target, which can include a target. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[serde(tag = "type", rename = "RestElement")] pub struct AssignmentTargetRest<'a> { @@ -951,7 +951,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum AssignmentTargetMaybeDefault<'a> { @@ -963,7 +963,7 @@ pub enum AssignmentTargetMaybeDefault<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct AssignmentTargetWithDefault<'a> { @@ -975,7 +975,7 @@ pub struct AssignmentTargetWithDefault<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum AssignmentTargetProperty<'a> { @@ -988,7 +988,7 @@ pub enum AssignmentTargetProperty<'a> { /// Represents an assignment target property identifier, which can include a binding and an init expression. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct AssignmentTargetPropertyIdentifier<'a> { @@ -1003,7 +1003,7 @@ pub struct AssignmentTargetPropertyIdentifier<'a> { /// Represents an assignment target property property, which can include a name and a binding. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct AssignmentTargetPropertyProperty<'a> { @@ -1018,7 +1018,7 @@ pub struct AssignmentTargetPropertyProperty<'a> { /// Represents a sequence expression, which can include expressions. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct SequenceExpression<'a> { @@ -1032,7 +1032,7 @@ pub struct SequenceExpression<'a> { /// Represents a super expression. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct Super { @@ -1045,7 +1045,7 @@ pub struct Super { /// Represents an await expression, which can include an argument. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct AwaitExpression<'a> { @@ -1059,7 +1059,7 @@ pub struct AwaitExpression<'a> { /// Represents a chain expression, which can include an expression. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ChainExpression<'a> { @@ -1076,7 +1076,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum ChainElement<'a> { @@ -1091,7 +1091,7 @@ pub enum ChainElement<'a> { /// Represents a parenthesized expression, which can include an expression. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ParenthesizedExpression<'a> { @@ -1109,7 +1109,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum Statement<'a> { @@ -1144,7 +1144,7 @@ pub enum Statement<'a> { /// Represents a directive statement, which can include a string literal. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct Directive<'a> { @@ -1161,7 +1161,7 @@ pub struct Directive<'a> { /// Represents a hashbang directive, which can include a value. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct Hashbang<'a> { @@ -1176,7 +1176,7 @@ pub struct Hashbang<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct BlockStatement<'a> { @@ -1189,7 +1189,7 @@ pub struct BlockStatement<'a> { /// Declarations and the Variable Statement #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum Declaration<'a> { @@ -1228,7 +1228,7 @@ pub use match_declaration; /// Represents a variable declaration, which can include a kind, declarations, and modifiers. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct VariableDeclaration<'a> { @@ -1241,7 +1241,7 @@ pub struct VariableDeclaration<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(rename_all = "camelCase")] pub enum VariableDeclarationKind { @@ -1252,7 +1252,7 @@ pub enum VariableDeclarationKind { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct VariableDeclarator<'a> { @@ -1269,7 +1269,7 @@ pub struct VariableDeclarator<'a> { /// * #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct UsingDeclaration<'a> { @@ -1283,7 +1283,7 @@ pub struct UsingDeclaration<'a> { /// Empty Statement #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct EmptyStatement { @@ -1294,7 +1294,7 @@ pub struct EmptyStatement { /// Expression Statement #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ExpressionStatement<'a> { @@ -1306,7 +1306,7 @@ pub struct ExpressionStatement<'a> { /// If Statement #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct IfStatement<'a> { @@ -1320,7 +1320,7 @@ pub struct IfStatement<'a> { /// Do-While Statement #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct DoWhileStatement<'a> { @@ -1333,7 +1333,7 @@ pub struct DoWhileStatement<'a> { /// While Statement #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct WhileStatement<'a> { @@ -1347,7 +1347,7 @@ pub struct WhileStatement<'a> { #[ast(visit)] #[scope(if(self.init.as_ref().is_some_and(ForStatementInit::is_lexical_declaration)))] #[derive(Debug)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ForStatement<'a> { @@ -1368,7 +1368,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum ForStatementInit<'a> { @@ -1383,7 +1383,7 @@ pub enum ForStatementInit<'a> { #[ast(visit)] #[scope(if(self.left.is_lexical_declaration()))] #[derive(Debug)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ForInStatement<'a> { @@ -1403,7 +1403,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum ForStatementLeft<'a> { @@ -1417,7 +1417,7 @@ pub enum ForStatementLeft<'a> { #[ast(visit)] #[scope(if(self.left.is_lexical_declaration()))] #[derive(Debug)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ForOfStatement<'a> { @@ -1433,7 +1433,7 @@ pub struct ForOfStatement<'a> { /// Continue Statement #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ContinueStatement<'a> { @@ -1445,7 +1445,7 @@ pub struct ContinueStatement<'a> { /// Break Statement #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct BreakStatement<'a> { @@ -1457,7 +1457,7 @@ pub struct BreakStatement<'a> { /// Return Statement #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ReturnStatement<'a> { @@ -1469,7 +1469,7 @@ pub struct ReturnStatement<'a> { /// With Statement #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct WithStatement<'a> { @@ -1483,7 +1483,7 @@ pub struct WithStatement<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct SwitchStatement<'a> { @@ -1497,7 +1497,7 @@ pub struct SwitchStatement<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct SwitchCase<'a> { @@ -1510,7 +1510,7 @@ pub struct SwitchCase<'a> { /// Labelled Statement #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct LabeledStatement<'a> { @@ -1523,7 +1523,7 @@ pub struct LabeledStatement<'a> { /// Throw Statement #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ThrowStatement<'a> { @@ -1535,7 +1535,7 @@ pub struct ThrowStatement<'a> { /// Try Statement #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TryStatement<'a> { @@ -1550,7 +1550,7 @@ pub struct TryStatement<'a> { #[ast(visit)] #[scope(flags(ScopeFlags::CatchClause), if(self.param.is_some()))] #[derive(Debug)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct CatchClause<'a> { @@ -1563,7 +1563,7 @@ pub struct CatchClause<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct CatchParameter<'a> { @@ -1575,7 +1575,7 @@ pub struct CatchParameter<'a> { /// Debugger Statement #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct DebuggerStatement { @@ -1587,7 +1587,7 @@ pub struct DebuggerStatement { /// * #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(rename_all = "camelCase")] pub struct BindingPattern<'a> { @@ -1602,7 +1602,7 @@ pub struct BindingPattern<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum BindingPatternKind<'a> { @@ -1621,7 +1621,7 @@ pub enum BindingPatternKind<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct AssignmentPattern<'a> { @@ -1634,7 +1634,7 @@ pub struct AssignmentPattern<'a> { // See serializer in serialize.rs #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Tsify))] #[serde(tag = "type")] pub struct ObjectPattern<'a> { @@ -1648,7 +1648,7 @@ pub struct ObjectPattern<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct BindingProperty<'a> { @@ -1663,7 +1663,7 @@ pub struct BindingProperty<'a> { // See serializer in serialize.rs #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Tsify))] #[serde(tag = "type")] pub struct ArrayPattern<'a> { @@ -1677,7 +1677,7 @@ pub struct ArrayPattern<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[serde(tag = "type", rename = "RestElement")] pub struct BindingRestElement<'a> { @@ -1694,7 +1694,7 @@ pub struct BindingRestElement<'a> { strict_if(self.is_strict()), )] #[derive(Debug)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(rename_all = "camelCase")] pub struct Function<'a> { @@ -1730,7 +1730,7 @@ pub struct Function<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] pub enum FunctionType { FunctionDeclaration = 0, @@ -1744,7 +1744,7 @@ pub enum FunctionType { // See serializer in serialize.rs #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Tsify))] #[serde(tag = "type")] pub struct FormalParameters<'a> { @@ -1759,7 +1759,7 @@ pub struct FormalParameters<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct FormalParameter<'a> { @@ -1774,7 +1774,7 @@ pub struct FormalParameter<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] pub enum FormalParameterKind { /// @@ -1790,7 +1790,7 @@ pub enum FormalParameterKind { /// #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct FunctionBody<'a> { @@ -1807,7 +1807,7 @@ pub struct FunctionBody<'a> { strict_if(self.body.has_use_strict_directive()), )] #[derive(Debug)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct ArrowFunctionExpression<'a> { @@ -1827,7 +1827,7 @@ pub struct ArrowFunctionExpression<'a> { /// Generator Function Definitions #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct YieldExpression<'a> { @@ -1841,7 +1841,7 @@ pub struct YieldExpression<'a> { #[ast(visit)] #[scope(flags(ScopeFlags::StrictMode))] #[derive(Debug)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(rename_all = "camelCase")] pub struct Class<'a> { @@ -1912,7 +1912,7 @@ pub struct Class<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] pub enum ClassType { /// Class declaration statement @@ -1930,7 +1930,7 @@ pub enum ClassType { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ClassBody<'a> { @@ -1959,7 +1959,7 @@ pub struct ClassBody<'a> { /// ``` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum ClassElement<'a> { @@ -1983,7 +1983,7 @@ pub enum ClassElement<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(rename_all = "camelCase")] pub struct MethodDefinition<'a> { @@ -2012,7 +2012,7 @@ pub struct MethodDefinition<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] pub enum MethodDefinitionType { MethodDefinition = 0, @@ -2021,7 +2021,7 @@ pub enum MethodDefinitionType { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(rename_all = "camelCase")] pub struct PropertyDefinition<'a> { @@ -2103,7 +2103,7 @@ pub struct PropertyDefinition<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] pub enum PropertyDefinitionType { PropertyDefinition = 0, @@ -2112,7 +2112,7 @@ pub enum PropertyDefinitionType { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(rename_all = "camelCase")] pub enum MethodDefinitionKind { @@ -2131,7 +2131,7 @@ pub enum MethodDefinitionKind { /// See: [MDN - Private class fields](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields) #[ast(visit)] #[derive(Debug, Clone, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct PrivateIdentifier<'a> { @@ -2156,7 +2156,7 @@ pub struct PrivateIdentifier<'a> { #[ast(visit)] #[scope(flags(ScopeFlags::ClassStaticBlock))] #[derive(Debug)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct StaticBlock<'a> { @@ -2191,7 +2191,7 @@ pub struct StaticBlock<'a> { /// ``` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum ModuleDeclaration<'a> { @@ -2228,7 +2228,7 @@ pub use match_module_declaration; #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] pub enum AccessorPropertyType { AccessorProperty = 0, @@ -2245,7 +2245,7 @@ pub enum AccessorPropertyType { /// ``` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] pub struct AccessorProperty<'a> { pub r#type: AccessorPropertyType, @@ -2265,7 +2265,7 @@ pub struct AccessorProperty<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ImportExpression<'a> { @@ -2277,7 +2277,7 @@ pub struct ImportExpression<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct ImportDeclaration<'a> { @@ -2294,7 +2294,7 @@ pub struct ImportDeclaration<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum ImportDeclarationSpecifier<'a> { @@ -2311,7 +2311,7 @@ pub enum ImportDeclarationSpecifier<'a> { // import {imported as local} from "source" #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct ImportSpecifier<'a> { @@ -2342,7 +2342,7 @@ pub struct ImportSpecifier<'a> { /// #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ImportDefaultSpecifier<'a> { @@ -2360,7 +2360,7 @@ pub struct ImportDefaultSpecifier<'a> { /// ``` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ImportNamespaceSpecifier<'a> { @@ -2371,7 +2371,7 @@ pub struct ImportNamespaceSpecifier<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct WithClause<'a> { @@ -2383,7 +2383,7 @@ pub struct WithClause<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ImportAttribute<'a> { @@ -2395,7 +2395,7 @@ pub struct ImportAttribute<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum ImportAttributeKey<'a> { @@ -2416,7 +2416,7 @@ pub enum ImportAttributeKey<'a> { /// ``` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct ExportNamedDeclaration<'a> { @@ -2442,7 +2442,7 @@ pub struct ExportNamedDeclaration<'a> { /// ``` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct ExportDefaultDeclaration<'a> { @@ -2463,7 +2463,7 @@ pub struct ExportDefaultDeclaration<'a> { /// ``` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct ExportAllDeclaration<'a> { @@ -2490,7 +2490,7 @@ pub struct ExportAllDeclaration<'a> { /// ``` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct ExportSpecifier<'a> { @@ -2509,7 +2509,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum ExportDefaultDeclarationKind<'a> { @@ -2533,7 +2533,7 @@ pub enum ExportDefaultDeclarationKind<'a> { /// * #[ast(visit)] #[derive(Debug, Clone, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum ModuleExportName<'a> { diff --git a/crates/oxc_ast/src/ast/jsx.rs b/crates/oxc_ast/src/ast/jsx.rs index 589cb44b063ef..a9ab6b2513d58 100644 --- a/crates/oxc_ast/src/ast/jsx.rs +++ b/crates/oxc_ast/src/ast/jsx.rs @@ -38,7 +38,7 @@ use super::{inherit_variants, js::*, literal::*, ts::*}; /// See: [JSX Syntax](https://facebook.github.io/jsx/) #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct JSXElement<'a> { @@ -66,7 +66,7 @@ pub struct JSXElement<'a> { /// ``` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct JSXOpeningElement<'a> { @@ -92,7 +92,7 @@ pub struct JSXOpeningElement<'a> { /// Closing tag in a [`JSXElement`]. Not all JSX elements have a closing tag. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct JSXClosingElement<'a> { @@ -111,7 +111,7 @@ pub struct JSXClosingElement<'a> { /// See: [`React.Fragment`](https://react.dev/reference/react/Fragment) #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct JSXFragment<'a> { @@ -125,7 +125,7 @@ pub struct JSXFragment<'a> { /// JSX Opening Fragment (`<>`) #[ast] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct JSXOpeningFragment { @@ -136,7 +136,7 @@ pub struct JSXOpeningFragment { /// JSX Closing Fragment (``) #[ast] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct JSXClosingFragment { @@ -147,7 +147,7 @@ pub struct JSXClosingFragment { /// JSX Element Name #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum JSXElementName<'a> { @@ -168,7 +168,7 @@ pub enum JSXElementName<'a> { /// ``` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct JSXNamespacedName<'a> { @@ -197,7 +197,7 @@ pub struct JSXNamespacedName<'a> { /// [`member expression`]: JSXMemberExpressionObject::MemberExpression #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct JSXMemberExpression<'a> { @@ -211,7 +211,7 @@ pub struct JSXMemberExpression<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum JSXMemberExpressionObject<'a> { @@ -234,7 +234,7 @@ pub enum JSXMemberExpressionObject<'a> { /// ``` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct JSXExpressionContainer<'a> { @@ -252,7 +252,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum JSXExpression<'a> { @@ -265,7 +265,7 @@ pub enum JSXExpression<'a> { /// An empty JSX expression (`{}`) #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct JSXEmptyExpression { @@ -278,7 +278,7 @@ pub struct JSXEmptyExpression { /// JSX Attributes #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum JSXAttributeItem<'a> { @@ -295,7 +295,7 @@ pub enum JSXAttributeItem<'a> { /// // name ^^^ ^^^^ value #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct JSXAttribute<'a> { @@ -314,7 +314,7 @@ pub struct JSXAttribute<'a> { /// ``` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct JSXSpreadAttribute<'a> { @@ -328,7 +328,7 @@ pub struct JSXSpreadAttribute<'a> { /// Part of a [`JSXAttribute`]. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum JSXAttributeName<'a> { @@ -341,7 +341,7 @@ pub enum JSXAttributeName<'a> { /// Part of a [`JSXAttribute`]. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum JSXAttributeValue<'a> { @@ -358,7 +358,7 @@ pub enum JSXAttributeValue<'a> { /// [`IdentifierName`]: super::IdentifierName #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct JSXIdentifier<'a> { @@ -374,7 +374,7 @@ pub struct JSXIdentifier<'a> { /// Part of a [`JSXElement`]. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum JSXChild<'a> { @@ -395,7 +395,7 @@ pub enum JSXChild<'a> { /// Variant of [`JSXChild`] that represents an object spread (`{...expression}`). #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct JSXSpreadChild<'a> { @@ -416,7 +416,7 @@ pub struct JSXSpreadChild<'a> { /// ``` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct JSXText<'a> { diff --git a/crates/oxc_ast/src/ast/literal.rs b/crates/oxc_ast/src/ast/literal.rs index 5fe2a70fc697a..f68aeac0530ee 100644 --- a/crates/oxc_ast/src/ast/literal.rs +++ b/crates/oxc_ast/src/ast/literal.rs @@ -23,7 +23,7 @@ use tsify::Tsify; /// #[ast(visit)] #[derive(Debug, Clone, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct BooleanLiteral { @@ -37,7 +37,7 @@ pub struct BooleanLiteral { /// #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct NullLiteral { @@ -50,7 +50,7 @@ pub struct NullLiteral { /// #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct NumericLiteral<'a> { @@ -68,7 +68,7 @@ pub struct NumericLiteral<'a> { /// BigInt literal #[ast(visit)] #[derive(Debug, Clone, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct BigIntLiteral<'a> { @@ -86,7 +86,7 @@ pub struct BigIntLiteral<'a> { /// #[ast(visit)] #[derive(Debug, Clone, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct RegExpLiteral<'a> { @@ -103,7 +103,7 @@ pub struct RegExpLiteral<'a> { /// #[ast] #[derive(Debug, Clone, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] pub struct RegExp<'a> { /// The regex pattern between the slashes @@ -114,7 +114,7 @@ pub struct RegExp<'a> { #[ast] #[derive(Debug, Clone, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] pub struct EmptyObject; @@ -123,7 +123,7 @@ pub struct EmptyObject; /// #[ast(visit)] #[derive(Debug, Clone, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct StringLiteral<'a> { diff --git a/crates/oxc_ast/src/ast/ts.rs b/crates/oxc_ast/src/ast/ts.rs index 8090fcca9b0a5..f82470536ad63 100644 --- a/crates/oxc_ast/src/ast/ts.rs +++ b/crates/oxc_ast/src/ast/ts.rs @@ -35,7 +35,7 @@ export interface TSIndexSignatureName extends Span { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSThisParameter<'a> { @@ -65,7 +65,7 @@ pub struct TSThisParameter<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSEnumDeclaration<'a> { @@ -94,7 +94,7 @@ pub struct TSEnumDeclaration<'a> { /// ``` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSEnumMember<'a> { @@ -112,7 +112,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum TSEnumMemberName<'a> { @@ -141,7 +141,7 @@ pub enum TSEnumMemberName<'a> { /// ``` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTypeAnnotation<'a> { @@ -167,7 +167,7 @@ pub struct TSTypeAnnotation<'a> { /// ``` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSLiteralType<'a> { @@ -178,7 +178,7 @@ pub struct TSLiteralType<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged, rename_all = "camelCase")] pub enum TSLiteral<'a> { @@ -198,7 +198,7 @@ pub enum TSLiteral<'a> { /// expressions. #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged, rename_all = "camelCase")] pub enum TSType<'a> { @@ -303,7 +303,7 @@ pub use match_ts_type; #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSConditionalType<'a> { @@ -327,7 +327,7 @@ pub struct TSConditionalType<'a> { /// #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSUnionType<'a> { @@ -341,7 +341,7 @@ pub struct TSUnionType<'a> { /// #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSIntersectionType<'a> { @@ -352,7 +352,7 @@ pub struct TSIntersectionType<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSParenthesizedType<'a> { @@ -371,7 +371,7 @@ pub struct TSParenthesizedType<'a> { /// #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTypeOperator<'a> { @@ -383,7 +383,7 @@ pub struct TSTypeOperator<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(rename_all = "camelCase")] pub enum TSTypeOperatorOperator { @@ -405,7 +405,7 @@ pub enum TSTypeOperatorOperator { /// #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSArrayType<'a> { @@ -427,7 +427,7 @@ pub struct TSArrayType<'a> { /// #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSIndexedAccessType<'a> { @@ -448,7 +448,7 @@ pub struct TSIndexedAccessType<'a> { /// #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTupleType<'a> { @@ -459,7 +459,7 @@ pub struct TSTupleType<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSNamedTupleMember<'a> { @@ -472,7 +472,7 @@ pub struct TSNamedTupleMember<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSOptionalType<'a> { @@ -483,7 +483,7 @@ pub struct TSOptionalType<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSRestType<'a> { @@ -502,7 +502,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged, rename_all = "camelCase")] pub enum TSTupleElement<'a> { @@ -517,7 +517,7 @@ pub enum TSTupleElement<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSAnyKeyword { @@ -527,7 +527,7 @@ pub struct TSAnyKeyword { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSStringKeyword { @@ -537,7 +537,7 @@ pub struct TSStringKeyword { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSBooleanKeyword { @@ -547,7 +547,7 @@ pub struct TSBooleanKeyword { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSNumberKeyword { @@ -557,7 +557,7 @@ pub struct TSNumberKeyword { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSNeverKeyword { @@ -568,7 +568,7 @@ pub struct TSNeverKeyword { /// `type Uppercase = intrinsic;` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSIntrinsicKeyword { @@ -578,7 +578,7 @@ pub struct TSIntrinsicKeyword { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSUnknownKeyword { @@ -588,7 +588,7 @@ pub struct TSUnknownKeyword { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSNullKeyword { @@ -598,7 +598,7 @@ pub struct TSNullKeyword { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSUndefinedKeyword { @@ -608,7 +608,7 @@ pub struct TSUndefinedKeyword { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSVoidKeyword { @@ -618,7 +618,7 @@ pub struct TSVoidKeyword { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSSymbolKeyword { @@ -628,7 +628,7 @@ pub struct TSSymbolKeyword { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSThisType { @@ -638,7 +638,7 @@ pub struct TSThisType { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSObjectKeyword { @@ -648,7 +648,7 @@ pub struct TSObjectKeyword { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type")] pub struct TSBigIntKeyword { @@ -661,7 +661,7 @@ pub struct TSBigIntKeyword { /// type E = D.c.b.a; #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTypeReference<'a> { @@ -676,7 +676,7 @@ pub struct TSTypeReference<'a> { /// NamespaceName . IdentifierReference #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum TSTypeName<'a> { @@ -695,7 +695,7 @@ pub use match_ts_type_name; #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSQualifiedName<'a> { @@ -707,7 +707,7 @@ pub struct TSQualifiedName<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTypeParameterInstantiation<'a> { @@ -718,7 +718,7 @@ pub struct TSTypeParameterInstantiation<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTypeParameter<'a> { @@ -734,7 +734,7 @@ pub struct TSTypeParameter<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTypeParameterDeclaration<'a> { @@ -746,7 +746,7 @@ pub struct TSTypeParameterDeclaration<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTypeAliasDeclaration<'a> { @@ -762,7 +762,7 @@ pub struct TSTypeAliasDeclaration<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(rename_all = "camelCase")] pub enum TSAccessibility { @@ -773,7 +773,7 @@ pub enum TSAccessibility { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSClassImplements<'a> { @@ -789,7 +789,7 @@ pub struct TSClassImplements<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSInterfaceDeclaration<'a> { @@ -807,7 +807,7 @@ pub struct TSInterfaceDeclaration<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSInterfaceBody<'a> { @@ -818,7 +818,7 @@ pub struct TSInterfaceBody<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSPropertySignature<'a> { @@ -833,7 +833,7 @@ pub struct TSPropertySignature<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged, rename_all = "camelCase")] pub enum TSSignature<'a> { @@ -857,7 +857,7 @@ pub enum TSSignature<'a> { /// ``` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSIndexSignature<'a> { @@ -870,7 +870,7 @@ pub struct TSIndexSignature<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSCallSignatureDeclaration<'a> { @@ -884,7 +884,7 @@ pub struct TSCallSignatureDeclaration<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(rename_all = "camelCase")] pub enum TSMethodSignatureKind { @@ -896,7 +896,7 @@ pub enum TSMethodSignatureKind { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSMethodSignature<'a> { @@ -916,7 +916,7 @@ pub struct TSMethodSignature<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSConstructSignatureDeclaration<'a> { @@ -930,7 +930,7 @@ pub struct TSConstructSignatureDeclaration<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[serde(tag = "type", rename = "Identifier", rename_all = "camelCase")] pub struct TSIndexSignatureName<'a> { @@ -942,7 +942,7 @@ pub struct TSIndexSignatureName<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSInterfaceHeritage<'a> { @@ -954,7 +954,7 @@ pub struct TSInterfaceHeritage<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTypePredicate<'a> { @@ -967,7 +967,7 @@ pub struct TSTypePredicate<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged, rename_all = "camelCase")] pub enum TSTypePredicateName<'a> { @@ -981,7 +981,7 @@ pub enum TSTypePredicateName<'a> { strict_if(self.body.as_ref().is_some_and(TSModuleDeclarationBody::is_strict)), )] #[derive(Debug)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSModuleDeclaration<'a> { @@ -1006,7 +1006,7 @@ pub struct TSModuleDeclaration<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(rename_all = "camelCase")] pub enum TSModuleDeclarationKind { @@ -1023,7 +1023,7 @@ impl TSModuleDeclarationKind { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum TSModuleDeclarationName<'a> { @@ -1033,7 +1033,7 @@ pub enum TSModuleDeclarationName<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum TSModuleDeclarationBody<'a> { @@ -1044,7 +1044,7 @@ pub enum TSModuleDeclarationBody<'a> { // See serializer in serialize.rs #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSModuleBlock<'a> { @@ -1057,7 +1057,7 @@ pub struct TSModuleBlock<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTypeLiteral<'a> { @@ -1068,7 +1068,7 @@ pub struct TSTypeLiteral<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSInferType<'a> { @@ -1079,7 +1079,7 @@ pub struct TSInferType<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTypeQuery<'a> { @@ -1097,7 +1097,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum TSTypeQueryExprName<'a> { @@ -1109,7 +1109,7 @@ pub enum TSTypeQueryExprName<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSImportType<'a> { @@ -1124,7 +1124,7 @@ pub struct TSImportType<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSImportAttributes<'a> { @@ -1136,7 +1136,7 @@ pub struct TSImportAttributes<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSImportAttribute<'a> { @@ -1148,7 +1148,7 @@ pub struct TSImportAttribute<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum TSImportAttributeName<'a> { @@ -1158,7 +1158,7 @@ pub enum TSImportAttributeName<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSFunctionType<'a> { @@ -1172,7 +1172,7 @@ pub struct TSFunctionType<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSConstructorType<'a> { @@ -1187,7 +1187,7 @@ pub struct TSConstructorType<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSMappedType<'a> { @@ -1203,7 +1203,7 @@ pub struct TSMappedType<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(rename_all = "camelCase")] pub enum TSMappedTypeModifierOperator { @@ -1217,7 +1217,7 @@ pub enum TSMappedTypeModifierOperator { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTemplateLiteralType<'a> { @@ -1229,7 +1229,7 @@ pub struct TSTemplateLiteralType<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSAsExpression<'a> { @@ -1241,7 +1241,7 @@ pub struct TSAsExpression<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSSatisfiesExpression<'a> { @@ -1253,7 +1253,7 @@ pub struct TSSatisfiesExpression<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSTypeAssertion<'a> { @@ -1265,7 +1265,7 @@ pub struct TSTypeAssertion<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSImportEqualsDeclaration<'a> { @@ -1284,7 +1284,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged, rename_all = "camelCase")] pub enum TSModuleReference<'a> { @@ -1296,7 +1296,7 @@ pub enum TSModuleReference<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSExternalModuleReference<'a> { @@ -1307,7 +1307,7 @@ pub struct TSExternalModuleReference<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSNonNullExpression<'a> { @@ -1342,7 +1342,7 @@ pub struct TSNonNullExpression<'a> { /// [`CallExpression`]: crate::ast::js::CallExpression #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct Decorator<'a> { @@ -1356,7 +1356,7 @@ pub struct Decorator<'a> { /// `export = foo` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSExportAssignment<'a> { @@ -1370,7 +1370,7 @@ pub struct TSExportAssignment<'a> { /// `export as namespace foo` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSNamespaceExportDeclaration<'a> { @@ -1381,7 +1381,7 @@ pub struct TSNamespaceExportDeclaration<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct TSInstantiationExpression<'a> { @@ -1394,7 +1394,7 @@ pub struct TSInstantiationExpression<'a> { /// See [TypeScript - Type-Only Imports and Exports](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html) #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(rename_all = "camelCase")] pub enum ImportOrExportKind { @@ -1409,7 +1409,7 @@ pub enum ImportOrExportKind { /// `type foo = ty?` or `type foo = ?ty` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct JSDocNullableType<'a> { @@ -1423,7 +1423,7 @@ pub struct JSDocNullableType<'a> { /// `type foo = ty!` or `type foo = !ty` #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct JSDocNonNullableType<'a> { @@ -1435,7 +1435,7 @@ pub struct JSDocNonNullableType<'a> { #[ast(visit)] #[derive(Debug, Hash)] -#[generate_derive(CloneIn)] +#[generate_derive(CloneIn, GetSpan, GetSpanMut)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(tag = "type", rename_all = "camelCase")] pub struct JSDocUnknownType { diff --git a/crates/oxc_ast/src/generated/derive_clone_in.rs b/crates/oxc_ast/src/generated/derive_clone_in.rs index 98cce94db102f..069a0c4bcbfb1 100644 --- a/crates/oxc_ast/src/generated/derive_clone_in.rs +++ b/crates/oxc_ast/src/generated/derive_clone_in.rs @@ -92,67 +92,65 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for Expression<'old_alloc> { type Cloned = Expression<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::BooleanLiteral(it) => Self::Cloned::BooleanLiteral(it.clone_in(alloc)), - Self::NullLiteral(it) => Self::Cloned::NullLiteral(it.clone_in(alloc)), - Self::NumericLiteral(it) => Self::Cloned::NumericLiteral(it.clone_in(alloc)), - Self::BigIntLiteral(it) => Self::Cloned::BigIntLiteral(it.clone_in(alloc)), - Self::RegExpLiteral(it) => Self::Cloned::RegExpLiteral(it.clone_in(alloc)), - Self::StringLiteral(it) => Self::Cloned::StringLiteral(it.clone_in(alloc)), - Self::TemplateLiteral(it) => Self::Cloned::TemplateLiteral(it.clone_in(alloc)), - Self::Identifier(it) => Self::Cloned::Identifier(it.clone_in(alloc)), - Self::MetaProperty(it) => Self::Cloned::MetaProperty(it.clone_in(alloc)), - Self::Super(it) => Self::Cloned::Super(it.clone_in(alloc)), - Self::ArrayExpression(it) => Self::Cloned::ArrayExpression(it.clone_in(alloc)), + Self::BooleanLiteral(it) => Expression::BooleanLiteral(it.clone_in(alloc)), + Self::NullLiteral(it) => Expression::NullLiteral(it.clone_in(alloc)), + Self::NumericLiteral(it) => Expression::NumericLiteral(it.clone_in(alloc)), + Self::BigIntLiteral(it) => Expression::BigIntLiteral(it.clone_in(alloc)), + Self::RegExpLiteral(it) => Expression::RegExpLiteral(it.clone_in(alloc)), + Self::StringLiteral(it) => Expression::StringLiteral(it.clone_in(alloc)), + Self::TemplateLiteral(it) => Expression::TemplateLiteral(it.clone_in(alloc)), + Self::Identifier(it) => Expression::Identifier(it.clone_in(alloc)), + Self::MetaProperty(it) => Expression::MetaProperty(it.clone_in(alloc)), + Self::Super(it) => Expression::Super(it.clone_in(alloc)), + Self::ArrayExpression(it) => Expression::ArrayExpression(it.clone_in(alloc)), Self::ArrowFunctionExpression(it) => { - Self::Cloned::ArrowFunctionExpression(it.clone_in(alloc)) - } - Self::AssignmentExpression(it) => { - Self::Cloned::AssignmentExpression(it.clone_in(alloc)) - } - Self::AwaitExpression(it) => Self::Cloned::AwaitExpression(it.clone_in(alloc)), - Self::BinaryExpression(it) => Self::Cloned::BinaryExpression(it.clone_in(alloc)), - Self::CallExpression(it) => Self::Cloned::CallExpression(it.clone_in(alloc)), - Self::ChainExpression(it) => Self::Cloned::ChainExpression(it.clone_in(alloc)), - Self::ClassExpression(it) => Self::Cloned::ClassExpression(it.clone_in(alloc)), + Expression::ArrowFunctionExpression(it.clone_in(alloc)) + } + Self::AssignmentExpression(it) => Expression::AssignmentExpression(it.clone_in(alloc)), + Self::AwaitExpression(it) => Expression::AwaitExpression(it.clone_in(alloc)), + Self::BinaryExpression(it) => Expression::BinaryExpression(it.clone_in(alloc)), + Self::CallExpression(it) => Expression::CallExpression(it.clone_in(alloc)), + Self::ChainExpression(it) => Expression::ChainExpression(it.clone_in(alloc)), + Self::ClassExpression(it) => Expression::ClassExpression(it.clone_in(alloc)), Self::ConditionalExpression(it) => { - Self::Cloned::ConditionalExpression(it.clone_in(alloc)) + Expression::ConditionalExpression(it.clone_in(alloc)) } - Self::FunctionExpression(it) => Self::Cloned::FunctionExpression(it.clone_in(alloc)), - Self::ImportExpression(it) => Self::Cloned::ImportExpression(it.clone_in(alloc)), - Self::LogicalExpression(it) => Self::Cloned::LogicalExpression(it.clone_in(alloc)), - Self::NewExpression(it) => Self::Cloned::NewExpression(it.clone_in(alloc)), - Self::ObjectExpression(it) => Self::Cloned::ObjectExpression(it.clone_in(alloc)), + Self::FunctionExpression(it) => Expression::FunctionExpression(it.clone_in(alloc)), + Self::ImportExpression(it) => Expression::ImportExpression(it.clone_in(alloc)), + Self::LogicalExpression(it) => Expression::LogicalExpression(it.clone_in(alloc)), + Self::NewExpression(it) => Expression::NewExpression(it.clone_in(alloc)), + Self::ObjectExpression(it) => Expression::ObjectExpression(it.clone_in(alloc)), Self::ParenthesizedExpression(it) => { - Self::Cloned::ParenthesizedExpression(it.clone_in(alloc)) + Expression::ParenthesizedExpression(it.clone_in(alloc)) } - Self::SequenceExpression(it) => Self::Cloned::SequenceExpression(it.clone_in(alloc)), + Self::SequenceExpression(it) => Expression::SequenceExpression(it.clone_in(alloc)), Self::TaggedTemplateExpression(it) => { - Self::Cloned::TaggedTemplateExpression(it.clone_in(alloc)) - } - Self::ThisExpression(it) => Self::Cloned::ThisExpression(it.clone_in(alloc)), - Self::UnaryExpression(it) => Self::Cloned::UnaryExpression(it.clone_in(alloc)), - Self::UpdateExpression(it) => Self::Cloned::UpdateExpression(it.clone_in(alloc)), - Self::YieldExpression(it) => Self::Cloned::YieldExpression(it.clone_in(alloc)), - Self::PrivateInExpression(it) => Self::Cloned::PrivateInExpression(it.clone_in(alloc)), - Self::JSXElement(it) => Self::Cloned::JSXElement(it.clone_in(alloc)), - Self::JSXFragment(it) => Self::Cloned::JSXFragment(it.clone_in(alloc)), - Self::TSAsExpression(it) => Self::Cloned::TSAsExpression(it.clone_in(alloc)), + Expression::TaggedTemplateExpression(it.clone_in(alloc)) + } + Self::ThisExpression(it) => Expression::ThisExpression(it.clone_in(alloc)), + Self::UnaryExpression(it) => Expression::UnaryExpression(it.clone_in(alloc)), + Self::UpdateExpression(it) => Expression::UpdateExpression(it.clone_in(alloc)), + Self::YieldExpression(it) => Expression::YieldExpression(it.clone_in(alloc)), + Self::PrivateInExpression(it) => Expression::PrivateInExpression(it.clone_in(alloc)), + Self::JSXElement(it) => Expression::JSXElement(it.clone_in(alloc)), + Self::JSXFragment(it) => Expression::JSXFragment(it.clone_in(alloc)), + Self::TSAsExpression(it) => Expression::TSAsExpression(it.clone_in(alloc)), Self::TSSatisfiesExpression(it) => { - Self::Cloned::TSSatisfiesExpression(it.clone_in(alloc)) + Expression::TSSatisfiesExpression(it.clone_in(alloc)) } - Self::TSTypeAssertion(it) => Self::Cloned::TSTypeAssertion(it.clone_in(alloc)), - Self::TSNonNullExpression(it) => Self::Cloned::TSNonNullExpression(it.clone_in(alloc)), + Self::TSTypeAssertion(it) => Expression::TSTypeAssertion(it.clone_in(alloc)), + Self::TSNonNullExpression(it) => Expression::TSNonNullExpression(it.clone_in(alloc)), Self::TSInstantiationExpression(it) => { - Self::Cloned::TSInstantiationExpression(it.clone_in(alloc)) + Expression::TSInstantiationExpression(it.clone_in(alloc)) } Self::ComputedMemberExpression(it) => { - Self::Cloned::ComputedMemberExpression(it.clone_in(alloc)) + Expression::ComputedMemberExpression(it.clone_in(alloc)) } Self::StaticMemberExpression(it) => { - Self::Cloned::StaticMemberExpression(it.clone_in(alloc)) + Expression::StaticMemberExpression(it.clone_in(alloc)) } Self::PrivateFieldExpression(it) => { - Self::Cloned::PrivateFieldExpression(it.clone_in(alloc)) + Expression::PrivateFieldExpression(it.clone_in(alloc)) } } } @@ -217,69 +215,103 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for ArrayExpressionElement<'old type Cloned = ArrayExpressionElement<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::SpreadElement(it) => Self::Cloned::SpreadElement(it.clone_in(alloc)), - Self::Elision(it) => Self::Cloned::Elision(it.clone_in(alloc)), - Self::BooleanLiteral(it) => Self::Cloned::BooleanLiteral(it.clone_in(alloc)), - Self::NullLiteral(it) => Self::Cloned::NullLiteral(it.clone_in(alloc)), - Self::NumericLiteral(it) => Self::Cloned::NumericLiteral(it.clone_in(alloc)), - Self::BigIntLiteral(it) => Self::Cloned::BigIntLiteral(it.clone_in(alloc)), - Self::RegExpLiteral(it) => Self::Cloned::RegExpLiteral(it.clone_in(alloc)), - Self::StringLiteral(it) => Self::Cloned::StringLiteral(it.clone_in(alloc)), - Self::TemplateLiteral(it) => Self::Cloned::TemplateLiteral(it.clone_in(alloc)), - Self::Identifier(it) => Self::Cloned::Identifier(it.clone_in(alloc)), - Self::MetaProperty(it) => Self::Cloned::MetaProperty(it.clone_in(alloc)), - Self::Super(it) => Self::Cloned::Super(it.clone_in(alloc)), - Self::ArrayExpression(it) => Self::Cloned::ArrayExpression(it.clone_in(alloc)), + Self::SpreadElement(it) => ArrayExpressionElement::SpreadElement(it.clone_in(alloc)), + Self::Elision(it) => ArrayExpressionElement::Elision(it.clone_in(alloc)), + Self::BooleanLiteral(it) => ArrayExpressionElement::BooleanLiteral(it.clone_in(alloc)), + Self::NullLiteral(it) => ArrayExpressionElement::NullLiteral(it.clone_in(alloc)), + Self::NumericLiteral(it) => ArrayExpressionElement::NumericLiteral(it.clone_in(alloc)), + Self::BigIntLiteral(it) => ArrayExpressionElement::BigIntLiteral(it.clone_in(alloc)), + Self::RegExpLiteral(it) => ArrayExpressionElement::RegExpLiteral(it.clone_in(alloc)), + Self::StringLiteral(it) => ArrayExpressionElement::StringLiteral(it.clone_in(alloc)), + Self::TemplateLiteral(it) => { + ArrayExpressionElement::TemplateLiteral(it.clone_in(alloc)) + } + Self::Identifier(it) => ArrayExpressionElement::Identifier(it.clone_in(alloc)), + Self::MetaProperty(it) => ArrayExpressionElement::MetaProperty(it.clone_in(alloc)), + Self::Super(it) => ArrayExpressionElement::Super(it.clone_in(alloc)), + Self::ArrayExpression(it) => { + ArrayExpressionElement::ArrayExpression(it.clone_in(alloc)) + } Self::ArrowFunctionExpression(it) => { - Self::Cloned::ArrowFunctionExpression(it.clone_in(alloc)) + ArrayExpressionElement::ArrowFunctionExpression(it.clone_in(alloc)) } Self::AssignmentExpression(it) => { - Self::Cloned::AssignmentExpression(it.clone_in(alloc)) + ArrayExpressionElement::AssignmentExpression(it.clone_in(alloc)) + } + Self::AwaitExpression(it) => { + ArrayExpressionElement::AwaitExpression(it.clone_in(alloc)) + } + Self::BinaryExpression(it) => { + ArrayExpressionElement::BinaryExpression(it.clone_in(alloc)) + } + Self::CallExpression(it) => ArrayExpressionElement::CallExpression(it.clone_in(alloc)), + Self::ChainExpression(it) => { + ArrayExpressionElement::ChainExpression(it.clone_in(alloc)) + } + Self::ClassExpression(it) => { + ArrayExpressionElement::ClassExpression(it.clone_in(alloc)) } - Self::AwaitExpression(it) => Self::Cloned::AwaitExpression(it.clone_in(alloc)), - Self::BinaryExpression(it) => Self::Cloned::BinaryExpression(it.clone_in(alloc)), - Self::CallExpression(it) => Self::Cloned::CallExpression(it.clone_in(alloc)), - Self::ChainExpression(it) => Self::Cloned::ChainExpression(it.clone_in(alloc)), - Self::ClassExpression(it) => Self::Cloned::ClassExpression(it.clone_in(alloc)), Self::ConditionalExpression(it) => { - Self::Cloned::ConditionalExpression(it.clone_in(alloc)) + ArrayExpressionElement::ConditionalExpression(it.clone_in(alloc)) + } + Self::FunctionExpression(it) => { + ArrayExpressionElement::FunctionExpression(it.clone_in(alloc)) + } + Self::ImportExpression(it) => { + ArrayExpressionElement::ImportExpression(it.clone_in(alloc)) + } + Self::LogicalExpression(it) => { + ArrayExpressionElement::LogicalExpression(it.clone_in(alloc)) + } + Self::NewExpression(it) => ArrayExpressionElement::NewExpression(it.clone_in(alloc)), + Self::ObjectExpression(it) => { + ArrayExpressionElement::ObjectExpression(it.clone_in(alloc)) } - Self::FunctionExpression(it) => Self::Cloned::FunctionExpression(it.clone_in(alloc)), - Self::ImportExpression(it) => Self::Cloned::ImportExpression(it.clone_in(alloc)), - Self::LogicalExpression(it) => Self::Cloned::LogicalExpression(it.clone_in(alloc)), - Self::NewExpression(it) => Self::Cloned::NewExpression(it.clone_in(alloc)), - Self::ObjectExpression(it) => Self::Cloned::ObjectExpression(it.clone_in(alloc)), Self::ParenthesizedExpression(it) => { - Self::Cloned::ParenthesizedExpression(it.clone_in(alloc)) + ArrayExpressionElement::ParenthesizedExpression(it.clone_in(alloc)) + } + Self::SequenceExpression(it) => { + ArrayExpressionElement::SequenceExpression(it.clone_in(alloc)) } - Self::SequenceExpression(it) => Self::Cloned::SequenceExpression(it.clone_in(alloc)), Self::TaggedTemplateExpression(it) => { - Self::Cloned::TaggedTemplateExpression(it.clone_in(alloc)) - } - Self::ThisExpression(it) => Self::Cloned::ThisExpression(it.clone_in(alloc)), - Self::UnaryExpression(it) => Self::Cloned::UnaryExpression(it.clone_in(alloc)), - Self::UpdateExpression(it) => Self::Cloned::UpdateExpression(it.clone_in(alloc)), - Self::YieldExpression(it) => Self::Cloned::YieldExpression(it.clone_in(alloc)), - Self::PrivateInExpression(it) => Self::Cloned::PrivateInExpression(it.clone_in(alloc)), - Self::JSXElement(it) => Self::Cloned::JSXElement(it.clone_in(alloc)), - Self::JSXFragment(it) => Self::Cloned::JSXFragment(it.clone_in(alloc)), - Self::TSAsExpression(it) => Self::Cloned::TSAsExpression(it.clone_in(alloc)), + ArrayExpressionElement::TaggedTemplateExpression(it.clone_in(alloc)) + } + Self::ThisExpression(it) => ArrayExpressionElement::ThisExpression(it.clone_in(alloc)), + Self::UnaryExpression(it) => { + ArrayExpressionElement::UnaryExpression(it.clone_in(alloc)) + } + Self::UpdateExpression(it) => { + ArrayExpressionElement::UpdateExpression(it.clone_in(alloc)) + } + Self::YieldExpression(it) => { + ArrayExpressionElement::YieldExpression(it.clone_in(alloc)) + } + Self::PrivateInExpression(it) => { + ArrayExpressionElement::PrivateInExpression(it.clone_in(alloc)) + } + Self::JSXElement(it) => ArrayExpressionElement::JSXElement(it.clone_in(alloc)), + Self::JSXFragment(it) => ArrayExpressionElement::JSXFragment(it.clone_in(alloc)), + Self::TSAsExpression(it) => ArrayExpressionElement::TSAsExpression(it.clone_in(alloc)), Self::TSSatisfiesExpression(it) => { - Self::Cloned::TSSatisfiesExpression(it.clone_in(alloc)) + ArrayExpressionElement::TSSatisfiesExpression(it.clone_in(alloc)) + } + Self::TSTypeAssertion(it) => { + ArrayExpressionElement::TSTypeAssertion(it.clone_in(alloc)) + } + Self::TSNonNullExpression(it) => { + ArrayExpressionElement::TSNonNullExpression(it.clone_in(alloc)) } - Self::TSTypeAssertion(it) => Self::Cloned::TSTypeAssertion(it.clone_in(alloc)), - Self::TSNonNullExpression(it) => Self::Cloned::TSNonNullExpression(it.clone_in(alloc)), Self::TSInstantiationExpression(it) => { - Self::Cloned::TSInstantiationExpression(it.clone_in(alloc)) + ArrayExpressionElement::TSInstantiationExpression(it.clone_in(alloc)) } Self::ComputedMemberExpression(it) => { - Self::Cloned::ComputedMemberExpression(it.clone_in(alloc)) + ArrayExpressionElement::ComputedMemberExpression(it.clone_in(alloc)) } Self::StaticMemberExpression(it) => { - Self::Cloned::StaticMemberExpression(it.clone_in(alloc)) + ArrayExpressionElement::StaticMemberExpression(it.clone_in(alloc)) } Self::PrivateFieldExpression(it) => { - Self::Cloned::PrivateFieldExpression(it.clone_in(alloc)) + ArrayExpressionElement::PrivateFieldExpression(it.clone_in(alloc)) } } } @@ -307,8 +339,8 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for ObjectPropertyKind<'old_all type Cloned = ObjectPropertyKind<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::ObjectProperty(it) => Self::Cloned::ObjectProperty(it.clone_in(alloc)), - Self::SpreadProperty(it) => Self::Cloned::SpreadProperty(it.clone_in(alloc)), + Self::ObjectProperty(it) => ObjectPropertyKind::ObjectProperty(it.clone_in(alloc)), + Self::SpreadProperty(it) => ObjectPropertyKind::SpreadProperty(it.clone_in(alloc)), } } } @@ -333,69 +365,67 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for PropertyKey<'old_alloc> { type Cloned = PropertyKey<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::StaticIdentifier(it) => Self::Cloned::StaticIdentifier(it.clone_in(alloc)), - Self::PrivateIdentifier(it) => Self::Cloned::PrivateIdentifier(it.clone_in(alloc)), - Self::BooleanLiteral(it) => Self::Cloned::BooleanLiteral(it.clone_in(alloc)), - Self::NullLiteral(it) => Self::Cloned::NullLiteral(it.clone_in(alloc)), - Self::NumericLiteral(it) => Self::Cloned::NumericLiteral(it.clone_in(alloc)), - Self::BigIntLiteral(it) => Self::Cloned::BigIntLiteral(it.clone_in(alloc)), - Self::RegExpLiteral(it) => Self::Cloned::RegExpLiteral(it.clone_in(alloc)), - Self::StringLiteral(it) => Self::Cloned::StringLiteral(it.clone_in(alloc)), - Self::TemplateLiteral(it) => Self::Cloned::TemplateLiteral(it.clone_in(alloc)), - Self::Identifier(it) => Self::Cloned::Identifier(it.clone_in(alloc)), - Self::MetaProperty(it) => Self::Cloned::MetaProperty(it.clone_in(alloc)), - Self::Super(it) => Self::Cloned::Super(it.clone_in(alloc)), - Self::ArrayExpression(it) => Self::Cloned::ArrayExpression(it.clone_in(alloc)), + Self::StaticIdentifier(it) => PropertyKey::StaticIdentifier(it.clone_in(alloc)), + Self::PrivateIdentifier(it) => PropertyKey::PrivateIdentifier(it.clone_in(alloc)), + Self::BooleanLiteral(it) => PropertyKey::BooleanLiteral(it.clone_in(alloc)), + Self::NullLiteral(it) => PropertyKey::NullLiteral(it.clone_in(alloc)), + Self::NumericLiteral(it) => PropertyKey::NumericLiteral(it.clone_in(alloc)), + Self::BigIntLiteral(it) => PropertyKey::BigIntLiteral(it.clone_in(alloc)), + Self::RegExpLiteral(it) => PropertyKey::RegExpLiteral(it.clone_in(alloc)), + Self::StringLiteral(it) => PropertyKey::StringLiteral(it.clone_in(alloc)), + Self::TemplateLiteral(it) => PropertyKey::TemplateLiteral(it.clone_in(alloc)), + Self::Identifier(it) => PropertyKey::Identifier(it.clone_in(alloc)), + Self::MetaProperty(it) => PropertyKey::MetaProperty(it.clone_in(alloc)), + Self::Super(it) => PropertyKey::Super(it.clone_in(alloc)), + Self::ArrayExpression(it) => PropertyKey::ArrayExpression(it.clone_in(alloc)), Self::ArrowFunctionExpression(it) => { - Self::Cloned::ArrowFunctionExpression(it.clone_in(alloc)) - } - Self::AssignmentExpression(it) => { - Self::Cloned::AssignmentExpression(it.clone_in(alloc)) - } - Self::AwaitExpression(it) => Self::Cloned::AwaitExpression(it.clone_in(alloc)), - Self::BinaryExpression(it) => Self::Cloned::BinaryExpression(it.clone_in(alloc)), - Self::CallExpression(it) => Self::Cloned::CallExpression(it.clone_in(alloc)), - Self::ChainExpression(it) => Self::Cloned::ChainExpression(it.clone_in(alloc)), - Self::ClassExpression(it) => Self::Cloned::ClassExpression(it.clone_in(alloc)), + PropertyKey::ArrowFunctionExpression(it.clone_in(alloc)) + } + Self::AssignmentExpression(it) => PropertyKey::AssignmentExpression(it.clone_in(alloc)), + Self::AwaitExpression(it) => PropertyKey::AwaitExpression(it.clone_in(alloc)), + Self::BinaryExpression(it) => PropertyKey::BinaryExpression(it.clone_in(alloc)), + Self::CallExpression(it) => PropertyKey::CallExpression(it.clone_in(alloc)), + Self::ChainExpression(it) => PropertyKey::ChainExpression(it.clone_in(alloc)), + Self::ClassExpression(it) => PropertyKey::ClassExpression(it.clone_in(alloc)), Self::ConditionalExpression(it) => { - Self::Cloned::ConditionalExpression(it.clone_in(alloc)) + PropertyKey::ConditionalExpression(it.clone_in(alloc)) } - Self::FunctionExpression(it) => Self::Cloned::FunctionExpression(it.clone_in(alloc)), - Self::ImportExpression(it) => Self::Cloned::ImportExpression(it.clone_in(alloc)), - Self::LogicalExpression(it) => Self::Cloned::LogicalExpression(it.clone_in(alloc)), - Self::NewExpression(it) => Self::Cloned::NewExpression(it.clone_in(alloc)), - Self::ObjectExpression(it) => Self::Cloned::ObjectExpression(it.clone_in(alloc)), + Self::FunctionExpression(it) => PropertyKey::FunctionExpression(it.clone_in(alloc)), + Self::ImportExpression(it) => PropertyKey::ImportExpression(it.clone_in(alloc)), + Self::LogicalExpression(it) => PropertyKey::LogicalExpression(it.clone_in(alloc)), + Self::NewExpression(it) => PropertyKey::NewExpression(it.clone_in(alloc)), + Self::ObjectExpression(it) => PropertyKey::ObjectExpression(it.clone_in(alloc)), Self::ParenthesizedExpression(it) => { - Self::Cloned::ParenthesizedExpression(it.clone_in(alloc)) + PropertyKey::ParenthesizedExpression(it.clone_in(alloc)) } - Self::SequenceExpression(it) => Self::Cloned::SequenceExpression(it.clone_in(alloc)), + Self::SequenceExpression(it) => PropertyKey::SequenceExpression(it.clone_in(alloc)), Self::TaggedTemplateExpression(it) => { - Self::Cloned::TaggedTemplateExpression(it.clone_in(alloc)) - } - Self::ThisExpression(it) => Self::Cloned::ThisExpression(it.clone_in(alloc)), - Self::UnaryExpression(it) => Self::Cloned::UnaryExpression(it.clone_in(alloc)), - Self::UpdateExpression(it) => Self::Cloned::UpdateExpression(it.clone_in(alloc)), - Self::YieldExpression(it) => Self::Cloned::YieldExpression(it.clone_in(alloc)), - Self::PrivateInExpression(it) => Self::Cloned::PrivateInExpression(it.clone_in(alloc)), - Self::JSXElement(it) => Self::Cloned::JSXElement(it.clone_in(alloc)), - Self::JSXFragment(it) => Self::Cloned::JSXFragment(it.clone_in(alloc)), - Self::TSAsExpression(it) => Self::Cloned::TSAsExpression(it.clone_in(alloc)), + PropertyKey::TaggedTemplateExpression(it.clone_in(alloc)) + } + Self::ThisExpression(it) => PropertyKey::ThisExpression(it.clone_in(alloc)), + Self::UnaryExpression(it) => PropertyKey::UnaryExpression(it.clone_in(alloc)), + Self::UpdateExpression(it) => PropertyKey::UpdateExpression(it.clone_in(alloc)), + Self::YieldExpression(it) => PropertyKey::YieldExpression(it.clone_in(alloc)), + Self::PrivateInExpression(it) => PropertyKey::PrivateInExpression(it.clone_in(alloc)), + Self::JSXElement(it) => PropertyKey::JSXElement(it.clone_in(alloc)), + Self::JSXFragment(it) => PropertyKey::JSXFragment(it.clone_in(alloc)), + Self::TSAsExpression(it) => PropertyKey::TSAsExpression(it.clone_in(alloc)), Self::TSSatisfiesExpression(it) => { - Self::Cloned::TSSatisfiesExpression(it.clone_in(alloc)) + PropertyKey::TSSatisfiesExpression(it.clone_in(alloc)) } - Self::TSTypeAssertion(it) => Self::Cloned::TSTypeAssertion(it.clone_in(alloc)), - Self::TSNonNullExpression(it) => Self::Cloned::TSNonNullExpression(it.clone_in(alloc)), + Self::TSTypeAssertion(it) => PropertyKey::TSTypeAssertion(it.clone_in(alloc)), + Self::TSNonNullExpression(it) => PropertyKey::TSNonNullExpression(it.clone_in(alloc)), Self::TSInstantiationExpression(it) => { - Self::Cloned::TSInstantiationExpression(it.clone_in(alloc)) + PropertyKey::TSInstantiationExpression(it.clone_in(alloc)) } Self::ComputedMemberExpression(it) => { - Self::Cloned::ComputedMemberExpression(it.clone_in(alloc)) + PropertyKey::ComputedMemberExpression(it.clone_in(alloc)) } Self::StaticMemberExpression(it) => { - Self::Cloned::StaticMemberExpression(it.clone_in(alloc)) + PropertyKey::StaticMemberExpression(it.clone_in(alloc)) } Self::PrivateFieldExpression(it) => { - Self::Cloned::PrivateFieldExpression(it.clone_in(alloc)) + PropertyKey::PrivateFieldExpression(it.clone_in(alloc)) } } } @@ -405,9 +435,9 @@ impl<'alloc> CloneIn<'alloc> for PropertyKind { type Cloned = PropertyKind; fn clone_in(&self, _: &'alloc Allocator) -> Self::Cloned { match self { - Self::Init => Self::Cloned::Init, - Self::Get => Self::Cloned::Get, - Self::Set => Self::Cloned::Set, + Self::Init => PropertyKind::Init, + Self::Get => PropertyKind::Get, + Self::Set => PropertyKind::Set, } } } @@ -458,13 +488,13 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for MemberExpression<'old_alloc fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { Self::ComputedMemberExpression(it) => { - Self::Cloned::ComputedMemberExpression(it.clone_in(alloc)) + MemberExpression::ComputedMemberExpression(it.clone_in(alloc)) } Self::StaticMemberExpression(it) => { - Self::Cloned::StaticMemberExpression(it.clone_in(alloc)) + MemberExpression::StaticMemberExpression(it.clone_in(alloc)) } Self::PrivateFieldExpression(it) => { - Self::Cloned::PrivateFieldExpression(it.clone_in(alloc)) + MemberExpression::PrivateFieldExpression(it.clone_in(alloc)) } } } @@ -553,68 +583,62 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for Argument<'old_alloc> { type Cloned = Argument<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::SpreadElement(it) => Self::Cloned::SpreadElement(it.clone_in(alloc)), - Self::BooleanLiteral(it) => Self::Cloned::BooleanLiteral(it.clone_in(alloc)), - Self::NullLiteral(it) => Self::Cloned::NullLiteral(it.clone_in(alloc)), - Self::NumericLiteral(it) => Self::Cloned::NumericLiteral(it.clone_in(alloc)), - Self::BigIntLiteral(it) => Self::Cloned::BigIntLiteral(it.clone_in(alloc)), - Self::RegExpLiteral(it) => Self::Cloned::RegExpLiteral(it.clone_in(alloc)), - Self::StringLiteral(it) => Self::Cloned::StringLiteral(it.clone_in(alloc)), - Self::TemplateLiteral(it) => Self::Cloned::TemplateLiteral(it.clone_in(alloc)), - Self::Identifier(it) => Self::Cloned::Identifier(it.clone_in(alloc)), - Self::MetaProperty(it) => Self::Cloned::MetaProperty(it.clone_in(alloc)), - Self::Super(it) => Self::Cloned::Super(it.clone_in(alloc)), - Self::ArrayExpression(it) => Self::Cloned::ArrayExpression(it.clone_in(alloc)), + Self::SpreadElement(it) => Argument::SpreadElement(it.clone_in(alloc)), + Self::BooleanLiteral(it) => Argument::BooleanLiteral(it.clone_in(alloc)), + Self::NullLiteral(it) => Argument::NullLiteral(it.clone_in(alloc)), + Self::NumericLiteral(it) => Argument::NumericLiteral(it.clone_in(alloc)), + Self::BigIntLiteral(it) => Argument::BigIntLiteral(it.clone_in(alloc)), + Self::RegExpLiteral(it) => Argument::RegExpLiteral(it.clone_in(alloc)), + Self::StringLiteral(it) => Argument::StringLiteral(it.clone_in(alloc)), + Self::TemplateLiteral(it) => Argument::TemplateLiteral(it.clone_in(alloc)), + Self::Identifier(it) => Argument::Identifier(it.clone_in(alloc)), + Self::MetaProperty(it) => Argument::MetaProperty(it.clone_in(alloc)), + Self::Super(it) => Argument::Super(it.clone_in(alloc)), + Self::ArrayExpression(it) => Argument::ArrayExpression(it.clone_in(alloc)), Self::ArrowFunctionExpression(it) => { - Self::Cloned::ArrowFunctionExpression(it.clone_in(alloc)) - } - Self::AssignmentExpression(it) => { - Self::Cloned::AssignmentExpression(it.clone_in(alloc)) - } - Self::AwaitExpression(it) => Self::Cloned::AwaitExpression(it.clone_in(alloc)), - Self::BinaryExpression(it) => Self::Cloned::BinaryExpression(it.clone_in(alloc)), - Self::CallExpression(it) => Self::Cloned::CallExpression(it.clone_in(alloc)), - Self::ChainExpression(it) => Self::Cloned::ChainExpression(it.clone_in(alloc)), - Self::ClassExpression(it) => Self::Cloned::ClassExpression(it.clone_in(alloc)), - Self::ConditionalExpression(it) => { - Self::Cloned::ConditionalExpression(it.clone_in(alloc)) - } - Self::FunctionExpression(it) => Self::Cloned::FunctionExpression(it.clone_in(alloc)), - Self::ImportExpression(it) => Self::Cloned::ImportExpression(it.clone_in(alloc)), - Self::LogicalExpression(it) => Self::Cloned::LogicalExpression(it.clone_in(alloc)), - Self::NewExpression(it) => Self::Cloned::NewExpression(it.clone_in(alloc)), - Self::ObjectExpression(it) => Self::Cloned::ObjectExpression(it.clone_in(alloc)), + Argument::ArrowFunctionExpression(it.clone_in(alloc)) + } + Self::AssignmentExpression(it) => Argument::AssignmentExpression(it.clone_in(alloc)), + Self::AwaitExpression(it) => Argument::AwaitExpression(it.clone_in(alloc)), + Self::BinaryExpression(it) => Argument::BinaryExpression(it.clone_in(alloc)), + Self::CallExpression(it) => Argument::CallExpression(it.clone_in(alloc)), + Self::ChainExpression(it) => Argument::ChainExpression(it.clone_in(alloc)), + Self::ClassExpression(it) => Argument::ClassExpression(it.clone_in(alloc)), + Self::ConditionalExpression(it) => Argument::ConditionalExpression(it.clone_in(alloc)), + Self::FunctionExpression(it) => Argument::FunctionExpression(it.clone_in(alloc)), + Self::ImportExpression(it) => Argument::ImportExpression(it.clone_in(alloc)), + Self::LogicalExpression(it) => Argument::LogicalExpression(it.clone_in(alloc)), + Self::NewExpression(it) => Argument::NewExpression(it.clone_in(alloc)), + Self::ObjectExpression(it) => Argument::ObjectExpression(it.clone_in(alloc)), Self::ParenthesizedExpression(it) => { - Self::Cloned::ParenthesizedExpression(it.clone_in(alloc)) + Argument::ParenthesizedExpression(it.clone_in(alloc)) } - Self::SequenceExpression(it) => Self::Cloned::SequenceExpression(it.clone_in(alloc)), + Self::SequenceExpression(it) => Argument::SequenceExpression(it.clone_in(alloc)), Self::TaggedTemplateExpression(it) => { - Self::Cloned::TaggedTemplateExpression(it.clone_in(alloc)) - } - Self::ThisExpression(it) => Self::Cloned::ThisExpression(it.clone_in(alloc)), - Self::UnaryExpression(it) => Self::Cloned::UnaryExpression(it.clone_in(alloc)), - Self::UpdateExpression(it) => Self::Cloned::UpdateExpression(it.clone_in(alloc)), - Self::YieldExpression(it) => Self::Cloned::YieldExpression(it.clone_in(alloc)), - Self::PrivateInExpression(it) => Self::Cloned::PrivateInExpression(it.clone_in(alloc)), - Self::JSXElement(it) => Self::Cloned::JSXElement(it.clone_in(alloc)), - Self::JSXFragment(it) => Self::Cloned::JSXFragment(it.clone_in(alloc)), - Self::TSAsExpression(it) => Self::Cloned::TSAsExpression(it.clone_in(alloc)), - Self::TSSatisfiesExpression(it) => { - Self::Cloned::TSSatisfiesExpression(it.clone_in(alloc)) - } - Self::TSTypeAssertion(it) => Self::Cloned::TSTypeAssertion(it.clone_in(alloc)), - Self::TSNonNullExpression(it) => Self::Cloned::TSNonNullExpression(it.clone_in(alloc)), + Argument::TaggedTemplateExpression(it.clone_in(alloc)) + } + Self::ThisExpression(it) => Argument::ThisExpression(it.clone_in(alloc)), + Self::UnaryExpression(it) => Argument::UnaryExpression(it.clone_in(alloc)), + Self::UpdateExpression(it) => Argument::UpdateExpression(it.clone_in(alloc)), + Self::YieldExpression(it) => Argument::YieldExpression(it.clone_in(alloc)), + Self::PrivateInExpression(it) => Argument::PrivateInExpression(it.clone_in(alloc)), + Self::JSXElement(it) => Argument::JSXElement(it.clone_in(alloc)), + Self::JSXFragment(it) => Argument::JSXFragment(it.clone_in(alloc)), + Self::TSAsExpression(it) => Argument::TSAsExpression(it.clone_in(alloc)), + Self::TSSatisfiesExpression(it) => Argument::TSSatisfiesExpression(it.clone_in(alloc)), + Self::TSTypeAssertion(it) => Argument::TSTypeAssertion(it.clone_in(alloc)), + Self::TSNonNullExpression(it) => Argument::TSNonNullExpression(it.clone_in(alloc)), Self::TSInstantiationExpression(it) => { - Self::Cloned::TSInstantiationExpression(it.clone_in(alloc)) + Argument::TSInstantiationExpression(it.clone_in(alloc)) } Self::ComputedMemberExpression(it) => { - Self::Cloned::ComputedMemberExpression(it.clone_in(alloc)) + Argument::ComputedMemberExpression(it.clone_in(alloc)) } Self::StaticMemberExpression(it) => { - Self::Cloned::StaticMemberExpression(it.clone_in(alloc)) + Argument::StaticMemberExpression(it.clone_in(alloc)) } Self::PrivateFieldExpression(it) => { - Self::Cloned::PrivateFieldExpression(it.clone_in(alloc)) + Argument::PrivateFieldExpression(it.clone_in(alloc)) } } } @@ -708,31 +732,33 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for AssignmentTarget<'old_alloc fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { Self::AssignmentTargetIdentifier(it) => { - Self::Cloned::AssignmentTargetIdentifier(it.clone_in(alloc)) + AssignmentTarget::AssignmentTargetIdentifier(it.clone_in(alloc)) } - Self::TSAsExpression(it) => Self::Cloned::TSAsExpression(it.clone_in(alloc)), + Self::TSAsExpression(it) => AssignmentTarget::TSAsExpression(it.clone_in(alloc)), Self::TSSatisfiesExpression(it) => { - Self::Cloned::TSSatisfiesExpression(it.clone_in(alloc)) + AssignmentTarget::TSSatisfiesExpression(it.clone_in(alloc)) + } + Self::TSNonNullExpression(it) => { + AssignmentTarget::TSNonNullExpression(it.clone_in(alloc)) } - Self::TSNonNullExpression(it) => Self::Cloned::TSNonNullExpression(it.clone_in(alloc)), - Self::TSTypeAssertion(it) => Self::Cloned::TSTypeAssertion(it.clone_in(alloc)), + Self::TSTypeAssertion(it) => AssignmentTarget::TSTypeAssertion(it.clone_in(alloc)), Self::TSInstantiationExpression(it) => { - Self::Cloned::TSInstantiationExpression(it.clone_in(alloc)) + AssignmentTarget::TSInstantiationExpression(it.clone_in(alloc)) } Self::ComputedMemberExpression(it) => { - Self::Cloned::ComputedMemberExpression(it.clone_in(alloc)) + AssignmentTarget::ComputedMemberExpression(it.clone_in(alloc)) } Self::StaticMemberExpression(it) => { - Self::Cloned::StaticMemberExpression(it.clone_in(alloc)) + AssignmentTarget::StaticMemberExpression(it.clone_in(alloc)) } Self::PrivateFieldExpression(it) => { - Self::Cloned::PrivateFieldExpression(it.clone_in(alloc)) + AssignmentTarget::PrivateFieldExpression(it.clone_in(alloc)) } Self::ArrayAssignmentTarget(it) => { - Self::Cloned::ArrayAssignmentTarget(it.clone_in(alloc)) + AssignmentTarget::ArrayAssignmentTarget(it.clone_in(alloc)) } Self::ObjectAssignmentTarget(it) => { - Self::Cloned::ObjectAssignmentTarget(it.clone_in(alloc)) + AssignmentTarget::ObjectAssignmentTarget(it.clone_in(alloc)) } } } @@ -743,25 +769,29 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for SimpleAssignmentTarget<'old fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { Self::AssignmentTargetIdentifier(it) => { - Self::Cloned::AssignmentTargetIdentifier(it.clone_in(alloc)) + SimpleAssignmentTarget::AssignmentTargetIdentifier(it.clone_in(alloc)) } - Self::TSAsExpression(it) => Self::Cloned::TSAsExpression(it.clone_in(alloc)), + Self::TSAsExpression(it) => SimpleAssignmentTarget::TSAsExpression(it.clone_in(alloc)), Self::TSSatisfiesExpression(it) => { - Self::Cloned::TSSatisfiesExpression(it.clone_in(alloc)) + SimpleAssignmentTarget::TSSatisfiesExpression(it.clone_in(alloc)) + } + Self::TSNonNullExpression(it) => { + SimpleAssignmentTarget::TSNonNullExpression(it.clone_in(alloc)) + } + Self::TSTypeAssertion(it) => { + SimpleAssignmentTarget::TSTypeAssertion(it.clone_in(alloc)) } - Self::TSNonNullExpression(it) => Self::Cloned::TSNonNullExpression(it.clone_in(alloc)), - Self::TSTypeAssertion(it) => Self::Cloned::TSTypeAssertion(it.clone_in(alloc)), Self::TSInstantiationExpression(it) => { - Self::Cloned::TSInstantiationExpression(it.clone_in(alloc)) + SimpleAssignmentTarget::TSInstantiationExpression(it.clone_in(alloc)) } Self::ComputedMemberExpression(it) => { - Self::Cloned::ComputedMemberExpression(it.clone_in(alloc)) + SimpleAssignmentTarget::ComputedMemberExpression(it.clone_in(alloc)) } Self::StaticMemberExpression(it) => { - Self::Cloned::StaticMemberExpression(it.clone_in(alloc)) + SimpleAssignmentTarget::StaticMemberExpression(it.clone_in(alloc)) } Self::PrivateFieldExpression(it) => { - Self::Cloned::PrivateFieldExpression(it.clone_in(alloc)) + SimpleAssignmentTarget::PrivateFieldExpression(it.clone_in(alloc)) } } } @@ -772,10 +802,10 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for AssignmentTargetPattern<'ol fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { Self::ArrayAssignmentTarget(it) => { - Self::Cloned::ArrayAssignmentTarget(it.clone_in(alloc)) + AssignmentTargetPattern::ArrayAssignmentTarget(it.clone_in(alloc)) } Self::ObjectAssignmentTarget(it) => { - Self::Cloned::ObjectAssignmentTarget(it.clone_in(alloc)) + AssignmentTargetPattern::ObjectAssignmentTarget(it.clone_in(alloc)) } } } @@ -819,34 +849,40 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for AssignmentTargetMaybeDefaul fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { Self::AssignmentTargetWithDefault(it) => { - Self::Cloned::AssignmentTargetWithDefault(it.clone_in(alloc)) + AssignmentTargetMaybeDefault::AssignmentTargetWithDefault(it.clone_in(alloc)) } Self::AssignmentTargetIdentifier(it) => { - Self::Cloned::AssignmentTargetIdentifier(it.clone_in(alloc)) + AssignmentTargetMaybeDefault::AssignmentTargetIdentifier(it.clone_in(alloc)) + } + Self::TSAsExpression(it) => { + AssignmentTargetMaybeDefault::TSAsExpression(it.clone_in(alloc)) } - Self::TSAsExpression(it) => Self::Cloned::TSAsExpression(it.clone_in(alloc)), Self::TSSatisfiesExpression(it) => { - Self::Cloned::TSSatisfiesExpression(it.clone_in(alloc)) + AssignmentTargetMaybeDefault::TSSatisfiesExpression(it.clone_in(alloc)) + } + Self::TSNonNullExpression(it) => { + AssignmentTargetMaybeDefault::TSNonNullExpression(it.clone_in(alloc)) + } + Self::TSTypeAssertion(it) => { + AssignmentTargetMaybeDefault::TSTypeAssertion(it.clone_in(alloc)) } - Self::TSNonNullExpression(it) => Self::Cloned::TSNonNullExpression(it.clone_in(alloc)), - Self::TSTypeAssertion(it) => Self::Cloned::TSTypeAssertion(it.clone_in(alloc)), Self::TSInstantiationExpression(it) => { - Self::Cloned::TSInstantiationExpression(it.clone_in(alloc)) + AssignmentTargetMaybeDefault::TSInstantiationExpression(it.clone_in(alloc)) } Self::ComputedMemberExpression(it) => { - Self::Cloned::ComputedMemberExpression(it.clone_in(alloc)) + AssignmentTargetMaybeDefault::ComputedMemberExpression(it.clone_in(alloc)) } Self::StaticMemberExpression(it) => { - Self::Cloned::StaticMemberExpression(it.clone_in(alloc)) + AssignmentTargetMaybeDefault::StaticMemberExpression(it.clone_in(alloc)) } Self::PrivateFieldExpression(it) => { - Self::Cloned::PrivateFieldExpression(it.clone_in(alloc)) + AssignmentTargetMaybeDefault::PrivateFieldExpression(it.clone_in(alloc)) } Self::ArrayAssignmentTarget(it) => { - Self::Cloned::ArrayAssignmentTarget(it.clone_in(alloc)) + AssignmentTargetMaybeDefault::ArrayAssignmentTarget(it.clone_in(alloc)) } Self::ObjectAssignmentTarget(it) => { - Self::Cloned::ObjectAssignmentTarget(it.clone_in(alloc)) + AssignmentTargetMaybeDefault::ObjectAssignmentTarget(it.clone_in(alloc)) } } } @@ -868,10 +904,10 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for AssignmentTargetProperty<'o fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { Self::AssignmentTargetPropertyIdentifier(it) => { - Self::Cloned::AssignmentTargetPropertyIdentifier(it.clone_in(alloc)) + AssignmentTargetProperty::AssignmentTargetPropertyIdentifier(it.clone_in(alloc)) } Self::AssignmentTargetPropertyProperty(it) => { - Self::Cloned::AssignmentTargetPropertyProperty(it.clone_in(alloc)) + AssignmentTargetProperty::AssignmentTargetPropertyProperty(it.clone_in(alloc)) } } } @@ -939,15 +975,15 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for ChainElement<'old_alloc> { type Cloned = ChainElement<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::CallExpression(it) => Self::Cloned::CallExpression(it.clone_in(alloc)), + Self::CallExpression(it) => ChainElement::CallExpression(it.clone_in(alloc)), Self::ComputedMemberExpression(it) => { - Self::Cloned::ComputedMemberExpression(it.clone_in(alloc)) + ChainElement::ComputedMemberExpression(it.clone_in(alloc)) } Self::StaticMemberExpression(it) => { - Self::Cloned::StaticMemberExpression(it.clone_in(alloc)) + ChainElement::StaticMemberExpression(it.clone_in(alloc)) } Self::PrivateFieldExpression(it) => { - Self::Cloned::PrivateFieldExpression(it.clone_in(alloc)) + ChainElement::PrivateFieldExpression(it.clone_in(alloc)) } } } @@ -967,52 +1003,50 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for Statement<'old_alloc> { type Cloned = Statement<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::BlockStatement(it) => Self::Cloned::BlockStatement(it.clone_in(alloc)), - Self::BreakStatement(it) => Self::Cloned::BreakStatement(it.clone_in(alloc)), - Self::ContinueStatement(it) => Self::Cloned::ContinueStatement(it.clone_in(alloc)), - Self::DebuggerStatement(it) => Self::Cloned::DebuggerStatement(it.clone_in(alloc)), - Self::DoWhileStatement(it) => Self::Cloned::DoWhileStatement(it.clone_in(alloc)), - Self::EmptyStatement(it) => Self::Cloned::EmptyStatement(it.clone_in(alloc)), - Self::ExpressionStatement(it) => Self::Cloned::ExpressionStatement(it.clone_in(alloc)), - Self::ForInStatement(it) => Self::Cloned::ForInStatement(it.clone_in(alloc)), - Self::ForOfStatement(it) => Self::Cloned::ForOfStatement(it.clone_in(alloc)), - Self::ForStatement(it) => Self::Cloned::ForStatement(it.clone_in(alloc)), - Self::IfStatement(it) => Self::Cloned::IfStatement(it.clone_in(alloc)), - Self::LabeledStatement(it) => Self::Cloned::LabeledStatement(it.clone_in(alloc)), - Self::ReturnStatement(it) => Self::Cloned::ReturnStatement(it.clone_in(alloc)), - Self::SwitchStatement(it) => Self::Cloned::SwitchStatement(it.clone_in(alloc)), - Self::ThrowStatement(it) => Self::Cloned::ThrowStatement(it.clone_in(alloc)), - Self::TryStatement(it) => Self::Cloned::TryStatement(it.clone_in(alloc)), - Self::WhileStatement(it) => Self::Cloned::WhileStatement(it.clone_in(alloc)), - Self::WithStatement(it) => Self::Cloned::WithStatement(it.clone_in(alloc)), - Self::VariableDeclaration(it) => Self::Cloned::VariableDeclaration(it.clone_in(alloc)), - Self::FunctionDeclaration(it) => Self::Cloned::FunctionDeclaration(it.clone_in(alloc)), - Self::ClassDeclaration(it) => Self::Cloned::ClassDeclaration(it.clone_in(alloc)), - Self::UsingDeclaration(it) => Self::Cloned::UsingDeclaration(it.clone_in(alloc)), + Self::BlockStatement(it) => Statement::BlockStatement(it.clone_in(alloc)), + Self::BreakStatement(it) => Statement::BreakStatement(it.clone_in(alloc)), + Self::ContinueStatement(it) => Statement::ContinueStatement(it.clone_in(alloc)), + Self::DebuggerStatement(it) => Statement::DebuggerStatement(it.clone_in(alloc)), + Self::DoWhileStatement(it) => Statement::DoWhileStatement(it.clone_in(alloc)), + Self::EmptyStatement(it) => Statement::EmptyStatement(it.clone_in(alloc)), + Self::ExpressionStatement(it) => Statement::ExpressionStatement(it.clone_in(alloc)), + Self::ForInStatement(it) => Statement::ForInStatement(it.clone_in(alloc)), + Self::ForOfStatement(it) => Statement::ForOfStatement(it.clone_in(alloc)), + Self::ForStatement(it) => Statement::ForStatement(it.clone_in(alloc)), + Self::IfStatement(it) => Statement::IfStatement(it.clone_in(alloc)), + Self::LabeledStatement(it) => Statement::LabeledStatement(it.clone_in(alloc)), + Self::ReturnStatement(it) => Statement::ReturnStatement(it.clone_in(alloc)), + Self::SwitchStatement(it) => Statement::SwitchStatement(it.clone_in(alloc)), + Self::ThrowStatement(it) => Statement::ThrowStatement(it.clone_in(alloc)), + Self::TryStatement(it) => Statement::TryStatement(it.clone_in(alloc)), + Self::WhileStatement(it) => Statement::WhileStatement(it.clone_in(alloc)), + Self::WithStatement(it) => Statement::WithStatement(it.clone_in(alloc)), + Self::VariableDeclaration(it) => Statement::VariableDeclaration(it.clone_in(alloc)), + Self::FunctionDeclaration(it) => Statement::FunctionDeclaration(it.clone_in(alloc)), + Self::ClassDeclaration(it) => Statement::ClassDeclaration(it.clone_in(alloc)), + Self::UsingDeclaration(it) => Statement::UsingDeclaration(it.clone_in(alloc)), Self::TSTypeAliasDeclaration(it) => { - Self::Cloned::TSTypeAliasDeclaration(it.clone_in(alloc)) + Statement::TSTypeAliasDeclaration(it.clone_in(alloc)) } Self::TSInterfaceDeclaration(it) => { - Self::Cloned::TSInterfaceDeclaration(it.clone_in(alloc)) + Statement::TSInterfaceDeclaration(it.clone_in(alloc)) } - Self::TSEnumDeclaration(it) => Self::Cloned::TSEnumDeclaration(it.clone_in(alloc)), - Self::TSModuleDeclaration(it) => Self::Cloned::TSModuleDeclaration(it.clone_in(alloc)), + Self::TSEnumDeclaration(it) => Statement::TSEnumDeclaration(it.clone_in(alloc)), + Self::TSModuleDeclaration(it) => Statement::TSModuleDeclaration(it.clone_in(alloc)), Self::TSImportEqualsDeclaration(it) => { - Self::Cloned::TSImportEqualsDeclaration(it.clone_in(alloc)) - } - Self::ImportDeclaration(it) => Self::Cloned::ImportDeclaration(it.clone_in(alloc)), - Self::ExportAllDeclaration(it) => { - Self::Cloned::ExportAllDeclaration(it.clone_in(alloc)) + Statement::TSImportEqualsDeclaration(it.clone_in(alloc)) } + Self::ImportDeclaration(it) => Statement::ImportDeclaration(it.clone_in(alloc)), + Self::ExportAllDeclaration(it) => Statement::ExportAllDeclaration(it.clone_in(alloc)), Self::ExportDefaultDeclaration(it) => { - Self::Cloned::ExportDefaultDeclaration(it.clone_in(alloc)) + Statement::ExportDefaultDeclaration(it.clone_in(alloc)) } Self::ExportNamedDeclaration(it) => { - Self::Cloned::ExportNamedDeclaration(it.clone_in(alloc)) + Statement::ExportNamedDeclaration(it.clone_in(alloc)) } - Self::TSExportAssignment(it) => Self::Cloned::TSExportAssignment(it.clone_in(alloc)), + Self::TSExportAssignment(it) => Statement::TSExportAssignment(it.clone_in(alloc)), Self::TSNamespaceExportDeclaration(it) => { - Self::Cloned::TSNamespaceExportDeclaration(it.clone_in(alloc)) + Statement::TSNamespaceExportDeclaration(it.clone_in(alloc)) } } } @@ -1051,20 +1085,20 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for Declaration<'old_alloc> { type Cloned = Declaration<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::VariableDeclaration(it) => Self::Cloned::VariableDeclaration(it.clone_in(alloc)), - Self::FunctionDeclaration(it) => Self::Cloned::FunctionDeclaration(it.clone_in(alloc)), - Self::ClassDeclaration(it) => Self::Cloned::ClassDeclaration(it.clone_in(alloc)), - Self::UsingDeclaration(it) => Self::Cloned::UsingDeclaration(it.clone_in(alloc)), + Self::VariableDeclaration(it) => Declaration::VariableDeclaration(it.clone_in(alloc)), + Self::FunctionDeclaration(it) => Declaration::FunctionDeclaration(it.clone_in(alloc)), + Self::ClassDeclaration(it) => Declaration::ClassDeclaration(it.clone_in(alloc)), + Self::UsingDeclaration(it) => Declaration::UsingDeclaration(it.clone_in(alloc)), Self::TSTypeAliasDeclaration(it) => { - Self::Cloned::TSTypeAliasDeclaration(it.clone_in(alloc)) + Declaration::TSTypeAliasDeclaration(it.clone_in(alloc)) } Self::TSInterfaceDeclaration(it) => { - Self::Cloned::TSInterfaceDeclaration(it.clone_in(alloc)) + Declaration::TSInterfaceDeclaration(it.clone_in(alloc)) } - Self::TSEnumDeclaration(it) => Self::Cloned::TSEnumDeclaration(it.clone_in(alloc)), - Self::TSModuleDeclaration(it) => Self::Cloned::TSModuleDeclaration(it.clone_in(alloc)), + Self::TSEnumDeclaration(it) => Declaration::TSEnumDeclaration(it.clone_in(alloc)), + Self::TSModuleDeclaration(it) => Declaration::TSModuleDeclaration(it.clone_in(alloc)), Self::TSImportEqualsDeclaration(it) => { - Self::Cloned::TSImportEqualsDeclaration(it.clone_in(alloc)) + Declaration::TSImportEqualsDeclaration(it.clone_in(alloc)) } } } @@ -1086,9 +1120,9 @@ impl<'alloc> CloneIn<'alloc> for VariableDeclarationKind { type Cloned = VariableDeclarationKind; fn clone_in(&self, _: &'alloc Allocator) -> Self::Cloned { match self { - Self::Var => Self::Cloned::Var, - Self::Const => Self::Cloned::Const, - Self::Let => Self::Cloned::Let, + Self::Var => VariableDeclarationKind::Var, + Self::Const => VariableDeclarationKind::Const, + Self::Let => VariableDeclarationKind::Let, } } } @@ -1186,69 +1220,79 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for ForStatementInit<'old_alloc type Cloned = ForStatementInit<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::VariableDeclaration(it) => Self::Cloned::VariableDeclaration(it.clone_in(alloc)), - Self::UsingDeclaration(it) => Self::Cloned::UsingDeclaration(it.clone_in(alloc)), - Self::BooleanLiteral(it) => Self::Cloned::BooleanLiteral(it.clone_in(alloc)), - Self::NullLiteral(it) => Self::Cloned::NullLiteral(it.clone_in(alloc)), - Self::NumericLiteral(it) => Self::Cloned::NumericLiteral(it.clone_in(alloc)), - Self::BigIntLiteral(it) => Self::Cloned::BigIntLiteral(it.clone_in(alloc)), - Self::RegExpLiteral(it) => Self::Cloned::RegExpLiteral(it.clone_in(alloc)), - Self::StringLiteral(it) => Self::Cloned::StringLiteral(it.clone_in(alloc)), - Self::TemplateLiteral(it) => Self::Cloned::TemplateLiteral(it.clone_in(alloc)), - Self::Identifier(it) => Self::Cloned::Identifier(it.clone_in(alloc)), - Self::MetaProperty(it) => Self::Cloned::MetaProperty(it.clone_in(alloc)), - Self::Super(it) => Self::Cloned::Super(it.clone_in(alloc)), - Self::ArrayExpression(it) => Self::Cloned::ArrayExpression(it.clone_in(alloc)), + Self::VariableDeclaration(it) => { + ForStatementInit::VariableDeclaration(it.clone_in(alloc)) + } + Self::UsingDeclaration(it) => ForStatementInit::UsingDeclaration(it.clone_in(alloc)), + Self::BooleanLiteral(it) => ForStatementInit::BooleanLiteral(it.clone_in(alloc)), + Self::NullLiteral(it) => ForStatementInit::NullLiteral(it.clone_in(alloc)), + Self::NumericLiteral(it) => ForStatementInit::NumericLiteral(it.clone_in(alloc)), + Self::BigIntLiteral(it) => ForStatementInit::BigIntLiteral(it.clone_in(alloc)), + Self::RegExpLiteral(it) => ForStatementInit::RegExpLiteral(it.clone_in(alloc)), + Self::StringLiteral(it) => ForStatementInit::StringLiteral(it.clone_in(alloc)), + Self::TemplateLiteral(it) => ForStatementInit::TemplateLiteral(it.clone_in(alloc)), + Self::Identifier(it) => ForStatementInit::Identifier(it.clone_in(alloc)), + Self::MetaProperty(it) => ForStatementInit::MetaProperty(it.clone_in(alloc)), + Self::Super(it) => ForStatementInit::Super(it.clone_in(alloc)), + Self::ArrayExpression(it) => ForStatementInit::ArrayExpression(it.clone_in(alloc)), Self::ArrowFunctionExpression(it) => { - Self::Cloned::ArrowFunctionExpression(it.clone_in(alloc)) + ForStatementInit::ArrowFunctionExpression(it.clone_in(alloc)) } Self::AssignmentExpression(it) => { - Self::Cloned::AssignmentExpression(it.clone_in(alloc)) + ForStatementInit::AssignmentExpression(it.clone_in(alloc)) } - Self::AwaitExpression(it) => Self::Cloned::AwaitExpression(it.clone_in(alloc)), - Self::BinaryExpression(it) => Self::Cloned::BinaryExpression(it.clone_in(alloc)), - Self::CallExpression(it) => Self::Cloned::CallExpression(it.clone_in(alloc)), - Self::ChainExpression(it) => Self::Cloned::ChainExpression(it.clone_in(alloc)), - Self::ClassExpression(it) => Self::Cloned::ClassExpression(it.clone_in(alloc)), + Self::AwaitExpression(it) => ForStatementInit::AwaitExpression(it.clone_in(alloc)), + Self::BinaryExpression(it) => ForStatementInit::BinaryExpression(it.clone_in(alloc)), + Self::CallExpression(it) => ForStatementInit::CallExpression(it.clone_in(alloc)), + Self::ChainExpression(it) => ForStatementInit::ChainExpression(it.clone_in(alloc)), + Self::ClassExpression(it) => ForStatementInit::ClassExpression(it.clone_in(alloc)), Self::ConditionalExpression(it) => { - Self::Cloned::ConditionalExpression(it.clone_in(alloc)) + ForStatementInit::ConditionalExpression(it.clone_in(alloc)) } - Self::FunctionExpression(it) => Self::Cloned::FunctionExpression(it.clone_in(alloc)), - Self::ImportExpression(it) => Self::Cloned::ImportExpression(it.clone_in(alloc)), - Self::LogicalExpression(it) => Self::Cloned::LogicalExpression(it.clone_in(alloc)), - Self::NewExpression(it) => Self::Cloned::NewExpression(it.clone_in(alloc)), - Self::ObjectExpression(it) => Self::Cloned::ObjectExpression(it.clone_in(alloc)), + Self::FunctionExpression(it) => { + ForStatementInit::FunctionExpression(it.clone_in(alloc)) + } + Self::ImportExpression(it) => ForStatementInit::ImportExpression(it.clone_in(alloc)), + Self::LogicalExpression(it) => ForStatementInit::LogicalExpression(it.clone_in(alloc)), + Self::NewExpression(it) => ForStatementInit::NewExpression(it.clone_in(alloc)), + Self::ObjectExpression(it) => ForStatementInit::ObjectExpression(it.clone_in(alloc)), Self::ParenthesizedExpression(it) => { - Self::Cloned::ParenthesizedExpression(it.clone_in(alloc)) + ForStatementInit::ParenthesizedExpression(it.clone_in(alloc)) + } + Self::SequenceExpression(it) => { + ForStatementInit::SequenceExpression(it.clone_in(alloc)) } - Self::SequenceExpression(it) => Self::Cloned::SequenceExpression(it.clone_in(alloc)), Self::TaggedTemplateExpression(it) => { - Self::Cloned::TaggedTemplateExpression(it.clone_in(alloc)) - } - Self::ThisExpression(it) => Self::Cloned::ThisExpression(it.clone_in(alloc)), - Self::UnaryExpression(it) => Self::Cloned::UnaryExpression(it.clone_in(alloc)), - Self::UpdateExpression(it) => Self::Cloned::UpdateExpression(it.clone_in(alloc)), - Self::YieldExpression(it) => Self::Cloned::YieldExpression(it.clone_in(alloc)), - Self::PrivateInExpression(it) => Self::Cloned::PrivateInExpression(it.clone_in(alloc)), - Self::JSXElement(it) => Self::Cloned::JSXElement(it.clone_in(alloc)), - Self::JSXFragment(it) => Self::Cloned::JSXFragment(it.clone_in(alloc)), - Self::TSAsExpression(it) => Self::Cloned::TSAsExpression(it.clone_in(alloc)), + ForStatementInit::TaggedTemplateExpression(it.clone_in(alloc)) + } + Self::ThisExpression(it) => ForStatementInit::ThisExpression(it.clone_in(alloc)), + Self::UnaryExpression(it) => ForStatementInit::UnaryExpression(it.clone_in(alloc)), + Self::UpdateExpression(it) => ForStatementInit::UpdateExpression(it.clone_in(alloc)), + Self::YieldExpression(it) => ForStatementInit::YieldExpression(it.clone_in(alloc)), + Self::PrivateInExpression(it) => { + ForStatementInit::PrivateInExpression(it.clone_in(alloc)) + } + Self::JSXElement(it) => ForStatementInit::JSXElement(it.clone_in(alloc)), + Self::JSXFragment(it) => ForStatementInit::JSXFragment(it.clone_in(alloc)), + Self::TSAsExpression(it) => ForStatementInit::TSAsExpression(it.clone_in(alloc)), Self::TSSatisfiesExpression(it) => { - Self::Cloned::TSSatisfiesExpression(it.clone_in(alloc)) + ForStatementInit::TSSatisfiesExpression(it.clone_in(alloc)) + } + Self::TSTypeAssertion(it) => ForStatementInit::TSTypeAssertion(it.clone_in(alloc)), + Self::TSNonNullExpression(it) => { + ForStatementInit::TSNonNullExpression(it.clone_in(alloc)) } - Self::TSTypeAssertion(it) => Self::Cloned::TSTypeAssertion(it.clone_in(alloc)), - Self::TSNonNullExpression(it) => Self::Cloned::TSNonNullExpression(it.clone_in(alloc)), Self::TSInstantiationExpression(it) => { - Self::Cloned::TSInstantiationExpression(it.clone_in(alloc)) + ForStatementInit::TSInstantiationExpression(it.clone_in(alloc)) } Self::ComputedMemberExpression(it) => { - Self::Cloned::ComputedMemberExpression(it.clone_in(alloc)) + ForStatementInit::ComputedMemberExpression(it.clone_in(alloc)) } Self::StaticMemberExpression(it) => { - Self::Cloned::StaticMemberExpression(it.clone_in(alloc)) + ForStatementInit::StaticMemberExpression(it.clone_in(alloc)) } Self::PrivateFieldExpression(it) => { - Self::Cloned::PrivateFieldExpression(it.clone_in(alloc)) + ForStatementInit::PrivateFieldExpression(it.clone_in(alloc)) } } } @@ -1271,34 +1315,38 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for ForStatementLeft<'old_alloc type Cloned = ForStatementLeft<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::VariableDeclaration(it) => Self::Cloned::VariableDeclaration(it.clone_in(alloc)), - Self::UsingDeclaration(it) => Self::Cloned::UsingDeclaration(it.clone_in(alloc)), + Self::VariableDeclaration(it) => { + ForStatementLeft::VariableDeclaration(it.clone_in(alloc)) + } + Self::UsingDeclaration(it) => ForStatementLeft::UsingDeclaration(it.clone_in(alloc)), Self::AssignmentTargetIdentifier(it) => { - Self::Cloned::AssignmentTargetIdentifier(it.clone_in(alloc)) + ForStatementLeft::AssignmentTargetIdentifier(it.clone_in(alloc)) } - Self::TSAsExpression(it) => Self::Cloned::TSAsExpression(it.clone_in(alloc)), + Self::TSAsExpression(it) => ForStatementLeft::TSAsExpression(it.clone_in(alloc)), Self::TSSatisfiesExpression(it) => { - Self::Cloned::TSSatisfiesExpression(it.clone_in(alloc)) + ForStatementLeft::TSSatisfiesExpression(it.clone_in(alloc)) + } + Self::TSNonNullExpression(it) => { + ForStatementLeft::TSNonNullExpression(it.clone_in(alloc)) } - Self::TSNonNullExpression(it) => Self::Cloned::TSNonNullExpression(it.clone_in(alloc)), - Self::TSTypeAssertion(it) => Self::Cloned::TSTypeAssertion(it.clone_in(alloc)), + Self::TSTypeAssertion(it) => ForStatementLeft::TSTypeAssertion(it.clone_in(alloc)), Self::TSInstantiationExpression(it) => { - Self::Cloned::TSInstantiationExpression(it.clone_in(alloc)) + ForStatementLeft::TSInstantiationExpression(it.clone_in(alloc)) } Self::ComputedMemberExpression(it) => { - Self::Cloned::ComputedMemberExpression(it.clone_in(alloc)) + ForStatementLeft::ComputedMemberExpression(it.clone_in(alloc)) } Self::StaticMemberExpression(it) => { - Self::Cloned::StaticMemberExpression(it.clone_in(alloc)) + ForStatementLeft::StaticMemberExpression(it.clone_in(alloc)) } Self::PrivateFieldExpression(it) => { - Self::Cloned::PrivateFieldExpression(it.clone_in(alloc)) + ForStatementLeft::PrivateFieldExpression(it.clone_in(alloc)) } Self::ArrayAssignmentTarget(it) => { - Self::Cloned::ArrayAssignmentTarget(it.clone_in(alloc)) + ForStatementLeft::ArrayAssignmentTarget(it.clone_in(alloc)) } Self::ObjectAssignmentTarget(it) => { - Self::Cloned::ObjectAssignmentTarget(it.clone_in(alloc)) + ForStatementLeft::ObjectAssignmentTarget(it.clone_in(alloc)) } } } @@ -1444,10 +1492,14 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for BindingPatternKind<'old_all type Cloned = BindingPatternKind<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::BindingIdentifier(it) => Self::Cloned::BindingIdentifier(it.clone_in(alloc)), - Self::ObjectPattern(it) => Self::Cloned::ObjectPattern(it.clone_in(alloc)), - Self::ArrayPattern(it) => Self::Cloned::ArrayPattern(it.clone_in(alloc)), - Self::AssignmentPattern(it) => Self::Cloned::AssignmentPattern(it.clone_in(alloc)), + Self::BindingIdentifier(it) => { + BindingPatternKind::BindingIdentifier(it.clone_in(alloc)) + } + Self::ObjectPattern(it) => BindingPatternKind::ObjectPattern(it.clone_in(alloc)), + Self::ArrayPattern(it) => BindingPatternKind::ArrayPattern(it.clone_in(alloc)), + Self::AssignmentPattern(it) => { + BindingPatternKind::AssignmentPattern(it.clone_in(alloc)) + } } } } @@ -1532,10 +1584,10 @@ impl<'alloc> CloneIn<'alloc> for FunctionType { type Cloned = FunctionType; fn clone_in(&self, _: &'alloc Allocator) -> Self::Cloned { match self { - Self::FunctionDeclaration => Self::Cloned::FunctionDeclaration, - Self::FunctionExpression => Self::Cloned::FunctionExpression, - Self::TSDeclareFunction => Self::Cloned::TSDeclareFunction, - Self::TSEmptyBodyFunctionExpression => Self::Cloned::TSEmptyBodyFunctionExpression, + Self::FunctionDeclaration => FunctionType::FunctionDeclaration, + Self::FunctionExpression => FunctionType::FunctionExpression, + Self::TSDeclareFunction => FunctionType::TSDeclareFunction, + Self::TSEmptyBodyFunctionExpression => FunctionType::TSEmptyBodyFunctionExpression, } } } @@ -1570,10 +1622,10 @@ impl<'alloc> CloneIn<'alloc> for FormalParameterKind { type Cloned = FormalParameterKind; fn clone_in(&self, _: &'alloc Allocator) -> Self::Cloned { match self { - Self::FormalParameter => Self::Cloned::FormalParameter, - Self::UniqueFormalParameters => Self::Cloned::UniqueFormalParameters, - Self::ArrowFormalParameters => Self::Cloned::ArrowFormalParameters, - Self::Signature => Self::Cloned::Signature, + Self::FormalParameter => FormalParameterKind::FormalParameter, + Self::UniqueFormalParameters => FormalParameterKind::UniqueFormalParameters, + Self::ArrowFormalParameters => FormalParameterKind::ArrowFormalParameters, + Self::Signature => FormalParameterKind::Signature, } } } @@ -1640,8 +1692,8 @@ impl<'alloc> CloneIn<'alloc> for ClassType { type Cloned = ClassType; fn clone_in(&self, _: &'alloc Allocator) -> Self::Cloned { match self { - Self::ClassDeclaration => Self::Cloned::ClassDeclaration, - Self::ClassExpression => Self::Cloned::ClassExpression, + Self::ClassDeclaration => ClassType::ClassDeclaration, + Self::ClassExpression => ClassType::ClassExpression, } } } @@ -1657,11 +1709,11 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for ClassElement<'old_alloc> { type Cloned = ClassElement<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::StaticBlock(it) => Self::Cloned::StaticBlock(it.clone_in(alloc)), - Self::MethodDefinition(it) => Self::Cloned::MethodDefinition(it.clone_in(alloc)), - Self::PropertyDefinition(it) => Self::Cloned::PropertyDefinition(it.clone_in(alloc)), - Self::AccessorProperty(it) => Self::Cloned::AccessorProperty(it.clone_in(alloc)), - Self::TSIndexSignature(it) => Self::Cloned::TSIndexSignature(it.clone_in(alloc)), + Self::StaticBlock(it) => ClassElement::StaticBlock(it.clone_in(alloc)), + Self::MethodDefinition(it) => ClassElement::MethodDefinition(it.clone_in(alloc)), + Self::PropertyDefinition(it) => ClassElement::PropertyDefinition(it.clone_in(alloc)), + Self::AccessorProperty(it) => ClassElement::AccessorProperty(it.clone_in(alloc)), + Self::TSIndexSignature(it) => ClassElement::TSIndexSignature(it.clone_in(alloc)), } } } @@ -1689,8 +1741,8 @@ impl<'alloc> CloneIn<'alloc> for MethodDefinitionType { type Cloned = MethodDefinitionType; fn clone_in(&self, _: &'alloc Allocator) -> Self::Cloned { match self { - Self::MethodDefinition => Self::Cloned::MethodDefinition, - Self::TSAbstractMethodDefinition => Self::Cloned::TSAbstractMethodDefinition, + Self::MethodDefinition => MethodDefinitionType::MethodDefinition, + Self::TSAbstractMethodDefinition => MethodDefinitionType::TSAbstractMethodDefinition, } } } @@ -1721,8 +1773,10 @@ impl<'alloc> CloneIn<'alloc> for PropertyDefinitionType { type Cloned = PropertyDefinitionType; fn clone_in(&self, _: &'alloc Allocator) -> Self::Cloned { match self { - Self::PropertyDefinition => Self::Cloned::PropertyDefinition, - Self::TSAbstractPropertyDefinition => Self::Cloned::TSAbstractPropertyDefinition, + Self::PropertyDefinition => PropertyDefinitionType::PropertyDefinition, + Self::TSAbstractPropertyDefinition => { + PropertyDefinitionType::TSAbstractPropertyDefinition + } } } } @@ -1731,10 +1785,10 @@ impl<'alloc> CloneIn<'alloc> for MethodDefinitionKind { type Cloned = MethodDefinitionKind; fn clone_in(&self, _: &'alloc Allocator) -> Self::Cloned { match self { - Self::Constructor => Self::Cloned::Constructor, - Self::Method => Self::Cloned::Method, - Self::Get => Self::Cloned::Get, - Self::Set => Self::Cloned::Set, + Self::Constructor => MethodDefinitionKind::Constructor, + Self::Method => MethodDefinitionKind::Method, + Self::Get => MethodDefinitionKind::Get, + Self::Set => MethodDefinitionKind::Set, } } } @@ -1761,19 +1815,21 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for ModuleDeclaration<'old_allo type Cloned = ModuleDeclaration<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::ImportDeclaration(it) => Self::Cloned::ImportDeclaration(it.clone_in(alloc)), + Self::ImportDeclaration(it) => ModuleDeclaration::ImportDeclaration(it.clone_in(alloc)), Self::ExportAllDeclaration(it) => { - Self::Cloned::ExportAllDeclaration(it.clone_in(alloc)) + ModuleDeclaration::ExportAllDeclaration(it.clone_in(alloc)) } Self::ExportDefaultDeclaration(it) => { - Self::Cloned::ExportDefaultDeclaration(it.clone_in(alloc)) + ModuleDeclaration::ExportDefaultDeclaration(it.clone_in(alloc)) } Self::ExportNamedDeclaration(it) => { - Self::Cloned::ExportNamedDeclaration(it.clone_in(alloc)) + ModuleDeclaration::ExportNamedDeclaration(it.clone_in(alloc)) + } + Self::TSExportAssignment(it) => { + ModuleDeclaration::TSExportAssignment(it.clone_in(alloc)) } - Self::TSExportAssignment(it) => Self::Cloned::TSExportAssignment(it.clone_in(alloc)), Self::TSNamespaceExportDeclaration(it) => { - Self::Cloned::TSNamespaceExportDeclaration(it.clone_in(alloc)) + ModuleDeclaration::TSNamespaceExportDeclaration(it.clone_in(alloc)) } } } @@ -1783,8 +1839,8 @@ impl<'alloc> CloneIn<'alloc> for AccessorPropertyType { type Cloned = AccessorPropertyType; fn clone_in(&self, _: &'alloc Allocator) -> Self::Cloned { match self { - Self::AccessorProperty => Self::Cloned::AccessorProperty, - Self::TSAbstractAccessorProperty => Self::Cloned::TSAbstractAccessorProperty, + Self::AccessorProperty => AccessorPropertyType::AccessorProperty, + Self::TSAbstractAccessorProperty => AccessorPropertyType::TSAbstractAccessorProperty, } } } @@ -1832,12 +1888,14 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for ImportDeclarationSpecifier< type Cloned = ImportDeclarationSpecifier<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::ImportSpecifier(it) => Self::Cloned::ImportSpecifier(it.clone_in(alloc)), + Self::ImportSpecifier(it) => { + ImportDeclarationSpecifier::ImportSpecifier(it.clone_in(alloc)) + } Self::ImportDefaultSpecifier(it) => { - Self::Cloned::ImportDefaultSpecifier(it.clone_in(alloc)) + ImportDeclarationSpecifier::ImportDefaultSpecifier(it.clone_in(alloc)) } Self::ImportNamespaceSpecifier(it) => { - Self::Cloned::ImportNamespaceSpecifier(it.clone_in(alloc)) + ImportDeclarationSpecifier::ImportNamespaceSpecifier(it.clone_in(alloc)) } } } @@ -1901,8 +1959,8 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for ImportAttributeKey<'old_all type Cloned = ImportAttributeKey<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::Identifier(it) => Self::Cloned::Identifier(it.clone_in(alloc)), - Self::StringLiteral(it) => Self::Cloned::StringLiteral(it.clone_in(alloc)), + Self::Identifier(it) => ImportAttributeKey::Identifier(it.clone_in(alloc)), + Self::StringLiteral(it) => ImportAttributeKey::StringLiteral(it.clone_in(alloc)), } } } @@ -1961,72 +2019,130 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for ExportDefaultDeclarationKin type Cloned = ExportDefaultDeclarationKind<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::FunctionDeclaration(it) => Self::Cloned::FunctionDeclaration(it.clone_in(alloc)), - Self::ClassDeclaration(it) => Self::Cloned::ClassDeclaration(it.clone_in(alloc)), + Self::FunctionDeclaration(it) => { + ExportDefaultDeclarationKind::FunctionDeclaration(it.clone_in(alloc)) + } + Self::ClassDeclaration(it) => { + ExportDefaultDeclarationKind::ClassDeclaration(it.clone_in(alloc)) + } Self::TSInterfaceDeclaration(it) => { - Self::Cloned::TSInterfaceDeclaration(it.clone_in(alloc)) - } - Self::BooleanLiteral(it) => Self::Cloned::BooleanLiteral(it.clone_in(alloc)), - Self::NullLiteral(it) => Self::Cloned::NullLiteral(it.clone_in(alloc)), - Self::NumericLiteral(it) => Self::Cloned::NumericLiteral(it.clone_in(alloc)), - Self::BigIntLiteral(it) => Self::Cloned::BigIntLiteral(it.clone_in(alloc)), - Self::RegExpLiteral(it) => Self::Cloned::RegExpLiteral(it.clone_in(alloc)), - Self::StringLiteral(it) => Self::Cloned::StringLiteral(it.clone_in(alloc)), - Self::TemplateLiteral(it) => Self::Cloned::TemplateLiteral(it.clone_in(alloc)), - Self::Identifier(it) => Self::Cloned::Identifier(it.clone_in(alloc)), - Self::MetaProperty(it) => Self::Cloned::MetaProperty(it.clone_in(alloc)), - Self::Super(it) => Self::Cloned::Super(it.clone_in(alloc)), - Self::ArrayExpression(it) => Self::Cloned::ArrayExpression(it.clone_in(alloc)), + ExportDefaultDeclarationKind::TSInterfaceDeclaration(it.clone_in(alloc)) + } + Self::BooleanLiteral(it) => { + ExportDefaultDeclarationKind::BooleanLiteral(it.clone_in(alloc)) + } + Self::NullLiteral(it) => ExportDefaultDeclarationKind::NullLiteral(it.clone_in(alloc)), + Self::NumericLiteral(it) => { + ExportDefaultDeclarationKind::NumericLiteral(it.clone_in(alloc)) + } + Self::BigIntLiteral(it) => { + ExportDefaultDeclarationKind::BigIntLiteral(it.clone_in(alloc)) + } + Self::RegExpLiteral(it) => { + ExportDefaultDeclarationKind::RegExpLiteral(it.clone_in(alloc)) + } + Self::StringLiteral(it) => { + ExportDefaultDeclarationKind::StringLiteral(it.clone_in(alloc)) + } + Self::TemplateLiteral(it) => { + ExportDefaultDeclarationKind::TemplateLiteral(it.clone_in(alloc)) + } + Self::Identifier(it) => ExportDefaultDeclarationKind::Identifier(it.clone_in(alloc)), + Self::MetaProperty(it) => { + ExportDefaultDeclarationKind::MetaProperty(it.clone_in(alloc)) + } + Self::Super(it) => ExportDefaultDeclarationKind::Super(it.clone_in(alloc)), + Self::ArrayExpression(it) => { + ExportDefaultDeclarationKind::ArrayExpression(it.clone_in(alloc)) + } Self::ArrowFunctionExpression(it) => { - Self::Cloned::ArrowFunctionExpression(it.clone_in(alloc)) + ExportDefaultDeclarationKind::ArrowFunctionExpression(it.clone_in(alloc)) } Self::AssignmentExpression(it) => { - Self::Cloned::AssignmentExpression(it.clone_in(alloc)) + ExportDefaultDeclarationKind::AssignmentExpression(it.clone_in(alloc)) + } + Self::AwaitExpression(it) => { + ExportDefaultDeclarationKind::AwaitExpression(it.clone_in(alloc)) + } + Self::BinaryExpression(it) => { + ExportDefaultDeclarationKind::BinaryExpression(it.clone_in(alloc)) + } + Self::CallExpression(it) => { + ExportDefaultDeclarationKind::CallExpression(it.clone_in(alloc)) + } + Self::ChainExpression(it) => { + ExportDefaultDeclarationKind::ChainExpression(it.clone_in(alloc)) + } + Self::ClassExpression(it) => { + ExportDefaultDeclarationKind::ClassExpression(it.clone_in(alloc)) } - Self::AwaitExpression(it) => Self::Cloned::AwaitExpression(it.clone_in(alloc)), - Self::BinaryExpression(it) => Self::Cloned::BinaryExpression(it.clone_in(alloc)), - Self::CallExpression(it) => Self::Cloned::CallExpression(it.clone_in(alloc)), - Self::ChainExpression(it) => Self::Cloned::ChainExpression(it.clone_in(alloc)), - Self::ClassExpression(it) => Self::Cloned::ClassExpression(it.clone_in(alloc)), Self::ConditionalExpression(it) => { - Self::Cloned::ConditionalExpression(it.clone_in(alloc)) + ExportDefaultDeclarationKind::ConditionalExpression(it.clone_in(alloc)) + } + Self::FunctionExpression(it) => { + ExportDefaultDeclarationKind::FunctionExpression(it.clone_in(alloc)) + } + Self::ImportExpression(it) => { + ExportDefaultDeclarationKind::ImportExpression(it.clone_in(alloc)) + } + Self::LogicalExpression(it) => { + ExportDefaultDeclarationKind::LogicalExpression(it.clone_in(alloc)) + } + Self::NewExpression(it) => { + ExportDefaultDeclarationKind::NewExpression(it.clone_in(alloc)) + } + Self::ObjectExpression(it) => { + ExportDefaultDeclarationKind::ObjectExpression(it.clone_in(alloc)) } - Self::FunctionExpression(it) => Self::Cloned::FunctionExpression(it.clone_in(alloc)), - Self::ImportExpression(it) => Self::Cloned::ImportExpression(it.clone_in(alloc)), - Self::LogicalExpression(it) => Self::Cloned::LogicalExpression(it.clone_in(alloc)), - Self::NewExpression(it) => Self::Cloned::NewExpression(it.clone_in(alloc)), - Self::ObjectExpression(it) => Self::Cloned::ObjectExpression(it.clone_in(alloc)), Self::ParenthesizedExpression(it) => { - Self::Cloned::ParenthesizedExpression(it.clone_in(alloc)) + ExportDefaultDeclarationKind::ParenthesizedExpression(it.clone_in(alloc)) + } + Self::SequenceExpression(it) => { + ExportDefaultDeclarationKind::SequenceExpression(it.clone_in(alloc)) } - Self::SequenceExpression(it) => Self::Cloned::SequenceExpression(it.clone_in(alloc)), Self::TaggedTemplateExpression(it) => { - Self::Cloned::TaggedTemplateExpression(it.clone_in(alloc)) - } - Self::ThisExpression(it) => Self::Cloned::ThisExpression(it.clone_in(alloc)), - Self::UnaryExpression(it) => Self::Cloned::UnaryExpression(it.clone_in(alloc)), - Self::UpdateExpression(it) => Self::Cloned::UpdateExpression(it.clone_in(alloc)), - Self::YieldExpression(it) => Self::Cloned::YieldExpression(it.clone_in(alloc)), - Self::PrivateInExpression(it) => Self::Cloned::PrivateInExpression(it.clone_in(alloc)), - Self::JSXElement(it) => Self::Cloned::JSXElement(it.clone_in(alloc)), - Self::JSXFragment(it) => Self::Cloned::JSXFragment(it.clone_in(alloc)), - Self::TSAsExpression(it) => Self::Cloned::TSAsExpression(it.clone_in(alloc)), + ExportDefaultDeclarationKind::TaggedTemplateExpression(it.clone_in(alloc)) + } + Self::ThisExpression(it) => { + ExportDefaultDeclarationKind::ThisExpression(it.clone_in(alloc)) + } + Self::UnaryExpression(it) => { + ExportDefaultDeclarationKind::UnaryExpression(it.clone_in(alloc)) + } + Self::UpdateExpression(it) => { + ExportDefaultDeclarationKind::UpdateExpression(it.clone_in(alloc)) + } + Self::YieldExpression(it) => { + ExportDefaultDeclarationKind::YieldExpression(it.clone_in(alloc)) + } + Self::PrivateInExpression(it) => { + ExportDefaultDeclarationKind::PrivateInExpression(it.clone_in(alloc)) + } + Self::JSXElement(it) => ExportDefaultDeclarationKind::JSXElement(it.clone_in(alloc)), + Self::JSXFragment(it) => ExportDefaultDeclarationKind::JSXFragment(it.clone_in(alloc)), + Self::TSAsExpression(it) => { + ExportDefaultDeclarationKind::TSAsExpression(it.clone_in(alloc)) + } Self::TSSatisfiesExpression(it) => { - Self::Cloned::TSSatisfiesExpression(it.clone_in(alloc)) + ExportDefaultDeclarationKind::TSSatisfiesExpression(it.clone_in(alloc)) + } + Self::TSTypeAssertion(it) => { + ExportDefaultDeclarationKind::TSTypeAssertion(it.clone_in(alloc)) + } + Self::TSNonNullExpression(it) => { + ExportDefaultDeclarationKind::TSNonNullExpression(it.clone_in(alloc)) } - Self::TSTypeAssertion(it) => Self::Cloned::TSTypeAssertion(it.clone_in(alloc)), - Self::TSNonNullExpression(it) => Self::Cloned::TSNonNullExpression(it.clone_in(alloc)), Self::TSInstantiationExpression(it) => { - Self::Cloned::TSInstantiationExpression(it.clone_in(alloc)) + ExportDefaultDeclarationKind::TSInstantiationExpression(it.clone_in(alloc)) } Self::ComputedMemberExpression(it) => { - Self::Cloned::ComputedMemberExpression(it.clone_in(alloc)) + ExportDefaultDeclarationKind::ComputedMemberExpression(it.clone_in(alloc)) } Self::StaticMemberExpression(it) => { - Self::Cloned::StaticMemberExpression(it.clone_in(alloc)) + ExportDefaultDeclarationKind::StaticMemberExpression(it.clone_in(alloc)) } Self::PrivateFieldExpression(it) => { - Self::Cloned::PrivateFieldExpression(it.clone_in(alloc)) + ExportDefaultDeclarationKind::PrivateFieldExpression(it.clone_in(alloc)) } } } @@ -2036,9 +2152,11 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for ModuleExportName<'old_alloc type Cloned = ModuleExportName<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::IdentifierName(it) => Self::Cloned::IdentifierName(it.clone_in(alloc)), - Self::IdentifierReference(it) => Self::Cloned::IdentifierReference(it.clone_in(alloc)), - Self::StringLiteral(it) => Self::Cloned::StringLiteral(it.clone_in(alloc)), + Self::IdentifierName(it) => ModuleExportName::IdentifierName(it.clone_in(alloc)), + Self::IdentifierReference(it) => { + ModuleExportName::IdentifierReference(it.clone_in(alloc)) + } + Self::StringLiteral(it) => ModuleExportName::StringLiteral(it.clone_in(alloc)), } } } @@ -2083,75 +2201,85 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for TSEnumMemberName<'old_alloc type Cloned = TSEnumMemberName<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::StaticIdentifier(it) => Self::Cloned::StaticIdentifier(it.clone_in(alloc)), - Self::StaticStringLiteral(it) => Self::Cloned::StaticStringLiteral(it.clone_in(alloc)), + Self::StaticIdentifier(it) => TSEnumMemberName::StaticIdentifier(it.clone_in(alloc)), + Self::StaticStringLiteral(it) => { + TSEnumMemberName::StaticStringLiteral(it.clone_in(alloc)) + } Self::StaticTemplateLiteral(it) => { - Self::Cloned::StaticTemplateLiteral(it.clone_in(alloc)) + TSEnumMemberName::StaticTemplateLiteral(it.clone_in(alloc)) } Self::StaticNumericLiteral(it) => { - Self::Cloned::StaticNumericLiteral(it.clone_in(alloc)) - } - Self::BooleanLiteral(it) => Self::Cloned::BooleanLiteral(it.clone_in(alloc)), - Self::NullLiteral(it) => Self::Cloned::NullLiteral(it.clone_in(alloc)), - Self::NumericLiteral(it) => Self::Cloned::NumericLiteral(it.clone_in(alloc)), - Self::BigIntLiteral(it) => Self::Cloned::BigIntLiteral(it.clone_in(alloc)), - Self::RegExpLiteral(it) => Self::Cloned::RegExpLiteral(it.clone_in(alloc)), - Self::StringLiteral(it) => Self::Cloned::StringLiteral(it.clone_in(alloc)), - Self::TemplateLiteral(it) => Self::Cloned::TemplateLiteral(it.clone_in(alloc)), - Self::Identifier(it) => Self::Cloned::Identifier(it.clone_in(alloc)), - Self::MetaProperty(it) => Self::Cloned::MetaProperty(it.clone_in(alloc)), - Self::Super(it) => Self::Cloned::Super(it.clone_in(alloc)), - Self::ArrayExpression(it) => Self::Cloned::ArrayExpression(it.clone_in(alloc)), + TSEnumMemberName::StaticNumericLiteral(it.clone_in(alloc)) + } + Self::BooleanLiteral(it) => TSEnumMemberName::BooleanLiteral(it.clone_in(alloc)), + Self::NullLiteral(it) => TSEnumMemberName::NullLiteral(it.clone_in(alloc)), + Self::NumericLiteral(it) => TSEnumMemberName::NumericLiteral(it.clone_in(alloc)), + Self::BigIntLiteral(it) => TSEnumMemberName::BigIntLiteral(it.clone_in(alloc)), + Self::RegExpLiteral(it) => TSEnumMemberName::RegExpLiteral(it.clone_in(alloc)), + Self::StringLiteral(it) => TSEnumMemberName::StringLiteral(it.clone_in(alloc)), + Self::TemplateLiteral(it) => TSEnumMemberName::TemplateLiteral(it.clone_in(alloc)), + Self::Identifier(it) => TSEnumMemberName::Identifier(it.clone_in(alloc)), + Self::MetaProperty(it) => TSEnumMemberName::MetaProperty(it.clone_in(alloc)), + Self::Super(it) => TSEnumMemberName::Super(it.clone_in(alloc)), + Self::ArrayExpression(it) => TSEnumMemberName::ArrayExpression(it.clone_in(alloc)), Self::ArrowFunctionExpression(it) => { - Self::Cloned::ArrowFunctionExpression(it.clone_in(alloc)) + TSEnumMemberName::ArrowFunctionExpression(it.clone_in(alloc)) } Self::AssignmentExpression(it) => { - Self::Cloned::AssignmentExpression(it.clone_in(alloc)) + TSEnumMemberName::AssignmentExpression(it.clone_in(alloc)) } - Self::AwaitExpression(it) => Self::Cloned::AwaitExpression(it.clone_in(alloc)), - Self::BinaryExpression(it) => Self::Cloned::BinaryExpression(it.clone_in(alloc)), - Self::CallExpression(it) => Self::Cloned::CallExpression(it.clone_in(alloc)), - Self::ChainExpression(it) => Self::Cloned::ChainExpression(it.clone_in(alloc)), - Self::ClassExpression(it) => Self::Cloned::ClassExpression(it.clone_in(alloc)), + Self::AwaitExpression(it) => TSEnumMemberName::AwaitExpression(it.clone_in(alloc)), + Self::BinaryExpression(it) => TSEnumMemberName::BinaryExpression(it.clone_in(alloc)), + Self::CallExpression(it) => TSEnumMemberName::CallExpression(it.clone_in(alloc)), + Self::ChainExpression(it) => TSEnumMemberName::ChainExpression(it.clone_in(alloc)), + Self::ClassExpression(it) => TSEnumMemberName::ClassExpression(it.clone_in(alloc)), Self::ConditionalExpression(it) => { - Self::Cloned::ConditionalExpression(it.clone_in(alloc)) + TSEnumMemberName::ConditionalExpression(it.clone_in(alloc)) } - Self::FunctionExpression(it) => Self::Cloned::FunctionExpression(it.clone_in(alloc)), - Self::ImportExpression(it) => Self::Cloned::ImportExpression(it.clone_in(alloc)), - Self::LogicalExpression(it) => Self::Cloned::LogicalExpression(it.clone_in(alloc)), - Self::NewExpression(it) => Self::Cloned::NewExpression(it.clone_in(alloc)), - Self::ObjectExpression(it) => Self::Cloned::ObjectExpression(it.clone_in(alloc)), + Self::FunctionExpression(it) => { + TSEnumMemberName::FunctionExpression(it.clone_in(alloc)) + } + Self::ImportExpression(it) => TSEnumMemberName::ImportExpression(it.clone_in(alloc)), + Self::LogicalExpression(it) => TSEnumMemberName::LogicalExpression(it.clone_in(alloc)), + Self::NewExpression(it) => TSEnumMemberName::NewExpression(it.clone_in(alloc)), + Self::ObjectExpression(it) => TSEnumMemberName::ObjectExpression(it.clone_in(alloc)), Self::ParenthesizedExpression(it) => { - Self::Cloned::ParenthesizedExpression(it.clone_in(alloc)) + TSEnumMemberName::ParenthesizedExpression(it.clone_in(alloc)) + } + Self::SequenceExpression(it) => { + TSEnumMemberName::SequenceExpression(it.clone_in(alloc)) } - Self::SequenceExpression(it) => Self::Cloned::SequenceExpression(it.clone_in(alloc)), Self::TaggedTemplateExpression(it) => { - Self::Cloned::TaggedTemplateExpression(it.clone_in(alloc)) - } - Self::ThisExpression(it) => Self::Cloned::ThisExpression(it.clone_in(alloc)), - Self::UnaryExpression(it) => Self::Cloned::UnaryExpression(it.clone_in(alloc)), - Self::UpdateExpression(it) => Self::Cloned::UpdateExpression(it.clone_in(alloc)), - Self::YieldExpression(it) => Self::Cloned::YieldExpression(it.clone_in(alloc)), - Self::PrivateInExpression(it) => Self::Cloned::PrivateInExpression(it.clone_in(alloc)), - Self::JSXElement(it) => Self::Cloned::JSXElement(it.clone_in(alloc)), - Self::JSXFragment(it) => Self::Cloned::JSXFragment(it.clone_in(alloc)), - Self::TSAsExpression(it) => Self::Cloned::TSAsExpression(it.clone_in(alloc)), + TSEnumMemberName::TaggedTemplateExpression(it.clone_in(alloc)) + } + Self::ThisExpression(it) => TSEnumMemberName::ThisExpression(it.clone_in(alloc)), + Self::UnaryExpression(it) => TSEnumMemberName::UnaryExpression(it.clone_in(alloc)), + Self::UpdateExpression(it) => TSEnumMemberName::UpdateExpression(it.clone_in(alloc)), + Self::YieldExpression(it) => TSEnumMemberName::YieldExpression(it.clone_in(alloc)), + Self::PrivateInExpression(it) => { + TSEnumMemberName::PrivateInExpression(it.clone_in(alloc)) + } + Self::JSXElement(it) => TSEnumMemberName::JSXElement(it.clone_in(alloc)), + Self::JSXFragment(it) => TSEnumMemberName::JSXFragment(it.clone_in(alloc)), + Self::TSAsExpression(it) => TSEnumMemberName::TSAsExpression(it.clone_in(alloc)), Self::TSSatisfiesExpression(it) => { - Self::Cloned::TSSatisfiesExpression(it.clone_in(alloc)) + TSEnumMemberName::TSSatisfiesExpression(it.clone_in(alloc)) + } + Self::TSTypeAssertion(it) => TSEnumMemberName::TSTypeAssertion(it.clone_in(alloc)), + Self::TSNonNullExpression(it) => { + TSEnumMemberName::TSNonNullExpression(it.clone_in(alloc)) } - Self::TSTypeAssertion(it) => Self::Cloned::TSTypeAssertion(it.clone_in(alloc)), - Self::TSNonNullExpression(it) => Self::Cloned::TSNonNullExpression(it.clone_in(alloc)), Self::TSInstantiationExpression(it) => { - Self::Cloned::TSInstantiationExpression(it.clone_in(alloc)) + TSEnumMemberName::TSInstantiationExpression(it.clone_in(alloc)) } Self::ComputedMemberExpression(it) => { - Self::Cloned::ComputedMemberExpression(it.clone_in(alloc)) + TSEnumMemberName::ComputedMemberExpression(it.clone_in(alloc)) } Self::StaticMemberExpression(it) => { - Self::Cloned::StaticMemberExpression(it.clone_in(alloc)) + TSEnumMemberName::StaticMemberExpression(it.clone_in(alloc)) } Self::PrivateFieldExpression(it) => { - Self::Cloned::PrivateFieldExpression(it.clone_in(alloc)) + TSEnumMemberName::PrivateFieldExpression(it.clone_in(alloc)) } } } @@ -2178,14 +2306,14 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for TSLiteral<'old_alloc> { type Cloned = TSLiteral<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::BooleanLiteral(it) => Self::Cloned::BooleanLiteral(it.clone_in(alloc)), - Self::NullLiteral(it) => Self::Cloned::NullLiteral(it.clone_in(alloc)), - Self::NumericLiteral(it) => Self::Cloned::NumericLiteral(it.clone_in(alloc)), - Self::BigIntLiteral(it) => Self::Cloned::BigIntLiteral(it.clone_in(alloc)), - Self::RegExpLiteral(it) => Self::Cloned::RegExpLiteral(it.clone_in(alloc)), - Self::StringLiteral(it) => Self::Cloned::StringLiteral(it.clone_in(alloc)), - Self::TemplateLiteral(it) => Self::Cloned::TemplateLiteral(it.clone_in(alloc)), - Self::UnaryExpression(it) => Self::Cloned::UnaryExpression(it.clone_in(alloc)), + Self::BooleanLiteral(it) => TSLiteral::BooleanLiteral(it.clone_in(alloc)), + Self::NullLiteral(it) => TSLiteral::NullLiteral(it.clone_in(alloc)), + Self::NumericLiteral(it) => TSLiteral::NumericLiteral(it.clone_in(alloc)), + Self::BigIntLiteral(it) => TSLiteral::BigIntLiteral(it.clone_in(alloc)), + Self::RegExpLiteral(it) => TSLiteral::RegExpLiteral(it.clone_in(alloc)), + Self::StringLiteral(it) => TSLiteral::StringLiteral(it.clone_in(alloc)), + Self::TemplateLiteral(it) => TSLiteral::TemplateLiteral(it.clone_in(alloc)), + Self::UnaryExpression(it) => TSLiteral::UnaryExpression(it.clone_in(alloc)), } } } @@ -2194,48 +2322,44 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for TSType<'old_alloc> { type Cloned = TSType<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::TSAnyKeyword(it) => Self::Cloned::TSAnyKeyword(it.clone_in(alloc)), - Self::TSBigIntKeyword(it) => Self::Cloned::TSBigIntKeyword(it.clone_in(alloc)), - Self::TSBooleanKeyword(it) => Self::Cloned::TSBooleanKeyword(it.clone_in(alloc)), - Self::TSIntrinsicKeyword(it) => Self::Cloned::TSIntrinsicKeyword(it.clone_in(alloc)), - Self::TSNeverKeyword(it) => Self::Cloned::TSNeverKeyword(it.clone_in(alloc)), - Self::TSNullKeyword(it) => Self::Cloned::TSNullKeyword(it.clone_in(alloc)), - Self::TSNumberKeyword(it) => Self::Cloned::TSNumberKeyword(it.clone_in(alloc)), - Self::TSObjectKeyword(it) => Self::Cloned::TSObjectKeyword(it.clone_in(alloc)), - Self::TSStringKeyword(it) => Self::Cloned::TSStringKeyword(it.clone_in(alloc)), - Self::TSSymbolKeyword(it) => Self::Cloned::TSSymbolKeyword(it.clone_in(alloc)), - Self::TSUndefinedKeyword(it) => Self::Cloned::TSUndefinedKeyword(it.clone_in(alloc)), - Self::TSUnknownKeyword(it) => Self::Cloned::TSUnknownKeyword(it.clone_in(alloc)), - Self::TSVoidKeyword(it) => Self::Cloned::TSVoidKeyword(it.clone_in(alloc)), - Self::TSArrayType(it) => Self::Cloned::TSArrayType(it.clone_in(alloc)), - Self::TSConditionalType(it) => Self::Cloned::TSConditionalType(it.clone_in(alloc)), - Self::TSConstructorType(it) => Self::Cloned::TSConstructorType(it.clone_in(alloc)), - Self::TSFunctionType(it) => Self::Cloned::TSFunctionType(it.clone_in(alloc)), - Self::TSImportType(it) => Self::Cloned::TSImportType(it.clone_in(alloc)), - Self::TSIndexedAccessType(it) => Self::Cloned::TSIndexedAccessType(it.clone_in(alloc)), - Self::TSInferType(it) => Self::Cloned::TSInferType(it.clone_in(alloc)), - Self::TSIntersectionType(it) => Self::Cloned::TSIntersectionType(it.clone_in(alloc)), - Self::TSLiteralType(it) => Self::Cloned::TSLiteralType(it.clone_in(alloc)), - Self::TSMappedType(it) => Self::Cloned::TSMappedType(it.clone_in(alloc)), - Self::TSNamedTupleMember(it) => Self::Cloned::TSNamedTupleMember(it.clone_in(alloc)), - Self::TSQualifiedName(it) => Self::Cloned::TSQualifiedName(it.clone_in(alloc)), - Self::TSTemplateLiteralType(it) => { - Self::Cloned::TSTemplateLiteralType(it.clone_in(alloc)) - } - Self::TSThisType(it) => Self::Cloned::TSThisType(it.clone_in(alloc)), - Self::TSTupleType(it) => Self::Cloned::TSTupleType(it.clone_in(alloc)), - Self::TSTypeLiteral(it) => Self::Cloned::TSTypeLiteral(it.clone_in(alloc)), - Self::TSTypeOperatorType(it) => Self::Cloned::TSTypeOperatorType(it.clone_in(alloc)), - Self::TSTypePredicate(it) => Self::Cloned::TSTypePredicate(it.clone_in(alloc)), - Self::TSTypeQuery(it) => Self::Cloned::TSTypeQuery(it.clone_in(alloc)), - Self::TSTypeReference(it) => Self::Cloned::TSTypeReference(it.clone_in(alloc)), - Self::TSUnionType(it) => Self::Cloned::TSUnionType(it.clone_in(alloc)), - Self::TSParenthesizedType(it) => Self::Cloned::TSParenthesizedType(it.clone_in(alloc)), - Self::JSDocNullableType(it) => Self::Cloned::JSDocNullableType(it.clone_in(alloc)), - Self::JSDocNonNullableType(it) => { - Self::Cloned::JSDocNonNullableType(it.clone_in(alloc)) - } - Self::JSDocUnknownType(it) => Self::Cloned::JSDocUnknownType(it.clone_in(alloc)), + Self::TSAnyKeyword(it) => TSType::TSAnyKeyword(it.clone_in(alloc)), + Self::TSBigIntKeyword(it) => TSType::TSBigIntKeyword(it.clone_in(alloc)), + Self::TSBooleanKeyword(it) => TSType::TSBooleanKeyword(it.clone_in(alloc)), + Self::TSIntrinsicKeyword(it) => TSType::TSIntrinsicKeyword(it.clone_in(alloc)), + Self::TSNeverKeyword(it) => TSType::TSNeverKeyword(it.clone_in(alloc)), + Self::TSNullKeyword(it) => TSType::TSNullKeyword(it.clone_in(alloc)), + Self::TSNumberKeyword(it) => TSType::TSNumberKeyword(it.clone_in(alloc)), + Self::TSObjectKeyword(it) => TSType::TSObjectKeyword(it.clone_in(alloc)), + Self::TSStringKeyword(it) => TSType::TSStringKeyword(it.clone_in(alloc)), + Self::TSSymbolKeyword(it) => TSType::TSSymbolKeyword(it.clone_in(alloc)), + Self::TSUndefinedKeyword(it) => TSType::TSUndefinedKeyword(it.clone_in(alloc)), + Self::TSUnknownKeyword(it) => TSType::TSUnknownKeyword(it.clone_in(alloc)), + Self::TSVoidKeyword(it) => TSType::TSVoidKeyword(it.clone_in(alloc)), + Self::TSArrayType(it) => TSType::TSArrayType(it.clone_in(alloc)), + Self::TSConditionalType(it) => TSType::TSConditionalType(it.clone_in(alloc)), + Self::TSConstructorType(it) => TSType::TSConstructorType(it.clone_in(alloc)), + Self::TSFunctionType(it) => TSType::TSFunctionType(it.clone_in(alloc)), + Self::TSImportType(it) => TSType::TSImportType(it.clone_in(alloc)), + Self::TSIndexedAccessType(it) => TSType::TSIndexedAccessType(it.clone_in(alloc)), + Self::TSInferType(it) => TSType::TSInferType(it.clone_in(alloc)), + Self::TSIntersectionType(it) => TSType::TSIntersectionType(it.clone_in(alloc)), + Self::TSLiteralType(it) => TSType::TSLiteralType(it.clone_in(alloc)), + Self::TSMappedType(it) => TSType::TSMappedType(it.clone_in(alloc)), + Self::TSNamedTupleMember(it) => TSType::TSNamedTupleMember(it.clone_in(alloc)), + Self::TSQualifiedName(it) => TSType::TSQualifiedName(it.clone_in(alloc)), + Self::TSTemplateLiteralType(it) => TSType::TSTemplateLiteralType(it.clone_in(alloc)), + Self::TSThisType(it) => TSType::TSThisType(it.clone_in(alloc)), + Self::TSTupleType(it) => TSType::TSTupleType(it.clone_in(alloc)), + Self::TSTypeLiteral(it) => TSType::TSTypeLiteral(it.clone_in(alloc)), + Self::TSTypeOperatorType(it) => TSType::TSTypeOperatorType(it.clone_in(alloc)), + Self::TSTypePredicate(it) => TSType::TSTypePredicate(it.clone_in(alloc)), + Self::TSTypeQuery(it) => TSType::TSTypeQuery(it.clone_in(alloc)), + Self::TSTypeReference(it) => TSType::TSTypeReference(it.clone_in(alloc)), + Self::TSUnionType(it) => TSType::TSUnionType(it.clone_in(alloc)), + Self::TSParenthesizedType(it) => TSType::TSParenthesizedType(it.clone_in(alloc)), + Self::JSDocNullableType(it) => TSType::JSDocNullableType(it.clone_in(alloc)), + Self::JSDocNonNullableType(it) => TSType::JSDocNonNullableType(it.clone_in(alloc)), + Self::JSDocUnknownType(it) => TSType::JSDocUnknownType(it.clone_in(alloc)), } } } @@ -2293,9 +2417,9 @@ impl<'alloc> CloneIn<'alloc> for TSTypeOperatorOperator { type Cloned = TSTypeOperatorOperator; fn clone_in(&self, _: &'alloc Allocator) -> Self::Cloned { match self { - Self::Keyof => Self::Cloned::Keyof, - Self::Unique => Self::Cloned::Unique, - Self::Readonly => Self::Cloned::Readonly, + Self::Keyof => TSTypeOperatorOperator::Keyof, + Self::Unique => TSTypeOperatorOperator::Unique, + Self::Readonly => TSTypeOperatorOperator::Readonly, } } } @@ -2367,50 +2491,54 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for TSTupleElement<'old_alloc> type Cloned = TSTupleElement<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::TSOptionalType(it) => Self::Cloned::TSOptionalType(it.clone_in(alloc)), - Self::TSRestType(it) => Self::Cloned::TSRestType(it.clone_in(alloc)), - Self::TSAnyKeyword(it) => Self::Cloned::TSAnyKeyword(it.clone_in(alloc)), - Self::TSBigIntKeyword(it) => Self::Cloned::TSBigIntKeyword(it.clone_in(alloc)), - Self::TSBooleanKeyword(it) => Self::Cloned::TSBooleanKeyword(it.clone_in(alloc)), - Self::TSIntrinsicKeyword(it) => Self::Cloned::TSIntrinsicKeyword(it.clone_in(alloc)), - Self::TSNeverKeyword(it) => Self::Cloned::TSNeverKeyword(it.clone_in(alloc)), - Self::TSNullKeyword(it) => Self::Cloned::TSNullKeyword(it.clone_in(alloc)), - Self::TSNumberKeyword(it) => Self::Cloned::TSNumberKeyword(it.clone_in(alloc)), - Self::TSObjectKeyword(it) => Self::Cloned::TSObjectKeyword(it.clone_in(alloc)), - Self::TSStringKeyword(it) => Self::Cloned::TSStringKeyword(it.clone_in(alloc)), - Self::TSSymbolKeyword(it) => Self::Cloned::TSSymbolKeyword(it.clone_in(alloc)), - Self::TSUndefinedKeyword(it) => Self::Cloned::TSUndefinedKeyword(it.clone_in(alloc)), - Self::TSUnknownKeyword(it) => Self::Cloned::TSUnknownKeyword(it.clone_in(alloc)), - Self::TSVoidKeyword(it) => Self::Cloned::TSVoidKeyword(it.clone_in(alloc)), - Self::TSArrayType(it) => Self::Cloned::TSArrayType(it.clone_in(alloc)), - Self::TSConditionalType(it) => Self::Cloned::TSConditionalType(it.clone_in(alloc)), - Self::TSConstructorType(it) => Self::Cloned::TSConstructorType(it.clone_in(alloc)), - Self::TSFunctionType(it) => Self::Cloned::TSFunctionType(it.clone_in(alloc)), - Self::TSImportType(it) => Self::Cloned::TSImportType(it.clone_in(alloc)), - Self::TSIndexedAccessType(it) => Self::Cloned::TSIndexedAccessType(it.clone_in(alloc)), - Self::TSInferType(it) => Self::Cloned::TSInferType(it.clone_in(alloc)), - Self::TSIntersectionType(it) => Self::Cloned::TSIntersectionType(it.clone_in(alloc)), - Self::TSLiteralType(it) => Self::Cloned::TSLiteralType(it.clone_in(alloc)), - Self::TSMappedType(it) => Self::Cloned::TSMappedType(it.clone_in(alloc)), - Self::TSNamedTupleMember(it) => Self::Cloned::TSNamedTupleMember(it.clone_in(alloc)), - Self::TSQualifiedName(it) => Self::Cloned::TSQualifiedName(it.clone_in(alloc)), + Self::TSOptionalType(it) => TSTupleElement::TSOptionalType(it.clone_in(alloc)), + Self::TSRestType(it) => TSTupleElement::TSRestType(it.clone_in(alloc)), + Self::TSAnyKeyword(it) => TSTupleElement::TSAnyKeyword(it.clone_in(alloc)), + Self::TSBigIntKeyword(it) => TSTupleElement::TSBigIntKeyword(it.clone_in(alloc)), + Self::TSBooleanKeyword(it) => TSTupleElement::TSBooleanKeyword(it.clone_in(alloc)), + Self::TSIntrinsicKeyword(it) => TSTupleElement::TSIntrinsicKeyword(it.clone_in(alloc)), + Self::TSNeverKeyword(it) => TSTupleElement::TSNeverKeyword(it.clone_in(alloc)), + Self::TSNullKeyword(it) => TSTupleElement::TSNullKeyword(it.clone_in(alloc)), + Self::TSNumberKeyword(it) => TSTupleElement::TSNumberKeyword(it.clone_in(alloc)), + Self::TSObjectKeyword(it) => TSTupleElement::TSObjectKeyword(it.clone_in(alloc)), + Self::TSStringKeyword(it) => TSTupleElement::TSStringKeyword(it.clone_in(alloc)), + Self::TSSymbolKeyword(it) => TSTupleElement::TSSymbolKeyword(it.clone_in(alloc)), + Self::TSUndefinedKeyword(it) => TSTupleElement::TSUndefinedKeyword(it.clone_in(alloc)), + Self::TSUnknownKeyword(it) => TSTupleElement::TSUnknownKeyword(it.clone_in(alloc)), + Self::TSVoidKeyword(it) => TSTupleElement::TSVoidKeyword(it.clone_in(alloc)), + Self::TSArrayType(it) => TSTupleElement::TSArrayType(it.clone_in(alloc)), + Self::TSConditionalType(it) => TSTupleElement::TSConditionalType(it.clone_in(alloc)), + Self::TSConstructorType(it) => TSTupleElement::TSConstructorType(it.clone_in(alloc)), + Self::TSFunctionType(it) => TSTupleElement::TSFunctionType(it.clone_in(alloc)), + Self::TSImportType(it) => TSTupleElement::TSImportType(it.clone_in(alloc)), + Self::TSIndexedAccessType(it) => { + TSTupleElement::TSIndexedAccessType(it.clone_in(alloc)) + } + Self::TSInferType(it) => TSTupleElement::TSInferType(it.clone_in(alloc)), + Self::TSIntersectionType(it) => TSTupleElement::TSIntersectionType(it.clone_in(alloc)), + Self::TSLiteralType(it) => TSTupleElement::TSLiteralType(it.clone_in(alloc)), + Self::TSMappedType(it) => TSTupleElement::TSMappedType(it.clone_in(alloc)), + Self::TSNamedTupleMember(it) => TSTupleElement::TSNamedTupleMember(it.clone_in(alloc)), + Self::TSQualifiedName(it) => TSTupleElement::TSQualifiedName(it.clone_in(alloc)), Self::TSTemplateLiteralType(it) => { - Self::Cloned::TSTemplateLiteralType(it.clone_in(alloc)) - } - Self::TSThisType(it) => Self::Cloned::TSThisType(it.clone_in(alloc)), - Self::TSTupleType(it) => Self::Cloned::TSTupleType(it.clone_in(alloc)), - Self::TSTypeLiteral(it) => Self::Cloned::TSTypeLiteral(it.clone_in(alloc)), - Self::TSTypeOperatorType(it) => Self::Cloned::TSTypeOperatorType(it.clone_in(alloc)), - Self::TSTypePredicate(it) => Self::Cloned::TSTypePredicate(it.clone_in(alloc)), - Self::TSTypeQuery(it) => Self::Cloned::TSTypeQuery(it.clone_in(alloc)), - Self::TSTypeReference(it) => Self::Cloned::TSTypeReference(it.clone_in(alloc)), - Self::TSUnionType(it) => Self::Cloned::TSUnionType(it.clone_in(alloc)), - Self::TSParenthesizedType(it) => Self::Cloned::TSParenthesizedType(it.clone_in(alloc)), - Self::JSDocNullableType(it) => Self::Cloned::JSDocNullableType(it.clone_in(alloc)), + TSTupleElement::TSTemplateLiteralType(it.clone_in(alloc)) + } + Self::TSThisType(it) => TSTupleElement::TSThisType(it.clone_in(alloc)), + Self::TSTupleType(it) => TSTupleElement::TSTupleType(it.clone_in(alloc)), + Self::TSTypeLiteral(it) => TSTupleElement::TSTypeLiteral(it.clone_in(alloc)), + Self::TSTypeOperatorType(it) => TSTupleElement::TSTypeOperatorType(it.clone_in(alloc)), + Self::TSTypePredicate(it) => TSTupleElement::TSTypePredicate(it.clone_in(alloc)), + Self::TSTypeQuery(it) => TSTupleElement::TSTypeQuery(it.clone_in(alloc)), + Self::TSTypeReference(it) => TSTupleElement::TSTypeReference(it.clone_in(alloc)), + Self::TSUnionType(it) => TSTupleElement::TSUnionType(it.clone_in(alloc)), + Self::TSParenthesizedType(it) => { + TSTupleElement::TSParenthesizedType(it.clone_in(alloc)) + } + Self::JSDocNullableType(it) => TSTupleElement::JSDocNullableType(it.clone_in(alloc)), Self::JSDocNonNullableType(it) => { - Self::Cloned::JSDocNonNullableType(it.clone_in(alloc)) + TSTupleElement::JSDocNonNullableType(it.clone_in(alloc)) } - Self::JSDocUnknownType(it) => Self::Cloned::JSDocUnknownType(it.clone_in(alloc)), + Self::JSDocUnknownType(it) => TSTupleElement::JSDocUnknownType(it.clone_in(alloc)), } } } @@ -2528,8 +2656,8 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for TSTypeName<'old_alloc> { type Cloned = TSTypeName<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::IdentifierReference(it) => Self::Cloned::IdentifierReference(it.clone_in(alloc)), - Self::QualifiedName(it) => Self::Cloned::QualifiedName(it.clone_in(alloc)), + Self::IdentifierReference(it) => TSTypeName::IdentifierReference(it.clone_in(alloc)), + Self::QualifiedName(it) => TSTypeName::QualifiedName(it.clone_in(alloc)), } } } @@ -2598,9 +2726,9 @@ impl<'alloc> CloneIn<'alloc> for TSAccessibility { type Cloned = TSAccessibility; fn clone_in(&self, _: &'alloc Allocator) -> Self::Cloned { match self { - Self::Private => Self::Cloned::Private, - Self::Protected => Self::Cloned::Protected, - Self::Public => Self::Cloned::Public, + Self::Private => TSAccessibility::Private, + Self::Protected => TSAccessibility::Protected, + Self::Public => TSAccessibility::Public, } } } @@ -2656,15 +2784,15 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for TSSignature<'old_alloc> { type Cloned = TSSignature<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::TSIndexSignature(it) => Self::Cloned::TSIndexSignature(it.clone_in(alloc)), - Self::TSPropertySignature(it) => Self::Cloned::TSPropertySignature(it.clone_in(alloc)), + Self::TSIndexSignature(it) => TSSignature::TSIndexSignature(it.clone_in(alloc)), + Self::TSPropertySignature(it) => TSSignature::TSPropertySignature(it.clone_in(alloc)), Self::TSCallSignatureDeclaration(it) => { - Self::Cloned::TSCallSignatureDeclaration(it.clone_in(alloc)) + TSSignature::TSCallSignatureDeclaration(it.clone_in(alloc)) } Self::TSConstructSignatureDeclaration(it) => { - Self::Cloned::TSConstructSignatureDeclaration(it.clone_in(alloc)) + TSSignature::TSConstructSignatureDeclaration(it.clone_in(alloc)) } - Self::TSMethodSignature(it) => Self::Cloned::TSMethodSignature(it.clone_in(alloc)), + Self::TSMethodSignature(it) => TSSignature::TSMethodSignature(it.clone_in(alloc)), } } } @@ -2698,9 +2826,9 @@ impl<'alloc> CloneIn<'alloc> for TSMethodSignatureKind { type Cloned = TSMethodSignatureKind; fn clone_in(&self, _: &'alloc Allocator) -> Self::Cloned { match self { - Self::Method => Self::Cloned::Method, - Self::Get => Self::Cloned::Get, - Self::Set => Self::Cloned::Set, + Self::Method => TSMethodSignatureKind::Method, + Self::Get => TSMethodSignatureKind::Get, + Self::Set => TSMethodSignatureKind::Set, } } } @@ -2774,8 +2902,8 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for TSTypePredicateName<'old_al type Cloned = TSTypePredicateName<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::Identifier(it) => Self::Cloned::Identifier(it.clone_in(alloc)), - Self::This(it) => Self::Cloned::This(it.clone_in(alloc)), + Self::Identifier(it) => TSTypePredicateName::Identifier(it.clone_in(alloc)), + Self::This(it) => TSTypePredicateName::This(it.clone_in(alloc)), } } } @@ -2798,9 +2926,9 @@ impl<'alloc> CloneIn<'alloc> for TSModuleDeclarationKind { type Cloned = TSModuleDeclarationKind; fn clone_in(&self, _: &'alloc Allocator) -> Self::Cloned { match self { - Self::Global => Self::Cloned::Global, - Self::Module => Self::Cloned::Module, - Self::Namespace => Self::Cloned::Namespace, + Self::Global => TSModuleDeclarationKind::Global, + Self::Module => TSModuleDeclarationKind::Module, + Self::Namespace => TSModuleDeclarationKind::Namespace, } } } @@ -2809,8 +2937,8 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for TSModuleDeclarationName<'ol type Cloned = TSModuleDeclarationName<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::Identifier(it) => Self::Cloned::Identifier(it.clone_in(alloc)), - Self::StringLiteral(it) => Self::Cloned::StringLiteral(it.clone_in(alloc)), + Self::Identifier(it) => TSModuleDeclarationName::Identifier(it.clone_in(alloc)), + Self::StringLiteral(it) => TSModuleDeclarationName::StringLiteral(it.clone_in(alloc)), } } } @@ -2819,8 +2947,10 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for TSModuleDeclarationBody<'ol type Cloned = TSModuleDeclarationBody<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::TSModuleDeclaration(it) => Self::Cloned::TSModuleDeclaration(it.clone_in(alloc)), - Self::TSModuleBlock(it) => Self::Cloned::TSModuleBlock(it.clone_in(alloc)), + Self::TSModuleDeclaration(it) => { + TSModuleDeclarationBody::TSModuleDeclaration(it.clone_in(alloc)) + } + Self::TSModuleBlock(it) => TSModuleDeclarationBody::TSModuleBlock(it.clone_in(alloc)), } } } @@ -2868,9 +2998,11 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for TSTypeQueryExprName<'old_al type Cloned = TSTypeQueryExprName<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::TSImportType(it) => Self::Cloned::TSImportType(it.clone_in(alloc)), - Self::IdentifierReference(it) => Self::Cloned::IdentifierReference(it.clone_in(alloc)), - Self::QualifiedName(it) => Self::Cloned::QualifiedName(it.clone_in(alloc)), + Self::TSImportType(it) => TSTypeQueryExprName::TSImportType(it.clone_in(alloc)), + Self::IdentifierReference(it) => { + TSTypeQueryExprName::IdentifierReference(it.clone_in(alloc)) + } + Self::QualifiedName(it) => TSTypeQueryExprName::QualifiedName(it.clone_in(alloc)), } } } @@ -2915,8 +3047,8 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for TSImportAttributeName<'old_ type Cloned = TSImportAttributeName<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::Identifier(it) => Self::Cloned::Identifier(it.clone_in(alloc)), - Self::StringLiteral(it) => Self::Cloned::StringLiteral(it.clone_in(alloc)), + Self::Identifier(it) => TSImportAttributeName::Identifier(it.clone_in(alloc)), + Self::StringLiteral(it) => TSImportAttributeName::StringLiteral(it.clone_in(alloc)), } } } @@ -2966,10 +3098,10 @@ impl<'alloc> CloneIn<'alloc> for TSMappedTypeModifierOperator { type Cloned = TSMappedTypeModifierOperator; fn clone_in(&self, _: &'alloc Allocator) -> Self::Cloned { match self { - Self::True => Self::Cloned::True, - Self::Plus => Self::Cloned::Plus, - Self::Minus => Self::Cloned::Minus, - Self::None => Self::Cloned::None, + Self::True => TSMappedTypeModifierOperator::True, + Self::Plus => TSMappedTypeModifierOperator::Plus, + Self::Minus => TSMappedTypeModifierOperator::Minus, + Self::None => TSMappedTypeModifierOperator::None, } } } @@ -3035,10 +3167,12 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for TSModuleReference<'old_allo fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { Self::ExternalModuleReference(it) => { - Self::Cloned::ExternalModuleReference(it.clone_in(alloc)) + TSModuleReference::ExternalModuleReference(it.clone_in(alloc)) + } + Self::IdentifierReference(it) => { + TSModuleReference::IdentifierReference(it.clone_in(alloc)) } - Self::IdentifierReference(it) => Self::Cloned::IdentifierReference(it.clone_in(alloc)), - Self::QualifiedName(it) => Self::Cloned::QualifiedName(it.clone_in(alloc)), + Self::QualifiedName(it) => TSModuleReference::QualifiedName(it.clone_in(alloc)), } } } @@ -3105,8 +3239,8 @@ impl<'alloc> CloneIn<'alloc> for ImportOrExportKind { type Cloned = ImportOrExportKind; fn clone_in(&self, _: &'alloc Allocator) -> Self::Cloned { match self { - Self::Value => Self::Cloned::Value, - Self::Type => Self::Cloned::Type, + Self::Value => ImportOrExportKind::Value, + Self::Type => ImportOrExportKind::Type, } } } @@ -3202,9 +3336,9 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for JSXElementName<'old_alloc> type Cloned = JSXElementName<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::Identifier(it) => Self::Cloned::Identifier(it.clone_in(alloc)), - Self::NamespacedName(it) => Self::Cloned::NamespacedName(it.clone_in(alloc)), - Self::MemberExpression(it) => Self::Cloned::MemberExpression(it.clone_in(alloc)), + Self::Identifier(it) => JSXElementName::Identifier(it.clone_in(alloc)), + Self::NamespacedName(it) => JSXElementName::NamespacedName(it.clone_in(alloc)), + Self::MemberExpression(it) => JSXElementName::MemberExpression(it.clone_in(alloc)), } } } @@ -3235,8 +3369,10 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for JSXMemberExpressionObject<' type Cloned = JSXMemberExpressionObject<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::Identifier(it) => Self::Cloned::Identifier(it.clone_in(alloc)), - Self::MemberExpression(it) => Self::Cloned::MemberExpression(it.clone_in(alloc)), + Self::Identifier(it) => JSXMemberExpressionObject::Identifier(it.clone_in(alloc)), + Self::MemberExpression(it) => { + JSXMemberExpressionObject::MemberExpression(it.clone_in(alloc)) + } } } } @@ -3255,68 +3391,68 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for JSXExpression<'old_alloc> { type Cloned = JSXExpression<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::EmptyExpression(it) => Self::Cloned::EmptyExpression(it.clone_in(alloc)), - Self::BooleanLiteral(it) => Self::Cloned::BooleanLiteral(it.clone_in(alloc)), - Self::NullLiteral(it) => Self::Cloned::NullLiteral(it.clone_in(alloc)), - Self::NumericLiteral(it) => Self::Cloned::NumericLiteral(it.clone_in(alloc)), - Self::BigIntLiteral(it) => Self::Cloned::BigIntLiteral(it.clone_in(alloc)), - Self::RegExpLiteral(it) => Self::Cloned::RegExpLiteral(it.clone_in(alloc)), - Self::StringLiteral(it) => Self::Cloned::StringLiteral(it.clone_in(alloc)), - Self::TemplateLiteral(it) => Self::Cloned::TemplateLiteral(it.clone_in(alloc)), - Self::Identifier(it) => Self::Cloned::Identifier(it.clone_in(alloc)), - Self::MetaProperty(it) => Self::Cloned::MetaProperty(it.clone_in(alloc)), - Self::Super(it) => Self::Cloned::Super(it.clone_in(alloc)), - Self::ArrayExpression(it) => Self::Cloned::ArrayExpression(it.clone_in(alloc)), + Self::EmptyExpression(it) => JSXExpression::EmptyExpression(it.clone_in(alloc)), + Self::BooleanLiteral(it) => JSXExpression::BooleanLiteral(it.clone_in(alloc)), + Self::NullLiteral(it) => JSXExpression::NullLiteral(it.clone_in(alloc)), + Self::NumericLiteral(it) => JSXExpression::NumericLiteral(it.clone_in(alloc)), + Self::BigIntLiteral(it) => JSXExpression::BigIntLiteral(it.clone_in(alloc)), + Self::RegExpLiteral(it) => JSXExpression::RegExpLiteral(it.clone_in(alloc)), + Self::StringLiteral(it) => JSXExpression::StringLiteral(it.clone_in(alloc)), + Self::TemplateLiteral(it) => JSXExpression::TemplateLiteral(it.clone_in(alloc)), + Self::Identifier(it) => JSXExpression::Identifier(it.clone_in(alloc)), + Self::MetaProperty(it) => JSXExpression::MetaProperty(it.clone_in(alloc)), + Self::Super(it) => JSXExpression::Super(it.clone_in(alloc)), + Self::ArrayExpression(it) => JSXExpression::ArrayExpression(it.clone_in(alloc)), Self::ArrowFunctionExpression(it) => { - Self::Cloned::ArrowFunctionExpression(it.clone_in(alloc)) + JSXExpression::ArrowFunctionExpression(it.clone_in(alloc)) } Self::AssignmentExpression(it) => { - Self::Cloned::AssignmentExpression(it.clone_in(alloc)) + JSXExpression::AssignmentExpression(it.clone_in(alloc)) } - Self::AwaitExpression(it) => Self::Cloned::AwaitExpression(it.clone_in(alloc)), - Self::BinaryExpression(it) => Self::Cloned::BinaryExpression(it.clone_in(alloc)), - Self::CallExpression(it) => Self::Cloned::CallExpression(it.clone_in(alloc)), - Self::ChainExpression(it) => Self::Cloned::ChainExpression(it.clone_in(alloc)), - Self::ClassExpression(it) => Self::Cloned::ClassExpression(it.clone_in(alloc)), + Self::AwaitExpression(it) => JSXExpression::AwaitExpression(it.clone_in(alloc)), + Self::BinaryExpression(it) => JSXExpression::BinaryExpression(it.clone_in(alloc)), + Self::CallExpression(it) => JSXExpression::CallExpression(it.clone_in(alloc)), + Self::ChainExpression(it) => JSXExpression::ChainExpression(it.clone_in(alloc)), + Self::ClassExpression(it) => JSXExpression::ClassExpression(it.clone_in(alloc)), Self::ConditionalExpression(it) => { - Self::Cloned::ConditionalExpression(it.clone_in(alloc)) + JSXExpression::ConditionalExpression(it.clone_in(alloc)) } - Self::FunctionExpression(it) => Self::Cloned::FunctionExpression(it.clone_in(alloc)), - Self::ImportExpression(it) => Self::Cloned::ImportExpression(it.clone_in(alloc)), - Self::LogicalExpression(it) => Self::Cloned::LogicalExpression(it.clone_in(alloc)), - Self::NewExpression(it) => Self::Cloned::NewExpression(it.clone_in(alloc)), - Self::ObjectExpression(it) => Self::Cloned::ObjectExpression(it.clone_in(alloc)), + Self::FunctionExpression(it) => JSXExpression::FunctionExpression(it.clone_in(alloc)), + Self::ImportExpression(it) => JSXExpression::ImportExpression(it.clone_in(alloc)), + Self::LogicalExpression(it) => JSXExpression::LogicalExpression(it.clone_in(alloc)), + Self::NewExpression(it) => JSXExpression::NewExpression(it.clone_in(alloc)), + Self::ObjectExpression(it) => JSXExpression::ObjectExpression(it.clone_in(alloc)), Self::ParenthesizedExpression(it) => { - Self::Cloned::ParenthesizedExpression(it.clone_in(alloc)) + JSXExpression::ParenthesizedExpression(it.clone_in(alloc)) } - Self::SequenceExpression(it) => Self::Cloned::SequenceExpression(it.clone_in(alloc)), + Self::SequenceExpression(it) => JSXExpression::SequenceExpression(it.clone_in(alloc)), Self::TaggedTemplateExpression(it) => { - Self::Cloned::TaggedTemplateExpression(it.clone_in(alloc)) - } - Self::ThisExpression(it) => Self::Cloned::ThisExpression(it.clone_in(alloc)), - Self::UnaryExpression(it) => Self::Cloned::UnaryExpression(it.clone_in(alloc)), - Self::UpdateExpression(it) => Self::Cloned::UpdateExpression(it.clone_in(alloc)), - Self::YieldExpression(it) => Self::Cloned::YieldExpression(it.clone_in(alloc)), - Self::PrivateInExpression(it) => Self::Cloned::PrivateInExpression(it.clone_in(alloc)), - Self::JSXElement(it) => Self::Cloned::JSXElement(it.clone_in(alloc)), - Self::JSXFragment(it) => Self::Cloned::JSXFragment(it.clone_in(alloc)), - Self::TSAsExpression(it) => Self::Cloned::TSAsExpression(it.clone_in(alloc)), + JSXExpression::TaggedTemplateExpression(it.clone_in(alloc)) + } + Self::ThisExpression(it) => JSXExpression::ThisExpression(it.clone_in(alloc)), + Self::UnaryExpression(it) => JSXExpression::UnaryExpression(it.clone_in(alloc)), + Self::UpdateExpression(it) => JSXExpression::UpdateExpression(it.clone_in(alloc)), + Self::YieldExpression(it) => JSXExpression::YieldExpression(it.clone_in(alloc)), + Self::PrivateInExpression(it) => JSXExpression::PrivateInExpression(it.clone_in(alloc)), + Self::JSXElement(it) => JSXExpression::JSXElement(it.clone_in(alloc)), + Self::JSXFragment(it) => JSXExpression::JSXFragment(it.clone_in(alloc)), + Self::TSAsExpression(it) => JSXExpression::TSAsExpression(it.clone_in(alloc)), Self::TSSatisfiesExpression(it) => { - Self::Cloned::TSSatisfiesExpression(it.clone_in(alloc)) + JSXExpression::TSSatisfiesExpression(it.clone_in(alloc)) } - Self::TSTypeAssertion(it) => Self::Cloned::TSTypeAssertion(it.clone_in(alloc)), - Self::TSNonNullExpression(it) => Self::Cloned::TSNonNullExpression(it.clone_in(alloc)), + Self::TSTypeAssertion(it) => JSXExpression::TSTypeAssertion(it.clone_in(alloc)), + Self::TSNonNullExpression(it) => JSXExpression::TSNonNullExpression(it.clone_in(alloc)), Self::TSInstantiationExpression(it) => { - Self::Cloned::TSInstantiationExpression(it.clone_in(alloc)) + JSXExpression::TSInstantiationExpression(it.clone_in(alloc)) } Self::ComputedMemberExpression(it) => { - Self::Cloned::ComputedMemberExpression(it.clone_in(alloc)) + JSXExpression::ComputedMemberExpression(it.clone_in(alloc)) } Self::StaticMemberExpression(it) => { - Self::Cloned::StaticMemberExpression(it.clone_in(alloc)) + JSXExpression::StaticMemberExpression(it.clone_in(alloc)) } Self::PrivateFieldExpression(it) => { - Self::Cloned::PrivateFieldExpression(it.clone_in(alloc)) + JSXExpression::PrivateFieldExpression(it.clone_in(alloc)) } } } @@ -3333,8 +3469,8 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for JSXAttributeItem<'old_alloc type Cloned = JSXAttributeItem<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::Attribute(it) => Self::Cloned::Attribute(it.clone_in(alloc)), - Self::SpreadAttribute(it) => Self::Cloned::SpreadAttribute(it.clone_in(alloc)), + Self::Attribute(it) => JSXAttributeItem::Attribute(it.clone_in(alloc)), + Self::SpreadAttribute(it) => JSXAttributeItem::SpreadAttribute(it.clone_in(alloc)), } } } @@ -3364,8 +3500,8 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for JSXAttributeName<'old_alloc type Cloned = JSXAttributeName<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::Identifier(it) => Self::Cloned::Identifier(it.clone_in(alloc)), - Self::NamespacedName(it) => Self::Cloned::NamespacedName(it.clone_in(alloc)), + Self::Identifier(it) => JSXAttributeName::Identifier(it.clone_in(alloc)), + Self::NamespacedName(it) => JSXAttributeName::NamespacedName(it.clone_in(alloc)), } } } @@ -3374,10 +3510,12 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for JSXAttributeValue<'old_allo type Cloned = JSXAttributeValue<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::StringLiteral(it) => Self::Cloned::StringLiteral(it.clone_in(alloc)), - Self::ExpressionContainer(it) => Self::Cloned::ExpressionContainer(it.clone_in(alloc)), - Self::Element(it) => Self::Cloned::Element(it.clone_in(alloc)), - Self::Fragment(it) => Self::Cloned::Fragment(it.clone_in(alloc)), + Self::StringLiteral(it) => JSXAttributeValue::StringLiteral(it.clone_in(alloc)), + Self::ExpressionContainer(it) => { + JSXAttributeValue::ExpressionContainer(it.clone_in(alloc)) + } + Self::Element(it) => JSXAttributeValue::Element(it.clone_in(alloc)), + Self::Fragment(it) => JSXAttributeValue::Fragment(it.clone_in(alloc)), } } } @@ -3393,11 +3531,11 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for JSXChild<'old_alloc> { type Cloned = JSXChild<'new_alloc>; fn clone_in(&self, alloc: &'new_alloc Allocator) -> Self::Cloned { match self { - Self::Text(it) => Self::Cloned::Text(it.clone_in(alloc)), - Self::Element(it) => Self::Cloned::Element(it.clone_in(alloc)), - Self::Fragment(it) => Self::Cloned::Fragment(it.clone_in(alloc)), - Self::ExpressionContainer(it) => Self::Cloned::ExpressionContainer(it.clone_in(alloc)), - Self::Spread(it) => Self::Cloned::Spread(it.clone_in(alloc)), + Self::Text(it) => JSXChild::Text(it.clone_in(alloc)), + Self::Element(it) => JSXChild::Element(it.clone_in(alloc)), + Self::Fragment(it) => JSXChild::Fragment(it.clone_in(alloc)), + Self::ExpressionContainer(it) => JSXChild::ExpressionContainer(it.clone_in(alloc)), + Self::Spread(it) => JSXChild::Spread(it.clone_in(alloc)), } } } diff --git a/crates/oxc_ast/src/generated/derive_get_span.rs b/crates/oxc_ast/src/generated/derive_get_span.rs new file mode 100644 index 0000000000000..3bed45bee9160 --- /dev/null +++ b/crates/oxc_ast/src/generated/derive_get_span.rs @@ -0,0 +1,2237 @@ +// Auto-generated code, DO NOT EDIT DIRECTLY! +// To edit this generated file you have to edit `tasks/ast_codegen/src/generators/derive_get_span.rs` + +#![allow(clippy::match_same_arms)] + +use crate::ast::*; +use oxc_span::{GetSpan, Span}; + +impl GetSpan for BooleanLiteral { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl GetSpan for NullLiteral { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for NumericLiteral<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for BigIntLiteral<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for RegExpLiteral<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for StringLiteral<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for Program<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for Expression<'a> { + #[inline] + 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(), + } + } +} + +impl<'a> GetSpan for IdentifierName<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for IdentifierReference<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for BindingIdentifier<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for LabelIdentifier<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl GetSpan for ThisExpression { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ArrayExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ArrayExpressionElement<'a> { + #[inline] + 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(), + } + } +} + +impl GetSpan for Elision { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ObjectExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ObjectPropertyKind<'a> { + #[inline] + fn span(&self) -> Span { + match self { + Self::ObjectProperty(it) => it.span(), + Self::SpreadProperty(it) => it.span(), + } + } +} + +impl<'a> GetSpan for ObjectProperty<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for PropertyKey<'a> { + #[inline] + 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(), + } + } +} + +impl<'a> GetSpan for TemplateLiteral<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TaggedTemplateExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TemplateElement<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for MemberExpression<'a> { + #[inline] + fn span(&self) -> Span { + match self { + Self::ComputedMemberExpression(it) => it.span(), + Self::StaticMemberExpression(it) => it.span(), + Self::PrivateFieldExpression(it) => it.span(), + } + } +} + +impl<'a> GetSpan for ComputedMemberExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for StaticMemberExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for PrivateFieldExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for CallExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for NewExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for MetaProperty<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for SpreadElement<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for Argument<'a> { + #[inline] + 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(), + } + } +} + +impl<'a> GetSpan for UpdateExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for UnaryExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for BinaryExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for PrivateInExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for LogicalExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ConditionalExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for AssignmentExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for AssignmentTarget<'a> { + #[inline] + 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(), + } + } +} + +impl<'a> GetSpan for SimpleAssignmentTarget<'a> { + #[inline] + 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(), + } + } +} + +impl<'a> GetSpan for AssignmentTargetPattern<'a> { + #[inline] + fn span(&self) -> Span { + match self { + Self::ArrayAssignmentTarget(it) => it.span(), + Self::ObjectAssignmentTarget(it) => it.span(), + } + } +} + +impl<'a> GetSpan for ArrayAssignmentTarget<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ObjectAssignmentTarget<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for AssignmentTargetRest<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for AssignmentTargetMaybeDefault<'a> { + #[inline] + 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(), + } + } +} + +impl<'a> GetSpan for AssignmentTargetWithDefault<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for AssignmentTargetProperty<'a> { + #[inline] + fn span(&self) -> Span { + match self { + Self::AssignmentTargetPropertyIdentifier(it) => it.span(), + Self::AssignmentTargetPropertyProperty(it) => it.span(), + } + } +} + +impl<'a> GetSpan for AssignmentTargetPropertyIdentifier<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for AssignmentTargetPropertyProperty<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for SequenceExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl GetSpan for Super { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for AwaitExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ChainExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ChainElement<'a> { + #[inline] + 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(), + } + } +} + +impl<'a> GetSpan for ParenthesizedExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for Statement<'a> { + #[inline] + 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::UsingDeclaration(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(), + } + } +} + +impl<'a> GetSpan for Directive<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for Hashbang<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for BlockStatement<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for Declaration<'a> { + #[inline] + fn span(&self) -> Span { + match self { + Self::VariableDeclaration(it) => it.span(), + Self::FunctionDeclaration(it) => it.span(), + Self::ClassDeclaration(it) => it.span(), + Self::UsingDeclaration(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(), + } + } +} + +impl<'a> GetSpan for VariableDeclaration<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for VariableDeclarator<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for UsingDeclaration<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl GetSpan for EmptyStatement { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ExpressionStatement<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for IfStatement<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for DoWhileStatement<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for WhileStatement<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ForStatement<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ForStatementInit<'a> { + #[inline] + fn span(&self) -> Span { + match self { + Self::VariableDeclaration(it) => it.span(), + Self::UsingDeclaration(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(), + } + } +} + +impl<'a> GetSpan for ForInStatement<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ForStatementLeft<'a> { + #[inline] + fn span(&self) -> Span { + match self { + Self::VariableDeclaration(it) => it.span(), + Self::UsingDeclaration(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(), + } + } +} + +impl<'a> GetSpan for ForOfStatement<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ContinueStatement<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for BreakStatement<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ReturnStatement<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for WithStatement<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for SwitchStatement<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for SwitchCase<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for LabeledStatement<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ThrowStatement<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TryStatement<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for CatchClause<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for CatchParameter<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl GetSpan for DebuggerStatement { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for BindingPattern<'a> { + #[inline] + fn span(&self) -> Span { + self.kind.span() + } +} + +impl<'a> GetSpan for BindingPatternKind<'a> { + #[inline] + 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(), + } + } +} + +impl<'a> GetSpan for AssignmentPattern<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ObjectPattern<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for BindingProperty<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ArrayPattern<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for BindingRestElement<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for Function<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for FormalParameters<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for FormalParameter<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for FunctionBody<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ArrowFunctionExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for YieldExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for Class<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ClassBody<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ClassElement<'a> { + #[inline] + 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(), + } + } +} + +impl<'a> GetSpan for MethodDefinition<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for PropertyDefinition<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for PrivateIdentifier<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for StaticBlock<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ModuleDeclaration<'a> { + #[inline] + 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(), + } + } +} + +impl<'a> GetSpan for AccessorProperty<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ImportExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ImportDeclaration<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ImportDeclarationSpecifier<'a> { + #[inline] + fn span(&self) -> Span { + match self { + Self::ImportSpecifier(it) => it.span(), + Self::ImportDefaultSpecifier(it) => it.span(), + Self::ImportNamespaceSpecifier(it) => it.span(), + } + } +} + +impl<'a> GetSpan for ImportSpecifier<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ImportDefaultSpecifier<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ImportNamespaceSpecifier<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for WithClause<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ImportAttribute<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ImportAttributeKey<'a> { + #[inline] + fn span(&self) -> Span { + match self { + Self::Identifier(it) => it.span(), + Self::StringLiteral(it) => it.span(), + } + } +} + +impl<'a> GetSpan for ExportNamedDeclaration<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ExportDefaultDeclaration<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ExportAllDeclaration<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ExportSpecifier<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for ExportDefaultDeclarationKind<'a> { + #[inline] + 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(), + } + } +} + +impl<'a> GetSpan for ModuleExportName<'a> { + #[inline] + fn span(&self) -> Span { + match self { + Self::IdentifierName(it) => it.span(), + Self::IdentifierReference(it) => it.span(), + Self::StringLiteral(it) => it.span(), + } + } +} + +impl<'a> GetSpan for TSThisParameter<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSEnumDeclaration<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSEnumMember<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSEnumMemberName<'a> { + #[inline] + 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(), + } + } +} + +impl<'a> GetSpan for TSTypeAnnotation<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSLiteralType<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSLiteral<'a> { + #[inline] + 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(), + } + } +} + +impl<'a> GetSpan for TSType<'a> { + #[inline] + 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(), + } + } +} + +impl<'a> GetSpan for TSConditionalType<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSUnionType<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSIntersectionType<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSParenthesizedType<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSTypeOperator<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSArrayType<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSIndexedAccessType<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSTupleType<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSNamedTupleMember<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSOptionalType<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSRestType<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSTupleElement<'a> { + #[inline] + 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(), + } + } +} + +impl GetSpan for TSAnyKeyword { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl GetSpan for TSStringKeyword { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl GetSpan for TSBooleanKeyword { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl GetSpan for TSNumberKeyword { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl GetSpan for TSNeverKeyword { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl GetSpan for TSIntrinsicKeyword { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl GetSpan for TSUnknownKeyword { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl GetSpan for TSNullKeyword { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl GetSpan for TSUndefinedKeyword { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl GetSpan for TSVoidKeyword { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl GetSpan for TSSymbolKeyword { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl GetSpan for TSThisType { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl GetSpan for TSObjectKeyword { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl GetSpan for TSBigIntKeyword { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSTypeReference<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSTypeName<'a> { + #[inline] + fn span(&self) -> Span { + match self { + Self::IdentifierReference(it) => it.span(), + Self::QualifiedName(it) => it.span(), + } + } +} + +impl<'a> GetSpan for TSQualifiedName<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSTypeParameterInstantiation<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSTypeParameter<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSTypeParameterDeclaration<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSTypeAliasDeclaration<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSClassImplements<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSInterfaceDeclaration<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSInterfaceBody<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSPropertySignature<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSSignature<'a> { + #[inline] + 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(), + } + } +} + +impl<'a> GetSpan for TSIndexSignature<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSCallSignatureDeclaration<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSMethodSignature<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSConstructSignatureDeclaration<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSIndexSignatureName<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSInterfaceHeritage<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSTypePredicate<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSTypePredicateName<'a> { + #[inline] + fn span(&self) -> Span { + match self { + Self::Identifier(it) => it.span(), + Self::This(it) => it.span(), + } + } +} + +impl<'a> GetSpan for TSModuleDeclaration<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSModuleDeclarationName<'a> { + #[inline] + fn span(&self) -> Span { + match self { + Self::Identifier(it) => it.span(), + Self::StringLiteral(it) => it.span(), + } + } +} + +impl<'a> GetSpan for TSModuleDeclarationBody<'a> { + #[inline] + fn span(&self) -> Span { + match self { + Self::TSModuleDeclaration(it) => it.span(), + Self::TSModuleBlock(it) => it.span(), + } + } +} + +impl<'a> GetSpan for TSModuleBlock<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSTypeLiteral<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSInferType<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSTypeQuery<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSTypeQueryExprName<'a> { + #[inline] + fn span(&self) -> Span { + match self { + Self::TSImportType(it) => it.span(), + Self::IdentifierReference(it) => it.span(), + Self::QualifiedName(it) => it.span(), + } + } +} + +impl<'a> GetSpan for TSImportType<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSImportAttributes<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSImportAttribute<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSImportAttributeName<'a> { + #[inline] + fn span(&self) -> Span { + match self { + Self::Identifier(it) => it.span(), + Self::StringLiteral(it) => it.span(), + } + } +} + +impl<'a> GetSpan for TSFunctionType<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSConstructorType<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSMappedType<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSTemplateLiteralType<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSAsExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSSatisfiesExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSTypeAssertion<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSImportEqualsDeclaration<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSModuleReference<'a> { + #[inline] + fn span(&self) -> Span { + match self { + Self::ExternalModuleReference(it) => it.span(), + Self::IdentifierReference(it) => it.span(), + Self::QualifiedName(it) => it.span(), + } + } +} + +impl<'a> GetSpan for TSExternalModuleReference<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSNonNullExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for Decorator<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSExportAssignment<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSNamespaceExportDeclaration<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for TSInstantiationExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for JSDocNullableType<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for JSDocNonNullableType<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl GetSpan for JSDocUnknownType { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for JSXElement<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for JSXOpeningElement<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for JSXClosingElement<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for JSXFragment<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for JSXElementName<'a> { + #[inline] + fn span(&self) -> Span { + match self { + Self::Identifier(it) => it.span(), + Self::NamespacedName(it) => it.span(), + Self::MemberExpression(it) => it.span(), + } + } +} + +impl<'a> GetSpan for JSXNamespacedName<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for JSXMemberExpression<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for JSXMemberExpressionObject<'a> { + #[inline] + fn span(&self) -> Span { + match self { + Self::Identifier(it) => it.span(), + Self::MemberExpression(it) => it.span(), + } + } +} + +impl<'a> GetSpan for JSXExpressionContainer<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for JSXExpression<'a> { + #[inline] + 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(), + } + } +} + +impl GetSpan for JSXEmptyExpression { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for JSXAttributeItem<'a> { + #[inline] + fn span(&self) -> Span { + match self { + Self::Attribute(it) => it.span(), + Self::SpreadAttribute(it) => it.span(), + } + } +} + +impl<'a> GetSpan for JSXAttribute<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for JSXSpreadAttribute<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for JSXAttributeName<'a> { + #[inline] + fn span(&self) -> Span { + match self { + Self::Identifier(it) => it.span(), + Self::NamespacedName(it) => it.span(), + } + } +} + +impl<'a> GetSpan for JSXAttributeValue<'a> { + #[inline] + 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(), + } + } +} + +impl<'a> GetSpan for JSXIdentifier<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for JSXChild<'a> { + #[inline] + 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(), + } + } +} + +impl<'a> GetSpan for JSXSpreadChild<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +impl<'a> GetSpan for JSXText<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} diff --git a/crates/oxc_ast/src/generated/span.rs b/crates/oxc_ast/src/generated/derive_get_span_mut.rs similarity index 53% rename from crates/oxc_ast/src/generated/span.rs rename to crates/oxc_ast/src/generated/derive_get_span_mut.rs index fef350ad706be..b5eb8fb4848b1 100644 --- a/crates/oxc_ast/src/generated/span.rs +++ b/crates/oxc_ast/src/generated/derive_get_span_mut.rs @@ -1,17 +1,10 @@ // Auto-generated code, DO NOT EDIT DIRECTLY! -// To edit this generated file you have to edit `tasks/ast_codegen/src/generators/impl_get_span.rs` +// To edit this generated file you have to edit `tasks/ast_codegen/src/generators/derive_get_span.rs` #![allow(clippy::match_same_arms)] use crate::ast::*; -use oxc_span::{GetSpan, GetSpanMut, Span}; - -impl GetSpan for BooleanLiteral { - #[inline] - fn span(&self) -> Span { - self.span - } -} +use oxc_span::{GetSpanMut, Span}; impl GetSpanMut for BooleanLiteral { #[inline] @@ -20,13 +13,6 @@ impl GetSpanMut for BooleanLiteral { } } -impl GetSpan for NullLiteral { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl GetSpanMut for NullLiteral { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -34,13 +20,6 @@ impl GetSpanMut for NullLiteral { } } -impl<'a> GetSpan for NumericLiteral<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for NumericLiteral<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -48,13 +27,6 @@ impl<'a> GetSpanMut for NumericLiteral<'a> { } } -impl<'a> GetSpan for BigIntLiteral<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for BigIntLiteral<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -62,13 +34,6 @@ impl<'a> GetSpanMut for BigIntLiteral<'a> { } } -impl<'a> GetSpan for RegExpLiteral<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for RegExpLiteral<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -76,13 +41,6 @@ impl<'a> GetSpanMut for RegExpLiteral<'a> { } } -impl<'a> GetSpan for StringLiteral<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for StringLiteral<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -90,13 +48,6 @@ impl<'a> GetSpanMut for StringLiteral<'a> { } } -impl<'a> GetSpan for Program<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for Program<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -104,56 +55,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for Expression<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::BooleanLiteral(it) => it.span_mut(), @@ -202,13 +105,6 @@ impl<'a> GetSpanMut for Expression<'a> { } } -impl<'a> GetSpan for IdentifierName<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for IdentifierName<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -216,13 +112,6 @@ impl<'a> GetSpanMut for IdentifierName<'a> { } } -impl<'a> GetSpan for IdentifierReference<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for IdentifierReference<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -230,13 +119,6 @@ impl<'a> GetSpanMut for IdentifierReference<'a> { } } -impl<'a> GetSpan for BindingIdentifier<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for BindingIdentifier<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -244,13 +126,6 @@ impl<'a> GetSpanMut for BindingIdentifier<'a> { } } -impl<'a> GetSpan for LabelIdentifier<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for LabelIdentifier<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -258,13 +133,6 @@ impl<'a> GetSpanMut for LabelIdentifier<'a> { } } -impl GetSpan for ThisExpression { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl GetSpanMut for ThisExpression { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -272,13 +140,6 @@ impl GetSpanMut for ThisExpression { } } -impl<'a> GetSpan for ArrayExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ArrayExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -286,58 +147,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for ArrayExpressionElement<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::SpreadElement(it) => it.span_mut(), @@ -388,13 +199,6 @@ impl<'a> GetSpanMut for ArrayExpressionElement<'a> { } } -impl GetSpan for Elision { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl GetSpanMut for Elision { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -402,13 +206,6 @@ impl GetSpanMut for Elision { } } -impl<'a> GetSpan for ObjectExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ObjectExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -416,16 +213,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for ObjectPropertyKind<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::ObjectProperty(it) => it.span_mut(), @@ -434,13 +223,6 @@ impl<'a> GetSpanMut for ObjectPropertyKind<'a> { } } -impl<'a> GetSpan for ObjectProperty<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ObjectProperty<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -448,58 +230,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for PropertyKey<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::StaticIdentifier(it) => it.span_mut(), @@ -550,13 +282,6 @@ impl<'a> GetSpanMut for PropertyKey<'a> { } } -impl<'a> GetSpan for TemplateLiteral<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TemplateLiteral<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -564,13 +289,6 @@ impl<'a> GetSpanMut for TemplateLiteral<'a> { } } -impl<'a> GetSpan for TaggedTemplateExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TaggedTemplateExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -578,13 +296,6 @@ impl<'a> GetSpanMut for TaggedTemplateExpression<'a> { } } -impl<'a> GetSpan for TemplateElement<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TemplateElement<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -592,17 +303,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for MemberExpression<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::ComputedMemberExpression(it) => it.span_mut(), @@ -612,13 +314,6 @@ impl<'a> GetSpanMut for MemberExpression<'a> { } } -impl<'a> GetSpan for ComputedMemberExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ComputedMemberExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -626,13 +321,6 @@ impl<'a> GetSpanMut for ComputedMemberExpression<'a> { } } -impl<'a> GetSpan for StaticMemberExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for StaticMemberExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -640,13 +328,6 @@ impl<'a> GetSpanMut for StaticMemberExpression<'a> { } } -impl<'a> GetSpan for PrivateFieldExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for PrivateFieldExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -654,13 +335,6 @@ impl<'a> GetSpanMut for PrivateFieldExpression<'a> { } } -impl<'a> GetSpan for CallExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for CallExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -668,13 +342,6 @@ impl<'a> GetSpanMut for CallExpression<'a> { } } -impl<'a> GetSpan for NewExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for NewExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -682,13 +349,6 @@ impl<'a> GetSpanMut for NewExpression<'a> { } } -impl<'a> GetSpan for MetaProperty<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for MetaProperty<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -696,13 +356,6 @@ impl<'a> GetSpanMut for MetaProperty<'a> { } } -impl<'a> GetSpan for SpreadElement<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for SpreadElement<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -710,57 +363,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for Argument<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::SpreadElement(it) => it.span_mut(), @@ -810,13 +414,6 @@ impl<'a> GetSpanMut for Argument<'a> { } } -impl<'a> GetSpan for UpdateExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for UpdateExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -824,13 +421,6 @@ impl<'a> GetSpanMut for UpdateExpression<'a> { } } -impl<'a> GetSpan for UnaryExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for UnaryExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -838,13 +428,6 @@ impl<'a> GetSpanMut for UnaryExpression<'a> { } } -impl<'a> GetSpan for BinaryExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for BinaryExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -852,13 +435,6 @@ impl<'a> GetSpanMut for BinaryExpression<'a> { } } -impl<'a> GetSpan for PrivateInExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for PrivateInExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -866,13 +442,6 @@ impl<'a> GetSpanMut for PrivateInExpression<'a> { } } -impl<'a> GetSpan for LogicalExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for LogicalExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -880,13 +449,6 @@ impl<'a> GetSpanMut for LogicalExpression<'a> { } } -impl<'a> GetSpan for ConditionalExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ConditionalExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -894,13 +456,6 @@ impl<'a> GetSpanMut for ConditionalExpression<'a> { } } -impl<'a> GetSpan for AssignmentExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for AssignmentExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -908,25 +463,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for AssignmentTarget<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::AssignmentTargetIdentifier(it) => it.span_mut(), @@ -944,23 +482,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for SimpleAssignmentTarget<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::AssignmentTargetIdentifier(it) => it.span_mut(), @@ -976,16 +499,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for AssignmentTargetPattern<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::ArrayAssignmentTarget(it) => it.span_mut(), @@ -994,13 +509,6 @@ impl<'a> GetSpanMut for AssignmentTargetPattern<'a> { } } -impl<'a> GetSpan for ArrayAssignmentTarget<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ArrayAssignmentTarget<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1008,13 +516,6 @@ impl<'a> GetSpanMut for ArrayAssignmentTarget<'a> { } } -impl<'a> GetSpan for ObjectAssignmentTarget<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ObjectAssignmentTarget<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1022,13 +523,6 @@ impl<'a> GetSpanMut for ObjectAssignmentTarget<'a> { } } -impl<'a> GetSpan for AssignmentTargetRest<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for AssignmentTargetRest<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1036,26 +530,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for AssignmentTargetMaybeDefault<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::AssignmentTargetWithDefault(it) => it.span_mut(), @@ -1074,13 +550,6 @@ impl<'a> GetSpanMut for AssignmentTargetMaybeDefault<'a> { } } -impl<'a> GetSpan for AssignmentTargetWithDefault<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for AssignmentTargetWithDefault<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1088,16 +557,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for AssignmentTargetProperty<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::AssignmentTargetPropertyIdentifier(it) => it.span_mut(), @@ -1106,13 +567,6 @@ impl<'a> GetSpanMut for AssignmentTargetProperty<'a> { } } -impl<'a> GetSpan for AssignmentTargetPropertyIdentifier<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for AssignmentTargetPropertyIdentifier<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1120,13 +574,6 @@ impl<'a> GetSpanMut for AssignmentTargetPropertyIdentifier<'a> { } } -impl<'a> GetSpan for AssignmentTargetPropertyProperty<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for AssignmentTargetPropertyProperty<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1134,13 +581,6 @@ impl<'a> GetSpanMut for AssignmentTargetPropertyProperty<'a> { } } -impl<'a> GetSpan for SequenceExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for SequenceExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1148,13 +588,6 @@ impl<'a> GetSpanMut for SequenceExpression<'a> { } } -impl GetSpan for Super { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl GetSpanMut for Super { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1162,13 +595,6 @@ impl GetSpanMut for Super { } } -impl<'a> GetSpan for AwaitExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for AwaitExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1176,13 +602,6 @@ impl<'a> GetSpanMut for AwaitExpression<'a> { } } -impl<'a> GetSpan for ChainExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ChainExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1190,18 +609,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for ChainElement<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::CallExpression(it) => it.span_mut(), @@ -1212,13 +621,6 @@ impl<'a> GetSpanMut for ChainElement<'a> { } } -impl<'a> GetSpan for ParenthesizedExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ParenthesizedExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1226,47 +628,8 @@ impl<'a> GetSpanMut 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::UsingDeclaration(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(), - } - } -} - impl<'a> GetSpanMut for Statement<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::BlockStatement(it) => it.span_mut(), @@ -1306,27 +669,13 @@ impl<'a> GetSpanMut for Statement<'a> { } } -impl<'a> GetSpan for Directive<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - -impl<'a> GetSpanMut for Directive<'a> { +impl<'a> GetSpanMut for Directive<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { &mut self.span } } -impl<'a> GetSpan for Hashbang<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for Hashbang<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1334,13 +683,6 @@ impl<'a> GetSpanMut for Hashbang<'a> { } } -impl<'a> GetSpan for BlockStatement<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for BlockStatement<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1348,23 +690,8 @@ impl<'a> GetSpanMut 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::UsingDeclaration(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(), - } - } -} - impl<'a> GetSpanMut for Declaration<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::VariableDeclaration(it) => it.span_mut(), @@ -1380,13 +707,6 @@ impl<'a> GetSpanMut for Declaration<'a> { } } -impl<'a> GetSpan for VariableDeclaration<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for VariableDeclaration<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1394,13 +714,6 @@ impl<'a> GetSpanMut for VariableDeclaration<'a> { } } -impl<'a> GetSpan for VariableDeclarator<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for VariableDeclarator<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1408,13 +721,6 @@ impl<'a> GetSpanMut for VariableDeclarator<'a> { } } -impl<'a> GetSpan for UsingDeclaration<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for UsingDeclaration<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1422,13 +728,6 @@ impl<'a> GetSpanMut for UsingDeclaration<'a> { } } -impl GetSpan for EmptyStatement { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl GetSpanMut for EmptyStatement { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1436,13 +735,6 @@ impl GetSpanMut for EmptyStatement { } } -impl<'a> GetSpan for ExpressionStatement<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ExpressionStatement<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1450,13 +742,6 @@ impl<'a> GetSpanMut for ExpressionStatement<'a> { } } -impl<'a> GetSpan for IfStatement<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for IfStatement<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1464,13 +749,6 @@ impl<'a> GetSpanMut for IfStatement<'a> { } } -impl<'a> GetSpan for DoWhileStatement<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for DoWhileStatement<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1478,13 +756,6 @@ impl<'a> GetSpanMut for DoWhileStatement<'a> { } } -impl<'a> GetSpan for WhileStatement<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for WhileStatement<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1492,13 +763,6 @@ impl<'a> GetSpanMut for WhileStatement<'a> { } } -impl<'a> GetSpan for ForStatement<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ForStatement<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1506,58 +770,8 @@ impl<'a> GetSpanMut for ForStatement<'a> { } } -impl<'a> GetSpan for ForStatementInit<'a> { - fn span(&self) -> Span { - match self { - Self::VariableDeclaration(it) => it.span(), - Self::UsingDeclaration(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(), - } - } -} - impl<'a> GetSpanMut for ForStatementInit<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::VariableDeclaration(it) => it.span_mut(), @@ -1608,13 +822,6 @@ impl<'a> GetSpanMut for ForStatementInit<'a> { } } -impl<'a> GetSpan for ForInStatement<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ForInStatement<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1622,27 +829,8 @@ impl<'a> GetSpanMut for ForInStatement<'a> { } } -impl<'a> GetSpan for ForStatementLeft<'a> { - fn span(&self) -> Span { - match self { - Self::VariableDeclaration(it) => it.span(), - Self::UsingDeclaration(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(), - } - } -} - impl<'a> GetSpanMut for ForStatementLeft<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::VariableDeclaration(it) => it.span_mut(), @@ -1662,13 +850,6 @@ impl<'a> GetSpanMut for ForStatementLeft<'a> { } } -impl<'a> GetSpan for ForOfStatement<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ForOfStatement<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1676,13 +857,6 @@ impl<'a> GetSpanMut for ForOfStatement<'a> { } } -impl<'a> GetSpan for ContinueStatement<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ContinueStatement<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1690,13 +864,6 @@ impl<'a> GetSpanMut for ContinueStatement<'a> { } } -impl<'a> GetSpan for BreakStatement<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for BreakStatement<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1704,13 +871,6 @@ impl<'a> GetSpanMut for BreakStatement<'a> { } } -impl<'a> GetSpan for ReturnStatement<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ReturnStatement<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1718,13 +878,6 @@ impl<'a> GetSpanMut for ReturnStatement<'a> { } } -impl<'a> GetSpan for WithStatement<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for WithStatement<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1732,13 +885,6 @@ impl<'a> GetSpanMut for WithStatement<'a> { } } -impl<'a> GetSpan for SwitchStatement<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for SwitchStatement<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1746,13 +892,6 @@ impl<'a> GetSpanMut for SwitchStatement<'a> { } } -impl<'a> GetSpan for SwitchCase<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for SwitchCase<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1760,13 +899,6 @@ impl<'a> GetSpanMut for SwitchCase<'a> { } } -impl<'a> GetSpan for LabeledStatement<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for LabeledStatement<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1774,13 +906,6 @@ impl<'a> GetSpanMut for LabeledStatement<'a> { } } -impl<'a> GetSpan for ThrowStatement<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ThrowStatement<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1788,13 +913,6 @@ impl<'a> GetSpanMut for ThrowStatement<'a> { } } -impl<'a> GetSpan for TryStatement<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TryStatement<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1802,13 +920,6 @@ impl<'a> GetSpanMut for TryStatement<'a> { } } -impl<'a> GetSpan for CatchClause<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for CatchClause<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1816,13 +927,6 @@ impl<'a> GetSpanMut for CatchClause<'a> { } } -impl<'a> GetSpan for CatchParameter<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for CatchParameter<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1830,13 +934,6 @@ impl<'a> GetSpanMut for CatchParameter<'a> { } } -impl GetSpan for DebuggerStatement { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl GetSpanMut for DebuggerStatement { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1844,13 +941,6 @@ impl GetSpanMut for DebuggerStatement { } } -impl<'a> GetSpan for BindingPattern<'a> { - #[inline] - fn span(&self) -> Span { - self.kind.span() - } -} - impl<'a> GetSpanMut for BindingPattern<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1858,18 +948,8 @@ impl<'a> GetSpanMut for BindingPattern<'a> { } } -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(), - } - } -} - impl<'a> GetSpanMut for BindingPatternKind<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::BindingIdentifier(it) => it.span_mut(), @@ -1880,13 +960,6 @@ impl<'a> GetSpanMut for BindingPatternKind<'a> { } } -impl<'a> GetSpan for AssignmentPattern<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for AssignmentPattern<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1894,13 +967,6 @@ impl<'a> GetSpanMut for AssignmentPattern<'a> { } } -impl<'a> GetSpan for ObjectPattern<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ObjectPattern<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1908,13 +974,6 @@ impl<'a> GetSpanMut for ObjectPattern<'a> { } } -impl<'a> GetSpan for BindingProperty<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for BindingProperty<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1922,13 +981,6 @@ impl<'a> GetSpanMut for BindingProperty<'a> { } } -impl<'a> GetSpan for ArrayPattern<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ArrayPattern<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1936,13 +988,6 @@ impl<'a> GetSpanMut for ArrayPattern<'a> { } } -impl<'a> GetSpan for BindingRestElement<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for BindingRestElement<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1950,13 +995,6 @@ impl<'a> GetSpanMut for BindingRestElement<'a> { } } -impl<'a> GetSpan for Function<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for Function<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1964,13 +1002,6 @@ impl<'a> GetSpanMut for Function<'a> { } } -impl<'a> GetSpan for FormalParameters<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for FormalParameters<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1978,13 +1009,6 @@ impl<'a> GetSpanMut for FormalParameters<'a> { } } -impl<'a> GetSpan for FormalParameter<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for FormalParameter<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1992,13 +1016,6 @@ impl<'a> GetSpanMut for FormalParameter<'a> { } } -impl<'a> GetSpan for FunctionBody<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for FunctionBody<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2006,13 +1023,6 @@ impl<'a> GetSpanMut for FunctionBody<'a> { } } -impl<'a> GetSpan for ArrowFunctionExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ArrowFunctionExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2020,13 +1030,6 @@ impl<'a> GetSpanMut for ArrowFunctionExpression<'a> { } } -impl<'a> GetSpan for YieldExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for YieldExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2034,13 +1037,6 @@ impl<'a> GetSpanMut for YieldExpression<'a> { } } -impl<'a> GetSpan for Class<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for Class<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2048,13 +1044,6 @@ impl<'a> GetSpanMut for Class<'a> { } } -impl<'a> GetSpan for ClassBody<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ClassBody<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2062,19 +1051,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for ClassElement<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::StaticBlock(it) => it.span_mut(), @@ -2086,13 +1064,6 @@ impl<'a> GetSpanMut for ClassElement<'a> { } } -impl<'a> GetSpan for MethodDefinition<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for MethodDefinition<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2100,13 +1071,6 @@ impl<'a> GetSpanMut for MethodDefinition<'a> { } } -impl<'a> GetSpan for PropertyDefinition<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for PropertyDefinition<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2114,13 +1078,6 @@ impl<'a> GetSpanMut for PropertyDefinition<'a> { } } -impl<'a> GetSpan for PrivateIdentifier<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for PrivateIdentifier<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2128,13 +1085,6 @@ impl<'a> GetSpanMut for PrivateIdentifier<'a> { } } -impl<'a> GetSpan for StaticBlock<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for StaticBlock<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2142,20 +1092,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for ModuleDeclaration<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::ImportDeclaration(it) => it.span_mut(), @@ -2168,13 +1106,6 @@ impl<'a> GetSpanMut for ModuleDeclaration<'a> { } } -impl<'a> GetSpan for AccessorProperty<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for AccessorProperty<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2182,13 +1113,6 @@ impl<'a> GetSpanMut for AccessorProperty<'a> { } } -impl<'a> GetSpan for ImportExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ImportExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2196,13 +1120,6 @@ impl<'a> GetSpanMut for ImportExpression<'a> { } } -impl<'a> GetSpan for ImportDeclaration<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ImportDeclaration<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2210,17 +1127,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for ImportDeclarationSpecifier<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::ImportSpecifier(it) => it.span_mut(), @@ -2230,13 +1138,6 @@ impl<'a> GetSpanMut for ImportDeclarationSpecifier<'a> { } } -impl<'a> GetSpan for ImportSpecifier<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ImportSpecifier<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2244,13 +1145,6 @@ impl<'a> GetSpanMut for ImportSpecifier<'a> { } } -impl<'a> GetSpan for ImportDefaultSpecifier<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ImportDefaultSpecifier<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2258,13 +1152,6 @@ impl<'a> GetSpanMut for ImportDefaultSpecifier<'a> { } } -impl<'a> GetSpan for ImportNamespaceSpecifier<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ImportNamespaceSpecifier<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2272,13 +1159,6 @@ impl<'a> GetSpanMut for ImportNamespaceSpecifier<'a> { } } -impl<'a> GetSpan for WithClause<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for WithClause<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2286,13 +1166,6 @@ impl<'a> GetSpanMut for WithClause<'a> { } } -impl<'a> GetSpan for ImportAttribute<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ImportAttribute<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2300,16 +1173,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for ImportAttributeKey<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::Identifier(it) => it.span_mut(), @@ -2318,13 +1183,6 @@ impl<'a> GetSpanMut for ImportAttributeKey<'a> { } } -impl<'a> GetSpan for ExportNamedDeclaration<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ExportNamedDeclaration<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2332,13 +1190,6 @@ impl<'a> GetSpanMut for ExportNamedDeclaration<'a> { } } -impl<'a> GetSpan for ExportDefaultDeclaration<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ExportDefaultDeclaration<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2346,13 +1197,6 @@ impl<'a> GetSpanMut for ExportDefaultDeclaration<'a> { } } -impl<'a> GetSpan for ExportAllDeclaration<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ExportAllDeclaration<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2360,13 +1204,6 @@ impl<'a> GetSpanMut for ExportAllDeclaration<'a> { } } -impl<'a> GetSpan for ExportSpecifier<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for ExportSpecifier<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2374,59 +1211,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for ExportDefaultDeclarationKind<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::FunctionDeclaration(it) => it.span_mut(), @@ -2478,17 +1264,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for ModuleExportName<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::IdentifierName(it) => it.span_mut(), @@ -2498,13 +1275,6 @@ impl<'a> GetSpanMut for ModuleExportName<'a> { } } -impl<'a> GetSpan for TSThisParameter<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSThisParameter<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2512,13 +1282,6 @@ impl<'a> GetSpanMut for TSThisParameter<'a> { } } -impl<'a> GetSpan for TSEnumDeclaration<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSEnumDeclaration<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2526,13 +1289,6 @@ impl<'a> GetSpanMut for TSEnumDeclaration<'a> { } } -impl<'a> GetSpan for TSEnumMember<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSEnumMember<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2540,60 +1296,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for TSEnumMemberName<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::StaticIdentifier(it) => it.span_mut(), @@ -2646,13 +1350,6 @@ impl<'a> GetSpanMut for TSEnumMemberName<'a> { } } -impl<'a> GetSpan for TSTypeAnnotation<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSTypeAnnotation<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2660,13 +1357,6 @@ impl<'a> GetSpanMut for TSTypeAnnotation<'a> { } } -impl<'a> GetSpan for TSLiteralType<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSLiteralType<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2674,22 +1364,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for TSLiteral<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::BooleanLiteral(it) => it.span_mut(), @@ -2704,52 +1380,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for TSType<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::TSAnyKeyword(it) => it.span_mut(), @@ -2794,13 +1426,6 @@ impl<'a> GetSpanMut for TSType<'a> { } } -impl<'a> GetSpan for TSConditionalType<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSConditionalType<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2808,13 +1433,6 @@ impl<'a> GetSpanMut for TSConditionalType<'a> { } } -impl<'a> GetSpan for TSUnionType<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSUnionType<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2822,13 +1440,6 @@ impl<'a> GetSpanMut for TSUnionType<'a> { } } -impl<'a> GetSpan for TSIntersectionType<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSIntersectionType<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2836,13 +1447,6 @@ impl<'a> GetSpanMut for TSIntersectionType<'a> { } } -impl<'a> GetSpan for TSParenthesizedType<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSParenthesizedType<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2850,13 +1454,6 @@ impl<'a> GetSpanMut for TSParenthesizedType<'a> { } } -impl<'a> GetSpan for TSTypeOperator<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSTypeOperator<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2864,13 +1461,6 @@ impl<'a> GetSpanMut for TSTypeOperator<'a> { } } -impl<'a> GetSpan for TSArrayType<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSArrayType<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2878,13 +1468,6 @@ impl<'a> GetSpanMut for TSArrayType<'a> { } } -impl<'a> GetSpan for TSIndexedAccessType<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSIndexedAccessType<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2892,13 +1475,6 @@ impl<'a> GetSpanMut for TSIndexedAccessType<'a> { } } -impl<'a> GetSpan for TSTupleType<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSTupleType<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2906,13 +1482,6 @@ impl<'a> GetSpanMut for TSTupleType<'a> { } } -impl<'a> GetSpan for TSNamedTupleMember<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSNamedTupleMember<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2920,13 +1489,6 @@ impl<'a> GetSpanMut for TSNamedTupleMember<'a> { } } -impl<'a> GetSpan for TSOptionalType<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSOptionalType<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2934,13 +1496,6 @@ impl<'a> GetSpanMut for TSOptionalType<'a> { } } -impl<'a> GetSpan for TSRestType<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSRestType<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -2948,54 +1503,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for TSTupleElement<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::TSOptionalType(it) => it.span_mut(), @@ -3042,13 +1551,6 @@ impl<'a> GetSpanMut for TSTupleElement<'a> { } } -impl GetSpan for TSAnyKeyword { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl GetSpanMut for TSAnyKeyword { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3056,13 +1558,6 @@ impl GetSpanMut for TSAnyKeyword { } } -impl GetSpan for TSStringKeyword { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl GetSpanMut for TSStringKeyword { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3070,13 +1565,6 @@ impl GetSpanMut for TSStringKeyword { } } -impl GetSpan for TSBooleanKeyword { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl GetSpanMut for TSBooleanKeyword { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3084,13 +1572,6 @@ impl GetSpanMut for TSBooleanKeyword { } } -impl GetSpan for TSNumberKeyword { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl GetSpanMut for TSNumberKeyword { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3098,13 +1579,6 @@ impl GetSpanMut for TSNumberKeyword { } } -impl GetSpan for TSNeverKeyword { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl GetSpanMut for TSNeverKeyword { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3112,13 +1586,6 @@ impl GetSpanMut for TSNeverKeyword { } } -impl GetSpan for TSIntrinsicKeyword { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl GetSpanMut for TSIntrinsicKeyword { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3126,13 +1593,6 @@ impl GetSpanMut for TSIntrinsicKeyword { } } -impl GetSpan for TSUnknownKeyword { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl GetSpanMut for TSUnknownKeyword { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3140,13 +1600,6 @@ impl GetSpanMut for TSUnknownKeyword { } } -impl GetSpan for TSNullKeyword { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl GetSpanMut for TSNullKeyword { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3154,13 +1607,6 @@ impl GetSpanMut for TSNullKeyword { } } -impl GetSpan for TSUndefinedKeyword { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl GetSpanMut for TSUndefinedKeyword { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3168,13 +1614,6 @@ impl GetSpanMut for TSUndefinedKeyword { } } -impl GetSpan for TSVoidKeyword { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl GetSpanMut for TSVoidKeyword { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3182,13 +1621,6 @@ impl GetSpanMut for TSVoidKeyword { } } -impl GetSpan for TSSymbolKeyword { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl GetSpanMut for TSSymbolKeyword { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3196,13 +1628,6 @@ impl GetSpanMut for TSSymbolKeyword { } } -impl GetSpan for TSThisType { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl GetSpanMut for TSThisType { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3210,13 +1635,6 @@ impl GetSpanMut for TSThisType { } } -impl GetSpan for TSObjectKeyword { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl GetSpanMut for TSObjectKeyword { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3224,13 +1642,6 @@ impl GetSpanMut for TSObjectKeyword { } } -impl GetSpan for TSBigIntKeyword { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl GetSpanMut for TSBigIntKeyword { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3238,13 +1649,6 @@ impl GetSpanMut for TSBigIntKeyword { } } -impl<'a> GetSpan for TSTypeReference<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSTypeReference<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3252,16 +1656,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for TSTypeName<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::IdentifierReference(it) => it.span_mut(), @@ -3270,13 +1666,6 @@ impl<'a> GetSpanMut for TSTypeName<'a> { } } -impl<'a> GetSpan for TSQualifiedName<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSQualifiedName<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3284,13 +1673,6 @@ impl<'a> GetSpanMut for TSQualifiedName<'a> { } } -impl<'a> GetSpan for TSTypeParameterInstantiation<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSTypeParameterInstantiation<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3298,13 +1680,6 @@ impl<'a> GetSpanMut for TSTypeParameterInstantiation<'a> { } } -impl<'a> GetSpan for TSTypeParameter<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSTypeParameter<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3312,13 +1687,6 @@ impl<'a> GetSpanMut for TSTypeParameter<'a> { } } -impl<'a> GetSpan for TSTypeParameterDeclaration<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSTypeParameterDeclaration<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3326,13 +1694,6 @@ impl<'a> GetSpanMut for TSTypeParameterDeclaration<'a> { } } -impl<'a> GetSpan for TSTypeAliasDeclaration<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSTypeAliasDeclaration<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3340,13 +1701,6 @@ impl<'a> GetSpanMut for TSTypeAliasDeclaration<'a> { } } -impl<'a> GetSpan for TSClassImplements<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSClassImplements<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3354,13 +1708,6 @@ impl<'a> GetSpanMut for TSClassImplements<'a> { } } -impl<'a> GetSpan for TSInterfaceDeclaration<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSInterfaceDeclaration<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3368,13 +1715,6 @@ impl<'a> GetSpanMut for TSInterfaceDeclaration<'a> { } } -impl<'a> GetSpan for TSInterfaceBody<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSInterfaceBody<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3382,13 +1722,6 @@ impl<'a> GetSpanMut for TSInterfaceBody<'a> { } } -impl<'a> GetSpan for TSPropertySignature<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSPropertySignature<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3396,19 +1729,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for TSSignature<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::TSIndexSignature(it) => it.span_mut(), @@ -3420,13 +1742,6 @@ impl<'a> GetSpanMut for TSSignature<'a> { } } -impl<'a> GetSpan for TSIndexSignature<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSIndexSignature<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3434,13 +1749,6 @@ impl<'a> GetSpanMut for TSIndexSignature<'a> { } } -impl<'a> GetSpan for TSCallSignatureDeclaration<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSCallSignatureDeclaration<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3448,13 +1756,6 @@ impl<'a> GetSpanMut for TSCallSignatureDeclaration<'a> { } } -impl<'a> GetSpan for TSMethodSignature<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSMethodSignature<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3462,13 +1763,6 @@ impl<'a> GetSpanMut for TSMethodSignature<'a> { } } -impl<'a> GetSpan for TSConstructSignatureDeclaration<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSConstructSignatureDeclaration<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3476,13 +1770,6 @@ impl<'a> GetSpanMut for TSConstructSignatureDeclaration<'a> { } } -impl<'a> GetSpan for TSIndexSignatureName<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSIndexSignatureName<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3490,13 +1777,6 @@ impl<'a> GetSpanMut for TSIndexSignatureName<'a> { } } -impl<'a> GetSpan for TSInterfaceHeritage<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSInterfaceHeritage<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3504,13 +1784,6 @@ impl<'a> GetSpanMut for TSInterfaceHeritage<'a> { } } -impl<'a> GetSpan for TSTypePredicate<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSTypePredicate<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3518,16 +1791,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for TSTypePredicateName<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::Identifier(it) => it.span_mut(), @@ -3536,13 +1801,6 @@ impl<'a> GetSpanMut for TSTypePredicateName<'a> { } } -impl<'a> GetSpan for TSModuleDeclaration<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSModuleDeclaration<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3550,16 +1808,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for TSModuleDeclarationName<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::Identifier(it) => it.span_mut(), @@ -3568,16 +1818,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for TSModuleDeclarationBody<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::TSModuleDeclaration(it) => it.span_mut(), @@ -3586,13 +1828,6 @@ impl<'a> GetSpanMut for TSModuleDeclarationBody<'a> { } } -impl<'a> GetSpan for TSModuleBlock<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSModuleBlock<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3600,13 +1835,6 @@ impl<'a> GetSpanMut for TSModuleBlock<'a> { } } -impl<'a> GetSpan for TSTypeLiteral<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSTypeLiteral<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3614,13 +1842,6 @@ impl<'a> GetSpanMut for TSTypeLiteral<'a> { } } -impl<'a> GetSpan for TSInferType<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSInferType<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3628,13 +1849,6 @@ impl<'a> GetSpanMut for TSInferType<'a> { } } -impl<'a> GetSpan for TSTypeQuery<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSTypeQuery<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3642,17 +1856,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for TSTypeQueryExprName<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::TSImportType(it) => it.span_mut(), @@ -3662,13 +1867,6 @@ impl<'a> GetSpanMut for TSTypeQueryExprName<'a> { } } -impl<'a> GetSpan for TSImportType<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSImportType<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3676,13 +1874,6 @@ impl<'a> GetSpanMut for TSImportType<'a> { } } -impl<'a> GetSpan for TSImportAttributes<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSImportAttributes<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3690,13 +1881,6 @@ impl<'a> GetSpanMut for TSImportAttributes<'a> { } } -impl<'a> GetSpan for TSImportAttribute<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSImportAttribute<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3704,16 +1888,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for TSImportAttributeName<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::Identifier(it) => it.span_mut(), @@ -3722,13 +1898,6 @@ impl<'a> GetSpanMut for TSImportAttributeName<'a> { } } -impl<'a> GetSpan for TSFunctionType<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSFunctionType<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3736,13 +1905,6 @@ impl<'a> GetSpanMut for TSFunctionType<'a> { } } -impl<'a> GetSpan for TSConstructorType<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSConstructorType<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3750,13 +1912,6 @@ impl<'a> GetSpanMut for TSConstructorType<'a> { } } -impl<'a> GetSpan for TSMappedType<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSMappedType<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3764,13 +1919,6 @@ impl<'a> GetSpanMut for TSMappedType<'a> { } } -impl<'a> GetSpan for TSTemplateLiteralType<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSTemplateLiteralType<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3778,13 +1926,6 @@ impl<'a> GetSpanMut for TSTemplateLiteralType<'a> { } } -impl<'a> GetSpan for TSAsExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSAsExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3792,13 +1933,6 @@ impl<'a> GetSpanMut for TSAsExpression<'a> { } } -impl<'a> GetSpan for TSSatisfiesExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSSatisfiesExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3806,13 +1940,6 @@ impl<'a> GetSpanMut for TSSatisfiesExpression<'a> { } } -impl<'a> GetSpan for TSTypeAssertion<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSTypeAssertion<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3820,13 +1947,6 @@ impl<'a> GetSpanMut for TSTypeAssertion<'a> { } } -impl<'a> GetSpan for TSImportEqualsDeclaration<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSImportEqualsDeclaration<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3834,17 +1954,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for TSModuleReference<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::ExternalModuleReference(it) => it.span_mut(), @@ -3854,13 +1965,6 @@ impl<'a> GetSpanMut for TSModuleReference<'a> { } } -impl<'a> GetSpan for TSExternalModuleReference<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSExternalModuleReference<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3868,13 +1972,6 @@ impl<'a> GetSpanMut for TSExternalModuleReference<'a> { } } -impl<'a> GetSpan for TSNonNullExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSNonNullExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3882,13 +1979,6 @@ impl<'a> GetSpanMut for TSNonNullExpression<'a> { } } -impl<'a> GetSpan for Decorator<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for Decorator<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3896,13 +1986,6 @@ impl<'a> GetSpanMut for Decorator<'a> { } } -impl<'a> GetSpan for TSExportAssignment<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSExportAssignment<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3910,13 +1993,6 @@ impl<'a> GetSpanMut for TSExportAssignment<'a> { } } -impl<'a> GetSpan for TSNamespaceExportDeclaration<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSNamespaceExportDeclaration<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3924,13 +2000,6 @@ impl<'a> GetSpanMut for TSNamespaceExportDeclaration<'a> { } } -impl<'a> GetSpan for TSInstantiationExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for TSInstantiationExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3938,13 +2007,6 @@ impl<'a> GetSpanMut for TSInstantiationExpression<'a> { } } -impl<'a> GetSpan for JSDocNullableType<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for JSDocNullableType<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3952,13 +2014,6 @@ impl<'a> GetSpanMut for JSDocNullableType<'a> { } } -impl<'a> GetSpan for JSDocNonNullableType<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for JSDocNonNullableType<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3966,13 +2021,6 @@ impl<'a> GetSpanMut for JSDocNonNullableType<'a> { } } -impl GetSpan for JSDocUnknownType { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl GetSpanMut for JSDocUnknownType { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3980,13 +2028,6 @@ impl GetSpanMut for JSDocUnknownType { } } -impl<'a> GetSpan for JSXElement<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for JSXElement<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -3994,13 +2035,6 @@ impl<'a> GetSpanMut for JSXElement<'a> { } } -impl<'a> GetSpan for JSXOpeningElement<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for JSXOpeningElement<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -4008,13 +2042,6 @@ impl<'a> GetSpanMut for JSXOpeningElement<'a> { } } -impl<'a> GetSpan for JSXClosingElement<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for JSXClosingElement<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -4022,13 +2049,6 @@ impl<'a> GetSpanMut for JSXClosingElement<'a> { } } -impl<'a> GetSpan for JSXFragment<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for JSXFragment<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -4036,17 +2056,8 @@ impl<'a> GetSpanMut for JSXFragment<'a> { } } -impl<'a> GetSpan for JSXElementName<'a> { - fn span(&self) -> Span { - match self { - Self::Identifier(it) => it.span(), - Self::NamespacedName(it) => it.span(), - Self::MemberExpression(it) => it.span(), - } - } -} - impl<'a> GetSpanMut for JSXElementName<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::Identifier(it) => it.span_mut(), @@ -4056,13 +2067,6 @@ impl<'a> GetSpanMut for JSXElementName<'a> { } } -impl<'a> GetSpan for JSXNamespacedName<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for JSXNamespacedName<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -4070,13 +2074,6 @@ impl<'a> GetSpanMut for JSXNamespacedName<'a> { } } -impl<'a> GetSpan for JSXMemberExpression<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for JSXMemberExpression<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -4084,16 +2081,8 @@ impl<'a> GetSpanMut for JSXMemberExpression<'a> { } } -impl<'a> GetSpan for JSXMemberExpressionObject<'a> { - fn span(&self) -> Span { - match self { - Self::Identifier(it) => it.span(), - Self::MemberExpression(it) => it.span(), - } - } -} - impl<'a> GetSpanMut for JSXMemberExpressionObject<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::Identifier(it) => it.span_mut(), @@ -4102,13 +2091,6 @@ impl<'a> GetSpanMut for JSXMemberExpressionObject<'a> { } } -impl<'a> GetSpan for JSXExpressionContainer<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for JSXExpressionContainer<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -4116,57 +2098,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for JSXExpression<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::EmptyExpression(it) => it.span_mut(), @@ -4216,13 +2149,6 @@ impl<'a> GetSpanMut for JSXExpression<'a> { } } -impl GetSpan for JSXEmptyExpression { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl GetSpanMut for JSXEmptyExpression { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -4230,16 +2156,8 @@ impl GetSpanMut for JSXEmptyExpression { } } -impl<'a> GetSpan for JSXAttributeItem<'a> { - fn span(&self) -> Span { - match self { - Self::Attribute(it) => it.span(), - Self::SpreadAttribute(it) => it.span(), - } - } -} - impl<'a> GetSpanMut for JSXAttributeItem<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::Attribute(it) => it.span_mut(), @@ -4248,13 +2166,6 @@ impl<'a> GetSpanMut for JSXAttributeItem<'a> { } } -impl<'a> GetSpan for JSXAttribute<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for JSXAttribute<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -4262,13 +2173,6 @@ impl<'a> GetSpanMut for JSXAttribute<'a> { } } -impl<'a> GetSpan for JSXSpreadAttribute<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for JSXSpreadAttribute<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -4276,16 +2180,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for JSXAttributeName<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::Identifier(it) => it.span_mut(), @@ -4294,18 +2190,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for JSXAttributeValue<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::StringLiteral(it) => it.span_mut(), @@ -4316,13 +2202,6 @@ impl<'a> GetSpanMut for JSXAttributeValue<'a> { } } -impl<'a> GetSpan for JSXIdentifier<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for JSXIdentifier<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -4330,19 +2209,8 @@ impl<'a> GetSpanMut 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(), - } - } -} - impl<'a> GetSpanMut for JSXChild<'a> { + #[inline] fn span_mut(&mut self) -> &mut Span { match self { Self::Text(it) => it.span_mut(), @@ -4354,13 +2222,6 @@ impl<'a> GetSpanMut for JSXChild<'a> { } } -impl<'a> GetSpan for JSXSpreadChild<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for JSXSpreadChild<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -4368,13 +2229,6 @@ impl<'a> GetSpanMut for JSXSpreadChild<'a> { } } -impl<'a> GetSpan for JSXText<'a> { - #[inline] - fn span(&self) -> Span { - self.span - } -} - impl<'a> GetSpanMut for JSXText<'a> { #[inline] fn span_mut(&mut self) -> &mut Span { diff --git a/crates/oxc_ast/src/lib.rs b/crates/oxc_ast/src/lib.rs index 5dd6410acdf61..0eeb31bdd0f65 100644 --- a/crates/oxc_ast/src/lib.rs +++ b/crates/oxc_ast/src/lib.rs @@ -42,7 +42,8 @@ mod generated { pub mod ast_builder; pub mod ast_kind; pub mod derive_clone_in; - pub mod span; + pub mod derive_get_span; + pub mod derive_get_span_mut; pub mod visit; pub mod visit_mut; } diff --git a/tasks/ast_codegen/src/generators/derive_clone_in.rs b/tasks/ast_codegen/src/generators/derive_clone_in.rs index 2ffd680b8cd32..f3316c14cf902 100644 --- a/tasks/ast_codegen/src/generators/derive_clone_in.rs +++ b/tasks/ast_codegen/src/generators/derive_clone_in.rs @@ -59,10 +59,10 @@ fn derive_enum(def: &EnumDef) -> TokenStream { .map(|var| { let ident = var.ident(); if var.is_unit() { - quote!(Self :: #ident => Self :: Cloned :: #ident) + quote!(Self :: #ident => #ty_ident :: #ident) } else { used_alloc = true; - quote!(Self :: #ident(it) => Self :: Cloned :: #ident(it.clone_in(alloc))) + quote!(Self :: #ident(it) => #ty_ident :: #ident(it.clone_in(alloc))) } }) .collect_vec(); diff --git a/tasks/ast_codegen/src/generators/derive_get_span.rs b/tasks/ast_codegen/src/generators/derive_get_span.rs new file mode 100644 index 0000000000000..f58988833b061 --- /dev/null +++ b/tasks/ast_codegen/src/generators/derive_get_span.rs @@ -0,0 +1,155 @@ +use proc_macro2::TokenStream; +use quote::{format_ident, quote}; +use syn::{Generics, Ident, Type}; + +use crate::{ + output, + schema::{EnumDef, GetGenerics, StructDef, ToType, TypeDef}, + util::ToIdent, + Generator, GeneratorOutput, LateCtx, +}; + +use super::{define_generator, generated_header}; + +define_generator! { + pub struct DeriveGetSpan; +} + +define_generator! { + pub struct DeriveGetSpanMut; +} + +impl Generator for DeriveGetSpan { + fn name(&self) -> &'static str { + stringify!(DeriveGetSpan) + } + + fn generate(&mut self, ctx: &LateCtx) -> GeneratorOutput { + GeneratorOutput::Stream(( + output(crate::AST_CRATE, "derive_get_span.rs"), + derive::(ctx), + )) + } +} + +impl Generator for DeriveGetSpanMut { + fn name(&self) -> &'static str { + stringify!(DeriveGetSpanMut) + } + + fn generate(&mut self, ctx: &LateCtx) -> GeneratorOutput { + GeneratorOutput::Stream(( + output(crate::AST_CRATE, "derive_get_span_mut.rs"), + derive::(ctx), + )) + } +} + +fn derive(ctx: &LateCtx) -> TokenStream { + let (self_type, trait_ident, method_ident, result_type) = if MUT { + ( + quote!(&mut self), + format_ident!("GetSpanMut"), + format_ident!("span_mut"), + quote!(&mut Span), + ) + } else { + (quote!(&self), format_ident!("GetSpan"), format_ident!("span"), quote!(Span)) + }; + + let derive_enum = |it: &EnumDef| { + let generics = it.generics(); + let typ = it.to_type(); + impl_trait( + &trait_ident, + &method_ident, + &generics, + &typ, + &self_type, + &result_type, + &derive_enum(it, &method_ident), + ) + }; + + let derive_struct = |it: &StructDef| { + let generics = it.generics(); + let typ = it.to_type(); + impl_trait( + &trait_ident, + &method_ident, + &generics, + &typ, + &self_type, + &result_type, + &derive_struct::(it, &method_ident), + ) + }; + let impls: Vec = ctx + .schema + .definitions + .iter() + .filter(|def| def.visitable()) + .map(|def| match &def { + TypeDef::Enum(it) => derive_enum(it), + TypeDef::Struct(it) => derive_struct(it), + }) + .collect(); + + let header = generated_header!(); + + quote! { + #header + insert!("#![allow(clippy::match_same_arms)]"); + endl!(); + + use crate::ast::*; + use oxc_span::{#trait_ident, Span}; + + #(#impls)* + } +} + +fn derive_enum(def: &EnumDef, method: &Ident) -> TokenStream { + let matches = def.all_variants().map(|var| { + let ident = var.ident(); + quote!(Self :: #ident(it) => it.#method()) + }); + + quote! { + match self { + #(#matches),* + } + } +} + +fn derive_struct(def: &StructDef, method: &Ident) -> TokenStream { + let inner_span_hint = def.fields.iter().find(|it| it.markers.span); + if let Some(span_field) = inner_span_hint { + let ident = span_field.name.as_ref().map(ToIdent::to_ident).unwrap(); + quote!(self.#ident.#method()) + } else if MUT { + quote!(&mut self.span) + } else { + quote!(self.span) + } +} + +fn impl_trait( + trait_ident: &Ident, + method_ident: &Ident, + generics: &Option, + target_type: &Type, + self_: &TokenStream, + result_type: &TokenStream, + body: &TokenStream, +) -> TokenStream { + quote! { + endl!(); + impl #generics #trait_ident for #target_type { + #[inline] + fn #method_ident(#self_) -> #result_type { + #body + } + } + } +} diff --git a/tasks/ast_codegen/src/generators/impl_get_span.rs b/tasks/ast_codegen/src/generators/impl_get_span.rs deleted file mode 100644 index 5142c90fc8514..0000000000000 --- a/tasks/ast_codegen/src/generators/impl_get_span.rs +++ /dev/null @@ -1,111 +0,0 @@ -use proc_macro2::TokenStream; -use quote::quote; - -use crate::{ - output, - schema::{EnumDef, GetGenerics, StructDef, ToType, TypeDef}, - util::ToIdent, - Generator, GeneratorOutput, LateCtx, -}; - -use super::{define_generator, generated_header}; - -define_generator! { - pub struct ImplGetSpanGenerator; -} - -impl Generator for ImplGetSpanGenerator { - fn name(&self) -> &'static str { - stringify!(ImplGetSpanGenerator) - } - - fn generate(&mut self, ctx: &LateCtx) -> GeneratorOutput { - let impls: Vec = ctx - .schema - .definitions - .iter() - .filter(|def| def.visitable()) - .map(|def| match &def { - TypeDef::Enum(it) => impl_enum(it), - TypeDef::Struct(it) => impl_struct(it), - }) - .collect(); - - let header = generated_header!(); - - GeneratorOutput::Stream(( - output(crate::AST_CRATE, "span.rs"), - quote! { - #header - insert!("#![allow(clippy::match_same_arms)]"); - endl!(); - - use crate::ast::*; - use oxc_span::{GetSpan, GetSpanMut, Span}; - - #(#impls)* - }, - )) - } -} - -fn impl_enum(def: &EnumDef) -> TokenStream { - let typ = def.to_type(); - let generics = &def.generics(); - let (matches, matches_mut): (Vec, Vec) = def - .all_variants() - .map(|var| { - let ident = var.ident(); - (quote!(Self :: #ident(it) => it.span()), quote!(Self :: #ident(it) => it.span_mut())) - }) - .unzip(); - - quote! { - endl!(); - impl #generics GetSpan for #typ { - fn span(&self) -> Span { - match self { - #(#matches),* - } - } - } - endl!(); - - impl #generics GetSpanMut for #typ { - fn span_mut(&mut self) -> &mut Span { - match self { - #(#matches_mut),* - } - } - } - } -} - -fn impl_struct(def: &StructDef) -> TokenStream { - let typ = def.to_type(); - let generics = &def.generics(); - let inner_span_hint = def.fields.iter().find(|it| it.markers.span); - let (span, span_mut) = if let Some(span_field) = inner_span_hint { - let ident = span_field.name.as_ref().map(ToIdent::to_ident).unwrap(); - (quote!(self.#ident.span()), quote!(self.#ident.span_mut())) - } else { - (quote!(self.span), quote!(&mut self.span)) - }; - quote! { - endl!(); - impl #generics GetSpan for #typ { - #[inline] - fn span(&self) -> Span { - #span - } - } - endl!(); - - impl #generics GetSpanMut for #typ { - #[inline] - fn span_mut(&mut self) -> &mut Span { - #span_mut - } - } - } -} diff --git a/tasks/ast_codegen/src/generators/mod.rs b/tasks/ast_codegen/src/generators/mod.rs index 862a6f9a369d0..bc7a039ee9374 100644 --- a/tasks/ast_codegen/src/generators/mod.rs +++ b/tasks/ast_codegen/src/generators/mod.rs @@ -2,7 +2,7 @@ mod assert_layouts; mod ast_builder; mod ast_kind; mod derive_clone_in; -mod impl_get_span; +mod derive_get_span; mod visit; /// Inserts a newline in the `TokenStream`. @@ -45,7 +45,7 @@ pub use assert_layouts::AssertLayouts; pub use ast_builder::AstBuilderGenerator; pub use ast_kind::AstKindGenerator; pub use derive_clone_in::DeriveCloneIn; -pub use impl_get_span::ImplGetSpanGenerator; +pub use derive_get_span::{DeriveGetSpan, DeriveGetSpanMut}; pub use visit::{VisitGenerator, VisitMutGenerator}; use crate::{GeneratorOutput, LateCtx}; diff --git a/tasks/ast_codegen/src/main.rs b/tasks/ast_codegen/src/main.rs index c703263776496..48016b984eb48 100644 --- a/tasks/ast_codegen/src/main.rs +++ b/tasks/ast_codegen/src/main.rs @@ -16,16 +16,14 @@ mod util; use fmt::{cargo_fmt, pprint}; use generators::{ - AssertLayouts, AstBuilderGenerator, AstKindGenerator, DeriveCloneIn, Generator, VisitGenerator, - VisitMutGenerator, + AssertLayouts, AstBuilderGenerator, AstKindGenerator, DeriveCloneIn, DeriveGetSpan, + DeriveGetSpanMut, Generator, VisitGenerator, VisitMutGenerator, }; use passes::{CalcLayout, Linker, Pass}; use rust_ast::AstRef; use schema::{lower_ast_types, Schema, TypeDef}; use util::{write_all_to, NormalizeError}; -use crate::generators::ImplGetSpanGenerator; - static SOURCE_PATHS: &[&str] = &[ "oxc_ast/src/ast/literal.rs", "oxc_ast/src/ast/js.rs", @@ -298,7 +296,8 @@ fn main() -> std::result::Result<(), Box> { .gen(AstKindGenerator) .gen(AstBuilderGenerator) .gen(DeriveCloneIn) - .gen(ImplGetSpanGenerator) + .gen(DeriveGetSpan) + .gen(DeriveGetSpanMut) .gen(VisitGenerator) .gen(VisitMutGenerator) .generate()?;