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.
- package/generated/deserialize/js.js +331 -329
- package/generated/deserialize/js_range.js +331 -329
- package/generated/deserialize/ts.js +347 -341
- package/generated/deserialize/ts_range.js +347 -341
- package/generated/lazy/constructors.js +549 -496
- package/generated/lazy/type_ids.js +180 -180
- package/generated/lazy/walk.js +11 -7
- package/generated/visit/keys.js +214 -166
- package/generated/visit/type_ids.js +165 -165
- package/generated/visit/visitor.d.ts +171 -167
- package/generated/visit/walk.js +165 -165
- package/package.json +26 -26
- package/src-js/bindings.js +52 -52
- package/src-js/index.d.ts +19 -19
- package/src-js/index.js +9 -9
- package/src-js/raw-transfer/common.js +12 -8
- package/src-js/raw-transfer/eager.js +18 -16
- package/src-js/raw-transfer/lazy-common.js +1 -1
- package/src-js/raw-transfer/lazy.js +10 -12
- package/src-js/raw-transfer/node-array.js +16 -10
- package/src-js/raw-transfer/supported.js +2 -2
- package/src-js/raw-transfer/visitor.js +9 -5
- package/src-js/visit/index.js +7 -3
- package/src-js/visit/visitor.js +11 -6
- package/src-js/wasm.js +3 -3
- package/src-js/webcontainer-fallback.cjs +7 -7
|
@@ -4,187 +4,187 @@
|
|
|
4
4
|
// Mapping from node type name to node type ID
|
|
5
5
|
export const NODE_TYPE_IDS_MAP = new Map([
|
|
6
6
|
// Leaf nodes
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
[
|
|
10
|
-
[
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
19
|
-
[
|
|
20
|
-
[
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
[
|
|
25
|
-
[
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
29
|
-
[
|
|
30
|
-
[
|
|
31
|
-
[
|
|
32
|
-
[
|
|
33
|
-
[
|
|
34
|
-
[
|
|
35
|
-
[
|
|
36
|
-
[
|
|
37
|
-
[
|
|
38
|
-
[
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
[
|
|
44
|
-
[
|
|
7
|
+
["IdentifierName", 0],
|
|
8
|
+
["IdentifierReference", 1],
|
|
9
|
+
["BindingIdentifier", 2],
|
|
10
|
+
["LabelIdentifier", 3],
|
|
11
|
+
["ThisExpression", 4],
|
|
12
|
+
["Elision", 5],
|
|
13
|
+
["TemplateElement", 6],
|
|
14
|
+
["Super", 7],
|
|
15
|
+
["Hashbang", 8],
|
|
16
|
+
["EmptyStatement", 9],
|
|
17
|
+
["DebuggerStatement", 10],
|
|
18
|
+
["PrivateIdentifier", 11],
|
|
19
|
+
["BooleanLiteral", 12],
|
|
20
|
+
["NullLiteral", 13],
|
|
21
|
+
["NumericLiteral", 14],
|
|
22
|
+
["StringLiteral", 15],
|
|
23
|
+
["BigIntLiteral", 16],
|
|
24
|
+
["RegExpLiteral", 17],
|
|
25
|
+
["JSXOpeningFragment", 18],
|
|
26
|
+
["JSXClosingFragment", 19],
|
|
27
|
+
["JSXEmptyExpression", 20],
|
|
28
|
+
["JSXIdentifier", 21],
|
|
29
|
+
["JSXText", 22],
|
|
30
|
+
["TSAnyKeyword", 23],
|
|
31
|
+
["TSStringKeyword", 24],
|
|
32
|
+
["TSBooleanKeyword", 25],
|
|
33
|
+
["TSNumberKeyword", 26],
|
|
34
|
+
["TSNeverKeyword", 27],
|
|
35
|
+
["TSIntrinsicKeyword", 28],
|
|
36
|
+
["TSUnknownKeyword", 29],
|
|
37
|
+
["TSNullKeyword", 30],
|
|
38
|
+
["TSUndefinedKeyword", 31],
|
|
39
|
+
["TSVoidKeyword", 32],
|
|
40
|
+
["TSSymbolKeyword", 33],
|
|
41
|
+
["TSThisType", 34],
|
|
42
|
+
["TSObjectKeyword", 35],
|
|
43
|
+
["TSBigIntKeyword", 36],
|
|
44
|
+
["JSDocUnknownType", 37],
|
|
45
45
|
// Non-leaf nodes
|
|
46
|
-
[
|
|
47
|
-
[
|
|
48
|
-
[
|
|
49
|
-
[
|
|
50
|
-
[
|
|
51
|
-
[
|
|
52
|
-
[
|
|
53
|
-
[
|
|
54
|
-
[
|
|
55
|
-
[
|
|
56
|
-
[
|
|
57
|
-
[
|
|
58
|
-
[
|
|
59
|
-
[
|
|
60
|
-
[
|
|
61
|
-
[
|
|
62
|
-
[
|
|
63
|
-
[
|
|
64
|
-
[
|
|
65
|
-
[
|
|
66
|
-
[
|
|
67
|
-
[
|
|
68
|
-
[
|
|
69
|
-
[
|
|
70
|
-
[
|
|
71
|
-
[
|
|
72
|
-
[
|
|
73
|
-
[
|
|
74
|
-
[
|
|
75
|
-
[
|
|
76
|
-
[
|
|
77
|
-
[
|
|
78
|
-
[
|
|
79
|
-
[
|
|
80
|
-
[
|
|
81
|
-
[
|
|
82
|
-
[
|
|
83
|
-
[
|
|
84
|
-
[
|
|
85
|
-
[
|
|
86
|
-
[
|
|
87
|
-
[
|
|
88
|
-
[
|
|
89
|
-
[
|
|
90
|
-
[
|
|
91
|
-
[
|
|
92
|
-
[
|
|
93
|
-
[
|
|
94
|
-
[
|
|
95
|
-
[
|
|
96
|
-
[
|
|
97
|
-
[
|
|
98
|
-
[
|
|
99
|
-
[
|
|
100
|
-
[
|
|
101
|
-
[
|
|
102
|
-
[
|
|
103
|
-
[
|
|
104
|
-
[
|
|
105
|
-
[
|
|
106
|
-
[
|
|
107
|
-
[
|
|
108
|
-
[
|
|
109
|
-
[
|
|
110
|
-
[
|
|
111
|
-
[
|
|
112
|
-
[
|
|
113
|
-
[
|
|
114
|
-
[
|
|
115
|
-
[
|
|
116
|
-
[
|
|
117
|
-
[
|
|
118
|
-
[
|
|
119
|
-
[
|
|
120
|
-
[
|
|
121
|
-
[
|
|
122
|
-
[
|
|
123
|
-
[
|
|
124
|
-
[
|
|
125
|
-
[
|
|
126
|
-
[
|
|
127
|
-
[
|
|
128
|
-
[
|
|
129
|
-
[
|
|
130
|
-
[
|
|
131
|
-
[
|
|
132
|
-
[
|
|
133
|
-
[
|
|
134
|
-
[
|
|
135
|
-
[
|
|
136
|
-
[
|
|
137
|
-
[
|
|
138
|
-
[
|
|
139
|
-
[
|
|
140
|
-
[
|
|
141
|
-
[
|
|
142
|
-
[
|
|
143
|
-
[
|
|
144
|
-
[
|
|
145
|
-
[
|
|
146
|
-
[
|
|
147
|
-
[
|
|
148
|
-
[
|
|
149
|
-
[
|
|
150
|
-
[
|
|
151
|
-
[
|
|
152
|
-
[
|
|
153
|
-
[
|
|
154
|
-
[
|
|
155
|
-
[
|
|
156
|
-
[
|
|
157
|
-
[
|
|
158
|
-
[
|
|
159
|
-
[
|
|
160
|
-
[
|
|
161
|
-
[
|
|
162
|
-
[
|
|
163
|
-
[
|
|
164
|
-
[
|
|
165
|
-
[
|
|
166
|
-
[
|
|
167
|
-
[
|
|
168
|
-
[
|
|
169
|
-
[
|
|
170
|
-
[
|
|
171
|
-
[
|
|
172
|
-
[
|
|
173
|
-
[
|
|
174
|
-
[
|
|
175
|
-
[
|
|
176
|
-
[
|
|
177
|
-
[
|
|
178
|
-
[
|
|
179
|
-
[
|
|
180
|
-
[
|
|
181
|
-
[
|
|
182
|
-
[
|
|
183
|
-
[
|
|
184
|
-
[
|
|
185
|
-
[
|
|
186
|
-
[
|
|
187
|
-
[
|
|
46
|
+
["Program", 38],
|
|
47
|
+
["ArrayExpression", 39],
|
|
48
|
+
["ObjectExpression", 40],
|
|
49
|
+
["ObjectProperty", 41],
|
|
50
|
+
["TemplateLiteral", 42],
|
|
51
|
+
["TaggedTemplateExpression", 43],
|
|
52
|
+
["ComputedMemberExpression", 44],
|
|
53
|
+
["StaticMemberExpression", 45],
|
|
54
|
+
["PrivateFieldExpression", 46],
|
|
55
|
+
["CallExpression", 47],
|
|
56
|
+
["NewExpression", 48],
|
|
57
|
+
["MetaProperty", 49],
|
|
58
|
+
["SpreadElement", 50],
|
|
59
|
+
["UpdateExpression", 51],
|
|
60
|
+
["UnaryExpression", 52],
|
|
61
|
+
["BinaryExpression", 53],
|
|
62
|
+
["PrivateInExpression", 54],
|
|
63
|
+
["LogicalExpression", 55],
|
|
64
|
+
["ConditionalExpression", 56],
|
|
65
|
+
["AssignmentExpression", 57],
|
|
66
|
+
["ArrayAssignmentTarget", 58],
|
|
67
|
+
["ObjectAssignmentTarget", 59],
|
|
68
|
+
["AssignmentTargetWithDefault", 60],
|
|
69
|
+
["AssignmentTargetPropertyIdentifier", 61],
|
|
70
|
+
["AssignmentTargetPropertyProperty", 62],
|
|
71
|
+
["SequenceExpression", 63],
|
|
72
|
+
["AwaitExpression", 64],
|
|
73
|
+
["ChainExpression", 65],
|
|
74
|
+
["ParenthesizedExpression", 66],
|
|
75
|
+
["BlockStatement", 67],
|
|
76
|
+
["VariableDeclaration", 68],
|
|
77
|
+
["VariableDeclarator", 69],
|
|
78
|
+
["ExpressionStatement", 70],
|
|
79
|
+
["IfStatement", 71],
|
|
80
|
+
["DoWhileStatement", 72],
|
|
81
|
+
["WhileStatement", 73],
|
|
82
|
+
["ForStatement", 74],
|
|
83
|
+
["ForInStatement", 75],
|
|
84
|
+
["ForOfStatement", 76],
|
|
85
|
+
["ContinueStatement", 77],
|
|
86
|
+
["BreakStatement", 78],
|
|
87
|
+
["ReturnStatement", 79],
|
|
88
|
+
["WithStatement", 80],
|
|
89
|
+
["SwitchStatement", 81],
|
|
90
|
+
["SwitchCase", 82],
|
|
91
|
+
["LabeledStatement", 83],
|
|
92
|
+
["ThrowStatement", 84],
|
|
93
|
+
["TryStatement", 85],
|
|
94
|
+
["CatchClause", 86],
|
|
95
|
+
["AssignmentPattern", 87],
|
|
96
|
+
["ObjectPattern", 88],
|
|
97
|
+
["BindingProperty", 89],
|
|
98
|
+
["ArrayPattern", 90],
|
|
99
|
+
["Function", 91],
|
|
100
|
+
["FormalParameters", 92],
|
|
101
|
+
["FunctionBody", 93],
|
|
102
|
+
["ArrowFunctionExpression", 94],
|
|
103
|
+
["YieldExpression", 95],
|
|
104
|
+
["Class", 96],
|
|
105
|
+
["ClassBody", 97],
|
|
106
|
+
["MethodDefinition", 98],
|
|
107
|
+
["PropertyDefinition", 99],
|
|
108
|
+
["StaticBlock", 100],
|
|
109
|
+
["AccessorProperty", 101],
|
|
110
|
+
["ImportExpression", 102],
|
|
111
|
+
["ImportDeclaration", 103],
|
|
112
|
+
["ImportSpecifier", 104],
|
|
113
|
+
["ImportDefaultSpecifier", 105],
|
|
114
|
+
["ImportNamespaceSpecifier", 106],
|
|
115
|
+
["ImportAttribute", 107],
|
|
116
|
+
["ExportNamedDeclaration", 108],
|
|
117
|
+
["ExportDefaultDeclaration", 109],
|
|
118
|
+
["ExportAllDeclaration", 110],
|
|
119
|
+
["ExportSpecifier", 111],
|
|
120
|
+
["V8IntrinsicExpression", 112],
|
|
121
|
+
["JSXElement", 113],
|
|
122
|
+
["JSXOpeningElement", 114],
|
|
123
|
+
["JSXClosingElement", 115],
|
|
124
|
+
["JSXFragment", 116],
|
|
125
|
+
["JSXNamespacedName", 117],
|
|
126
|
+
["JSXMemberExpression", 118],
|
|
127
|
+
["JSXExpressionContainer", 119],
|
|
128
|
+
["JSXAttribute", 120],
|
|
129
|
+
["JSXSpreadAttribute", 121],
|
|
130
|
+
["JSXSpreadChild", 122],
|
|
131
|
+
["TSEnumDeclaration", 123],
|
|
132
|
+
["TSEnumBody", 124],
|
|
133
|
+
["TSEnumMember", 125],
|
|
134
|
+
["TSTypeAnnotation", 126],
|
|
135
|
+
["TSLiteralType", 127],
|
|
136
|
+
["TSConditionalType", 128],
|
|
137
|
+
["TSUnionType", 129],
|
|
138
|
+
["TSIntersectionType", 130],
|
|
139
|
+
["TSParenthesizedType", 131],
|
|
140
|
+
["TSTypeOperator", 132],
|
|
141
|
+
["TSArrayType", 133],
|
|
142
|
+
["TSIndexedAccessType", 134],
|
|
143
|
+
["TSTupleType", 135],
|
|
144
|
+
["TSNamedTupleMember", 136],
|
|
145
|
+
["TSOptionalType", 137],
|
|
146
|
+
["TSRestType", 138],
|
|
147
|
+
["TSTypeReference", 139],
|
|
148
|
+
["TSQualifiedName", 140],
|
|
149
|
+
["TSTypeParameterInstantiation", 141],
|
|
150
|
+
["TSTypeParameter", 142],
|
|
151
|
+
["TSTypeParameterDeclaration", 143],
|
|
152
|
+
["TSTypeAliasDeclaration", 144],
|
|
153
|
+
["TSClassImplements", 145],
|
|
154
|
+
["TSInterfaceDeclaration", 146],
|
|
155
|
+
["TSInterfaceBody", 147],
|
|
156
|
+
["TSPropertySignature", 148],
|
|
157
|
+
["TSIndexSignature", 149],
|
|
158
|
+
["TSCallSignatureDeclaration", 150],
|
|
159
|
+
["TSMethodSignature", 151],
|
|
160
|
+
["TSConstructSignatureDeclaration", 152],
|
|
161
|
+
["TSIndexSignatureName", 153],
|
|
162
|
+
["TSInterfaceHeritage", 154],
|
|
163
|
+
["TSTypePredicate", 155],
|
|
164
|
+
["TSModuleDeclaration", 156],
|
|
165
|
+
["TSGlobalDeclaration", 157],
|
|
166
|
+
["TSModuleBlock", 158],
|
|
167
|
+
["TSTypeLiteral", 159],
|
|
168
|
+
["TSInferType", 160],
|
|
169
|
+
["TSTypeQuery", 161],
|
|
170
|
+
["TSImportType", 162],
|
|
171
|
+
["TSImportTypeQualifiedName", 163],
|
|
172
|
+
["TSFunctionType", 164],
|
|
173
|
+
["TSConstructorType", 165],
|
|
174
|
+
["TSMappedType", 166],
|
|
175
|
+
["TSTemplateLiteralType", 167],
|
|
176
|
+
["TSAsExpression", 168],
|
|
177
|
+
["TSSatisfiesExpression", 169],
|
|
178
|
+
["TSTypeAssertion", 170],
|
|
179
|
+
["TSImportEqualsDeclaration", 171],
|
|
180
|
+
["TSExternalModuleReference", 172],
|
|
181
|
+
["TSNonNullExpression", 173],
|
|
182
|
+
["Decorator", 174],
|
|
183
|
+
["TSExportAssignment", 175],
|
|
184
|
+
["TSNamespaceExportDeclaration", 176],
|
|
185
|
+
["TSInstantiationExpression", 177],
|
|
186
|
+
["JSDocNullableType", 178],
|
|
187
|
+
["JSDocNonNullableType", 179],
|
|
188
188
|
]);
|
|
189
189
|
|
|
190
190
|
export const NODE_TYPES_COUNT = 180;
|
package/generated/lazy/walk.js
CHANGED
|
@@ -182,7 +182,7 @@ import {
|
|
|
182
182
|
JSDocNullableType,
|
|
183
183
|
JSDocNonNullableType,
|
|
184
184
|
JSDocUnknownType,
|
|
185
|
-
} from
|
|
185
|
+
} from "./constructors.js";
|
|
186
186
|
|
|
187
187
|
export { walkProgram };
|
|
188
188
|
|
|
@@ -1268,7 +1268,9 @@ function walkAssignmentTargetMaybeDefault(pos, ast, visitors) {
|
|
|
1268
1268
|
walkBoxPrivateFieldExpression(pos + 8, ast, visitors);
|
|
1269
1269
|
return;
|
|
1270
1270
|
default:
|
|
1271
|
-
throw new Error(
|
|
1271
|
+
throw new Error(
|
|
1272
|
+
`Unexpected discriminant ${ast.buffer[pos]} for AssignmentTargetMaybeDefault`,
|
|
1273
|
+
);
|
|
1272
1274
|
}
|
|
1273
1275
|
}
|
|
1274
1276
|
|
|
@@ -2768,7 +2770,9 @@ function walkExportDefaultDeclarationKind(pos, ast, visitors) {
|
|
|
2768
2770
|
walkBoxTSInterfaceDeclaration(pos + 8, ast, visitors);
|
|
2769
2771
|
return;
|
|
2770
2772
|
default:
|
|
2771
|
-
throw new Error(
|
|
2773
|
+
throw new Error(
|
|
2774
|
+
`Unexpected discriminant ${ast.buffer[pos]} for ExportDefaultDeclarationKind`,
|
|
2775
|
+
);
|
|
2772
2776
|
}
|
|
2773
2777
|
}
|
|
2774
2778
|
|
|
@@ -4390,10 +4394,10 @@ function walkTSImportType(pos, ast, visitors) {
|
|
|
4390
4394
|
if (enter !== null) enter(node);
|
|
4391
4395
|
}
|
|
4392
4396
|
|
|
4393
|
-
|
|
4394
|
-
walkOptionBoxObjectExpression(pos +
|
|
4395
|
-
walkOptionTSImportTypeQualifier(pos +
|
|
4396
|
-
walkOptionBoxTSTypeParameterInstantiation(pos +
|
|
4397
|
+
walkStringLiteral(pos + 8, ast, visitors);
|
|
4398
|
+
walkOptionBoxObjectExpression(pos + 56, ast, visitors);
|
|
4399
|
+
walkOptionTSImportTypeQualifier(pos + 64, ast, visitors);
|
|
4400
|
+
walkOptionBoxTSTypeParameterInstantiation(pos + 80, ast, visitors);
|
|
4397
4401
|
|
|
4398
4402
|
if (exit !== null) exit(node);
|
|
4399
4403
|
}
|