oxc-parser 0.99.0 → 0.102.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,172 +1,220 @@
1
1
  // Auto-generated code, DO NOT EDIT DIRECTLY!
2
2
  // To edit this generated file you have to edit `tasks/ast_tools/src/generators/estree_visit.rs`.
3
3
 
4
- export default Object.freeze({
4
+ const { freeze } = Object;
5
+
6
+ const $EMPTY = freeze([]),
7
+ DECORATORS__KEY__TYPE_ANNOTATION__VALUE = freeze([
8
+ "decorators",
9
+ "key",
10
+ "typeAnnotation",
11
+ "value",
12
+ ]),
13
+ LEFT__RIGHT = freeze(["left", "right"]),
14
+ ARGUMENT = freeze(["argument"]),
15
+ BODY = freeze(["body"]),
16
+ LABEL = freeze(["label"]),
17
+ CALLEE__TYPE_ARGUMENTS__ARGUMENTS = freeze(["callee", "typeArguments", "arguments"]),
18
+ EXPRESSION = freeze(["expression"]),
19
+ DECORATORS__ID__TYPE_PARAMETERS__SUPER_CLASS__SUPER_TYPE_ARGUMENTS__IMPLEMENTS__BODY = freeze([
20
+ "decorators",
21
+ "id",
22
+ "typeParameters",
23
+ "superClass",
24
+ "superTypeArguments",
25
+ "implements",
26
+ "body",
27
+ ]),
28
+ TEST__CONSEQUENT__ALTERNATE = freeze(["test", "consequent", "alternate"]),
29
+ LEFT__RIGHT__BODY = freeze(["left", "right", "body"]),
30
+ ID__TYPE_PARAMETERS__PARAMS__RETURN_TYPE__BODY = freeze([
31
+ "id",
32
+ "typeParameters",
33
+ "params",
34
+ "returnType",
35
+ "body",
36
+ ]),
37
+ KEY__VALUE = freeze(["key", "value"]),
38
+ LOCAL = freeze(["local"]),
39
+ OBJECT__PROPERTY = freeze(["object", "property"]),
40
+ DECORATORS__KEY__TYPE_ANNOTATION = freeze(["decorators", "key", "typeAnnotation"]),
41
+ EXPRESSION__TYPE_ANNOTATION = freeze(["expression", "typeAnnotation"]),
42
+ TYPE_PARAMETERS__PARAMS__RETURN_TYPE = freeze(["typeParameters", "params", "returnType"]),
43
+ EXPRESSION__TYPE_ARGUMENTS = freeze(["expression", "typeArguments"]),
44
+ MEMBERS = freeze(["members"]),
45
+ ID__BODY = freeze(["id", "body"]),
46
+ TYPES = freeze(["types"]),
47
+ TYPE_ANNOTATION = freeze(["typeAnnotation"]),
48
+ PARAMS = freeze(["params"]);
49
+
50
+ export default freeze({
5
51
  // Leaf nodes
6
- DebuggerStatement: [],
7
- EmptyStatement: [],
8
- Literal: [],
9
- PrivateIdentifier: [],
10
- Super: [],
11
- TemplateElement: [],
12
- ThisExpression: [],
13
- JSXClosingFragment: [],
14
- JSXEmptyExpression: [],
15
- JSXIdentifier: [],
16
- JSXOpeningFragment: [],
17
- JSXText: [],
18
- TSAnyKeyword: [],
19
- TSBigIntKeyword: [],
20
- TSBooleanKeyword: [],
21
- TSIntrinsicKeyword: [],
22
- TSJSDocUnknownType: [],
23
- TSNeverKeyword: [],
24
- TSNullKeyword: [],
25
- TSNumberKeyword: [],
26
- TSObjectKeyword: [],
27
- TSStringKeyword: [],
28
- TSSymbolKeyword: [],
29
- TSThisType: [],
30
- TSUndefinedKeyword: [],
31
- TSUnknownKeyword: [],
32
- TSVoidKeyword: [],
52
+ DebuggerStatement: $EMPTY,
53
+ EmptyStatement: $EMPTY,
54
+ Literal: $EMPTY,
55
+ PrivateIdentifier: $EMPTY,
56
+ Super: $EMPTY,
57
+ TemplateElement: $EMPTY,
58
+ ThisExpression: $EMPTY,
59
+ JSXClosingFragment: $EMPTY,
60
+ JSXEmptyExpression: $EMPTY,
61
+ JSXIdentifier: $EMPTY,
62
+ JSXOpeningFragment: $EMPTY,
63
+ JSXText: $EMPTY,
64
+ TSAnyKeyword: $EMPTY,
65
+ TSBigIntKeyword: $EMPTY,
66
+ TSBooleanKeyword: $EMPTY,
67
+ TSIntrinsicKeyword: $EMPTY,
68
+ TSJSDocUnknownType: $EMPTY,
69
+ TSNeverKeyword: $EMPTY,
70
+ TSNullKeyword: $EMPTY,
71
+ TSNumberKeyword: $EMPTY,
72
+ TSObjectKeyword: $EMPTY,
73
+ TSStringKeyword: $EMPTY,
74
+ TSSymbolKeyword: $EMPTY,
75
+ TSThisType: $EMPTY,
76
+ TSUndefinedKeyword: $EMPTY,
77
+ TSUnknownKeyword: $EMPTY,
78
+ TSVoidKeyword: $EMPTY,
33
79
  // Non-leaf nodes
34
- AccessorProperty: ['decorators', 'key', 'typeAnnotation', 'value'],
35
- ArrayExpression: ['elements'],
36
- ArrayPattern: ['decorators', 'elements', 'typeAnnotation'],
37
- ArrowFunctionExpression: ['typeParameters', 'params', 'returnType', 'body'],
38
- AssignmentExpression: ['left', 'right'],
39
- AssignmentPattern: ['decorators', 'left', 'right', 'typeAnnotation'],
40
- AwaitExpression: ['argument'],
41
- BinaryExpression: ['left', 'right'],
42
- BlockStatement: ['body'],
43
- BreakStatement: ['label'],
44
- CallExpression: ['callee', 'typeArguments', 'arguments'],
45
- CatchClause: ['param', 'body'],
46
- ChainExpression: ['expression'],
47
- ClassBody: ['body'],
48
- ClassDeclaration: ['decorators', 'id', 'typeParameters', 'superClass', 'superTypeArguments', 'implements', 'body'],
49
- ClassExpression: ['decorators', 'id', 'typeParameters', 'superClass', 'superTypeArguments', 'implements', 'body'],
50
- ConditionalExpression: ['test', 'consequent', 'alternate'],
51
- ContinueStatement: ['label'],
52
- Decorator: ['expression'],
53
- DoWhileStatement: ['body', 'test'],
54
- ExportAllDeclaration: ['exported', 'source', 'attributes'],
55
- ExportDefaultDeclaration: ['declaration'],
56
- ExportNamedDeclaration: ['declaration', 'specifiers', 'source', 'attributes'],
57
- ExportSpecifier: ['local', 'exported'],
58
- ExpressionStatement: ['expression'],
59
- ForInStatement: ['left', 'right', 'body'],
60
- ForOfStatement: ['left', 'right', 'body'],
61
- ForStatement: ['init', 'test', 'update', 'body'],
62
- FunctionDeclaration: ['id', 'typeParameters', 'params', 'returnType', 'body'],
63
- FunctionExpression: ['id', 'typeParameters', 'params', 'returnType', 'body'],
64
- Identifier: ['decorators', 'typeAnnotation'],
65
- IfStatement: ['test', 'consequent', 'alternate'],
66
- ImportAttribute: ['key', 'value'],
67
- ImportDeclaration: ['specifiers', 'source', 'attributes'],
68
- ImportDefaultSpecifier: ['local'],
69
- ImportExpression: ['source', 'options'],
70
- ImportNamespaceSpecifier: ['local'],
71
- ImportSpecifier: ['imported', 'local'],
72
- LabeledStatement: ['label', 'body'],
73
- LogicalExpression: ['left', 'right'],
74
- MemberExpression: ['object', 'property'],
75
- MetaProperty: ['meta', 'property'],
76
- MethodDefinition: ['decorators', 'key', 'value'],
77
- NewExpression: ['callee', 'typeArguments', 'arguments'],
78
- ObjectExpression: ['properties'],
79
- ObjectPattern: ['decorators', 'properties', 'typeAnnotation'],
80
- ParenthesizedExpression: ['expression'],
81
- Program: ['body'],
82
- Property: ['key', 'value'],
83
- PropertyDefinition: ['decorators', 'key', 'typeAnnotation', 'value'],
84
- RestElement: ['decorators', 'argument', 'typeAnnotation'],
85
- ReturnStatement: ['argument'],
86
- SequenceExpression: ['expressions'],
87
- SpreadElement: ['argument'],
88
- StaticBlock: ['body'],
89
- SwitchCase: ['test', 'consequent'],
90
- SwitchStatement: ['discriminant', 'cases'],
91
- TaggedTemplateExpression: ['tag', 'typeArguments', 'quasi'],
92
- TemplateLiteral: ['quasis', 'expressions'],
93
- ThrowStatement: ['argument'],
94
- TryStatement: ['block', 'handler', 'finalizer'],
95
- UnaryExpression: ['argument'],
96
- UpdateExpression: ['argument'],
97
- V8IntrinsicExpression: ['name', 'arguments'],
98
- VariableDeclaration: ['declarations'],
99
- VariableDeclarator: ['id', 'init'],
100
- WhileStatement: ['test', 'body'],
101
- WithStatement: ['object', 'body'],
102
- YieldExpression: ['argument'],
103
- JSXAttribute: ['name', 'value'],
104
- JSXClosingElement: ['name'],
105
- JSXElement: ['openingElement', 'children', 'closingElement'],
106
- JSXExpressionContainer: ['expression'],
107
- JSXFragment: ['openingFragment', 'children', 'closingFragment'],
108
- JSXMemberExpression: ['object', 'property'],
109
- JSXNamespacedName: ['namespace', 'name'],
110
- JSXOpeningElement: ['name', 'typeArguments', 'attributes'],
111
- JSXSpreadAttribute: ['argument'],
112
- JSXSpreadChild: ['expression'],
113
- TSAbstractAccessorProperty: ['decorators', 'key', 'typeAnnotation'],
114
- TSAbstractMethodDefinition: ['key', 'value'],
115
- TSAbstractPropertyDefinition: ['decorators', 'key', 'typeAnnotation'],
116
- TSArrayType: ['elementType'],
117
- TSAsExpression: ['expression', 'typeAnnotation'],
118
- TSCallSignatureDeclaration: ['typeParameters', 'params', 'returnType'],
119
- TSClassImplements: ['expression', 'typeArguments'],
120
- TSConditionalType: ['checkType', 'extendsType', 'trueType', 'falseType'],
121
- TSConstructSignatureDeclaration: ['typeParameters', 'params', 'returnType'],
122
- TSConstructorType: ['typeParameters', 'params', 'returnType'],
123
- TSDeclareFunction: ['id', 'typeParameters', 'params', 'returnType', 'body'],
124
- TSEmptyBodyFunctionExpression: ['id', 'typeParameters', 'params', 'returnType'],
125
- TSEnumBody: ['members'],
126
- TSEnumDeclaration: ['id', 'body'],
127
- TSEnumMember: ['id', 'initializer'],
128
- TSExportAssignment: ['expression'],
129
- TSExternalModuleReference: ['expression'],
130
- TSFunctionType: ['typeParameters', 'params', 'returnType'],
131
- TSImportEqualsDeclaration: ['id', 'moduleReference'],
132
- TSImportType: ['argument', 'options', 'qualifier', 'typeArguments'],
133
- TSIndexSignature: ['parameters', 'typeAnnotation'],
134
- TSIndexedAccessType: ['objectType', 'indexType'],
135
- TSInferType: ['typeParameter'],
136
- TSInstantiationExpression: ['expression', 'typeArguments'],
137
- TSInterfaceBody: ['body'],
138
- TSInterfaceDeclaration: ['id', 'typeParameters', 'extends', 'body'],
139
- TSInterfaceHeritage: ['expression', 'typeArguments'],
140
- TSIntersectionType: ['types'],
141
- TSJSDocNonNullableType: ['typeAnnotation'],
142
- TSJSDocNullableType: ['typeAnnotation'],
143
- TSLiteralType: ['literal'],
144
- TSMappedType: ['key', 'constraint', 'nameType', 'typeAnnotation'],
145
- TSMethodSignature: ['key', 'typeParameters', 'params', 'returnType'],
146
- TSModuleBlock: ['body'],
147
- TSModuleDeclaration: ['id', 'body'],
148
- TSNamedTupleMember: ['label', 'elementType'],
149
- TSNamespaceExportDeclaration: ['id'],
150
- TSNonNullExpression: ['expression'],
151
- TSOptionalType: ['typeAnnotation'],
152
- TSParameterProperty: ['decorators', 'parameter'],
153
- TSParenthesizedType: ['typeAnnotation'],
154
- TSPropertySignature: ['key', 'typeAnnotation'],
155
- TSQualifiedName: ['left', 'right'],
156
- TSRestType: ['typeAnnotation'],
157
- TSSatisfiesExpression: ['expression', 'typeAnnotation'],
158
- TSTemplateLiteralType: ['quasis', 'types'],
159
- TSTupleType: ['elementTypes'],
160
- TSTypeAliasDeclaration: ['id', 'typeParameters', 'typeAnnotation'],
161
- TSTypeAnnotation: ['typeAnnotation'],
162
- TSTypeAssertion: ['typeAnnotation', 'expression'],
163
- TSTypeLiteral: ['members'],
164
- TSTypeOperator: ['typeAnnotation'],
165
- TSTypeParameter: ['name', 'constraint', 'default'],
166
- TSTypeParameterDeclaration: ['params'],
167
- TSTypeParameterInstantiation: ['params'],
168
- TSTypePredicate: ['parameterName', 'typeAnnotation'],
169
- TSTypeQuery: ['exprName', 'typeArguments'],
170
- TSTypeReference: ['typeName', 'typeArguments'],
171
- TSUnionType: ['types'],
80
+ AccessorProperty: DECORATORS__KEY__TYPE_ANNOTATION__VALUE,
81
+ ArrayExpression: freeze(["elements"]),
82
+ ArrayPattern: freeze(["decorators", "elements", "typeAnnotation"]),
83
+ ArrowFunctionExpression: freeze(["typeParameters", "params", "returnType", "body"]),
84
+ AssignmentExpression: LEFT__RIGHT,
85
+ AssignmentPattern: freeze(["decorators", "left", "right", "typeAnnotation"]),
86
+ AwaitExpression: ARGUMENT,
87
+ BinaryExpression: LEFT__RIGHT,
88
+ BlockStatement: BODY,
89
+ BreakStatement: LABEL,
90
+ CallExpression: CALLEE__TYPE_ARGUMENTS__ARGUMENTS,
91
+ CatchClause: freeze(["param", "body"]),
92
+ ChainExpression: EXPRESSION,
93
+ ClassBody: BODY,
94
+ ClassDeclaration:
95
+ DECORATORS__ID__TYPE_PARAMETERS__SUPER_CLASS__SUPER_TYPE_ARGUMENTS__IMPLEMENTS__BODY,
96
+ ClassExpression:
97
+ DECORATORS__ID__TYPE_PARAMETERS__SUPER_CLASS__SUPER_TYPE_ARGUMENTS__IMPLEMENTS__BODY,
98
+ ConditionalExpression: TEST__CONSEQUENT__ALTERNATE,
99
+ ContinueStatement: LABEL,
100
+ Decorator: EXPRESSION,
101
+ DoWhileStatement: freeze(["body", "test"]),
102
+ ExportAllDeclaration: freeze(["exported", "source", "attributes"]),
103
+ ExportDefaultDeclaration: freeze(["declaration"]),
104
+ ExportNamedDeclaration: freeze(["declaration", "specifiers", "source", "attributes"]),
105
+ ExportSpecifier: freeze(["local", "exported"]),
106
+ ExpressionStatement: EXPRESSION,
107
+ ForInStatement: LEFT__RIGHT__BODY,
108
+ ForOfStatement: LEFT__RIGHT__BODY,
109
+ ForStatement: freeze(["init", "test", "update", "body"]),
110
+ FunctionDeclaration: ID__TYPE_PARAMETERS__PARAMS__RETURN_TYPE__BODY,
111
+ FunctionExpression: ID__TYPE_PARAMETERS__PARAMS__RETURN_TYPE__BODY,
112
+ Identifier: freeze(["decorators", "typeAnnotation"]),
113
+ IfStatement: TEST__CONSEQUENT__ALTERNATE,
114
+ ImportAttribute: KEY__VALUE,
115
+ ImportDeclaration: freeze(["specifiers", "source", "attributes"]),
116
+ ImportDefaultSpecifier: LOCAL,
117
+ ImportExpression: freeze(["source", "options"]),
118
+ ImportNamespaceSpecifier: LOCAL,
119
+ ImportSpecifier: freeze(["imported", "local"]),
120
+ LabeledStatement: freeze(["label", "body"]),
121
+ LogicalExpression: LEFT__RIGHT,
122
+ MemberExpression: OBJECT__PROPERTY,
123
+ MetaProperty: freeze(["meta", "property"]),
124
+ MethodDefinition: freeze(["decorators", "key", "value"]),
125
+ NewExpression: CALLEE__TYPE_ARGUMENTS__ARGUMENTS,
126
+ ObjectExpression: freeze(["properties"]),
127
+ ObjectPattern: freeze(["decorators", "properties", "typeAnnotation"]),
128
+ ParenthesizedExpression: EXPRESSION,
129
+ Program: BODY,
130
+ Property: KEY__VALUE,
131
+ PropertyDefinition: DECORATORS__KEY__TYPE_ANNOTATION__VALUE,
132
+ RestElement: freeze(["decorators", "argument", "typeAnnotation"]),
133
+ ReturnStatement: ARGUMENT,
134
+ SequenceExpression: freeze(["expressions"]),
135
+ SpreadElement: ARGUMENT,
136
+ StaticBlock: BODY,
137
+ SwitchCase: freeze(["test", "consequent"]),
138
+ SwitchStatement: freeze(["discriminant", "cases"]),
139
+ TaggedTemplateExpression: freeze(["tag", "typeArguments", "quasi"]),
140
+ TemplateLiteral: freeze(["quasis", "expressions"]),
141
+ ThrowStatement: ARGUMENT,
142
+ TryStatement: freeze(["block", "handler", "finalizer"]),
143
+ UnaryExpression: ARGUMENT,
144
+ UpdateExpression: ARGUMENT,
145
+ V8IntrinsicExpression: freeze(["name", "arguments"]),
146
+ VariableDeclaration: freeze(["declarations"]),
147
+ VariableDeclarator: freeze(["id", "init"]),
148
+ WhileStatement: freeze(["test", "body"]),
149
+ WithStatement: freeze(["object", "body"]),
150
+ YieldExpression: ARGUMENT,
151
+ JSXAttribute: freeze(["name", "value"]),
152
+ JSXClosingElement: freeze(["name"]),
153
+ JSXElement: freeze(["openingElement", "children", "closingElement"]),
154
+ JSXExpressionContainer: EXPRESSION,
155
+ JSXFragment: freeze(["openingFragment", "children", "closingFragment"]),
156
+ JSXMemberExpression: OBJECT__PROPERTY,
157
+ JSXNamespacedName: freeze(["namespace", "name"]),
158
+ JSXOpeningElement: freeze(["name", "typeArguments", "attributes"]),
159
+ JSXSpreadAttribute: ARGUMENT,
160
+ JSXSpreadChild: EXPRESSION,
161
+ TSAbstractAccessorProperty: DECORATORS__KEY__TYPE_ANNOTATION,
162
+ TSAbstractMethodDefinition: KEY__VALUE,
163
+ TSAbstractPropertyDefinition: DECORATORS__KEY__TYPE_ANNOTATION,
164
+ TSArrayType: freeze(["elementType"]),
165
+ TSAsExpression: EXPRESSION__TYPE_ANNOTATION,
166
+ TSCallSignatureDeclaration: TYPE_PARAMETERS__PARAMS__RETURN_TYPE,
167
+ TSClassImplements: EXPRESSION__TYPE_ARGUMENTS,
168
+ TSConditionalType: freeze(["checkType", "extendsType", "trueType", "falseType"]),
169
+ TSConstructSignatureDeclaration: TYPE_PARAMETERS__PARAMS__RETURN_TYPE,
170
+ TSConstructorType: TYPE_PARAMETERS__PARAMS__RETURN_TYPE,
171
+ TSDeclareFunction: ID__TYPE_PARAMETERS__PARAMS__RETURN_TYPE__BODY,
172
+ TSEmptyBodyFunctionExpression: freeze(["id", "typeParameters", "params", "returnType"]),
173
+ TSEnumBody: MEMBERS,
174
+ TSEnumDeclaration: ID__BODY,
175
+ TSEnumMember: freeze(["id", "initializer"]),
176
+ TSExportAssignment: EXPRESSION,
177
+ TSExternalModuleReference: EXPRESSION,
178
+ TSFunctionType: TYPE_PARAMETERS__PARAMS__RETURN_TYPE,
179
+ TSImportEqualsDeclaration: freeze(["id", "moduleReference"]),
180
+ TSImportType: freeze(["argument", "options", "qualifier", "typeArguments"]),
181
+ TSIndexSignature: freeze(["parameters", "typeAnnotation"]),
182
+ TSIndexedAccessType: freeze(["objectType", "indexType"]),
183
+ TSInferType: freeze(["typeParameter"]),
184
+ TSInstantiationExpression: EXPRESSION__TYPE_ARGUMENTS,
185
+ TSInterfaceBody: BODY,
186
+ TSInterfaceDeclaration: freeze(["id", "typeParameters", "extends", "body"]),
187
+ TSInterfaceHeritage: EXPRESSION__TYPE_ARGUMENTS,
188
+ TSIntersectionType: TYPES,
189
+ TSJSDocNonNullableType: TYPE_ANNOTATION,
190
+ TSJSDocNullableType: TYPE_ANNOTATION,
191
+ TSLiteralType: freeze(["literal"]),
192
+ TSMappedType: freeze(["key", "constraint", "nameType", "typeAnnotation"]),
193
+ TSMethodSignature: freeze(["key", "typeParameters", "params", "returnType"]),
194
+ TSModuleBlock: BODY,
195
+ TSModuleDeclaration: ID__BODY,
196
+ TSNamedTupleMember: freeze(["label", "elementType"]),
197
+ TSNamespaceExportDeclaration: freeze(["id"]),
198
+ TSNonNullExpression: EXPRESSION,
199
+ TSOptionalType: TYPE_ANNOTATION,
200
+ TSParameterProperty: freeze(["decorators", "parameter"]),
201
+ TSParenthesizedType: TYPE_ANNOTATION,
202
+ TSPropertySignature: freeze(["key", "typeAnnotation"]),
203
+ TSQualifiedName: LEFT__RIGHT,
204
+ TSRestType: TYPE_ANNOTATION,
205
+ TSSatisfiesExpression: EXPRESSION__TYPE_ANNOTATION,
206
+ TSTemplateLiteralType: freeze(["quasis", "types"]),
207
+ TSTupleType: freeze(["elementTypes"]),
208
+ TSTypeAliasDeclaration: freeze(["id", "typeParameters", "typeAnnotation"]),
209
+ TSTypeAnnotation: TYPE_ANNOTATION,
210
+ TSTypeAssertion: freeze(["typeAnnotation", "expression"]),
211
+ TSTypeLiteral: MEMBERS,
212
+ TSTypeOperator: TYPE_ANNOTATION,
213
+ TSTypeParameter: freeze(["name", "constraint", "default"]),
214
+ TSTypeParameterDeclaration: PARAMS,
215
+ TSTypeParameterInstantiation: PARAMS,
216
+ TSTypePredicate: freeze(["parameterName", "typeAnnotation"]),
217
+ TSTypeQuery: freeze(["exprName", "typeArguments"]),
218
+ TSTypeReference: freeze(["typeName", "typeArguments"]),
219
+ TSUnionType: TYPES,
172
220
  });