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_get_span.rs b/crates/oxc_ast/src/generated/derive_get_span.rs new file mode 100644 index 0000000000000..4d7349fec9ef0 --- /dev/null +++ b/crates/oxc_ast/src/generated/derive_get_span.rs @@ -0,0 +1,2196 @@ +// 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 oxc_span::{GetSpan, Span}; + +use crate::ast::*; + +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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + fn span(&self) -> Span { + match self { + Self::Identifier(it) => it.span(), + Self::StringLiteral(it) => it.span(), + } + } +} + +impl<'a> GetSpan for TSModuleDeclarationBody<'a> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + 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> { + fn span(&self) -> Span { + match self { + Self::Identifier(it) => it.span(), + Self::NamespacedName(it) => it.span(), + } + } +} + +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> GetSpan for JSXIdentifier<'a> { + #[inline] + fn span(&self) -> Span { + self.span + } +} + +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> 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 52% rename from crates/oxc_ast/src/generated/span.rs rename to crates/oxc_ast/src/generated/derive_get_span_mut.rs index fef350ad706be..7ce3ed03ce1ea 100644 --- a/crates/oxc_ast/src/generated/span.rs +++ b/crates/oxc_ast/src/generated/derive_get_span_mut.rs @@ -1,17 +1,11 @@ // 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}; +use oxc_span::{GetSpanMut, Span}; -impl GetSpan for BooleanLiteral { - #[inline] - fn span(&self) -> Span { - self.span - } -} +use crate::ast::*; impl GetSpanMut for BooleanLiteral { #[inline] @@ -20,13 +14,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 +21,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 +28,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 +35,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 +42,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 +49,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,55 +56,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -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,57 +147,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -388,13 +198,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 +205,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,15 +212,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -434,13 +221,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,57 +228,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -550,13 +279,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 +286,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 +293,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,16 +300,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -612,13 +310,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 +317,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 +324,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 +331,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 +338,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 +345,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 +352,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,56 +359,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -810,13 +409,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 +416,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 +423,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 +430,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 +437,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 +444,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 +451,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,24 +458,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -944,22 +476,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -976,15 +492,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -994,13 +501,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 +508,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 +515,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,25 +522,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -1074,13 +541,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,15 +548,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -1106,13 +557,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 +564,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 +571,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 +578,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 +585,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 +592,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,17 +599,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -1212,13 +610,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,46 +617,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -1306,13 +657,6 @@ 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> { #[inline] fn span_mut(&mut self) -> &mut Span { @@ -1320,13 +664,6 @@ impl<'a> GetSpanMut for Directive<'a> { } } -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 +671,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,24 +678,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> { - fn span_mut(&mut self) -> &mut Span { +impl<'a> GetSpanMut for Declaration<'a> { + fn span_mut(&mut self) -> &mut Span { match self { Self::VariableDeclaration(it) => it.span_mut(), Self::FunctionDeclaration(it) => it.span_mut(), @@ -1380,13 +694,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 +701,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 +708,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 +715,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 +722,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 +729,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 +736,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 +743,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 +750,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,57 +757,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -1608,13 +808,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,26 +815,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -1662,13 +835,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 +842,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 +849,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 +856,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 +863,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 +870,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 +877,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 +884,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 +891,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 +898,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 +905,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 +912,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 +919,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 +926,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,17 +933,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -1880,13 +944,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 +951,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 +958,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 +965,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 +972,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 +979,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 +986,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 +993,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 +1000,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 +1007,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 +1014,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 +1021,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 +1028,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,18 +1035,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -2086,13 +1047,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 +1054,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 +1061,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 +1068,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,19 +1075,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -2168,13 +1088,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 +1095,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 +1102,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,16 +1109,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -2230,13 +1119,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 +1126,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 +1133,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 +1140,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 +1147,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,15 +1154,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -2318,13 +1163,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 +1170,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 +1177,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 +1184,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,60 +1191,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> { - fn span_mut(&mut self) -> &mut Span { +impl<'a> GetSpanMut for ExportDefaultDeclarationKind<'a> { + fn span_mut(&mut self) -> &mut Span { match self { Self::FunctionDeclaration(it) => it.span_mut(), Self::ClassDeclaration(it) => it.span_mut(), @@ -2478,16 +1243,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -2498,13 +1253,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 +1260,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 +1267,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,59 +1274,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -2646,13 +1327,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 +1334,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,21 +1341,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -2704,51 +1356,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -2794,13 +1401,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 +1408,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 +1415,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 +1422,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 +1429,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 +1436,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 +1443,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 +1450,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 +1457,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 +1464,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 +1471,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,53 +1478,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -3042,13 +1525,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 +1532,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 +1539,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 +1546,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 +1553,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 +1560,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 +1567,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 +1574,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 +1581,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 +1588,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 +1595,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 +1602,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 +1609,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 +1616,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 +1623,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,15 +1630,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -3270,13 +1639,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 +1646,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 +1653,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 +1660,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 +1667,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 +1674,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 +1681,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 +1688,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 +1695,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,18 +1702,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -3420,13 +1714,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 +1721,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 +1728,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 +1735,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 +1742,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 +1749,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 +1756,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,15 +1763,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -3536,13 +1772,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,15 +1779,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -3568,15 +1788,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -3586,13 +1797,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 +1804,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 +1811,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 +1818,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,16 +1825,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -3662,13 +1835,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 +1842,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 +1849,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,15 +1856,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -3722,13 +1865,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 +1872,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 +1879,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 +1886,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 +1893,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 +1900,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 +1907,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 +1914,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,16 +1921,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -3854,13 +1931,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 +1938,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 +1945,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 +1952,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 +1959,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 +1966,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 +1973,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 +1980,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 +1987,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 +1994,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 +2001,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 +2008,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 +2015,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,16 +2022,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -4056,13 +2032,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 +2039,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,15 +2046,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -4102,13 +2055,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,56 +2062,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -4216,13 +2112,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,15 +2119,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -4248,13 +2128,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 +2135,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,15 +2142,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -4294,17 +2151,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -4316,13 +2162,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,18 +2169,6 @@ 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> { fn span_mut(&mut self) -> &mut Span { match self { @@ -4354,13 +2181,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 +2188,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_get_span.rs b/tasks/ast_codegen/src/generators/derive_get_span.rs new file mode 100644 index 0000000000000..22d03b2d7dbc3 --- /dev/null +++ b/tasks/ast_codegen/src/generators/derive_get_span.rs @@ -0,0 +1,161 @@ +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 inline = quote!(#[inline]); + + 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, + None, + &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, + Some(&inline), + &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 oxc_span::{#trait_ident, Span}; + endl!(); + use crate::ast::*; + + #(#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) + } +} + +#[allow(clippy::too_many_arguments)] +fn impl_trait( + trait_ident: &Ident, + method_ident: &Ident, + generics: &Option, + target_type: &Type, + self_: &TokenStream, + result_type: &TokenStream, + inline: Option<&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()?;