yuku-parser 0.4.3 → 0.4.4
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/README.md +10 -8
- package/index.d.ts +636 -372
- package/index.js +2 -2
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -15,8 +15,8 @@ import { parse } from "yuku-parser";
|
|
|
15
15
|
|
|
16
16
|
const result = parse("const x = 1 + 2;");
|
|
17
17
|
|
|
18
|
-
console.log(result.program);
|
|
19
|
-
console.log(result.comments);
|
|
18
|
+
console.log(result.program); // ESTree / TypeScript-ESTree Program node
|
|
19
|
+
console.log(result.comments); // all comments
|
|
20
20
|
console.log(result.diagnostics); // errors and warnings
|
|
21
21
|
```
|
|
22
22
|
|
|
@@ -76,16 +76,18 @@ const result = parse(source, {
|
|
|
76
76
|
sourceType: "module",
|
|
77
77
|
lang: "jsx",
|
|
78
78
|
preserveParens: true,
|
|
79
|
+
allowReturnOutsideFunction: false,
|
|
79
80
|
semanticErrors: false,
|
|
80
81
|
});
|
|
81
82
|
```
|
|
82
83
|
|
|
83
|
-
| Option
|
|
84
|
-
|
|
85
|
-
| `sourceType`
|
|
86
|
-
| `lang`
|
|
87
|
-
| `preserveParens` | `true`, `false`
|
|
88
|
-
| `
|
|
84
|
+
| Option | Values | Default | Description |
|
|
85
|
+
| ---------------- | ----------------------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------- |
|
|
86
|
+
| `sourceType` | `"module"`, `"script"` | `"module"` | Module mode enables `import`/`export`, `import.meta`, top-level `await`, and strict mode. |
|
|
87
|
+
| `lang` | `"js"`, `"ts"`, `"jsx"`, `"tsx"`, `"dts"` | `"js"` | Language variant controls which syntax extensions are enabled. |
|
|
88
|
+
| `preserveParens` | `true`, `false` | `true` | Keep `ParenthesizedExpression` nodes in the AST. When false, parentheses are stripped and only the inner expression is kept. |
|
|
89
|
+
| `allowReturnOutsideFunction` | `true`, `false` | `false` | Allow `return` statements outside of functions, at the top level. |
|
|
90
|
+
| `semanticErrors` | `true`, `false` | `false` | Run semantic analysis and report semantic errors alongside syntax errors. |
|
|
89
91
|
|
|
90
92
|
## Result
|
|
91
93
|
|
package/index.d.ts
CHANGED
|
@@ -6,53 +6,53 @@ type SourceLang = "js" | "ts" | "jsx" | "tsx" | "dts";
|
|
|
6
6
|
|
|
7
7
|
/** Options for configuring the parser. */
|
|
8
8
|
interface ParseOptions {
|
|
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
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Parse as a classic script or an ES module.
|
|
11
|
+
* Module mode enables `import`/`export`, `import.meta`, top-level `await`,
|
|
12
|
+
* and strict mode.
|
|
13
|
+
* @default "module"
|
|
14
|
+
*/
|
|
15
|
+
sourceType?: SourceType;
|
|
16
|
+
/**
|
|
17
|
+
* Language variant controls which syntax extensions are enabled.
|
|
18
|
+
* @default "js"
|
|
19
|
+
*/
|
|
20
|
+
lang?: SourceLang;
|
|
21
|
+
/**
|
|
22
|
+
* When true, parenthesized expressions are represented as
|
|
23
|
+
* `ParenthesizedExpression` nodes in the AST. When false,
|
|
24
|
+
* parentheses are stripped and only the inner expression is kept.
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
preserveParens?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Run semantic analysis after parsing and include semantic errors
|
|
30
|
+
* (e.g. duplicate declarations, invalid `break`/`continue` targets)
|
|
31
|
+
* alongside syntax errors. This requires a separate AST pass and may
|
|
32
|
+
* affect performance slightly.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
semanticErrors?: boolean;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/** A source code comment. */
|
|
39
39
|
interface Comment {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
type: "Line" | "Block";
|
|
41
|
+
/** Comment text without the delimiters. */
|
|
42
|
+
value: string;
|
|
43
|
+
/** Byte offset. */
|
|
44
|
+
start: number;
|
|
45
|
+
/** Byte offset. */
|
|
46
|
+
end: number;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
/** A labeled source span attached to a {@link Diagnostic}. */
|
|
50
50
|
interface DiagnosticLabel {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
/** Byte offset. */
|
|
52
|
+
start: number;
|
|
53
|
+
/** Byte offset. */
|
|
54
|
+
end: number;
|
|
55
|
+
message: string;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
/**
|
|
@@ -60,26 +60,26 @@ interface DiagnosticLabel {
|
|
|
60
60
|
* The parser is error tolerant: an AST is always produced even when diagnostics exist.
|
|
61
61
|
*/
|
|
62
62
|
interface Diagnostic {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
63
|
+
severity: "error" | "warning" | "hint" | "info";
|
|
64
|
+
message: string;
|
|
65
|
+
/** Fix suggestion, or `null` if unavailable. */
|
|
66
|
+
help: string | null;
|
|
67
|
+
/** Byte offset. */
|
|
68
|
+
start: number;
|
|
69
|
+
/** Byte offset. */
|
|
70
|
+
end: number;
|
|
71
|
+
/** Additional source spans providing context. */
|
|
72
|
+
labels: DiagnosticLabel[];
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
/** The result returned by the parser. */
|
|
76
76
|
interface ParseResult {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
/** Root ESTree/TypeScript-ESTree AST node. */
|
|
78
|
+
program: Program;
|
|
79
|
+
/** All comments in source order. */
|
|
80
|
+
comments: Comment[];
|
|
81
|
+
/** Syntax diagnostics, and semantic diagnostics when {@link ParseOptions.semanticErrors} is enabled. */
|
|
82
|
+
diagnostics: Diagnostic[];
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
/**
|
|
@@ -90,539 +90,803 @@ export function parse(source: string, options?: ParseOptions): ParseResult;
|
|
|
90
90
|
// AST node types
|
|
91
91
|
|
|
92
92
|
interface BaseNode {
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
start: number;
|
|
94
|
+
end: number;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
type BinaryOperator =
|
|
97
|
+
type BinaryOperator =
|
|
98
|
+
| "=="
|
|
99
|
+
| "!="
|
|
100
|
+
| "==="
|
|
101
|
+
| "!=="
|
|
102
|
+
| "<"
|
|
103
|
+
| "<="
|
|
104
|
+
| ">"
|
|
105
|
+
| ">="
|
|
106
|
+
| "+"
|
|
107
|
+
| "-"
|
|
108
|
+
| "*"
|
|
109
|
+
| "/"
|
|
110
|
+
| "%"
|
|
111
|
+
| "**"
|
|
112
|
+
| "|"
|
|
113
|
+
| "^"
|
|
114
|
+
| "&"
|
|
115
|
+
| "<<"
|
|
116
|
+
| ">>"
|
|
117
|
+
| ">>>"
|
|
118
|
+
| "in"
|
|
119
|
+
| "instanceof";
|
|
98
120
|
type LogicalOperator = "&&" | "||" | "??";
|
|
99
121
|
type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
|
|
100
122
|
type UpdateOperator = "++" | "--";
|
|
101
|
-
type AssignmentOperator =
|
|
123
|
+
type AssignmentOperator =
|
|
124
|
+
| "="
|
|
125
|
+
| "+="
|
|
126
|
+
| "-="
|
|
127
|
+
| "*="
|
|
128
|
+
| "/="
|
|
129
|
+
| "%="
|
|
130
|
+
| "**="
|
|
131
|
+
| "<<="
|
|
132
|
+
| ">>="
|
|
133
|
+
| ">>>="
|
|
134
|
+
| "|="
|
|
135
|
+
| "^="
|
|
136
|
+
| "&="
|
|
137
|
+
| "||="
|
|
138
|
+
| "&&="
|
|
139
|
+
| "??=";
|
|
102
140
|
|
|
103
141
|
interface Identifier extends BaseNode {
|
|
104
|
-
|
|
105
|
-
|
|
142
|
+
type: "Identifier";
|
|
143
|
+
name: string;
|
|
106
144
|
}
|
|
107
145
|
interface PrivateIdentifier extends BaseNode {
|
|
108
|
-
|
|
109
|
-
|
|
146
|
+
type: "PrivateIdentifier";
|
|
147
|
+
name: string;
|
|
110
148
|
}
|
|
111
149
|
interface StringLiteral extends BaseNode {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
150
|
+
type: "Literal";
|
|
151
|
+
value: string;
|
|
152
|
+
raw: string;
|
|
115
153
|
}
|
|
116
154
|
interface NumericLiteral extends BaseNode {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
155
|
+
type: "Literal";
|
|
156
|
+
value: number | null;
|
|
157
|
+
raw: string;
|
|
120
158
|
}
|
|
121
159
|
interface BigIntLiteral extends BaseNode {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
160
|
+
type: "Literal";
|
|
161
|
+
value: bigint;
|
|
162
|
+
raw: string;
|
|
163
|
+
bigint: string;
|
|
126
164
|
}
|
|
127
165
|
interface BooleanLiteral extends BaseNode {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
166
|
+
type: "Literal";
|
|
167
|
+
value: boolean;
|
|
168
|
+
raw: string;
|
|
131
169
|
}
|
|
132
170
|
interface NullLiteral extends BaseNode {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
171
|
+
type: "Literal";
|
|
172
|
+
value: null;
|
|
173
|
+
raw: "null";
|
|
136
174
|
}
|
|
137
175
|
interface RegExpLiteral extends BaseNode {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
146
|
-
type Literal =
|
|
176
|
+
type: "Literal";
|
|
177
|
+
value: RegExp | null;
|
|
178
|
+
raw: string;
|
|
179
|
+
regex: {
|
|
180
|
+
pattern: string;
|
|
181
|
+
flags: string;
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
type Literal =
|
|
185
|
+
| StringLiteral
|
|
186
|
+
| NumericLiteral
|
|
187
|
+
| BigIntLiteral
|
|
188
|
+
| BooleanLiteral
|
|
189
|
+
| NullLiteral
|
|
190
|
+
| RegExpLiteral;
|
|
147
191
|
interface ArrayPattern extends BaseNode {
|
|
148
|
-
|
|
149
|
-
|
|
192
|
+
type: "ArrayPattern";
|
|
193
|
+
elements: Array<BindingPattern | RestElement | null>;
|
|
150
194
|
}
|
|
151
195
|
interface ObjectPattern extends BaseNode {
|
|
152
|
-
|
|
153
|
-
|
|
196
|
+
type: "ObjectPattern";
|
|
197
|
+
properties: Array<Property | RestElement>;
|
|
154
198
|
}
|
|
155
199
|
interface AssignmentPattern extends BaseNode {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
200
|
+
type: "AssignmentPattern";
|
|
201
|
+
left: BindingPattern;
|
|
202
|
+
right: Expression;
|
|
159
203
|
}
|
|
160
204
|
interface RestElement extends BaseNode {
|
|
161
|
-
|
|
162
|
-
|
|
205
|
+
type: "RestElement";
|
|
206
|
+
argument: BindingPattern;
|
|
163
207
|
}
|
|
164
208
|
type BindingPattern = Identifier | ArrayPattern | ObjectPattern | AssignmentPattern;
|
|
165
209
|
type FunctionParameter = BindingPattern | RestElement;
|
|
166
210
|
interface Property extends BaseNode {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
211
|
+
type: "Property";
|
|
212
|
+
kind: "init" | "get" | "set";
|
|
213
|
+
key: Expression;
|
|
214
|
+
value: Expression | BindingPattern;
|
|
215
|
+
method: boolean;
|
|
216
|
+
shorthand: boolean;
|
|
217
|
+
computed: boolean;
|
|
174
218
|
}
|
|
175
219
|
interface SequenceExpression extends BaseNode {
|
|
176
|
-
|
|
177
|
-
|
|
220
|
+
type: "SequenceExpression";
|
|
221
|
+
expressions: Expression[];
|
|
178
222
|
}
|
|
179
223
|
interface ParenthesizedExpression extends BaseNode {
|
|
180
|
-
|
|
181
|
-
|
|
224
|
+
type: "ParenthesizedExpression";
|
|
225
|
+
expression: Expression;
|
|
182
226
|
}
|
|
183
227
|
interface BinaryExpression extends BaseNode {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
228
|
+
type: "BinaryExpression";
|
|
229
|
+
left: Expression;
|
|
230
|
+
operator: BinaryOperator;
|
|
231
|
+
right: Expression;
|
|
188
232
|
}
|
|
189
233
|
interface LogicalExpression extends BaseNode {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
234
|
+
type: "LogicalExpression";
|
|
235
|
+
left: Expression;
|
|
236
|
+
operator: LogicalOperator;
|
|
237
|
+
right: Expression;
|
|
194
238
|
}
|
|
195
239
|
interface ConditionalExpression extends BaseNode {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
240
|
+
type: "ConditionalExpression";
|
|
241
|
+
test: Expression;
|
|
242
|
+
consequent: Expression;
|
|
243
|
+
alternate: Expression;
|
|
200
244
|
}
|
|
201
245
|
interface UnaryExpression extends BaseNode {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
246
|
+
type: "UnaryExpression";
|
|
247
|
+
operator: UnaryOperator;
|
|
248
|
+
prefix: true;
|
|
249
|
+
argument: Expression;
|
|
206
250
|
}
|
|
207
251
|
interface UpdateExpression extends BaseNode {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
252
|
+
type: "UpdateExpression";
|
|
253
|
+
operator: UpdateOperator;
|
|
254
|
+
prefix: boolean;
|
|
255
|
+
argument: Expression;
|
|
212
256
|
}
|
|
213
257
|
interface AssignmentExpression extends BaseNode {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
258
|
+
type: "AssignmentExpression";
|
|
259
|
+
operator: AssignmentOperator;
|
|
260
|
+
left: Expression | BindingPattern;
|
|
261
|
+
right: Expression;
|
|
218
262
|
}
|
|
219
263
|
interface YieldExpression extends BaseNode {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
264
|
+
type: "YieldExpression";
|
|
265
|
+
delegate: boolean;
|
|
266
|
+
argument: Expression | null;
|
|
223
267
|
}
|
|
224
268
|
interface AwaitExpression extends BaseNode {
|
|
225
|
-
|
|
226
|
-
|
|
269
|
+
type: "AwaitExpression";
|
|
270
|
+
argument: Expression;
|
|
227
271
|
}
|
|
228
272
|
interface ArrayExpression extends BaseNode {
|
|
229
|
-
|
|
230
|
-
|
|
273
|
+
type: "ArrayExpression";
|
|
274
|
+
elements: Array<Expression | SpreadElement | null>;
|
|
231
275
|
}
|
|
232
276
|
interface ObjectExpression extends BaseNode {
|
|
233
|
-
|
|
234
|
-
|
|
277
|
+
type: "ObjectExpression";
|
|
278
|
+
properties: Array<Property | SpreadElement>;
|
|
235
279
|
}
|
|
236
280
|
interface SpreadElement extends BaseNode {
|
|
237
|
-
|
|
238
|
-
|
|
281
|
+
type: "SpreadElement";
|
|
282
|
+
argument: Expression;
|
|
239
283
|
}
|
|
240
284
|
interface MemberExpression extends BaseNode {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
285
|
+
type: "MemberExpression";
|
|
286
|
+
object: Expression | Super;
|
|
287
|
+
property: Expression | PrivateIdentifier;
|
|
288
|
+
computed: boolean;
|
|
289
|
+
optional: boolean;
|
|
246
290
|
}
|
|
247
291
|
interface CallExpression extends BaseNode {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
292
|
+
type: "CallExpression";
|
|
293
|
+
callee: Expression | Super;
|
|
294
|
+
arguments: Array<Expression | SpreadElement>;
|
|
295
|
+
optional: boolean;
|
|
252
296
|
}
|
|
253
297
|
interface ChainExpression extends BaseNode {
|
|
254
|
-
|
|
255
|
-
|
|
298
|
+
type: "ChainExpression";
|
|
299
|
+
expression: CallExpression | MemberExpression;
|
|
256
300
|
}
|
|
257
301
|
interface TaggedTemplateExpression extends BaseNode {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
302
|
+
type: "TaggedTemplateExpression";
|
|
303
|
+
tag: Expression;
|
|
304
|
+
quasi: TemplateLiteral;
|
|
261
305
|
}
|
|
262
306
|
interface NewExpression extends BaseNode {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
307
|
+
type: "NewExpression";
|
|
308
|
+
callee: Expression;
|
|
309
|
+
arguments: Array<Expression | SpreadElement>;
|
|
266
310
|
}
|
|
267
311
|
interface MetaProperty extends BaseNode {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
312
|
+
type: "MetaProperty";
|
|
313
|
+
meta: Identifier;
|
|
314
|
+
property: Identifier;
|
|
271
315
|
}
|
|
272
316
|
interface ImportExpression extends BaseNode {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
317
|
+
type: "ImportExpression";
|
|
318
|
+
source: Expression;
|
|
319
|
+
options: Expression | null;
|
|
320
|
+
phase: "source" | "defer" | null;
|
|
277
321
|
}
|
|
278
322
|
interface TemplateLiteral extends BaseNode {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
323
|
+
type: "TemplateLiteral";
|
|
324
|
+
quasis: TemplateElement[];
|
|
325
|
+
expressions: Expression[];
|
|
282
326
|
}
|
|
283
327
|
interface TemplateElement extends BaseNode {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
328
|
+
type: "TemplateElement";
|
|
329
|
+
value: {
|
|
330
|
+
raw: string;
|
|
331
|
+
cooked: string | null;
|
|
332
|
+
};
|
|
333
|
+
tail: boolean;
|
|
290
334
|
}
|
|
291
335
|
interface Super extends BaseNode {
|
|
292
|
-
|
|
336
|
+
type: "Super";
|
|
293
337
|
}
|
|
294
338
|
interface ThisExpression extends BaseNode {
|
|
295
|
-
|
|
339
|
+
type: "ThisExpression";
|
|
296
340
|
}
|
|
297
341
|
interface ExpressionStatement extends BaseNode {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
342
|
+
type: "ExpressionStatement";
|
|
343
|
+
expression: Expression;
|
|
344
|
+
directive?: string;
|
|
301
345
|
}
|
|
302
346
|
interface BlockStatement extends BaseNode {
|
|
303
|
-
|
|
304
|
-
|
|
347
|
+
type: "BlockStatement";
|
|
348
|
+
body: Statement[];
|
|
305
349
|
}
|
|
306
350
|
interface IfStatement extends BaseNode {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
351
|
+
type: "IfStatement";
|
|
352
|
+
test: Expression;
|
|
353
|
+
consequent: Statement;
|
|
354
|
+
alternate: Statement | null;
|
|
311
355
|
}
|
|
312
356
|
interface SwitchStatement extends BaseNode {
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
357
|
+
type: "SwitchStatement";
|
|
358
|
+
discriminant: Expression;
|
|
359
|
+
cases: SwitchCase[];
|
|
316
360
|
}
|
|
317
361
|
interface SwitchCase extends BaseNode {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
362
|
+
type: "SwitchCase";
|
|
363
|
+
test: Expression | null;
|
|
364
|
+
consequent: Statement[];
|
|
321
365
|
}
|
|
322
366
|
interface ForStatement extends BaseNode {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
367
|
+
type: "ForStatement";
|
|
368
|
+
init: VariableDeclaration | Expression | null;
|
|
369
|
+
test: Expression | null;
|
|
370
|
+
update: Expression | null;
|
|
371
|
+
body: Statement;
|
|
328
372
|
}
|
|
329
373
|
interface ForInStatement extends BaseNode {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
374
|
+
type: "ForInStatement";
|
|
375
|
+
left: VariableDeclaration | Expression;
|
|
376
|
+
right: Expression;
|
|
377
|
+
body: Statement;
|
|
334
378
|
}
|
|
335
379
|
interface ForOfStatement extends BaseNode {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
380
|
+
type: "ForOfStatement";
|
|
381
|
+
left: VariableDeclaration | Expression;
|
|
382
|
+
right: Expression;
|
|
383
|
+
body: Statement;
|
|
384
|
+
await: boolean;
|
|
341
385
|
}
|
|
342
386
|
interface WhileStatement extends BaseNode {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
387
|
+
type: "WhileStatement";
|
|
388
|
+
test: Expression;
|
|
389
|
+
body: Statement;
|
|
346
390
|
}
|
|
347
391
|
interface DoWhileStatement extends BaseNode {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
392
|
+
type: "DoWhileStatement";
|
|
393
|
+
body: Statement;
|
|
394
|
+
test: Expression;
|
|
351
395
|
}
|
|
352
396
|
interface BreakStatement extends BaseNode {
|
|
353
|
-
|
|
354
|
-
|
|
397
|
+
type: "BreakStatement";
|
|
398
|
+
label: Identifier | null;
|
|
355
399
|
}
|
|
356
400
|
interface ContinueStatement extends BaseNode {
|
|
357
|
-
|
|
358
|
-
|
|
401
|
+
type: "ContinueStatement";
|
|
402
|
+
label: Identifier | null;
|
|
359
403
|
}
|
|
360
404
|
interface LabeledStatement extends BaseNode {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
405
|
+
type: "LabeledStatement";
|
|
406
|
+
label: Identifier;
|
|
407
|
+
body: Statement;
|
|
364
408
|
}
|
|
365
409
|
interface WithStatement extends BaseNode {
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
410
|
+
type: "WithStatement";
|
|
411
|
+
object: Expression;
|
|
412
|
+
body: Statement;
|
|
369
413
|
}
|
|
370
414
|
interface ReturnStatement extends BaseNode {
|
|
371
|
-
|
|
372
|
-
|
|
415
|
+
type: "ReturnStatement";
|
|
416
|
+
argument: Expression | null;
|
|
373
417
|
}
|
|
374
418
|
interface ThrowStatement extends BaseNode {
|
|
375
|
-
|
|
376
|
-
|
|
419
|
+
type: "ThrowStatement";
|
|
420
|
+
argument: Expression;
|
|
377
421
|
}
|
|
378
422
|
interface TryStatement extends BaseNode {
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
423
|
+
type: "TryStatement";
|
|
424
|
+
block: BlockStatement;
|
|
425
|
+
handler: CatchClause | null;
|
|
426
|
+
finalizer: BlockStatement | null;
|
|
383
427
|
}
|
|
384
428
|
interface CatchClause extends BaseNode {
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
429
|
+
type: "CatchClause";
|
|
430
|
+
param: BindingPattern | null;
|
|
431
|
+
body: BlockStatement;
|
|
388
432
|
}
|
|
389
433
|
interface DebuggerStatement extends BaseNode {
|
|
390
|
-
|
|
434
|
+
type: "DebuggerStatement";
|
|
391
435
|
}
|
|
392
436
|
interface EmptyStatement extends BaseNode {
|
|
393
|
-
|
|
437
|
+
type: "EmptyStatement";
|
|
394
438
|
}
|
|
395
439
|
interface VariableDeclaration extends BaseNode {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
440
|
+
type: "VariableDeclaration";
|
|
441
|
+
kind: "var" | "let" | "const" | "using" | "await using";
|
|
442
|
+
declarations: VariableDeclarator[];
|
|
399
443
|
}
|
|
400
444
|
interface VariableDeclarator extends BaseNode {
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
445
|
+
type: "VariableDeclarator";
|
|
446
|
+
id: BindingPattern;
|
|
447
|
+
init: Expression | null;
|
|
404
448
|
}
|
|
405
449
|
interface FunctionNodeBase extends BaseNode {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
450
|
+
id: Identifier | null;
|
|
451
|
+
generator: boolean;
|
|
452
|
+
async: boolean;
|
|
453
|
+
declare?: boolean;
|
|
454
|
+
params: FunctionParameter[];
|
|
455
|
+
body: BlockStatement | null;
|
|
456
|
+
expression: false;
|
|
413
457
|
}
|
|
414
458
|
interface FunctionDeclaration extends FunctionNodeBase {
|
|
415
|
-
|
|
459
|
+
type: "FunctionDeclaration";
|
|
416
460
|
}
|
|
417
461
|
interface FunctionExpression extends FunctionNodeBase {
|
|
418
|
-
|
|
462
|
+
type: "FunctionExpression";
|
|
419
463
|
}
|
|
420
464
|
interface TSDeclareFunction extends FunctionNodeBase {
|
|
421
|
-
|
|
465
|
+
type: "TSDeclareFunction";
|
|
422
466
|
}
|
|
423
467
|
interface TSEmptyBodyFunctionExpression extends FunctionNodeBase {
|
|
424
|
-
|
|
468
|
+
type: "TSEmptyBodyFunctionExpression";
|
|
425
469
|
}
|
|
426
470
|
interface ArrowFunctionExpression extends BaseNode {
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
471
|
+
type: "ArrowFunctionExpression";
|
|
472
|
+
id: null;
|
|
473
|
+
generator: false;
|
|
474
|
+
async: boolean;
|
|
475
|
+
params: FunctionParameter[];
|
|
476
|
+
body: BlockStatement | Expression;
|
|
477
|
+
expression: boolean;
|
|
434
478
|
}
|
|
435
479
|
interface ClassNodeBase extends BaseNode {
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
480
|
+
decorators: Decorator[];
|
|
481
|
+
id: Identifier | null;
|
|
482
|
+
superClass: Expression | null;
|
|
483
|
+
body: ClassBody;
|
|
440
484
|
}
|
|
441
485
|
interface ClassDeclaration extends ClassNodeBase {
|
|
442
|
-
|
|
486
|
+
type: "ClassDeclaration";
|
|
443
487
|
}
|
|
444
488
|
interface ClassExpression extends ClassNodeBase {
|
|
445
|
-
|
|
489
|
+
type: "ClassExpression";
|
|
446
490
|
}
|
|
447
491
|
interface ClassBody extends BaseNode {
|
|
448
|
-
|
|
449
|
-
|
|
492
|
+
type: "ClassBody";
|
|
493
|
+
body: ClassElement[];
|
|
450
494
|
}
|
|
451
495
|
interface MethodDefinition extends BaseNode {
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
496
|
+
type: "MethodDefinition";
|
|
497
|
+
decorators: Decorator[];
|
|
498
|
+
key: Expression | PrivateIdentifier;
|
|
499
|
+
value: FunctionExpression | TSEmptyBodyFunctionExpression;
|
|
500
|
+
kind: "constructor" | "method" | "get" | "set";
|
|
501
|
+
computed: boolean;
|
|
502
|
+
static: boolean;
|
|
459
503
|
}
|
|
460
504
|
interface PropertyDefinition extends BaseNode {
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
505
|
+
type: "PropertyDefinition";
|
|
506
|
+
decorators: Decorator[];
|
|
507
|
+
key: Expression | PrivateIdentifier;
|
|
508
|
+
value: Expression | null;
|
|
509
|
+
computed: boolean;
|
|
510
|
+
static: boolean;
|
|
467
511
|
}
|
|
468
512
|
interface AccessorProperty extends BaseNode {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
513
|
+
type: "AccessorProperty";
|
|
514
|
+
decorators: Decorator[];
|
|
515
|
+
key: Expression | PrivateIdentifier;
|
|
516
|
+
value: Expression | null;
|
|
517
|
+
computed: boolean;
|
|
518
|
+
static: boolean;
|
|
475
519
|
}
|
|
476
520
|
interface StaticBlock extends BaseNode {
|
|
477
|
-
|
|
478
|
-
|
|
521
|
+
type: "StaticBlock";
|
|
522
|
+
body: Statement[];
|
|
479
523
|
}
|
|
480
524
|
interface Decorator extends BaseNode {
|
|
481
|
-
|
|
482
|
-
|
|
525
|
+
type: "Decorator";
|
|
526
|
+
expression: Expression;
|
|
483
527
|
}
|
|
484
528
|
type ClassElement = MethodDefinition | PropertyDefinition | AccessorProperty | StaticBlock;
|
|
485
529
|
interface ImportDeclaration extends BaseNode {
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
530
|
+
type: "ImportDeclaration";
|
|
531
|
+
specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>;
|
|
532
|
+
source: StringLiteral;
|
|
533
|
+
phase: "source" | "defer" | null;
|
|
534
|
+
attributes: ImportAttribute[];
|
|
491
535
|
}
|
|
492
536
|
interface ImportSpecifier extends BaseNode {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
537
|
+
type: "ImportSpecifier";
|
|
538
|
+
imported: Identifier | StringLiteral;
|
|
539
|
+
local: Identifier;
|
|
496
540
|
}
|
|
497
541
|
interface ImportDefaultSpecifier extends BaseNode {
|
|
498
|
-
|
|
499
|
-
|
|
542
|
+
type: "ImportDefaultSpecifier";
|
|
543
|
+
local: Identifier;
|
|
500
544
|
}
|
|
501
545
|
interface ImportNamespaceSpecifier extends BaseNode {
|
|
502
|
-
|
|
503
|
-
|
|
546
|
+
type: "ImportNamespaceSpecifier";
|
|
547
|
+
local: Identifier;
|
|
504
548
|
}
|
|
505
549
|
interface ImportAttribute extends BaseNode {
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
550
|
+
type: "ImportAttribute";
|
|
551
|
+
key: Identifier | StringLiteral;
|
|
552
|
+
value: StringLiteral;
|
|
509
553
|
}
|
|
510
554
|
interface ExportNamedDeclaration extends BaseNode {
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
555
|
+
type: "ExportNamedDeclaration";
|
|
556
|
+
declaration: Declaration | null;
|
|
557
|
+
specifiers: ExportSpecifier[];
|
|
558
|
+
source: StringLiteral | null;
|
|
559
|
+
attributes: ImportAttribute[];
|
|
516
560
|
}
|
|
517
561
|
interface ExportDefaultDeclaration extends BaseNode {
|
|
518
|
-
|
|
519
|
-
|
|
562
|
+
type: "ExportDefaultDeclaration";
|
|
563
|
+
declaration: Declaration | Expression;
|
|
520
564
|
}
|
|
521
565
|
interface ExportAllDeclaration extends BaseNode {
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
566
|
+
type: "ExportAllDeclaration";
|
|
567
|
+
exported: Identifier | StringLiteral | null;
|
|
568
|
+
source: StringLiteral;
|
|
569
|
+
attributes: ImportAttribute[];
|
|
526
570
|
}
|
|
527
571
|
interface ExportSpecifier extends BaseNode {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
572
|
+
type: "ExportSpecifier";
|
|
573
|
+
local: Identifier | StringLiteral;
|
|
574
|
+
exported: Identifier | StringLiteral;
|
|
531
575
|
}
|
|
532
576
|
interface TSExportAssignment extends BaseNode {
|
|
533
|
-
|
|
534
|
-
|
|
577
|
+
type: "TSExportAssignment";
|
|
578
|
+
expression: Expression;
|
|
535
579
|
}
|
|
536
580
|
interface TSNamespaceExportDeclaration extends BaseNode {
|
|
537
|
-
|
|
538
|
-
|
|
581
|
+
type: "TSNamespaceExportDeclaration";
|
|
582
|
+
id: Identifier;
|
|
539
583
|
}
|
|
540
584
|
interface JSXElement extends BaseNode {
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
585
|
+
type: "JSXElement";
|
|
586
|
+
openingElement: JSXOpeningElement;
|
|
587
|
+
children: JSXChild[];
|
|
588
|
+
closingElement: JSXClosingElement | null;
|
|
545
589
|
}
|
|
546
590
|
interface JSXOpeningElement extends BaseNode {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
591
|
+
type: "JSXOpeningElement";
|
|
592
|
+
name: JSXTagName;
|
|
593
|
+
attributes: Array<JSXAttribute | JSXSpreadAttribute>;
|
|
594
|
+
selfClosing: boolean;
|
|
551
595
|
}
|
|
552
596
|
interface JSXClosingElement extends BaseNode {
|
|
553
|
-
|
|
554
|
-
|
|
597
|
+
type: "JSXClosingElement";
|
|
598
|
+
name: JSXTagName;
|
|
555
599
|
}
|
|
556
600
|
interface JSXFragment extends BaseNode {
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
601
|
+
type: "JSXFragment";
|
|
602
|
+
openingFragment: JSXOpeningFragment;
|
|
603
|
+
children: JSXChild[];
|
|
604
|
+
closingFragment: JSXClosingFragment;
|
|
561
605
|
}
|
|
562
606
|
interface JSXOpeningFragment extends BaseNode {
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
607
|
+
type: "JSXOpeningFragment";
|
|
608
|
+
attributes: [];
|
|
609
|
+
selfClosing: false;
|
|
566
610
|
}
|
|
567
611
|
interface JSXClosingFragment extends BaseNode {
|
|
568
|
-
|
|
612
|
+
type: "JSXClosingFragment";
|
|
569
613
|
}
|
|
570
614
|
interface JSXIdentifier extends BaseNode {
|
|
571
|
-
|
|
572
|
-
|
|
615
|
+
type: "JSXIdentifier";
|
|
616
|
+
name: string;
|
|
573
617
|
}
|
|
574
618
|
interface JSXNamespacedName extends BaseNode {
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
619
|
+
type: "JSXNamespacedName";
|
|
620
|
+
namespace: JSXIdentifier;
|
|
621
|
+
name: JSXIdentifier;
|
|
578
622
|
}
|
|
579
623
|
interface JSXMemberExpression extends BaseNode {
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
624
|
+
type: "JSXMemberExpression";
|
|
625
|
+
object: JSXIdentifier | JSXMemberExpression;
|
|
626
|
+
property: JSXIdentifier;
|
|
583
627
|
}
|
|
584
628
|
interface JSXAttribute extends BaseNode {
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
629
|
+
type: "JSXAttribute";
|
|
630
|
+
name: JSXIdentifier | JSXNamespacedName;
|
|
631
|
+
value: StringLiteral | JSXExpressionContainer | JSXElement | JSXFragment | null;
|
|
588
632
|
}
|
|
589
633
|
interface JSXSpreadAttribute extends BaseNode {
|
|
590
|
-
|
|
591
|
-
|
|
634
|
+
type: "JSXSpreadAttribute";
|
|
635
|
+
argument: Expression;
|
|
592
636
|
}
|
|
593
637
|
interface JSXExpressionContainer extends BaseNode {
|
|
594
|
-
|
|
595
|
-
|
|
638
|
+
type: "JSXExpressionContainer";
|
|
639
|
+
expression: Expression | JSXEmptyExpression;
|
|
596
640
|
}
|
|
597
641
|
interface JSXEmptyExpression extends BaseNode {
|
|
598
|
-
|
|
642
|
+
type: "JSXEmptyExpression";
|
|
599
643
|
}
|
|
600
644
|
interface JSXText extends BaseNode {
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
645
|
+
type: "JSXText";
|
|
646
|
+
value: string;
|
|
647
|
+
raw: string;
|
|
604
648
|
}
|
|
605
649
|
interface JSXSpreadChild extends BaseNode {
|
|
606
|
-
|
|
607
|
-
|
|
650
|
+
type: "JSXSpreadChild";
|
|
651
|
+
expression: Expression;
|
|
608
652
|
}
|
|
609
653
|
type JSXTagName = JSXIdentifier | JSXNamespacedName | JSXMemberExpression;
|
|
610
654
|
type JSXChild = JSXText | JSXElement | JSXFragment | JSXExpressionContainer | JSXSpreadChild;
|
|
611
655
|
interface Program extends BaseNode {
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
656
|
+
type: "Program";
|
|
657
|
+
sourceType: "module" | "script";
|
|
658
|
+
hashbang: string | null;
|
|
659
|
+
body: Array<Statement | ModuleDeclaration>;
|
|
616
660
|
}
|
|
617
661
|
|
|
618
662
|
type Declaration = FunctionDeclaration | ClassDeclaration | VariableDeclaration | TSDeclareFunction;
|
|
619
663
|
|
|
620
|
-
type Expression =
|
|
664
|
+
type Expression =
|
|
665
|
+
| Identifier
|
|
666
|
+
| Literal
|
|
667
|
+
| ThisExpression
|
|
668
|
+
| Super
|
|
669
|
+
| ArrayExpression
|
|
670
|
+
| ObjectExpression
|
|
671
|
+
| FunctionExpression
|
|
672
|
+
| ArrowFunctionExpression
|
|
673
|
+
| ClassExpression
|
|
674
|
+
| TaggedTemplateExpression
|
|
675
|
+
| TemplateLiteral
|
|
676
|
+
| MemberExpression
|
|
677
|
+
| CallExpression
|
|
678
|
+
| NewExpression
|
|
679
|
+
| ChainExpression
|
|
680
|
+
| SequenceExpression
|
|
681
|
+
| ParenthesizedExpression
|
|
682
|
+
| BinaryExpression
|
|
683
|
+
| LogicalExpression
|
|
684
|
+
| ConditionalExpression
|
|
685
|
+
| UnaryExpression
|
|
686
|
+
| UpdateExpression
|
|
687
|
+
| AssignmentExpression
|
|
688
|
+
| YieldExpression
|
|
689
|
+
| AwaitExpression
|
|
690
|
+
| ImportExpression
|
|
691
|
+
| MetaProperty
|
|
692
|
+
| SpreadElement
|
|
693
|
+
| TSEmptyBodyFunctionExpression
|
|
694
|
+
| JSXElement
|
|
695
|
+
| JSXFragment;
|
|
621
696
|
|
|
622
|
-
type Statement =
|
|
697
|
+
type Statement =
|
|
698
|
+
| ExpressionStatement
|
|
699
|
+
| BlockStatement
|
|
700
|
+
| EmptyStatement
|
|
701
|
+
| DebuggerStatement
|
|
702
|
+
| ReturnStatement
|
|
703
|
+
| LabeledStatement
|
|
704
|
+
| BreakStatement
|
|
705
|
+
| ContinueStatement
|
|
706
|
+
| IfStatement
|
|
707
|
+
| SwitchStatement
|
|
708
|
+
| ThrowStatement
|
|
709
|
+
| TryStatement
|
|
710
|
+
| WhileStatement
|
|
711
|
+
| DoWhileStatement
|
|
712
|
+
| ForStatement
|
|
713
|
+
| ForInStatement
|
|
714
|
+
| ForOfStatement
|
|
715
|
+
| WithStatement
|
|
716
|
+
| Declaration;
|
|
623
717
|
|
|
624
|
-
type ModuleDeclaration =
|
|
718
|
+
type ModuleDeclaration =
|
|
719
|
+
| ImportDeclaration
|
|
720
|
+
| ExportNamedDeclaration
|
|
721
|
+
| ExportDefaultDeclaration
|
|
722
|
+
| ExportAllDeclaration
|
|
723
|
+
| TSExportAssignment
|
|
724
|
+
| TSNamespaceExportDeclaration;
|
|
625
725
|
|
|
626
|
-
type Node =
|
|
726
|
+
type Node =
|
|
727
|
+
| Program
|
|
728
|
+
| Statement
|
|
729
|
+
| Expression
|
|
730
|
+
| ModuleDeclaration
|
|
731
|
+
| Property
|
|
732
|
+
| PrivateIdentifier
|
|
733
|
+
| TemplateElement
|
|
734
|
+
| VariableDeclarator
|
|
735
|
+
| CatchClause
|
|
736
|
+
| SwitchCase
|
|
737
|
+
| RestElement
|
|
738
|
+
| ArrayPattern
|
|
739
|
+
| ObjectPattern
|
|
740
|
+
| AssignmentPattern
|
|
741
|
+
| ClassBody
|
|
742
|
+
| MethodDefinition
|
|
743
|
+
| PropertyDefinition
|
|
744
|
+
| AccessorProperty
|
|
745
|
+
| StaticBlock
|
|
746
|
+
| Decorator
|
|
747
|
+
| ImportSpecifier
|
|
748
|
+
| ImportDefaultSpecifier
|
|
749
|
+
| ImportNamespaceSpecifier
|
|
750
|
+
| ImportAttribute
|
|
751
|
+
| ExportSpecifier
|
|
752
|
+
| JSXOpeningElement
|
|
753
|
+
| JSXClosingElement
|
|
754
|
+
| JSXOpeningFragment
|
|
755
|
+
| JSXClosingFragment
|
|
756
|
+
| JSXIdentifier
|
|
757
|
+
| JSXNamespacedName
|
|
758
|
+
| JSXMemberExpression
|
|
759
|
+
| JSXAttribute
|
|
760
|
+
| JSXSpreadAttribute
|
|
761
|
+
| JSXExpressionContainer
|
|
762
|
+
| JSXEmptyExpression
|
|
763
|
+
| JSXText
|
|
764
|
+
| JSXSpreadChild;
|
|
627
765
|
|
|
628
|
-
export type {
|
|
766
|
+
export type {
|
|
767
|
+
ParseOptions,
|
|
768
|
+
ParseResult,
|
|
769
|
+
Comment,
|
|
770
|
+
Diagnostic,
|
|
771
|
+
DiagnosticLabel,
|
|
772
|
+
SourceType,
|
|
773
|
+
SourceLang,
|
|
774
|
+
BaseNode,
|
|
775
|
+
Program,
|
|
776
|
+
Statement,
|
|
777
|
+
Expression,
|
|
778
|
+
Declaration,
|
|
779
|
+
ModuleDeclaration,
|
|
780
|
+
Node,
|
|
781
|
+
Identifier,
|
|
782
|
+
PrivateIdentifier,
|
|
783
|
+
Literal,
|
|
784
|
+
StringLiteral,
|
|
785
|
+
NumericLiteral,
|
|
786
|
+
BigIntLiteral,
|
|
787
|
+
BooleanLiteral,
|
|
788
|
+
NullLiteral,
|
|
789
|
+
RegExpLiteral,
|
|
790
|
+
BindingPattern,
|
|
791
|
+
FunctionParameter,
|
|
792
|
+
Property,
|
|
793
|
+
ArrayPattern,
|
|
794
|
+
ObjectPattern,
|
|
795
|
+
AssignmentPattern,
|
|
796
|
+
RestElement,
|
|
797
|
+
SequenceExpression,
|
|
798
|
+
ParenthesizedExpression,
|
|
799
|
+
BinaryExpression,
|
|
800
|
+
LogicalExpression,
|
|
801
|
+
ConditionalExpression,
|
|
802
|
+
UnaryExpression,
|
|
803
|
+
UpdateExpression,
|
|
804
|
+
AssignmentExpression,
|
|
805
|
+
YieldExpression,
|
|
806
|
+
AwaitExpression,
|
|
807
|
+
ArrayExpression,
|
|
808
|
+
ObjectExpression,
|
|
809
|
+
SpreadElement,
|
|
810
|
+
MemberExpression,
|
|
811
|
+
CallExpression,
|
|
812
|
+
ChainExpression,
|
|
813
|
+
TaggedTemplateExpression,
|
|
814
|
+
NewExpression,
|
|
815
|
+
MetaProperty,
|
|
816
|
+
ImportExpression,
|
|
817
|
+
TemplateLiteral,
|
|
818
|
+
TemplateElement,
|
|
819
|
+
Super,
|
|
820
|
+
ThisExpression,
|
|
821
|
+
ExpressionStatement,
|
|
822
|
+
BlockStatement,
|
|
823
|
+
IfStatement,
|
|
824
|
+
SwitchStatement,
|
|
825
|
+
SwitchCase,
|
|
826
|
+
ForStatement,
|
|
827
|
+
ForInStatement,
|
|
828
|
+
ForOfStatement,
|
|
829
|
+
WhileStatement,
|
|
830
|
+
DoWhileStatement,
|
|
831
|
+
BreakStatement,
|
|
832
|
+
ContinueStatement,
|
|
833
|
+
LabeledStatement,
|
|
834
|
+
WithStatement,
|
|
835
|
+
ReturnStatement,
|
|
836
|
+
ThrowStatement,
|
|
837
|
+
TryStatement,
|
|
838
|
+
CatchClause,
|
|
839
|
+
DebuggerStatement,
|
|
840
|
+
EmptyStatement,
|
|
841
|
+
VariableDeclaration,
|
|
842
|
+
VariableDeclarator,
|
|
843
|
+
FunctionDeclaration,
|
|
844
|
+
FunctionExpression,
|
|
845
|
+
TSDeclareFunction,
|
|
846
|
+
TSEmptyBodyFunctionExpression,
|
|
847
|
+
ArrowFunctionExpression,
|
|
848
|
+
ClassDeclaration,
|
|
849
|
+
ClassExpression,
|
|
850
|
+
ClassBody,
|
|
851
|
+
MethodDefinition,
|
|
852
|
+
PropertyDefinition,
|
|
853
|
+
AccessorProperty,
|
|
854
|
+
StaticBlock,
|
|
855
|
+
Decorator,
|
|
856
|
+
ClassElement,
|
|
857
|
+
ImportDeclaration,
|
|
858
|
+
ImportSpecifier,
|
|
859
|
+
ImportDefaultSpecifier,
|
|
860
|
+
ImportNamespaceSpecifier,
|
|
861
|
+
ImportAttribute,
|
|
862
|
+
ExportNamedDeclaration,
|
|
863
|
+
ExportDefaultDeclaration,
|
|
864
|
+
ExportAllDeclaration,
|
|
865
|
+
ExportSpecifier,
|
|
866
|
+
TSExportAssignment,
|
|
867
|
+
TSNamespaceExportDeclaration,
|
|
868
|
+
JSXElement,
|
|
869
|
+
JSXOpeningElement,
|
|
870
|
+
JSXClosingElement,
|
|
871
|
+
JSXFragment,
|
|
872
|
+
JSXOpeningFragment,
|
|
873
|
+
JSXClosingFragment,
|
|
874
|
+
JSXIdentifier,
|
|
875
|
+
JSXNamespacedName,
|
|
876
|
+
JSXMemberExpression,
|
|
877
|
+
JSXAttribute,
|
|
878
|
+
JSXSpreadAttribute,
|
|
879
|
+
JSXExpressionContainer,
|
|
880
|
+
JSXEmptyExpression,
|
|
881
|
+
JSXText,
|
|
882
|
+
JSXSpreadChild,
|
|
883
|
+
JSXTagName,
|
|
884
|
+
JSXChild,
|
|
885
|
+
BinaryOperator,
|
|
886
|
+
LogicalOperator,
|
|
887
|
+
UnaryOperator,
|
|
888
|
+
UpdateOperator,
|
|
889
|
+
AssignmentOperator,
|
|
890
|
+
FunctionNodeBase,
|
|
891
|
+
ClassNodeBase,
|
|
892
|
+
};
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yuku-parser",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "High-performance JavaScript/TypeScript parser",
|
|
5
|
+
"license": "MIT",
|
|
5
6
|
"repository": {
|
|
6
7
|
"type": "git",
|
|
7
8
|
"url": "https://github.com/yuku-toolchain/yuku.git"
|
|
8
9
|
},
|
|
9
|
-
"license": "MIT",
|
|
10
|
-
"type": "module",
|
|
11
|
-
"main": "index.js",
|
|
12
|
-
"types": "index.d.ts",
|
|
13
10
|
"files": [
|
|
14
11
|
"index.js",
|
|
15
12
|
"index.d.ts",
|
|
16
13
|
"binding.js",
|
|
17
14
|
"decode.js"
|
|
18
15
|
],
|
|
16
|
+
"type": "module",
|
|
17
|
+
"main": "index.js",
|
|
18
|
+
"types": "index.d.ts",
|
|
19
19
|
"optionalDependencies": {
|
|
20
|
-
"@yuku-parser/binding-
|
|
21
|
-
"@yuku-parser/binding-
|
|
22
|
-
"@yuku-parser/binding-
|
|
23
|
-
"@yuku-parser/binding-linux-
|
|
24
|
-
"@yuku-parser/binding-linux-
|
|
25
|
-
"@yuku-parser/binding-linux-
|
|
26
|
-
"@yuku-parser/binding-
|
|
27
|
-
"@yuku-parser/binding-
|
|
28
|
-
"@yuku-parser/binding-
|
|
29
|
-
"@yuku-parser/binding-win32-arm64": "0.4.
|
|
30
|
-
"@yuku-parser/binding-
|
|
20
|
+
"@yuku-parser/binding-darwin-arm64": "0.4.4",
|
|
21
|
+
"@yuku-parser/binding-darwin-x64": "0.4.4",
|
|
22
|
+
"@yuku-parser/binding-freebsd-x64": "0.4.4",
|
|
23
|
+
"@yuku-parser/binding-linux-arm-gnu": "0.4.4",
|
|
24
|
+
"@yuku-parser/binding-linux-arm-musl": "0.4.4",
|
|
25
|
+
"@yuku-parser/binding-linux-arm64-gnu": "0.4.4",
|
|
26
|
+
"@yuku-parser/binding-linux-arm64-musl": "0.4.4",
|
|
27
|
+
"@yuku-parser/binding-linux-x64-gnu": "0.4.4",
|
|
28
|
+
"@yuku-parser/binding-linux-x64-musl": "0.4.4",
|
|
29
|
+
"@yuku-parser/binding-win32-arm64": "0.4.4",
|
|
30
|
+
"@yuku-parser/binding-win32-x64": "0.4.4"
|
|
31
31
|
}
|
|
32
32
|
}
|