Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions crates/oxc_ast/src/ast_kind_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,10 @@ impl AstKind<'_> {
Self::JSDocNonNullableType(_) => "JSDocNonNullableType".into(),
Self::JSDocUnknownType(_) => "JSDocUnknownType".into(),
Self::AssignmentTargetRest(_) => "AssignmentTargetRest".into(),
Self::AssignmentTargetPropertyIdentifier(_) => {
"AssignmentTargetPropertyIdentifier".into()
}
Self::AssignmentTargetPropertyProperty(_) => "AssignmentTargetPropertyProperty".into(),
}
}
}
Expand Down
330 changes: 177 additions & 153 deletions crates/oxc_ast/src/generated/ast_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,159 +50,161 @@ pub enum AstType {
ObjectAssignmentTarget = 33,
AssignmentTargetRest = 34,
AssignmentTargetWithDefault = 35,
SequenceExpression = 36,
Super = 37,
AwaitExpression = 38,
ChainExpression = 39,
ParenthesizedExpression = 40,
Directive = 41,
Hashbang = 42,
BlockStatement = 43,
VariableDeclaration = 44,
VariableDeclarator = 45,
EmptyStatement = 46,
ExpressionStatement = 47,
IfStatement = 48,
DoWhileStatement = 49,
WhileStatement = 50,
ForStatement = 51,
ForInStatement = 52,
ForOfStatement = 53,
ContinueStatement = 54,
BreakStatement = 55,
ReturnStatement = 56,
WithStatement = 57,
SwitchStatement = 58,
SwitchCase = 59,
LabeledStatement = 60,
ThrowStatement = 61,
TryStatement = 62,
CatchClause = 63,
CatchParameter = 64,
DebuggerStatement = 65,
AssignmentPattern = 66,
ObjectPattern = 67,
BindingProperty = 68,
ArrayPattern = 69,
BindingRestElement = 70,
Function = 71,
FormalParameters = 72,
FormalParameter = 73,
FunctionBody = 74,
ArrowFunctionExpression = 75,
YieldExpression = 76,
Class = 77,
ClassBody = 78,
MethodDefinition = 79,
PropertyDefinition = 80,
PrivateIdentifier = 81,
StaticBlock = 82,
ModuleDeclaration = 83,
AccessorProperty = 84,
ImportExpression = 85,
ImportDeclaration = 86,
ImportSpecifier = 87,
ImportDefaultSpecifier = 88,
ImportNamespaceSpecifier = 89,
WithClause = 90,
ImportAttribute = 91,
ExportNamedDeclaration = 92,
ExportDefaultDeclaration = 93,
ExportAllDeclaration = 94,
ExportSpecifier = 95,
V8IntrinsicExpression = 96,
BooleanLiteral = 97,
NullLiteral = 98,
NumericLiteral = 99,
StringLiteral = 100,
BigIntLiteral = 101,
RegExpLiteral = 102,
JSXElement = 103,
JSXOpeningElement = 104,
JSXClosingElement = 105,
JSXFragment = 106,
JSXOpeningFragment = 107,
JSXClosingFragment = 108,
JSXNamespacedName = 109,
JSXMemberExpression = 110,
JSXExpressionContainer = 111,
JSXEmptyExpression = 112,
JSXAttribute = 113,
JSXSpreadAttribute = 114,
JSXIdentifier = 115,
JSXSpreadChild = 116,
JSXText = 117,
TSThisParameter = 118,
TSEnumDeclaration = 119,
TSEnumBody = 120,
TSEnumMember = 121,
TSTypeAnnotation = 122,
TSLiteralType = 123,
TSConditionalType = 124,
TSUnionType = 125,
TSIntersectionType = 126,
TSParenthesizedType = 127,
TSTypeOperator = 128,
TSArrayType = 129,
TSIndexedAccessType = 130,
TSTupleType = 131,
TSNamedTupleMember = 132,
TSOptionalType = 133,
TSRestType = 134,
TSAnyKeyword = 135,
TSStringKeyword = 136,
TSBooleanKeyword = 137,
TSNumberKeyword = 138,
TSNeverKeyword = 139,
TSIntrinsicKeyword = 140,
TSUnknownKeyword = 141,
TSNullKeyword = 142,
TSUndefinedKeyword = 143,
TSVoidKeyword = 144,
TSSymbolKeyword = 145,
TSThisType = 146,
TSObjectKeyword = 147,
TSBigIntKeyword = 148,
TSTypeReference = 149,
TSTypeName = 150,
TSQualifiedName = 151,
TSTypeParameterInstantiation = 152,
TSTypeParameter = 153,
TSTypeParameterDeclaration = 154,
TSTypeAliasDeclaration = 155,
TSClassImplements = 156,
TSInterfaceDeclaration = 157,
TSInterfaceBody = 158,
TSPropertySignature = 159,
TSIndexSignature = 160,
TSCallSignatureDeclaration = 161,
TSMethodSignature = 162,
TSConstructSignatureDeclaration = 163,
TSIndexSignatureName = 164,
TSInterfaceHeritage = 165,
TSTypePredicate = 166,
TSModuleDeclaration = 167,
TSModuleBlock = 168,
TSTypeLiteral = 169,
TSInferType = 170,
TSTypeQuery = 171,
TSImportType = 172,
TSConstructorType = 173,
TSMappedType = 174,
TSTemplateLiteralType = 175,
TSAsExpression = 176,
TSSatisfiesExpression = 177,
TSTypeAssertion = 178,
TSImportEqualsDeclaration = 179,
TSExternalModuleReference = 180,
TSNonNullExpression = 181,
Decorator = 182,
TSExportAssignment = 183,
TSNamespaceExportDeclaration = 184,
TSInstantiationExpression = 185,
JSDocNullableType = 186,
JSDocNonNullableType = 187,
JSDocUnknownType = 188,
AssignmentTargetPropertyIdentifier = 36,
AssignmentTargetPropertyProperty = 37,
SequenceExpression = 38,
Super = 39,
AwaitExpression = 40,
ChainExpression = 41,
ParenthesizedExpression = 42,
Directive = 43,
Hashbang = 44,
BlockStatement = 45,
VariableDeclaration = 46,
VariableDeclarator = 47,
EmptyStatement = 48,
ExpressionStatement = 49,
IfStatement = 50,
DoWhileStatement = 51,
WhileStatement = 52,
ForStatement = 53,
ForInStatement = 54,
ForOfStatement = 55,
ContinueStatement = 56,
BreakStatement = 57,
ReturnStatement = 58,
WithStatement = 59,
SwitchStatement = 60,
SwitchCase = 61,
LabeledStatement = 62,
ThrowStatement = 63,
TryStatement = 64,
CatchClause = 65,
CatchParameter = 66,
DebuggerStatement = 67,
AssignmentPattern = 68,
ObjectPattern = 69,
BindingProperty = 70,
ArrayPattern = 71,
BindingRestElement = 72,
Function = 73,
FormalParameters = 74,
FormalParameter = 75,
FunctionBody = 76,
ArrowFunctionExpression = 77,
YieldExpression = 78,
Class = 79,
ClassBody = 80,
MethodDefinition = 81,
PropertyDefinition = 82,
PrivateIdentifier = 83,
StaticBlock = 84,
ModuleDeclaration = 85,
AccessorProperty = 86,
ImportExpression = 87,
ImportDeclaration = 88,
ImportSpecifier = 89,
ImportDefaultSpecifier = 90,
ImportNamespaceSpecifier = 91,
WithClause = 92,
ImportAttribute = 93,
ExportNamedDeclaration = 94,
ExportDefaultDeclaration = 95,
ExportAllDeclaration = 96,
ExportSpecifier = 97,
V8IntrinsicExpression = 98,
BooleanLiteral = 99,
NullLiteral = 100,
NumericLiteral = 101,
StringLiteral = 102,
BigIntLiteral = 103,
RegExpLiteral = 104,
JSXElement = 105,
JSXOpeningElement = 106,
JSXClosingElement = 107,
JSXFragment = 108,
JSXOpeningFragment = 109,
JSXClosingFragment = 110,
JSXNamespacedName = 111,
JSXMemberExpression = 112,
JSXExpressionContainer = 113,
JSXEmptyExpression = 114,
JSXAttribute = 115,
JSXSpreadAttribute = 116,
JSXIdentifier = 117,
JSXSpreadChild = 118,
JSXText = 119,
TSThisParameter = 120,
TSEnumDeclaration = 121,
TSEnumBody = 122,
TSEnumMember = 123,
TSTypeAnnotation = 124,
TSLiteralType = 125,
TSConditionalType = 126,
TSUnionType = 127,
TSIntersectionType = 128,
TSParenthesizedType = 129,
TSTypeOperator = 130,
TSArrayType = 131,
TSIndexedAccessType = 132,
TSTupleType = 133,
TSNamedTupleMember = 134,
TSOptionalType = 135,
TSRestType = 136,
TSAnyKeyword = 137,
TSStringKeyword = 138,
TSBooleanKeyword = 139,
TSNumberKeyword = 140,
TSNeverKeyword = 141,
TSIntrinsicKeyword = 142,
TSUnknownKeyword = 143,
TSNullKeyword = 144,
TSUndefinedKeyword = 145,
TSVoidKeyword = 146,
TSSymbolKeyword = 147,
TSThisType = 148,
TSObjectKeyword = 149,
TSBigIntKeyword = 150,
TSTypeReference = 151,
TSTypeName = 152,
TSQualifiedName = 153,
TSTypeParameterInstantiation = 154,
TSTypeParameter = 155,
TSTypeParameterDeclaration = 156,
TSTypeAliasDeclaration = 157,
TSClassImplements = 158,
TSInterfaceDeclaration = 159,
TSInterfaceBody = 160,
TSPropertySignature = 161,
TSIndexSignature = 162,
TSCallSignatureDeclaration = 163,
TSMethodSignature = 164,
TSConstructSignatureDeclaration = 165,
TSIndexSignatureName = 166,
TSInterfaceHeritage = 167,
TSTypePredicate = 168,
TSModuleDeclaration = 169,
TSModuleBlock = 170,
TSTypeLiteral = 171,
TSInferType = 172,
TSTypeQuery = 173,
TSImportType = 174,
TSConstructorType = 175,
TSMappedType = 176,
TSTemplateLiteralType = 177,
TSAsExpression = 178,
TSSatisfiesExpression = 179,
TSTypeAssertion = 180,
TSImportEqualsDeclaration = 181,
TSExternalModuleReference = 182,
TSNonNullExpression = 183,
Decorator = 184,
TSExportAssignment = 185,
TSNamespaceExportDeclaration = 186,
TSInstantiationExpression = 187,
JSDocNullableType = 188,
JSDocNonNullableType = 189,
JSDocUnknownType = 190,
}

/// Untyped AST Node Kind
Expand Down Expand Up @@ -249,6 +251,10 @@ pub enum AstKind<'a> {
AssignmentTargetRest(&'a AssignmentTargetRest<'a>) = AstType::AssignmentTargetRest as u8,
AssignmentTargetWithDefault(&'a AssignmentTargetWithDefault<'a>) =
AstType::AssignmentTargetWithDefault as u8,
AssignmentTargetPropertyIdentifier(&'a AssignmentTargetPropertyIdentifier<'a>) =
AstType::AssignmentTargetPropertyIdentifier as u8,
AssignmentTargetPropertyProperty(&'a AssignmentTargetPropertyProperty<'a>) =
AstType::AssignmentTargetPropertyProperty as u8,
SequenceExpression(&'a SequenceExpression<'a>) = AstType::SequenceExpression as u8,
Super(&'a Super) = AstType::Super as u8,
AwaitExpression(&'a AwaitExpression<'a>) = AstType::AwaitExpression as u8,
Expand Down Expand Up @@ -467,6 +473,8 @@ impl GetSpan for AstKind<'_> {
Self::ObjectAssignmentTarget(it) => it.span(),
Self::AssignmentTargetRest(it) => it.span(),
Self::AssignmentTargetWithDefault(it) => it.span(),
Self::AssignmentTargetPropertyIdentifier(it) => it.span(),
Self::AssignmentTargetPropertyProperty(it) => it.span(),
Self::SequenceExpression(it) => it.span(),
Self::Super(it) => it.span(),
Self::AwaitExpression(it) => it.span(),
Expand Down Expand Up @@ -663,6 +671,8 @@ impl GetAddress for AstKind<'_> {
Self::ObjectAssignmentTarget(it) => Address::from_ptr(it),
Self::AssignmentTargetRest(it) => Address::from_ptr(it),
Self::AssignmentTargetWithDefault(it) => Address::from_ptr(it),
Self::AssignmentTargetPropertyIdentifier(it) => Address::from_ptr(it),
Self::AssignmentTargetPropertyProperty(it) => Address::from_ptr(it),
Self::SequenceExpression(it) => Address::from_ptr(it),
Self::Super(it) => Address::from_ptr(it),
Self::AwaitExpression(it) => Address::from_ptr(it),
Expand Down Expand Up @@ -1001,6 +1011,20 @@ impl<'a> AstKind<'a> {
if let Self::AssignmentTargetWithDefault(v) = self { Some(v) } else { None }
}

#[inline]
pub fn as_assignment_target_property_identifier(
self,
) -> Option<&'a AssignmentTargetPropertyIdentifier<'a>> {
if let Self::AssignmentTargetPropertyIdentifier(v) = self { Some(v) } else { None }
}

#[inline]
pub fn as_assignment_target_property_property(
self,
) -> Option<&'a AssignmentTargetPropertyProperty<'a>> {
if let Self::AssignmentTargetPropertyProperty(v) = self { Some(v) } else { None }
}

#[inline]
pub fn as_sequence_expression(self) -> Option<&'a SequenceExpression<'a>> {
if let Self::SequenceExpression(v) = self { Some(v) } else { None }
Expand Down
Loading
Loading