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

/// Untyped AST Node Kind
Expand Down Expand Up @@ -245,6 +246,7 @@ pub enum AstKind<'a> {
AstType::AssignmentTargetPattern as u8,
ArrayAssignmentTarget(&'a ArrayAssignmentTarget<'a>) = AstType::ArrayAssignmentTarget as u8,
ObjectAssignmentTarget(&'a ObjectAssignmentTarget<'a>) = AstType::ObjectAssignmentTarget as u8,
AssignmentTargetRest(&'a AssignmentTargetRest<'a>) = AstType::AssignmentTargetRest as u8,
AssignmentTargetWithDefault(&'a AssignmentTargetWithDefault<'a>) =
AstType::AssignmentTargetWithDefault as u8,
SequenceExpression(&'a SequenceExpression<'a>) = AstType::SequenceExpression as u8,
Expand Down Expand Up @@ -463,6 +465,7 @@ impl GetSpan for AstKind<'_> {
Self::AssignmentTargetPattern(it) => it.span(),
Self::ArrayAssignmentTarget(it) => it.span(),
Self::ObjectAssignmentTarget(it) => it.span(),
Self::AssignmentTargetRest(it) => it.span(),
Self::AssignmentTargetWithDefault(it) => it.span(),
Self::SequenceExpression(it) => it.span(),
Self::Super(it) => it.span(),
Expand Down Expand Up @@ -658,6 +661,7 @@ impl GetAddress for AstKind<'_> {
Self::AssignmentTargetPattern(it) => it.address(),
Self::ArrayAssignmentTarget(it) => Address::from_ptr(it),
Self::ObjectAssignmentTarget(it) => Address::from_ptr(it),
Self::AssignmentTargetRest(it) => Address::from_ptr(it),
Self::AssignmentTargetWithDefault(it) => Address::from_ptr(it),
Self::SequenceExpression(it) => Address::from_ptr(it),
Self::Super(it) => Address::from_ptr(it),
Expand Down Expand Up @@ -987,6 +991,11 @@ impl<'a> AstKind<'a> {
if let Self::ObjectAssignmentTarget(v) = self { Some(v) } else { None }
}

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

#[inline]
pub fn as_assignment_target_with_default(self) -> Option<&'a AssignmentTargetWithDefault<'a>> {
if let Self::AssignmentTargetWithDefault(v) = self { Some(v) } else { None }
Expand Down
4 changes: 3 additions & 1 deletion crates/oxc_ast_visit/src/generated/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1852,9 +1852,11 @@ pub mod walk {
visitor: &mut V,
it: &AssignmentTargetRest<'a>,
) {
// No `AstKind` for this type
let kind = AstKind::AssignmentTargetRest(visitor.alloc(it));
visitor.enter_node(kind);
visitor.visit_span(&it.span);
visitor.visit_assignment_target(&it.target);
visitor.leave_node(kind);
}

#[inline]
Expand Down
4 changes: 3 additions & 1 deletion crates/oxc_ast_visit/src/generated/visit_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1883,9 +1883,11 @@ pub mod walk_mut {
visitor: &mut V,
it: &mut AssignmentTargetRest<'a>,
) {
// No `AstType` for this type
let kind = AstType::AssignmentTargetRest;
visitor.enter_node(kind);
visitor.visit_span(&mut it.span);
visitor.visit_assignment_target(&mut it.target);
visitor.leave_node(kind);
}

#[inline]
Expand Down
Loading
Loading