1
2
3
4
5
6
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
45
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
JsModule {
bom_token: missing (optional),
interpreter_token: missing (optional),
directives: JsDirectiveList [],
items: JsModuleItemList [
JsVariableStatement {
declaration: JsVariableDeclaration {
await_token: missing (optional),
kind: LET_KW@0..4 "let" [] [Whitespace(" ")],
declarators: JsVariableDeclaratorList [
JsVariableDeclarator {
id: JsIdentifierBinding {
name_token: IDENT@4..6 "b" [] [Whitespace(" ")],
},
variable_annotation: missing (optional),
initializer: JsInitializerClause {
eq_token: EQ@6..8 "=" [] [Whitespace(" ")],
expression: JsObjectExpression {
l_curly_token: L_CURLY@8..9 "{" [] [],
members: JsObjectMemberList [
JsMethodObjectMember {
async_token: missing (optional),
star_token: missing (optional),
name: JsLiteralMemberName {
value: IDENT@9..15 "foo" [Newline("\n"), Whitespace(" ")] [],
},
type_parameters: missing (optional),
parameters: JsParameters {
l_paren_token: L_PAREN@15..16 "(" [] [],
items: JsParameterList [],
r_paren_token: R_PAREN@16..18 ")" [] [Whitespace(" ")],
},
return_type_annotation: missing (optional),
body: JsFunctionBody {
l_curly_token: L_CURLY@18..19 "{" [] [],
directives: JsDirectiveList [],
statements: JsStatementList [],
r_curly_token: R_CURLY@19..20 "}" [] [],
},
},
COMMA@20..21 "," [] [],
JsMethodObjectMember {
async_token: missing (optional),
star_token: missing (optional),
name: JsLiteralMemberName {
value: JS_STRING_LITERAL@21..29 "\"bar\"" [Newline("\n"), Whitespace(" ")] [],
},
type_parameters: missing (optional),
parameters: JsParameters {
l_paren_token: L_PAREN@29..30 "(" [] [],
items: JsParameterList [
JsFormalParameter {
decorators: JsDecoratorList [],
binding: JsIdentifierBinding {
name_token: IDENT@30..31 "a" [] [],
},
question_mark_token: missing (optional),
type_annotation: missing (optional),
initializer: missing (optional),
},
COMMA@31..33 "," [] [Whitespace(" ")],
JsFormalParameter {
decorators: JsDecoratorList [],
binding: JsIdentifierBinding {
name_token: IDENT@33..34 "b" [] [],
},
question_mark_token: missing (optional),
type_annotation: missing (optional),
initializer: missing (optional),
},
COMMA@34..36 "," [] [Whitespace(" ")],
JsFormalParameter {
decorators: JsDecoratorList [],
binding: JsIdentifierBinding {
name_token: IDENT@36..37 "c" [] [],
},
question_mark_token: missing (optional),
type_annotation: missing (optional),
initializer: missing (optional),
},
],
r_paren_token: R_PAREN@37..39 ")" [] [Whitespace(" ")],
},
return_type_annotation: missing (optional),
body: JsFunctionBody {
l_curly_token: L_CURLY@39..40 "{" [] [],
directives: JsDirectiveList [],
statements: JsStatementList [],
r_curly_token: R_CURLY@40..41 "}" [] [],
},
},
COMMA@41..42 "," [] [],
JsMethodObjectMember {
async_token: missing (optional),
star_token: missing (optional),
name: JsComputedMemberName {
l_brack_token: L_BRACK@42..46 "[" [Newline("\n"), Whitespace(" ")] [],
expression: JsBinaryExpression {
left: JsStringLiteralExpression {
value_token: JS_STRING_LITERAL@46..52 "\"foo\"" [] [Whitespace(" ")],
},
operator_token: PLUS@52..54 "+" [] [Whitespace(" ")],
right: JsStringLiteralExpression {
value_token: JS_STRING_LITERAL@54..59 "\"bar\"" [] [],
},
},
r_brack_token: R_BRACK@59..60 "]" [] [],
},
type_parameters: missing (optional),
parameters: JsParameters {
l_paren_token: L_PAREN@60..61 "(" [] [],
items: JsParameterList [
JsFormalParameter {
decorators: JsDecoratorList [],
binding: JsIdentifierBinding {
name_token: IDENT@61..62 "a" [] [],
},
question_mark_token: missing (optional),
type_annotation: missing (optional),
initializer: missing (optional),
},
],
r_paren_token: R_PAREN@62..64 ")" [] [Whitespace(" ")],
},
return_type_annotation: missing (optional),
body: JsFunctionBody {
l_curly_token: L_CURLY@64..65 "{" [] [],
directives: JsDirectiveList [],
statements: JsStatementList [],
r_curly_token: R_CURLY@65..66 "}" [] [],
},
},
COMMA@66..67 "," [] [],
JsMethodObjectMember {
async_token: missing (optional),
star_token: missing (optional),
name: JsLiteralMemberName {
value: JS_NUMBER_LITERAL@67..71 "5" [Newline("\n"), Whitespace(" ")] [],
},
type_parameters: missing (optional),
parameters: JsParameters {
l_paren_token: L_PAREN@71..72 "(" [] [],
items: JsParameterList [
JsRestParameter {
decorators: JsDecoratorList [],
dotdotdot_token: DOT3@72..75 "..." [] [],
binding: JsIdentifierBinding {
name_token: IDENT@75..79 "rest" [] [],
},
type_annotation: missing (optional),
},
],
r_paren_token: R_PAREN@79..81 ")" [] [Whitespace(" ")],
},
return_type_annotation: missing (optional),
body: JsFunctionBody {
l_curly_token: L_CURLY@81..82 "{" [] [],
directives: JsDirectiveList [],
statements: JsStatementList [],
r_curly_token: R_CURLY@82..83 "}" [] [],
},
},
],
r_curly_token: R_CURLY@83..85 "}" [Newline("\n")] [],
},
},
},
],
},
semicolon_token: missing (optional),
},
],
eof_token: EOF@85..86 "" [Newline("\n")] [],
}
0: JS_MODULE@0..86
0: (empty)
1: (empty)
2: JS_DIRECTIVE_LIST@0..0
3: JS_MODULE_ITEM_LIST@0..85
0: JS_VARIABLE_STATEMENT@0..85
0: JS_VARIABLE_DECLARATION@0..85
0: (empty)
1: LET_KW@0..4 "let" [] [Whitespace(" ")]
2: JS_VARIABLE_DECLARATOR_LIST@4..85
0: JS_VARIABLE_DECLARATOR@4..85
0: JS_IDENTIFIER_BINDING@4..6
0: IDENT@4..6 "b" [] [Whitespace(" ")]
1: (empty)
2: JS_INITIALIZER_CLAUSE@6..85
0: EQ@6..8 "=" [] [Whitespace(" ")]
1: JS_OBJECT_EXPRESSION@8..85
0: L_CURLY@8..9 "{" [] []
1: JS_OBJECT_MEMBER_LIST@9..83
0: JS_METHOD_OBJECT_MEMBER@9..20
0: (empty)
1: (empty)
2: JS_LITERAL_MEMBER_NAME@9..15
0: IDENT@9..15 "foo" [Newline("\n"), Whitespace(" ")] []
3: (empty)
4: JS_PARAMETERS@15..18
0: L_PAREN@15..16 "(" [] []
1: JS_PARAMETER_LIST@16..16
2: R_PAREN@16..18 ")" [] [Whitespace(" ")]
5: (empty)
6: JS_FUNCTION_BODY@18..20
0: L_CURLY@18..19 "{" [] []
1: JS_DIRECTIVE_LIST@19..19
2: JS_STATEMENT_LIST@19..19
3: R_CURLY@19..20 "}" [] []
1: COMMA@20..21 "," [] []
2: JS_METHOD_OBJECT_MEMBER@21..41
0: (empty)
1: (empty)
2: JS_LITERAL_MEMBER_NAME@21..29
0: JS_STRING_LITERAL@21..29 "\"bar\"" [Newline("\n"), Whitespace(" ")] []
3: (empty)
4: JS_PARAMETERS@29..39
0: L_PAREN@29..30 "(" [] []
1: JS_PARAMETER_LIST@30..37
0: JS_FORMAL_PARAMETER@30..31
0: JS_DECORATOR_LIST@30..30
1: JS_IDENTIFIER_BINDING@30..31
0: IDENT@30..31 "a" [] []
2: (empty)
3: (empty)
4: (empty)
1: COMMA@31..33 "," [] [Whitespace(" ")]
2: JS_FORMAL_PARAMETER@33..34
0: JS_DECORATOR_LIST@33..33
1: JS_IDENTIFIER_BINDING@33..34
0: IDENT@33..34 "b" [] []
2: (empty)
3: (empty)
4: (empty)
3: COMMA@34..36 "," [] [Whitespace(" ")]
4: JS_FORMAL_PARAMETER@36..37
0: JS_DECORATOR_LIST@36..36
1: JS_IDENTIFIER_BINDING@36..37
0: IDENT@36..37 "c" [] []
2: (empty)
3: (empty)
4: (empty)
2: R_PAREN@37..39 ")" [] [Whitespace(" ")]
5: (empty)
6: JS_FUNCTION_BODY@39..41
0: L_CURLY@39..40 "{" [] []
1: JS_DIRECTIVE_LIST@40..40
2: JS_STATEMENT_LIST@40..40
3: R_CURLY@40..41 "}" [] []
3: COMMA@41..42 "," [] []
4: JS_METHOD_OBJECT_MEMBER@42..66
0: (empty)
1: (empty)
2: JS_COMPUTED_MEMBER_NAME@42..60
0: L_BRACK@42..46 "[" [Newline("\n"), Whitespace(" ")] []
1: JS_BINARY_EXPRESSION@46..59
0: JS_STRING_LITERAL_EXPRESSION@46..52
0: JS_STRING_LITERAL@46..52 "\"foo\"" [] [Whitespace(" ")]
1: PLUS@52..54 "+" [] [Whitespace(" ")]
2: JS_STRING_LITERAL_EXPRESSION@54..59
0: JS_STRING_LITERAL@54..59 "\"bar\"" [] []
2: R_BRACK@59..60 "]" [] []
3: (empty)
4: JS_PARAMETERS@60..64
0: L_PAREN@60..61 "(" [] []
1: JS_PARAMETER_LIST@61..62
0: JS_FORMAL_PARAMETER@61..62
0: JS_DECORATOR_LIST@61..61
1: JS_IDENTIFIER_BINDING@61..62
0: IDENT@61..62 "a" [] []
2: (empty)
3: (empty)
4: (empty)
2: R_PAREN@62..64 ")" [] [Whitespace(" ")]
5: (empty)
6: JS_FUNCTION_BODY@64..66
0: L_CURLY@64..65 "{" [] []
1: JS_DIRECTIVE_LIST@65..65
2: JS_STATEMENT_LIST@65..65
3: R_CURLY@65..66 "}" [] []
5: COMMA@66..67 "," [] []
6: JS_METHOD_OBJECT_MEMBER@67..83
0: (empty)
1: (empty)
2: JS_LITERAL_MEMBER_NAME@67..71
0: JS_NUMBER_LITERAL@67..71 "5" [Newline("\n"), Whitespace(" ")] []
3: (empty)
4: JS_PARAMETERS@71..81
0: L_PAREN@71..72 "(" [] []
1: JS_PARAMETER_LIST@72..79
0: JS_REST_PARAMETER@72..79
0: JS_DECORATOR_LIST@72..72
1: DOT3@72..75 "..." [] []
2: JS_IDENTIFIER_BINDING@75..79
0: IDENT@75..79 "rest" [] []
3: (empty)
2: R_PAREN@79..81 ")" [] [Whitespace(" ")]
5: (empty)
6: JS_FUNCTION_BODY@81..83
0: L_CURLY@81..82 "{" [] []
1: JS_DIRECTIVE_LIST@82..82
2: JS_STATEMENT_LIST@82..82
3: R_CURLY@82..83 "}" [] []
2: R_CURLY@83..85 "}" [Newline("\n")] []
1: (empty)
4: EOF@85..86 "" [Newline("\n")] []