yarp 0.10.0 → 0.12.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +50 -1
- data/CONTRIBUTING.md +7 -0
- data/config.yml +259 -49
- data/docs/configuration.md +0 -1
- data/docs/mapping.md +91 -91
- data/docs/serialization.md +23 -20
- data/ext/yarp/api_node.c +1268 -419
- data/ext/yarp/extension.c +9 -2
- data/ext/yarp/extension.h +2 -2
- data/include/yarp/ast.h +471 -318
- data/include/yarp/diagnostic.h +203 -1
- data/include/yarp/enc/yp_encoding.h +1 -1
- data/include/yarp/node.h +0 -4
- data/include/yarp/parser.h +44 -16
- data/include/yarp/util/yp_char.h +22 -6
- data/include/yarp/util/yp_constant_pool.h +11 -4
- data/include/yarp/version.h +2 -2
- data/lib/yarp/desugar_visitor.rb +19 -19
- data/lib/yarp/mutation_visitor.rb +50 -15
- data/lib/yarp/node.rb +6455 -443
- data/lib/yarp/parse_result/comments.rb +172 -0
- data/lib/yarp/parse_result/newlines.rb +60 -0
- data/lib/yarp/pattern.rb +239 -0
- data/lib/yarp/serialize.rb +173 -140
- data/lib/yarp.rb +151 -76
- data/src/diagnostic.c +259 -2
- data/src/enc/yp_unicode.c +5 -5
- data/src/node.c +984 -872
- data/src/prettyprint.c +461 -203
- data/src/serialize.c +380 -185
- data/src/unescape.c +20 -20
- data/src/util/yp_char.c +59 -16
- data/src/util/yp_constant_pool.c +97 -13
- data/src/util/yp_newline_list.c +5 -1
- data/src/util/yp_string_list.c +4 -1
- data/src/yarp.c +2313 -1675
- data/yarp.gemspec +4 -1
- metadata +5 -2
data/ext/yarp/api_node.c
CHANGED
@@ -14,7 +14,8 @@ extern VALUE rb_cYARPSource;
|
|
14
14
|
extern VALUE rb_cYARPToken;
|
15
15
|
extern VALUE rb_cYARPLocation;
|
16
16
|
|
17
|
-
static VALUE
|
17
|
+
static VALUE rb_cYARPAliasGlobalVariableNode;
|
18
|
+
static VALUE rb_cYARPAliasMethodNode;
|
18
19
|
static VALUE rb_cYARPAlternationPatternNode;
|
19
20
|
static VALUE rb_cYARPAndNode;
|
20
21
|
static VALUE rb_cYARPArgumentsNode;
|
@@ -25,14 +26,15 @@ static VALUE rb_cYARPAssocSplatNode;
|
|
25
26
|
static VALUE rb_cYARPBackReferenceReadNode;
|
26
27
|
static VALUE rb_cYARPBeginNode;
|
27
28
|
static VALUE rb_cYARPBlockArgumentNode;
|
29
|
+
static VALUE rb_cYARPBlockLocalVariableNode;
|
28
30
|
static VALUE rb_cYARPBlockNode;
|
29
31
|
static VALUE rb_cYARPBlockParameterNode;
|
30
32
|
static VALUE rb_cYARPBlockParametersNode;
|
31
33
|
static VALUE rb_cYARPBreakNode;
|
34
|
+
static VALUE rb_cYARPCallAndWriteNode;
|
32
35
|
static VALUE rb_cYARPCallNode;
|
33
|
-
static VALUE rb_cYARPCallOperatorAndWriteNode;
|
34
|
-
static VALUE rb_cYARPCallOperatorOrWriteNode;
|
35
36
|
static VALUE rb_cYARPCallOperatorWriteNode;
|
37
|
+
static VALUE rb_cYARPCallOrWriteNode;
|
36
38
|
static VALUE rb_cYARPCapturePatternNode;
|
37
39
|
static VALUE rb_cYARPCaseNode;
|
38
40
|
static VALUE rb_cYARPClassNode;
|
@@ -78,6 +80,7 @@ static VALUE rb_cYARPHashNode;
|
|
78
80
|
static VALUE rb_cYARPHashPatternNode;
|
79
81
|
static VALUE rb_cYARPIfNode;
|
80
82
|
static VALUE rb_cYARPImaginaryNode;
|
83
|
+
static VALUE rb_cYARPImplicitNode;
|
81
84
|
static VALUE rb_cYARPInNode;
|
82
85
|
static VALUE rb_cYARPInstanceVariableAndWriteNode;
|
83
86
|
static VALUE rb_cYARPInstanceVariableOperatorWriteNode;
|
@@ -86,6 +89,7 @@ static VALUE rb_cYARPInstanceVariableReadNode;
|
|
86
89
|
static VALUE rb_cYARPInstanceVariableTargetNode;
|
87
90
|
static VALUE rb_cYARPInstanceVariableWriteNode;
|
88
91
|
static VALUE rb_cYARPIntegerNode;
|
92
|
+
static VALUE rb_cYARPInterpolatedMatchLastLineNode;
|
89
93
|
static VALUE rb_cYARPInterpolatedRegularExpressionNode;
|
90
94
|
static VALUE rb_cYARPInterpolatedStringNode;
|
91
95
|
static VALUE rb_cYARPInterpolatedSymbolNode;
|
@@ -100,10 +104,13 @@ static VALUE rb_cYARPLocalVariableOrWriteNode;
|
|
100
104
|
static VALUE rb_cYARPLocalVariableReadNode;
|
101
105
|
static VALUE rb_cYARPLocalVariableTargetNode;
|
102
106
|
static VALUE rb_cYARPLocalVariableWriteNode;
|
107
|
+
static VALUE rb_cYARPMatchLastLineNode;
|
103
108
|
static VALUE rb_cYARPMatchPredicateNode;
|
104
109
|
static VALUE rb_cYARPMatchRequiredNode;
|
110
|
+
static VALUE rb_cYARPMatchWriteNode;
|
105
111
|
static VALUE rb_cYARPMissingNode;
|
106
112
|
static VALUE rb_cYARPModuleNode;
|
113
|
+
static VALUE rb_cYARPMultiTargetNode;
|
107
114
|
static VALUE rb_cYARPMultiWriteNode;
|
108
115
|
static VALUE rb_cYARPNextNode;
|
109
116
|
static VALUE rb_cYARPNilNode;
|
@@ -176,8 +183,8 @@ yp_string_new(yp_string_t *string, rb_encoding *encoding) {
|
|
176
183
|
|
177
184
|
// Create a YARP::Source object from the given parser.
|
178
185
|
VALUE
|
179
|
-
yp_source_new(yp_parser_t *parser) {
|
180
|
-
VALUE source =
|
186
|
+
yp_source_new(yp_parser_t *parser, rb_encoding *encoding) {
|
187
|
+
VALUE source = rb_enc_str_new((const char *) parser->start, parser->end - parser->start, encoding);
|
181
188
|
VALUE offsets = rb_ary_new_capa(parser->newline_list.size);
|
182
189
|
|
183
190
|
for (size_t index = 0; index < parser->newline_list.size; index++) {
|
@@ -216,7 +223,7 @@ yp_node_stack_pop(yp_node_stack_node_t **stack) {
|
|
216
223
|
|
217
224
|
VALUE
|
218
225
|
yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
219
|
-
VALUE source = yp_source_new(parser);
|
226
|
+
VALUE source = yp_source_new(parser, encoding);
|
220
227
|
ID *constants = calloc(parser->constant_pool.size, sizeof(ID));
|
221
228
|
|
222
229
|
for (size_t index = 0; index < parser->constant_pool.capacity; index++) {
|
@@ -244,28 +251,35 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
244
251
|
|
245
252
|
switch (YP_NODE_TYPE(node)) {
|
246
253
|
#line 111 "api_node.c.erb"
|
247
|
-
case
|
248
|
-
|
254
|
+
case YP_ALIAS_GLOBAL_VARIABLE_NODE: {
|
255
|
+
yp_alias_global_variable_node_t *cast = (yp_alias_global_variable_node_t *) node;
|
249
256
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->new_name);
|
250
257
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->old_name);
|
251
258
|
break;
|
252
259
|
}
|
253
260
|
#line 111 "api_node.c.erb"
|
254
|
-
case
|
261
|
+
case YP_ALIAS_METHOD_NODE: {
|
262
|
+
yp_alias_method_node_t *cast = (yp_alias_method_node_t *) node;
|
263
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->new_name);
|
264
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->old_name);
|
265
|
+
break;
|
266
|
+
}
|
267
|
+
#line 111 "api_node.c.erb"
|
268
|
+
case YP_ALTERNATION_PATTERN_NODE: {
|
255
269
|
yp_alternation_pattern_node_t *cast = (yp_alternation_pattern_node_t *) node;
|
256
270
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->left);
|
257
271
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->right);
|
258
272
|
break;
|
259
273
|
}
|
260
274
|
#line 111 "api_node.c.erb"
|
261
|
-
case
|
275
|
+
case YP_AND_NODE: {
|
262
276
|
yp_and_node_t *cast = (yp_and_node_t *) node;
|
263
277
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->left);
|
264
278
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->right);
|
265
279
|
break;
|
266
280
|
}
|
267
281
|
#line 111 "api_node.c.erb"
|
268
|
-
case
|
282
|
+
case YP_ARGUMENTS_NODE: {
|
269
283
|
yp_arguments_node_t *cast = (yp_arguments_node_t *) node;
|
270
284
|
for (size_t index = 0; index < cast->arguments.size; index++) {
|
271
285
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments.nodes[index]);
|
@@ -273,7 +287,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
273
287
|
break;
|
274
288
|
}
|
275
289
|
#line 111 "api_node.c.erb"
|
276
|
-
case
|
290
|
+
case YP_ARRAY_NODE: {
|
277
291
|
yp_array_node_t *cast = (yp_array_node_t *) node;
|
278
292
|
for (size_t index = 0; index < cast->elements.size; index++) {
|
279
293
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->elements.nodes[index]);
|
@@ -281,7 +295,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
281
295
|
break;
|
282
296
|
}
|
283
297
|
#line 111 "api_node.c.erb"
|
284
|
-
case
|
298
|
+
case YP_ARRAY_PATTERN_NODE: {
|
285
299
|
yp_array_pattern_node_t *cast = (yp_array_pattern_node_t *) node;
|
286
300
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->constant);
|
287
301
|
for (size_t index = 0; index < cast->requireds.size; index++) {
|
@@ -294,20 +308,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
294
308
|
break;
|
295
309
|
}
|
296
310
|
#line 111 "api_node.c.erb"
|
297
|
-
case
|
311
|
+
case YP_ASSOC_NODE: {
|
298
312
|
yp_assoc_node_t *cast = (yp_assoc_node_t *) node;
|
299
313
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->key);
|
300
314
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
301
315
|
break;
|
302
316
|
}
|
303
317
|
#line 111 "api_node.c.erb"
|
304
|
-
case
|
318
|
+
case YP_ASSOC_SPLAT_NODE: {
|
305
319
|
yp_assoc_splat_node_t *cast = (yp_assoc_splat_node_t *) node;
|
306
320
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
307
321
|
break;
|
308
322
|
}
|
309
323
|
#line 111 "api_node.c.erb"
|
310
|
-
case
|
324
|
+
case YP_BEGIN_NODE: {
|
311
325
|
yp_begin_node_t *cast = (yp_begin_node_t *) node;
|
312
326
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
|
313
327
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->rescue_clause);
|
@@ -316,68 +330,74 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
316
330
|
break;
|
317
331
|
}
|
318
332
|
#line 111 "api_node.c.erb"
|
319
|
-
case
|
333
|
+
case YP_BLOCK_ARGUMENT_NODE: {
|
320
334
|
yp_block_argument_node_t *cast = (yp_block_argument_node_t *) node;
|
321
335
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->expression);
|
322
336
|
break;
|
323
337
|
}
|
324
338
|
#line 111 "api_node.c.erb"
|
325
|
-
case
|
339
|
+
case YP_BLOCK_NODE: {
|
326
340
|
yp_block_node_t *cast = (yp_block_node_t *) node;
|
327
341
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parameters);
|
328
342
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->body);
|
329
343
|
break;
|
330
344
|
}
|
331
345
|
#line 111 "api_node.c.erb"
|
332
|
-
case
|
346
|
+
case YP_BLOCK_PARAMETERS_NODE: {
|
333
347
|
yp_block_parameters_node_t *cast = (yp_block_parameters_node_t *) node;
|
334
348
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parameters);
|
349
|
+
for (size_t index = 0; index < cast->locals.size; index++) {
|
350
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->locals.nodes[index]);
|
351
|
+
}
|
335
352
|
break;
|
336
353
|
}
|
337
354
|
#line 111 "api_node.c.erb"
|
338
|
-
case
|
355
|
+
case YP_BREAK_NODE: {
|
339
356
|
yp_break_node_t *cast = (yp_break_node_t *) node;
|
340
357
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
|
341
358
|
break;
|
342
359
|
}
|
343
360
|
#line 111 "api_node.c.erb"
|
344
|
-
case
|
345
|
-
|
361
|
+
case YP_CALL_AND_WRITE_NODE: {
|
362
|
+
yp_call_and_write_node_t *cast = (yp_call_and_write_node_t *) node;
|
346
363
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->receiver);
|
347
364
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
|
348
|
-
yp_node_stack_push(&node_stack, (yp_node_t *) cast->
|
365
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
349
366
|
break;
|
350
367
|
}
|
351
368
|
#line 111 "api_node.c.erb"
|
352
|
-
case
|
353
|
-
|
354
|
-
yp_node_stack_push(&node_stack, (yp_node_t *) cast->
|
355
|
-
yp_node_stack_push(&node_stack, (yp_node_t *) cast->
|
369
|
+
case YP_CALL_NODE: {
|
370
|
+
yp_call_node_t *cast = (yp_call_node_t *) node;
|
371
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->receiver);
|
372
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
|
373
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->block);
|
356
374
|
break;
|
357
375
|
}
|
358
376
|
#line 111 "api_node.c.erb"
|
359
|
-
case
|
360
|
-
|
361
|
-
yp_node_stack_push(&node_stack, (yp_node_t *) cast->
|
377
|
+
case YP_CALL_OPERATOR_WRITE_NODE: {
|
378
|
+
yp_call_operator_write_node_t *cast = (yp_call_operator_write_node_t *) node;
|
379
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->receiver);
|
380
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
|
362
381
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
363
382
|
break;
|
364
383
|
}
|
365
384
|
#line 111 "api_node.c.erb"
|
366
|
-
case
|
367
|
-
|
368
|
-
yp_node_stack_push(&node_stack, (yp_node_t *) cast->
|
385
|
+
case YP_CALL_OR_WRITE_NODE: {
|
386
|
+
yp_call_or_write_node_t *cast = (yp_call_or_write_node_t *) node;
|
387
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->receiver);
|
388
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
|
369
389
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
370
390
|
break;
|
371
391
|
}
|
372
392
|
#line 111 "api_node.c.erb"
|
373
|
-
case
|
393
|
+
case YP_CAPTURE_PATTERN_NODE: {
|
374
394
|
yp_capture_pattern_node_t *cast = (yp_capture_pattern_node_t *) node;
|
375
395
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
376
396
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
|
377
397
|
break;
|
378
398
|
}
|
379
399
|
#line 111 "api_node.c.erb"
|
380
|
-
case
|
400
|
+
case YP_CASE_NODE: {
|
381
401
|
yp_case_node_t *cast = (yp_case_node_t *) node;
|
382
402
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->predicate);
|
383
403
|
for (size_t index = 0; index < cast->conditions.size; index++) {
|
@@ -387,7 +407,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
387
407
|
break;
|
388
408
|
}
|
389
409
|
#line 111 "api_node.c.erb"
|
390
|
-
case
|
410
|
+
case YP_CLASS_NODE: {
|
391
411
|
yp_class_node_t *cast = (yp_class_node_t *) node;
|
392
412
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->constant_path);
|
393
413
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->superclass);
|
@@ -395,97 +415,97 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
395
415
|
break;
|
396
416
|
}
|
397
417
|
#line 111 "api_node.c.erb"
|
398
|
-
case
|
418
|
+
case YP_CLASS_VARIABLE_AND_WRITE_NODE: {
|
399
419
|
yp_class_variable_and_write_node_t *cast = (yp_class_variable_and_write_node_t *) node;
|
400
420
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
401
421
|
break;
|
402
422
|
}
|
403
423
|
#line 111 "api_node.c.erb"
|
404
|
-
case
|
424
|
+
case YP_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
|
405
425
|
yp_class_variable_operator_write_node_t *cast = (yp_class_variable_operator_write_node_t *) node;
|
406
426
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
407
427
|
break;
|
408
428
|
}
|
409
429
|
#line 111 "api_node.c.erb"
|
410
|
-
case
|
430
|
+
case YP_CLASS_VARIABLE_OR_WRITE_NODE: {
|
411
431
|
yp_class_variable_or_write_node_t *cast = (yp_class_variable_or_write_node_t *) node;
|
412
432
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
413
433
|
break;
|
414
434
|
}
|
415
435
|
#line 111 "api_node.c.erb"
|
416
|
-
case
|
436
|
+
case YP_CLASS_VARIABLE_WRITE_NODE: {
|
417
437
|
yp_class_variable_write_node_t *cast = (yp_class_variable_write_node_t *) node;
|
418
438
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
419
439
|
break;
|
420
440
|
}
|
421
441
|
#line 111 "api_node.c.erb"
|
422
|
-
case
|
442
|
+
case YP_CONSTANT_AND_WRITE_NODE: {
|
423
443
|
yp_constant_and_write_node_t *cast = (yp_constant_and_write_node_t *) node;
|
424
444
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
425
445
|
break;
|
426
446
|
}
|
427
447
|
#line 111 "api_node.c.erb"
|
428
|
-
case
|
448
|
+
case YP_CONSTANT_OPERATOR_WRITE_NODE: {
|
429
449
|
yp_constant_operator_write_node_t *cast = (yp_constant_operator_write_node_t *) node;
|
430
450
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
431
451
|
break;
|
432
452
|
}
|
433
453
|
#line 111 "api_node.c.erb"
|
434
|
-
case
|
454
|
+
case YP_CONSTANT_OR_WRITE_NODE: {
|
435
455
|
yp_constant_or_write_node_t *cast = (yp_constant_or_write_node_t *) node;
|
436
456
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
437
457
|
break;
|
438
458
|
}
|
439
459
|
#line 111 "api_node.c.erb"
|
440
|
-
case
|
460
|
+
case YP_CONSTANT_PATH_AND_WRITE_NODE: {
|
441
461
|
yp_constant_path_and_write_node_t *cast = (yp_constant_path_and_write_node_t *) node;
|
442
462
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
|
443
463
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
444
464
|
break;
|
445
465
|
}
|
446
466
|
#line 111 "api_node.c.erb"
|
447
|
-
case
|
467
|
+
case YP_CONSTANT_PATH_NODE: {
|
448
468
|
yp_constant_path_node_t *cast = (yp_constant_path_node_t *) node;
|
449
469
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parent);
|
450
470
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->child);
|
451
471
|
break;
|
452
472
|
}
|
453
473
|
#line 111 "api_node.c.erb"
|
454
|
-
case
|
474
|
+
case YP_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
|
455
475
|
yp_constant_path_operator_write_node_t *cast = (yp_constant_path_operator_write_node_t *) node;
|
456
476
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
|
457
477
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
458
478
|
break;
|
459
479
|
}
|
460
480
|
#line 111 "api_node.c.erb"
|
461
|
-
case
|
481
|
+
case YP_CONSTANT_PATH_OR_WRITE_NODE: {
|
462
482
|
yp_constant_path_or_write_node_t *cast = (yp_constant_path_or_write_node_t *) node;
|
463
483
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
|
464
484
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
465
485
|
break;
|
466
486
|
}
|
467
487
|
#line 111 "api_node.c.erb"
|
468
|
-
case
|
488
|
+
case YP_CONSTANT_PATH_TARGET_NODE: {
|
469
489
|
yp_constant_path_target_node_t *cast = (yp_constant_path_target_node_t *) node;
|
470
490
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parent);
|
471
491
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->child);
|
472
492
|
break;
|
473
493
|
}
|
474
494
|
#line 111 "api_node.c.erb"
|
475
|
-
case
|
495
|
+
case YP_CONSTANT_PATH_WRITE_NODE: {
|
476
496
|
yp_constant_path_write_node_t *cast = (yp_constant_path_write_node_t *) node;
|
477
497
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
|
478
498
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
479
499
|
break;
|
480
500
|
}
|
481
501
|
#line 111 "api_node.c.erb"
|
482
|
-
case
|
502
|
+
case YP_CONSTANT_WRITE_NODE: {
|
483
503
|
yp_constant_write_node_t *cast = (yp_constant_write_node_t *) node;
|
484
504
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
485
505
|
break;
|
486
506
|
}
|
487
507
|
#line 111 "api_node.c.erb"
|
488
|
-
case
|
508
|
+
case YP_DEF_NODE: {
|
489
509
|
yp_def_node_t *cast = (yp_def_node_t *) node;
|
490
510
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->receiver);
|
491
511
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parameters);
|
@@ -493,37 +513,37 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
493
513
|
break;
|
494
514
|
}
|
495
515
|
#line 111 "api_node.c.erb"
|
496
|
-
case
|
516
|
+
case YP_DEFINED_NODE: {
|
497
517
|
yp_defined_node_t *cast = (yp_defined_node_t *) node;
|
498
518
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
499
519
|
break;
|
500
520
|
}
|
501
521
|
#line 111 "api_node.c.erb"
|
502
|
-
case
|
522
|
+
case YP_ELSE_NODE: {
|
503
523
|
yp_else_node_t *cast = (yp_else_node_t *) node;
|
504
524
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
|
505
525
|
break;
|
506
526
|
}
|
507
527
|
#line 111 "api_node.c.erb"
|
508
|
-
case
|
528
|
+
case YP_EMBEDDED_STATEMENTS_NODE: {
|
509
529
|
yp_embedded_statements_node_t *cast = (yp_embedded_statements_node_t *) node;
|
510
530
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
|
511
531
|
break;
|
512
532
|
}
|
513
533
|
#line 111 "api_node.c.erb"
|
514
|
-
case
|
534
|
+
case YP_EMBEDDED_VARIABLE_NODE: {
|
515
535
|
yp_embedded_variable_node_t *cast = (yp_embedded_variable_node_t *) node;
|
516
536
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->variable);
|
517
537
|
break;
|
518
538
|
}
|
519
539
|
#line 111 "api_node.c.erb"
|
520
|
-
case
|
540
|
+
case YP_ENSURE_NODE: {
|
521
541
|
yp_ensure_node_t *cast = (yp_ensure_node_t *) node;
|
522
542
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
|
523
543
|
break;
|
524
544
|
}
|
525
545
|
#line 111 "api_node.c.erb"
|
526
|
-
case
|
546
|
+
case YP_FIND_PATTERN_NODE: {
|
527
547
|
yp_find_pattern_node_t *cast = (yp_find_pattern_node_t *) node;
|
528
548
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->constant);
|
529
549
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->left);
|
@@ -534,14 +554,14 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
534
554
|
break;
|
535
555
|
}
|
536
556
|
#line 111 "api_node.c.erb"
|
537
|
-
case
|
557
|
+
case YP_FLIP_FLOP_NODE: {
|
538
558
|
yp_flip_flop_node_t *cast = (yp_flip_flop_node_t *) node;
|
539
559
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->left);
|
540
560
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->right);
|
541
561
|
break;
|
542
562
|
}
|
543
563
|
#line 111 "api_node.c.erb"
|
544
|
-
case
|
564
|
+
case YP_FOR_NODE: {
|
545
565
|
yp_for_node_t *cast = (yp_for_node_t *) node;
|
546
566
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->index);
|
547
567
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->collection);
|
@@ -549,37 +569,37 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
549
569
|
break;
|
550
570
|
}
|
551
571
|
#line 111 "api_node.c.erb"
|
552
|
-
case
|
572
|
+
case YP_FORWARDING_SUPER_NODE: {
|
553
573
|
yp_forwarding_super_node_t *cast = (yp_forwarding_super_node_t *) node;
|
554
574
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->block);
|
555
575
|
break;
|
556
576
|
}
|
557
577
|
#line 111 "api_node.c.erb"
|
558
|
-
case
|
578
|
+
case YP_GLOBAL_VARIABLE_AND_WRITE_NODE: {
|
559
579
|
yp_global_variable_and_write_node_t *cast = (yp_global_variable_and_write_node_t *) node;
|
560
580
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
561
581
|
break;
|
562
582
|
}
|
563
583
|
#line 111 "api_node.c.erb"
|
564
|
-
case
|
584
|
+
case YP_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
|
565
585
|
yp_global_variable_operator_write_node_t *cast = (yp_global_variable_operator_write_node_t *) node;
|
566
586
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
567
587
|
break;
|
568
588
|
}
|
569
589
|
#line 111 "api_node.c.erb"
|
570
|
-
case
|
590
|
+
case YP_GLOBAL_VARIABLE_OR_WRITE_NODE: {
|
571
591
|
yp_global_variable_or_write_node_t *cast = (yp_global_variable_or_write_node_t *) node;
|
572
592
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
573
593
|
break;
|
574
594
|
}
|
575
595
|
#line 111 "api_node.c.erb"
|
576
|
-
case
|
596
|
+
case YP_GLOBAL_VARIABLE_WRITE_NODE: {
|
577
597
|
yp_global_variable_write_node_t *cast = (yp_global_variable_write_node_t *) node;
|
578
598
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
579
599
|
break;
|
580
600
|
}
|
581
601
|
#line 111 "api_node.c.erb"
|
582
|
-
case
|
602
|
+
case YP_HASH_NODE: {
|
583
603
|
yp_hash_node_t *cast = (yp_hash_node_t *) node;
|
584
604
|
for (size_t index = 0; index < cast->elements.size; index++) {
|
585
605
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->elements.nodes[index]);
|
@@ -587,7 +607,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
587
607
|
break;
|
588
608
|
}
|
589
609
|
#line 111 "api_node.c.erb"
|
590
|
-
case
|
610
|
+
case YP_HASH_PATTERN_NODE: {
|
591
611
|
yp_hash_pattern_node_t *cast = (yp_hash_pattern_node_t *) node;
|
592
612
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->constant);
|
593
613
|
for (size_t index = 0; index < cast->assocs.size; index++) {
|
@@ -597,7 +617,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
597
617
|
break;
|
598
618
|
}
|
599
619
|
#line 111 "api_node.c.erb"
|
600
|
-
case
|
620
|
+
case YP_IF_NODE: {
|
601
621
|
yp_if_node_t *cast = (yp_if_node_t *) node;
|
602
622
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->predicate);
|
603
623
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
|
@@ -605,44 +625,58 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
605
625
|
break;
|
606
626
|
}
|
607
627
|
#line 111 "api_node.c.erb"
|
608
|
-
case
|
628
|
+
case YP_IMAGINARY_NODE: {
|
609
629
|
yp_imaginary_node_t *cast = (yp_imaginary_node_t *) node;
|
610
630
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->numeric);
|
611
631
|
break;
|
612
632
|
}
|
613
633
|
#line 111 "api_node.c.erb"
|
614
|
-
case
|
634
|
+
case YP_IMPLICIT_NODE: {
|
635
|
+
yp_implicit_node_t *cast = (yp_implicit_node_t *) node;
|
636
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
637
|
+
break;
|
638
|
+
}
|
639
|
+
#line 111 "api_node.c.erb"
|
640
|
+
case YP_IN_NODE: {
|
615
641
|
yp_in_node_t *cast = (yp_in_node_t *) node;
|
616
642
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->pattern);
|
617
643
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
|
618
644
|
break;
|
619
645
|
}
|
620
646
|
#line 111 "api_node.c.erb"
|
621
|
-
case
|
647
|
+
case YP_INSTANCE_VARIABLE_AND_WRITE_NODE: {
|
622
648
|
yp_instance_variable_and_write_node_t *cast = (yp_instance_variable_and_write_node_t *) node;
|
623
649
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
624
650
|
break;
|
625
651
|
}
|
626
652
|
#line 111 "api_node.c.erb"
|
627
|
-
case
|
653
|
+
case YP_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
|
628
654
|
yp_instance_variable_operator_write_node_t *cast = (yp_instance_variable_operator_write_node_t *) node;
|
629
655
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
630
656
|
break;
|
631
657
|
}
|
632
658
|
#line 111 "api_node.c.erb"
|
633
|
-
case
|
659
|
+
case YP_INSTANCE_VARIABLE_OR_WRITE_NODE: {
|
634
660
|
yp_instance_variable_or_write_node_t *cast = (yp_instance_variable_or_write_node_t *) node;
|
635
661
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
636
662
|
break;
|
637
663
|
}
|
638
664
|
#line 111 "api_node.c.erb"
|
639
|
-
case
|
665
|
+
case YP_INSTANCE_VARIABLE_WRITE_NODE: {
|
640
666
|
yp_instance_variable_write_node_t *cast = (yp_instance_variable_write_node_t *) node;
|
641
667
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
642
668
|
break;
|
643
669
|
}
|
644
670
|
#line 111 "api_node.c.erb"
|
645
|
-
case
|
671
|
+
case YP_INTERPOLATED_MATCH_LAST_LINE_NODE: {
|
672
|
+
yp_interpolated_match_last_line_node_t *cast = (yp_interpolated_match_last_line_node_t *) node;
|
673
|
+
for (size_t index = 0; index < cast->parts.size; index++) {
|
674
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parts.nodes[index]);
|
675
|
+
}
|
676
|
+
break;
|
677
|
+
}
|
678
|
+
#line 111 "api_node.c.erb"
|
679
|
+
case YP_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
|
646
680
|
yp_interpolated_regular_expression_node_t *cast = (yp_interpolated_regular_expression_node_t *) node;
|
647
681
|
for (size_t index = 0; index < cast->parts.size; index++) {
|
648
682
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parts.nodes[index]);
|
@@ -650,7 +684,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
650
684
|
break;
|
651
685
|
}
|
652
686
|
#line 111 "api_node.c.erb"
|
653
|
-
case
|
687
|
+
case YP_INTERPOLATED_STRING_NODE: {
|
654
688
|
yp_interpolated_string_node_t *cast = (yp_interpolated_string_node_t *) node;
|
655
689
|
for (size_t index = 0; index < cast->parts.size; index++) {
|
656
690
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parts.nodes[index]);
|
@@ -658,7 +692,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
658
692
|
break;
|
659
693
|
}
|
660
694
|
#line 111 "api_node.c.erb"
|
661
|
-
case
|
695
|
+
case YP_INTERPOLATED_SYMBOL_NODE: {
|
662
696
|
yp_interpolated_symbol_node_t *cast = (yp_interpolated_symbol_node_t *) node;
|
663
697
|
for (size_t index = 0; index < cast->parts.size; index++) {
|
664
698
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parts.nodes[index]);
|
@@ -666,7 +700,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
666
700
|
break;
|
667
701
|
}
|
668
702
|
#line 111 "api_node.c.erb"
|
669
|
-
case
|
703
|
+
case YP_INTERPOLATED_X_STRING_NODE: {
|
670
704
|
yp_interpolated_x_string_node_t *cast = (yp_interpolated_x_string_node_t *) node;
|
671
705
|
for (size_t index = 0; index < cast->parts.size; index++) {
|
672
706
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parts.nodes[index]);
|
@@ -674,7 +708,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
674
708
|
break;
|
675
709
|
}
|
676
710
|
#line 111 "api_node.c.erb"
|
677
|
-
case
|
711
|
+
case YP_KEYWORD_HASH_NODE: {
|
678
712
|
yp_keyword_hash_node_t *cast = (yp_keyword_hash_node_t *) node;
|
679
713
|
for (size_t index = 0; index < cast->elements.size; index++) {
|
680
714
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->elements.nodes[index]);
|
@@ -682,65 +716,79 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
682
716
|
break;
|
683
717
|
}
|
684
718
|
#line 111 "api_node.c.erb"
|
685
|
-
case
|
719
|
+
case YP_KEYWORD_PARAMETER_NODE: {
|
686
720
|
yp_keyword_parameter_node_t *cast = (yp_keyword_parameter_node_t *) node;
|
687
721
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
688
722
|
break;
|
689
723
|
}
|
690
724
|
#line 111 "api_node.c.erb"
|
691
|
-
case
|
725
|
+
case YP_LAMBDA_NODE: {
|
692
726
|
yp_lambda_node_t *cast = (yp_lambda_node_t *) node;
|
693
727
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parameters);
|
694
728
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->body);
|
695
729
|
break;
|
696
730
|
}
|
697
731
|
#line 111 "api_node.c.erb"
|
698
|
-
case
|
732
|
+
case YP_LOCAL_VARIABLE_AND_WRITE_NODE: {
|
699
733
|
yp_local_variable_and_write_node_t *cast = (yp_local_variable_and_write_node_t *) node;
|
700
734
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
701
735
|
break;
|
702
736
|
}
|
703
737
|
#line 111 "api_node.c.erb"
|
704
|
-
case
|
738
|
+
case YP_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
|
705
739
|
yp_local_variable_operator_write_node_t *cast = (yp_local_variable_operator_write_node_t *) node;
|
706
740
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
707
741
|
break;
|
708
742
|
}
|
709
743
|
#line 111 "api_node.c.erb"
|
710
|
-
case
|
744
|
+
case YP_LOCAL_VARIABLE_OR_WRITE_NODE: {
|
711
745
|
yp_local_variable_or_write_node_t *cast = (yp_local_variable_or_write_node_t *) node;
|
712
746
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
713
747
|
break;
|
714
748
|
}
|
715
749
|
#line 111 "api_node.c.erb"
|
716
|
-
case
|
750
|
+
case YP_LOCAL_VARIABLE_WRITE_NODE: {
|
717
751
|
yp_local_variable_write_node_t *cast = (yp_local_variable_write_node_t *) node;
|
718
752
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
719
753
|
break;
|
720
754
|
}
|
721
755
|
#line 111 "api_node.c.erb"
|
722
|
-
case
|
756
|
+
case YP_MATCH_PREDICATE_NODE: {
|
723
757
|
yp_match_predicate_node_t *cast = (yp_match_predicate_node_t *) node;
|
724
758
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
725
759
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->pattern);
|
726
760
|
break;
|
727
761
|
}
|
728
762
|
#line 111 "api_node.c.erb"
|
729
|
-
case
|
763
|
+
case YP_MATCH_REQUIRED_NODE: {
|
730
764
|
yp_match_required_node_t *cast = (yp_match_required_node_t *) node;
|
731
765
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
732
766
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->pattern);
|
733
767
|
break;
|
734
768
|
}
|
735
769
|
#line 111 "api_node.c.erb"
|
736
|
-
case
|
770
|
+
case YP_MATCH_WRITE_NODE: {
|
771
|
+
yp_match_write_node_t *cast = (yp_match_write_node_t *) node;
|
772
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->call);
|
773
|
+
break;
|
774
|
+
}
|
775
|
+
#line 111 "api_node.c.erb"
|
776
|
+
case YP_MODULE_NODE: {
|
737
777
|
yp_module_node_t *cast = (yp_module_node_t *) node;
|
738
778
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->constant_path);
|
739
779
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->body);
|
740
780
|
break;
|
741
781
|
}
|
742
782
|
#line 111 "api_node.c.erb"
|
743
|
-
case
|
783
|
+
case YP_MULTI_TARGET_NODE: {
|
784
|
+
yp_multi_target_node_t *cast = (yp_multi_target_node_t *) node;
|
785
|
+
for (size_t index = 0; index < cast->targets.size; index++) {
|
786
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->targets.nodes[index]);
|
787
|
+
}
|
788
|
+
break;
|
789
|
+
}
|
790
|
+
#line 111 "api_node.c.erb"
|
791
|
+
case YP_MULTI_WRITE_NODE: {
|
744
792
|
yp_multi_write_node_t *cast = (yp_multi_write_node_t *) node;
|
745
793
|
for (size_t index = 0; index < cast->targets.size; index++) {
|
746
794
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->targets.nodes[index]);
|
@@ -749,26 +797,26 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
749
797
|
break;
|
750
798
|
}
|
751
799
|
#line 111 "api_node.c.erb"
|
752
|
-
case
|
800
|
+
case YP_NEXT_NODE: {
|
753
801
|
yp_next_node_t *cast = (yp_next_node_t *) node;
|
754
802
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
|
755
803
|
break;
|
756
804
|
}
|
757
805
|
#line 111 "api_node.c.erb"
|
758
|
-
case
|
806
|
+
case YP_OPTIONAL_PARAMETER_NODE: {
|
759
807
|
yp_optional_parameter_node_t *cast = (yp_optional_parameter_node_t *) node;
|
760
808
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
761
809
|
break;
|
762
810
|
}
|
763
811
|
#line 111 "api_node.c.erb"
|
764
|
-
case
|
812
|
+
case YP_OR_NODE: {
|
765
813
|
yp_or_node_t *cast = (yp_or_node_t *) node;
|
766
814
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->left);
|
767
815
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->right);
|
768
816
|
break;
|
769
817
|
}
|
770
818
|
#line 111 "api_node.c.erb"
|
771
|
-
case
|
819
|
+
case YP_PARAMETERS_NODE: {
|
772
820
|
yp_parameters_node_t *cast = (yp_parameters_node_t *) node;
|
773
821
|
for (size_t index = 0; index < cast->requireds.size; index++) {
|
774
822
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->requireds.nodes[index]);
|
@@ -776,10 +824,10 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
776
824
|
for (size_t index = 0; index < cast->optionals.size; index++) {
|
777
825
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->optionals.nodes[index]);
|
778
826
|
}
|
827
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->rest);
|
779
828
|
for (size_t index = 0; index < cast->posts.size; index++) {
|
780
829
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->posts.nodes[index]);
|
781
830
|
}
|
782
|
-
yp_node_stack_push(&node_stack, (yp_node_t *) cast->rest);
|
783
831
|
for (size_t index = 0; index < cast->keywords.size; index++) {
|
784
832
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->keywords.nodes[index]);
|
785
833
|
}
|
@@ -788,56 +836,56 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
788
836
|
break;
|
789
837
|
}
|
790
838
|
#line 111 "api_node.c.erb"
|
791
|
-
case
|
839
|
+
case YP_PARENTHESES_NODE: {
|
792
840
|
yp_parentheses_node_t *cast = (yp_parentheses_node_t *) node;
|
793
841
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->body);
|
794
842
|
break;
|
795
843
|
}
|
796
844
|
#line 111 "api_node.c.erb"
|
797
|
-
case
|
845
|
+
case YP_PINNED_EXPRESSION_NODE: {
|
798
846
|
yp_pinned_expression_node_t *cast = (yp_pinned_expression_node_t *) node;
|
799
847
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->expression);
|
800
848
|
break;
|
801
849
|
}
|
802
850
|
#line 111 "api_node.c.erb"
|
803
|
-
case
|
851
|
+
case YP_PINNED_VARIABLE_NODE: {
|
804
852
|
yp_pinned_variable_node_t *cast = (yp_pinned_variable_node_t *) node;
|
805
853
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->variable);
|
806
854
|
break;
|
807
855
|
}
|
808
856
|
#line 111 "api_node.c.erb"
|
809
|
-
case
|
857
|
+
case YP_POST_EXECUTION_NODE: {
|
810
858
|
yp_post_execution_node_t *cast = (yp_post_execution_node_t *) node;
|
811
859
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
|
812
860
|
break;
|
813
861
|
}
|
814
862
|
#line 111 "api_node.c.erb"
|
815
|
-
case
|
863
|
+
case YP_PRE_EXECUTION_NODE: {
|
816
864
|
yp_pre_execution_node_t *cast = (yp_pre_execution_node_t *) node;
|
817
865
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
|
818
866
|
break;
|
819
867
|
}
|
820
868
|
#line 111 "api_node.c.erb"
|
821
|
-
case
|
869
|
+
case YP_PROGRAM_NODE: {
|
822
870
|
yp_program_node_t *cast = (yp_program_node_t *) node;
|
823
871
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
|
824
872
|
break;
|
825
873
|
}
|
826
874
|
#line 111 "api_node.c.erb"
|
827
|
-
case
|
875
|
+
case YP_RANGE_NODE: {
|
828
876
|
yp_range_node_t *cast = (yp_range_node_t *) node;
|
829
877
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->left);
|
830
878
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->right);
|
831
879
|
break;
|
832
880
|
}
|
833
881
|
#line 111 "api_node.c.erb"
|
834
|
-
case
|
882
|
+
case YP_RATIONAL_NODE: {
|
835
883
|
yp_rational_node_t *cast = (yp_rational_node_t *) node;
|
836
884
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->numeric);
|
837
885
|
break;
|
838
886
|
}
|
839
887
|
#line 111 "api_node.c.erb"
|
840
|
-
case
|
888
|
+
case YP_REQUIRED_DESTRUCTURED_PARAMETER_NODE: {
|
841
889
|
yp_required_destructured_parameter_node_t *cast = (yp_required_destructured_parameter_node_t *) node;
|
842
890
|
for (size_t index = 0; index < cast->parameters.size; index++) {
|
843
891
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parameters.nodes[index]);
|
@@ -845,14 +893,14 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
845
893
|
break;
|
846
894
|
}
|
847
895
|
#line 111 "api_node.c.erb"
|
848
|
-
case
|
896
|
+
case YP_RESCUE_MODIFIER_NODE: {
|
849
897
|
yp_rescue_modifier_node_t *cast = (yp_rescue_modifier_node_t *) node;
|
850
898
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->expression);
|
851
899
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->rescue_expression);
|
852
900
|
break;
|
853
901
|
}
|
854
902
|
#line 111 "api_node.c.erb"
|
855
|
-
case
|
903
|
+
case YP_RESCUE_NODE: {
|
856
904
|
yp_rescue_node_t *cast = (yp_rescue_node_t *) node;
|
857
905
|
for (size_t index = 0; index < cast->exceptions.size; index++) {
|
858
906
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->exceptions.nodes[index]);
|
@@ -863,26 +911,26 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
863
911
|
break;
|
864
912
|
}
|
865
913
|
#line 111 "api_node.c.erb"
|
866
|
-
case
|
914
|
+
case YP_RETURN_NODE: {
|
867
915
|
yp_return_node_t *cast = (yp_return_node_t *) node;
|
868
916
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
|
869
917
|
break;
|
870
918
|
}
|
871
919
|
#line 111 "api_node.c.erb"
|
872
|
-
case
|
920
|
+
case YP_SINGLETON_CLASS_NODE: {
|
873
921
|
yp_singleton_class_node_t *cast = (yp_singleton_class_node_t *) node;
|
874
922
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->expression);
|
875
923
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->body);
|
876
924
|
break;
|
877
925
|
}
|
878
926
|
#line 111 "api_node.c.erb"
|
879
|
-
case
|
927
|
+
case YP_SPLAT_NODE: {
|
880
928
|
yp_splat_node_t *cast = (yp_splat_node_t *) node;
|
881
929
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->expression);
|
882
930
|
break;
|
883
931
|
}
|
884
932
|
#line 111 "api_node.c.erb"
|
885
|
-
case
|
933
|
+
case YP_STATEMENTS_NODE: {
|
886
934
|
yp_statements_node_t *cast = (yp_statements_node_t *) node;
|
887
935
|
for (size_t index = 0; index < cast->body.size; index++) {
|
888
936
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->body.nodes[index]);
|
@@ -890,21 +938,21 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
890
938
|
break;
|
891
939
|
}
|
892
940
|
#line 111 "api_node.c.erb"
|
893
|
-
case
|
941
|
+
case YP_STRING_CONCAT_NODE: {
|
894
942
|
yp_string_concat_node_t *cast = (yp_string_concat_node_t *) node;
|
895
943
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->left);
|
896
944
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->right);
|
897
945
|
break;
|
898
946
|
}
|
899
947
|
#line 111 "api_node.c.erb"
|
900
|
-
case
|
948
|
+
case YP_SUPER_NODE: {
|
901
949
|
yp_super_node_t *cast = (yp_super_node_t *) node;
|
902
950
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
|
903
951
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->block);
|
904
952
|
break;
|
905
953
|
}
|
906
954
|
#line 111 "api_node.c.erb"
|
907
|
-
case
|
955
|
+
case YP_UNDEF_NODE: {
|
908
956
|
yp_undef_node_t *cast = (yp_undef_node_t *) node;
|
909
957
|
for (size_t index = 0; index < cast->names.size; index++) {
|
910
958
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->names.nodes[index]);
|
@@ -912,7 +960,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
912
960
|
break;
|
913
961
|
}
|
914
962
|
#line 111 "api_node.c.erb"
|
915
|
-
case
|
963
|
+
case YP_UNLESS_NODE: {
|
916
964
|
yp_unless_node_t *cast = (yp_unless_node_t *) node;
|
917
965
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->predicate);
|
918
966
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
|
@@ -920,14 +968,14 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
920
968
|
break;
|
921
969
|
}
|
922
970
|
#line 111 "api_node.c.erb"
|
923
|
-
case
|
971
|
+
case YP_UNTIL_NODE: {
|
924
972
|
yp_until_node_t *cast = (yp_until_node_t *) node;
|
925
973
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->predicate);
|
926
974
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
|
927
975
|
break;
|
928
976
|
}
|
929
977
|
#line 111 "api_node.c.erb"
|
930
|
-
case
|
978
|
+
case YP_WHEN_NODE: {
|
931
979
|
yp_when_node_t *cast = (yp_when_node_t *) node;
|
932
980
|
for (size_t index = 0; index < cast->conditions.size; index++) {
|
933
981
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->conditions.nodes[index]);
|
@@ -936,14 +984,14 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
936
984
|
break;
|
937
985
|
}
|
938
986
|
#line 111 "api_node.c.erb"
|
939
|
-
case
|
987
|
+
case YP_WHILE_NODE: {
|
940
988
|
yp_while_node_t *cast = (yp_while_node_t *) node;
|
941
989
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->predicate);
|
942
990
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
|
943
991
|
break;
|
944
992
|
}
|
945
993
|
#line 111 "api_node.c.erb"
|
946
|
-
case
|
994
|
+
case YP_YIELD_NODE: {
|
947
995
|
yp_yield_node_t *cast = (yp_yield_node_t *) node;
|
948
996
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
|
949
997
|
break;
|
@@ -957,37 +1005,66 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
957
1005
|
|
958
1006
|
switch (YP_NODE_TYPE(node)) {
|
959
1007
|
#line 137 "api_node.c.erb"
|
960
|
-
case
|
961
|
-
|
1008
|
+
case YP_ALIAS_GLOBAL_VARIABLE_NODE: {
|
1009
|
+
yp_alias_global_variable_node_t *cast = (yp_alias_global_variable_node_t *) node;
|
1010
|
+
VALUE argv[4];
|
1011
|
+
|
1012
|
+
// new_name
|
1013
|
+
#line 148 "api_node.c.erb"
|
1014
|
+
argv[0] = rb_ary_pop(value_stack);
|
1015
|
+
|
1016
|
+
// old_name
|
1017
|
+
#line 148 "api_node.c.erb"
|
1018
|
+
argv[1] = rb_ary_pop(value_stack);
|
1019
|
+
|
1020
|
+
// keyword_loc
|
1021
|
+
#line 173 "api_node.c.erb"
|
1022
|
+
argv[2] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
|
1023
|
+
|
1024
|
+
// location
|
1025
|
+
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1026
|
+
|
1027
|
+
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPAliasGlobalVariableNode));
|
1028
|
+
break;
|
1029
|
+
}
|
1030
|
+
#line 137 "api_node.c.erb"
|
1031
|
+
case YP_ALIAS_METHOD_NODE: {
|
1032
|
+
yp_alias_method_node_t *cast = (yp_alias_method_node_t *) node;
|
962
1033
|
VALUE argv[4];
|
963
1034
|
|
964
1035
|
// new_name
|
1036
|
+
#line 148 "api_node.c.erb"
|
965
1037
|
argv[0] = rb_ary_pop(value_stack);
|
966
1038
|
|
967
1039
|
// old_name
|
1040
|
+
#line 148 "api_node.c.erb"
|
968
1041
|
argv[1] = rb_ary_pop(value_stack);
|
969
1042
|
|
970
1043
|
// keyword_loc
|
1044
|
+
#line 173 "api_node.c.erb"
|
971
1045
|
argv[2] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
|
972
1046
|
|
973
1047
|
// location
|
974
1048
|
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
|
975
1049
|
|
976
|
-
rb_ary_push(value_stack, rb_class_new_instance(4, argv,
|
1050
|
+
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPAliasMethodNode));
|
977
1051
|
break;
|
978
1052
|
}
|
979
1053
|
#line 137 "api_node.c.erb"
|
980
|
-
case
|
1054
|
+
case YP_ALTERNATION_PATTERN_NODE: {
|
981
1055
|
yp_alternation_pattern_node_t *cast = (yp_alternation_pattern_node_t *) node;
|
982
1056
|
VALUE argv[4];
|
983
1057
|
|
984
1058
|
// left
|
1059
|
+
#line 148 "api_node.c.erb"
|
985
1060
|
argv[0] = rb_ary_pop(value_stack);
|
986
1061
|
|
987
1062
|
// right
|
1063
|
+
#line 148 "api_node.c.erb"
|
988
1064
|
argv[1] = rb_ary_pop(value_stack);
|
989
1065
|
|
990
1066
|
// operator_loc
|
1067
|
+
#line 173 "api_node.c.erb"
|
991
1068
|
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
992
1069
|
|
993
1070
|
// location
|
@@ -997,17 +1074,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
997
1074
|
break;
|
998
1075
|
}
|
999
1076
|
#line 137 "api_node.c.erb"
|
1000
|
-
case
|
1077
|
+
case YP_AND_NODE: {
|
1001
1078
|
yp_and_node_t *cast = (yp_and_node_t *) node;
|
1002
1079
|
VALUE argv[4];
|
1003
1080
|
|
1004
1081
|
// left
|
1082
|
+
#line 148 "api_node.c.erb"
|
1005
1083
|
argv[0] = rb_ary_pop(value_stack);
|
1006
1084
|
|
1007
1085
|
// right
|
1086
|
+
#line 148 "api_node.c.erb"
|
1008
1087
|
argv[1] = rb_ary_pop(value_stack);
|
1009
1088
|
|
1010
1089
|
// operator_loc
|
1090
|
+
#line 173 "api_node.c.erb"
|
1011
1091
|
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1012
1092
|
|
1013
1093
|
// location
|
@@ -1017,11 +1097,12 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1017
1097
|
break;
|
1018
1098
|
}
|
1019
1099
|
#line 137 "api_node.c.erb"
|
1020
|
-
case
|
1100
|
+
case YP_ARGUMENTS_NODE: {
|
1021
1101
|
yp_arguments_node_t *cast = (yp_arguments_node_t *) node;
|
1022
1102
|
VALUE argv[2];
|
1023
1103
|
|
1024
1104
|
// arguments
|
1105
|
+
#line 151 "api_node.c.erb"
|
1025
1106
|
argv[0] = rb_ary_new_capa(cast->arguments.size);
|
1026
1107
|
for (size_t index = 0; index < cast->arguments.size; index++) {
|
1027
1108
|
rb_ary_push(argv[0], rb_ary_pop(value_stack));
|
@@ -1034,20 +1115,23 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1034
1115
|
break;
|
1035
1116
|
}
|
1036
1117
|
#line 137 "api_node.c.erb"
|
1037
|
-
case
|
1118
|
+
case YP_ARRAY_NODE: {
|
1038
1119
|
yp_array_node_t *cast = (yp_array_node_t *) node;
|
1039
1120
|
VALUE argv[4];
|
1040
1121
|
|
1041
1122
|
// elements
|
1123
|
+
#line 151 "api_node.c.erb"
|
1042
1124
|
argv[0] = rb_ary_new_capa(cast->elements.size);
|
1043
1125
|
for (size_t index = 0; index < cast->elements.size; index++) {
|
1044
1126
|
rb_ary_push(argv[0], rb_ary_pop(value_stack));
|
1045
1127
|
}
|
1046
1128
|
|
1047
1129
|
// opening_loc
|
1130
|
+
#line 176 "api_node.c.erb"
|
1048
1131
|
argv[1] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
1049
1132
|
|
1050
1133
|
// closing_loc
|
1134
|
+
#line 176 "api_node.c.erb"
|
1051
1135
|
argv[2] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
1052
1136
|
|
1053
1137
|
// location
|
@@ -1057,32 +1141,38 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1057
1141
|
break;
|
1058
1142
|
}
|
1059
1143
|
#line 137 "api_node.c.erb"
|
1060
|
-
case
|
1144
|
+
case YP_ARRAY_PATTERN_NODE: {
|
1061
1145
|
yp_array_pattern_node_t *cast = (yp_array_pattern_node_t *) node;
|
1062
1146
|
VALUE argv[7];
|
1063
1147
|
|
1064
1148
|
// constant
|
1149
|
+
#line 148 "api_node.c.erb"
|
1065
1150
|
argv[0] = rb_ary_pop(value_stack);
|
1066
1151
|
|
1067
1152
|
// requireds
|
1153
|
+
#line 151 "api_node.c.erb"
|
1068
1154
|
argv[1] = rb_ary_new_capa(cast->requireds.size);
|
1069
1155
|
for (size_t index = 0; index < cast->requireds.size; index++) {
|
1070
1156
|
rb_ary_push(argv[1], rb_ary_pop(value_stack));
|
1071
1157
|
}
|
1072
1158
|
|
1073
1159
|
// rest
|
1160
|
+
#line 148 "api_node.c.erb"
|
1074
1161
|
argv[2] = rb_ary_pop(value_stack);
|
1075
1162
|
|
1076
1163
|
// posts
|
1164
|
+
#line 151 "api_node.c.erb"
|
1077
1165
|
argv[3] = rb_ary_new_capa(cast->posts.size);
|
1078
1166
|
for (size_t index = 0; index < cast->posts.size; index++) {
|
1079
1167
|
rb_ary_push(argv[3], rb_ary_pop(value_stack));
|
1080
1168
|
}
|
1081
1169
|
|
1082
1170
|
// opening_loc
|
1171
|
+
#line 176 "api_node.c.erb"
|
1083
1172
|
argv[4] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
1084
1173
|
|
1085
1174
|
// closing_loc
|
1175
|
+
#line 176 "api_node.c.erb"
|
1086
1176
|
argv[5] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
1087
1177
|
|
1088
1178
|
// location
|
@@ -1092,17 +1182,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1092
1182
|
break;
|
1093
1183
|
}
|
1094
1184
|
#line 137 "api_node.c.erb"
|
1095
|
-
case
|
1185
|
+
case YP_ASSOC_NODE: {
|
1096
1186
|
yp_assoc_node_t *cast = (yp_assoc_node_t *) node;
|
1097
1187
|
VALUE argv[4];
|
1098
1188
|
|
1099
1189
|
// key
|
1190
|
+
#line 148 "api_node.c.erb"
|
1100
1191
|
argv[0] = rb_ary_pop(value_stack);
|
1101
1192
|
|
1102
1193
|
// value
|
1194
|
+
#line 148 "api_node.c.erb"
|
1103
1195
|
argv[1] = rb_ary_pop(value_stack);
|
1104
1196
|
|
1105
1197
|
// operator_loc
|
1198
|
+
#line 176 "api_node.c.erb"
|
1106
1199
|
argv[2] = cast->operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1107
1200
|
|
1108
1201
|
// location
|
@@ -1112,14 +1205,16 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1112
1205
|
break;
|
1113
1206
|
}
|
1114
1207
|
#line 137 "api_node.c.erb"
|
1115
|
-
case
|
1208
|
+
case YP_ASSOC_SPLAT_NODE: {
|
1116
1209
|
yp_assoc_splat_node_t *cast = (yp_assoc_splat_node_t *) node;
|
1117
1210
|
VALUE argv[3];
|
1118
1211
|
|
1119
1212
|
// value
|
1213
|
+
#line 148 "api_node.c.erb"
|
1120
1214
|
argv[0] = rb_ary_pop(value_stack);
|
1121
1215
|
|
1122
1216
|
// operator_loc
|
1217
|
+
#line 173 "api_node.c.erb"
|
1123
1218
|
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1124
1219
|
|
1125
1220
|
// location
|
@@ -1129,7 +1224,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1129
1224
|
break;
|
1130
1225
|
}
|
1131
1226
|
#line 137 "api_node.c.erb"
|
1132
|
-
case
|
1227
|
+
case YP_BACK_REFERENCE_READ_NODE: {
|
1133
1228
|
VALUE argv[1];
|
1134
1229
|
|
1135
1230
|
// location
|
@@ -1139,26 +1234,32 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1139
1234
|
break;
|
1140
1235
|
}
|
1141
1236
|
#line 137 "api_node.c.erb"
|
1142
|
-
case
|
1237
|
+
case YP_BEGIN_NODE: {
|
1143
1238
|
yp_begin_node_t *cast = (yp_begin_node_t *) node;
|
1144
1239
|
VALUE argv[7];
|
1145
1240
|
|
1146
1241
|
// begin_keyword_loc
|
1242
|
+
#line 176 "api_node.c.erb"
|
1147
1243
|
argv[0] = cast->begin_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->begin_keyword_loc.start, cast->begin_keyword_loc.end, source);
|
1148
1244
|
|
1149
1245
|
// statements
|
1246
|
+
#line 148 "api_node.c.erb"
|
1150
1247
|
argv[1] = rb_ary_pop(value_stack);
|
1151
1248
|
|
1152
1249
|
// rescue_clause
|
1250
|
+
#line 148 "api_node.c.erb"
|
1153
1251
|
argv[2] = rb_ary_pop(value_stack);
|
1154
1252
|
|
1155
1253
|
// else_clause
|
1254
|
+
#line 148 "api_node.c.erb"
|
1156
1255
|
argv[3] = rb_ary_pop(value_stack);
|
1157
1256
|
|
1158
1257
|
// ensure_clause
|
1258
|
+
#line 148 "api_node.c.erb"
|
1159
1259
|
argv[4] = rb_ary_pop(value_stack);
|
1160
1260
|
|
1161
1261
|
// end_keyword_loc
|
1262
|
+
#line 176 "api_node.c.erb"
|
1162
1263
|
argv[5] = cast->end_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
|
1163
1264
|
|
1164
1265
|
// location
|
@@ -1168,14 +1269,16 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1168
1269
|
break;
|
1169
1270
|
}
|
1170
1271
|
#line 137 "api_node.c.erb"
|
1171
|
-
case
|
1272
|
+
case YP_BLOCK_ARGUMENT_NODE: {
|
1172
1273
|
yp_block_argument_node_t *cast = (yp_block_argument_node_t *) node;
|
1173
1274
|
VALUE argv[3];
|
1174
1275
|
|
1175
1276
|
// expression
|
1277
|
+
#line 148 "api_node.c.erb"
|
1176
1278
|
argv[0] = rb_ary_pop(value_stack);
|
1177
1279
|
|
1178
1280
|
// operator_loc
|
1281
|
+
#line 173 "api_node.c.erb"
|
1179
1282
|
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1180
1283
|
|
1181
1284
|
// location
|
@@ -1185,26 +1288,48 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1185
1288
|
break;
|
1186
1289
|
}
|
1187
1290
|
#line 137 "api_node.c.erb"
|
1188
|
-
case
|
1291
|
+
case YP_BLOCK_LOCAL_VARIABLE_NODE: {
|
1292
|
+
yp_block_local_variable_node_t *cast = (yp_block_local_variable_node_t *) node;
|
1293
|
+
VALUE argv[2];
|
1294
|
+
|
1295
|
+
// name
|
1296
|
+
#line 160 "api_node.c.erb"
|
1297
|
+
assert(cast->name != 0);
|
1298
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1299
|
+
|
1300
|
+
// location
|
1301
|
+
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1302
|
+
|
1303
|
+
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPBlockLocalVariableNode));
|
1304
|
+
break;
|
1305
|
+
}
|
1306
|
+
#line 137 "api_node.c.erb"
|
1307
|
+
case YP_BLOCK_NODE: {
|
1189
1308
|
yp_block_node_t *cast = (yp_block_node_t *) node;
|
1190
1309
|
VALUE argv[6];
|
1191
1310
|
|
1192
1311
|
// locals
|
1312
|
+
#line 166 "api_node.c.erb"
|
1193
1313
|
argv[0] = rb_ary_new_capa(cast->locals.size);
|
1194
1314
|
for (size_t index = 0; index < cast->locals.size; index++) {
|
1315
|
+
assert(cast->locals.ids[index] != 0);
|
1195
1316
|
rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
|
1196
1317
|
}
|
1197
1318
|
|
1198
1319
|
// parameters
|
1320
|
+
#line 148 "api_node.c.erb"
|
1199
1321
|
argv[1] = rb_ary_pop(value_stack);
|
1200
1322
|
|
1201
1323
|
// body
|
1324
|
+
#line 148 "api_node.c.erb"
|
1202
1325
|
argv[2] = rb_ary_pop(value_stack);
|
1203
1326
|
|
1204
1327
|
// opening_loc
|
1328
|
+
#line 173 "api_node.c.erb"
|
1205
1329
|
argv[3] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
1206
1330
|
|
1207
1331
|
// closing_loc
|
1332
|
+
#line 173 "api_node.c.erb"
|
1208
1333
|
argv[4] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
1209
1334
|
|
1210
1335
|
// location
|
@@ -1214,41 +1339,49 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1214
1339
|
break;
|
1215
1340
|
}
|
1216
1341
|
#line 137 "api_node.c.erb"
|
1217
|
-
case
|
1342
|
+
case YP_BLOCK_PARAMETER_NODE: {
|
1218
1343
|
yp_block_parameter_node_t *cast = (yp_block_parameter_node_t *) node;
|
1219
|
-
VALUE argv[
|
1344
|
+
VALUE argv[4];
|
1345
|
+
|
1346
|
+
// name
|
1347
|
+
argv[0] = cast->name == 0 ? Qnil : rb_id2sym(constants[cast->name - 1]);
|
1220
1348
|
|
1221
1349
|
// name_loc
|
1222
|
-
|
1350
|
+
#line 176 "api_node.c.erb"
|
1351
|
+
argv[1] = cast->name_loc.start == NULL ? Qnil : yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
1223
1352
|
|
1224
1353
|
// operator_loc
|
1225
|
-
|
1354
|
+
#line 173 "api_node.c.erb"
|
1355
|
+
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1226
1356
|
|
1227
1357
|
// location
|
1228
|
-
argv[
|
1358
|
+
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1229
1359
|
|
1230
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
1360
|
+
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPBlockParameterNode));
|
1231
1361
|
break;
|
1232
1362
|
}
|
1233
1363
|
#line 137 "api_node.c.erb"
|
1234
|
-
case
|
1364
|
+
case YP_BLOCK_PARAMETERS_NODE: {
|
1235
1365
|
yp_block_parameters_node_t *cast = (yp_block_parameters_node_t *) node;
|
1236
1366
|
VALUE argv[5];
|
1237
1367
|
|
1238
1368
|
// parameters
|
1369
|
+
#line 148 "api_node.c.erb"
|
1239
1370
|
argv[0] = rb_ary_pop(value_stack);
|
1240
1371
|
|
1241
1372
|
// locals
|
1373
|
+
#line 151 "api_node.c.erb"
|
1242
1374
|
argv[1] = rb_ary_new_capa(cast->locals.size);
|
1243
1375
|
for (size_t index = 0; index < cast->locals.size; index++) {
|
1244
|
-
|
1245
|
-
rb_ary_push(argv[1], yp_location_new(parser, location.start, location.end, source));
|
1376
|
+
rb_ary_push(argv[1], rb_ary_pop(value_stack));
|
1246
1377
|
}
|
1247
1378
|
|
1248
1379
|
// opening_loc
|
1380
|
+
#line 176 "api_node.c.erb"
|
1249
1381
|
argv[2] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
1250
1382
|
|
1251
1383
|
// closing_loc
|
1384
|
+
#line 176 "api_node.c.erb"
|
1252
1385
|
argv[3] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
1253
1386
|
|
1254
1387
|
// location
|
@@ -1258,14 +1391,16 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1258
1391
|
break;
|
1259
1392
|
}
|
1260
1393
|
#line 137 "api_node.c.erb"
|
1261
|
-
case
|
1394
|
+
case YP_BREAK_NODE: {
|
1262
1395
|
yp_break_node_t *cast = (yp_break_node_t *) node;
|
1263
1396
|
VALUE argv[3];
|
1264
1397
|
|
1265
1398
|
// arguments
|
1399
|
+
#line 148 "api_node.c.erb"
|
1266
1400
|
argv[0] = rb_ary_pop(value_stack);
|
1267
1401
|
|
1268
1402
|
// keyword_loc
|
1403
|
+
#line 173 "api_node.c.erb"
|
1269
1404
|
argv[1] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
|
1270
1405
|
|
1271
1406
|
// location
|
@@ -1275,35 +1410,99 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1275
1410
|
break;
|
1276
1411
|
}
|
1277
1412
|
#line 137 "api_node.c.erb"
|
1278
|
-
case
|
1413
|
+
case YP_CALL_AND_WRITE_NODE: {
|
1414
|
+
yp_call_and_write_node_t *cast = (yp_call_and_write_node_t *) node;
|
1415
|
+
VALUE argv[12];
|
1416
|
+
|
1417
|
+
// receiver
|
1418
|
+
#line 148 "api_node.c.erb"
|
1419
|
+
argv[0] = rb_ary_pop(value_stack);
|
1420
|
+
|
1421
|
+
// call_operator_loc
|
1422
|
+
#line 176 "api_node.c.erb"
|
1423
|
+
argv[1] = cast->call_operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->call_operator_loc.start, cast->call_operator_loc.end, source);
|
1424
|
+
|
1425
|
+
// message_loc
|
1426
|
+
#line 176 "api_node.c.erb"
|
1427
|
+
argv[2] = cast->message_loc.start == NULL ? Qnil : yp_location_new(parser, cast->message_loc.start, cast->message_loc.end, source);
|
1428
|
+
|
1429
|
+
// opening_loc
|
1430
|
+
#line 176 "api_node.c.erb"
|
1431
|
+
argv[3] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
1432
|
+
|
1433
|
+
// arguments
|
1434
|
+
#line 148 "api_node.c.erb"
|
1435
|
+
argv[4] = rb_ary_pop(value_stack);
|
1436
|
+
|
1437
|
+
// closing_loc
|
1438
|
+
#line 176 "api_node.c.erb"
|
1439
|
+
argv[5] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
1440
|
+
|
1441
|
+
// flags
|
1442
|
+
#line 182 "api_node.c.erb"
|
1443
|
+
argv[6] = ULONG2NUM(node->flags >> 2);
|
1444
|
+
|
1445
|
+
// read_name
|
1446
|
+
#line 157 "api_node.c.erb"
|
1447
|
+
argv[7] = yp_string_new(&cast->read_name, encoding);
|
1448
|
+
|
1449
|
+
// write_name
|
1450
|
+
#line 157 "api_node.c.erb"
|
1451
|
+
argv[8] = yp_string_new(&cast->write_name, encoding);
|
1452
|
+
|
1453
|
+
// operator_loc
|
1454
|
+
#line 173 "api_node.c.erb"
|
1455
|
+
argv[9] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1456
|
+
|
1457
|
+
// value
|
1458
|
+
#line 148 "api_node.c.erb"
|
1459
|
+
argv[10] = rb_ary_pop(value_stack);
|
1460
|
+
|
1461
|
+
// location
|
1462
|
+
argv[11] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1463
|
+
|
1464
|
+
rb_ary_push(value_stack, rb_class_new_instance(12, argv, rb_cYARPCallAndWriteNode));
|
1465
|
+
break;
|
1466
|
+
}
|
1467
|
+
#line 137 "api_node.c.erb"
|
1468
|
+
case YP_CALL_NODE: {
|
1279
1469
|
yp_call_node_t *cast = (yp_call_node_t *) node;
|
1280
1470
|
VALUE argv[10];
|
1281
1471
|
|
1282
1472
|
// receiver
|
1473
|
+
#line 148 "api_node.c.erb"
|
1283
1474
|
argv[0] = rb_ary_pop(value_stack);
|
1284
1475
|
|
1285
|
-
//
|
1286
|
-
|
1476
|
+
// call_operator_loc
|
1477
|
+
#line 176 "api_node.c.erb"
|
1478
|
+
argv[1] = cast->call_operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->call_operator_loc.start, cast->call_operator_loc.end, source);
|
1287
1479
|
|
1288
1480
|
// message_loc
|
1481
|
+
#line 176 "api_node.c.erb"
|
1289
1482
|
argv[2] = cast->message_loc.start == NULL ? Qnil : yp_location_new(parser, cast->message_loc.start, cast->message_loc.end, source);
|
1290
1483
|
|
1291
1484
|
// opening_loc
|
1485
|
+
#line 176 "api_node.c.erb"
|
1292
1486
|
argv[3] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
1293
1487
|
|
1294
1488
|
// arguments
|
1489
|
+
#line 148 "api_node.c.erb"
|
1295
1490
|
argv[4] = rb_ary_pop(value_stack);
|
1296
1491
|
|
1297
1492
|
// closing_loc
|
1493
|
+
#line 176 "api_node.c.erb"
|
1298
1494
|
argv[5] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
1299
1495
|
|
1300
1496
|
// block
|
1497
|
+
#line 148 "api_node.c.erb"
|
1301
1498
|
argv[6] = rb_ary_pop(value_stack);
|
1302
1499
|
|
1303
1500
|
// flags
|
1304
|
-
|
1501
|
+
#line 182 "api_node.c.erb"
|
1502
|
+
argv[7] = ULONG2NUM(node->flags >> 2);
|
1305
1503
|
|
1306
1504
|
// name
|
1505
|
+
#line 157 "api_node.c.erb"
|
1307
1506
|
argv[8] = yp_string_new(&cast->name, encoding);
|
1308
1507
|
|
1309
1508
|
// location
|
@@ -1313,80 +1512,135 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1313
1512
|
break;
|
1314
1513
|
}
|
1315
1514
|
#line 137 "api_node.c.erb"
|
1316
|
-
case
|
1317
|
-
|
1318
|
-
VALUE argv[
|
1515
|
+
case YP_CALL_OPERATOR_WRITE_NODE: {
|
1516
|
+
yp_call_operator_write_node_t *cast = (yp_call_operator_write_node_t *) node;
|
1517
|
+
VALUE argv[13];
|
1319
1518
|
|
1320
|
-
//
|
1519
|
+
// receiver
|
1520
|
+
#line 148 "api_node.c.erb"
|
1321
1521
|
argv[0] = rb_ary_pop(value_stack);
|
1322
1522
|
|
1523
|
+
// call_operator_loc
|
1524
|
+
#line 176 "api_node.c.erb"
|
1525
|
+
argv[1] = cast->call_operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->call_operator_loc.start, cast->call_operator_loc.end, source);
|
1526
|
+
|
1527
|
+
// message_loc
|
1528
|
+
#line 176 "api_node.c.erb"
|
1529
|
+
argv[2] = cast->message_loc.start == NULL ? Qnil : yp_location_new(parser, cast->message_loc.start, cast->message_loc.end, source);
|
1530
|
+
|
1531
|
+
// opening_loc
|
1532
|
+
#line 176 "api_node.c.erb"
|
1533
|
+
argv[3] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
1534
|
+
|
1535
|
+
// arguments
|
1536
|
+
#line 148 "api_node.c.erb"
|
1537
|
+
argv[4] = rb_ary_pop(value_stack);
|
1538
|
+
|
1539
|
+
// closing_loc
|
1540
|
+
#line 176 "api_node.c.erb"
|
1541
|
+
argv[5] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
1542
|
+
|
1543
|
+
// flags
|
1544
|
+
#line 182 "api_node.c.erb"
|
1545
|
+
argv[6] = ULONG2NUM(node->flags >> 2);
|
1546
|
+
|
1547
|
+
// read_name
|
1548
|
+
#line 157 "api_node.c.erb"
|
1549
|
+
argv[7] = yp_string_new(&cast->read_name, encoding);
|
1550
|
+
|
1551
|
+
// write_name
|
1552
|
+
#line 157 "api_node.c.erb"
|
1553
|
+
argv[8] = yp_string_new(&cast->write_name, encoding);
|
1554
|
+
|
1555
|
+
// operator
|
1556
|
+
#line 160 "api_node.c.erb"
|
1557
|
+
assert(cast->operator != 0);
|
1558
|
+
argv[9] = rb_id2sym(constants[cast->operator - 1]);
|
1559
|
+
|
1323
1560
|
// operator_loc
|
1324
|
-
|
1561
|
+
#line 173 "api_node.c.erb"
|
1562
|
+
argv[10] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1325
1563
|
|
1326
1564
|
// value
|
1327
|
-
|
1565
|
+
#line 148 "api_node.c.erb"
|
1566
|
+
argv[11] = rb_ary_pop(value_stack);
|
1328
1567
|
|
1329
1568
|
// location
|
1330
|
-
argv[
|
1569
|
+
argv[12] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1331
1570
|
|
1332
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
1571
|
+
rb_ary_push(value_stack, rb_class_new_instance(13, argv, rb_cYARPCallOperatorWriteNode));
|
1333
1572
|
break;
|
1334
1573
|
}
|
1335
1574
|
#line 137 "api_node.c.erb"
|
1336
|
-
case
|
1337
|
-
|
1338
|
-
VALUE argv[
|
1575
|
+
case YP_CALL_OR_WRITE_NODE: {
|
1576
|
+
yp_call_or_write_node_t *cast = (yp_call_or_write_node_t *) node;
|
1577
|
+
VALUE argv[12];
|
1339
1578
|
|
1340
|
-
//
|
1579
|
+
// receiver
|
1580
|
+
#line 148 "api_node.c.erb"
|
1341
1581
|
argv[0] = rb_ary_pop(value_stack);
|
1342
1582
|
|
1343
|
-
//
|
1344
|
-
|
1583
|
+
// call_operator_loc
|
1584
|
+
#line 176 "api_node.c.erb"
|
1585
|
+
argv[1] = cast->call_operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->call_operator_loc.start, cast->call_operator_loc.end, source);
|
1345
1586
|
|
1346
|
-
//
|
1347
|
-
|
1587
|
+
// message_loc
|
1588
|
+
#line 176 "api_node.c.erb"
|
1589
|
+
argv[2] = cast->message_loc.start == NULL ? Qnil : yp_location_new(parser, cast->message_loc.start, cast->message_loc.end, source);
|
1348
1590
|
|
1349
|
-
//
|
1350
|
-
|
1591
|
+
// opening_loc
|
1592
|
+
#line 176 "api_node.c.erb"
|
1593
|
+
argv[3] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
1351
1594
|
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
#line 137 "api_node.c.erb"
|
1356
|
-
case YP_NODE_CALL_OPERATOR_WRITE_NODE: {
|
1357
|
-
yp_call_operator_write_node_t *cast = (yp_call_operator_write_node_t *) node;
|
1358
|
-
VALUE argv[5];
|
1595
|
+
// arguments
|
1596
|
+
#line 148 "api_node.c.erb"
|
1597
|
+
argv[4] = rb_ary_pop(value_stack);
|
1359
1598
|
|
1360
|
-
//
|
1361
|
-
|
1599
|
+
// closing_loc
|
1600
|
+
#line 176 "api_node.c.erb"
|
1601
|
+
argv[5] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
1602
|
+
|
1603
|
+
// flags
|
1604
|
+
#line 182 "api_node.c.erb"
|
1605
|
+
argv[6] = ULONG2NUM(node->flags >> 2);
|
1606
|
+
|
1607
|
+
// read_name
|
1608
|
+
#line 157 "api_node.c.erb"
|
1609
|
+
argv[7] = yp_string_new(&cast->read_name, encoding);
|
1610
|
+
|
1611
|
+
// write_name
|
1612
|
+
#line 157 "api_node.c.erb"
|
1613
|
+
argv[8] = yp_string_new(&cast->write_name, encoding);
|
1362
1614
|
|
1363
1615
|
// operator_loc
|
1364
|
-
|
1616
|
+
#line 173 "api_node.c.erb"
|
1617
|
+
argv[9] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1365
1618
|
|
1366
1619
|
// value
|
1367
|
-
|
1368
|
-
|
1369
|
-
// operator
|
1370
|
-
argv[3] = rb_id2sym(constants[cast->operator - 1]);
|
1620
|
+
#line 148 "api_node.c.erb"
|
1621
|
+
argv[10] = rb_ary_pop(value_stack);
|
1371
1622
|
|
1372
1623
|
// location
|
1373
|
-
argv[
|
1624
|
+
argv[11] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1374
1625
|
|
1375
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
1626
|
+
rb_ary_push(value_stack, rb_class_new_instance(12, argv, rb_cYARPCallOrWriteNode));
|
1376
1627
|
break;
|
1377
1628
|
}
|
1378
1629
|
#line 137 "api_node.c.erb"
|
1379
|
-
case
|
1630
|
+
case YP_CAPTURE_PATTERN_NODE: {
|
1380
1631
|
yp_capture_pattern_node_t *cast = (yp_capture_pattern_node_t *) node;
|
1381
1632
|
VALUE argv[4];
|
1382
1633
|
|
1383
1634
|
// value
|
1635
|
+
#line 148 "api_node.c.erb"
|
1384
1636
|
argv[0] = rb_ary_pop(value_stack);
|
1385
1637
|
|
1386
1638
|
// target
|
1639
|
+
#line 148 "api_node.c.erb"
|
1387
1640
|
argv[1] = rb_ary_pop(value_stack);
|
1388
1641
|
|
1389
1642
|
// operator_loc
|
1643
|
+
#line 173 "api_node.c.erb"
|
1390
1644
|
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1391
1645
|
|
1392
1646
|
// location
|
@@ -1396,26 +1650,31 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1396
1650
|
break;
|
1397
1651
|
}
|
1398
1652
|
#line 137 "api_node.c.erb"
|
1399
|
-
case
|
1653
|
+
case YP_CASE_NODE: {
|
1400
1654
|
yp_case_node_t *cast = (yp_case_node_t *) node;
|
1401
1655
|
VALUE argv[6];
|
1402
1656
|
|
1403
1657
|
// predicate
|
1658
|
+
#line 148 "api_node.c.erb"
|
1404
1659
|
argv[0] = rb_ary_pop(value_stack);
|
1405
1660
|
|
1406
1661
|
// conditions
|
1662
|
+
#line 151 "api_node.c.erb"
|
1407
1663
|
argv[1] = rb_ary_new_capa(cast->conditions.size);
|
1408
1664
|
for (size_t index = 0; index < cast->conditions.size; index++) {
|
1409
1665
|
rb_ary_push(argv[1], rb_ary_pop(value_stack));
|
1410
1666
|
}
|
1411
1667
|
|
1412
1668
|
// consequent
|
1669
|
+
#line 148 "api_node.c.erb"
|
1413
1670
|
argv[2] = rb_ary_pop(value_stack);
|
1414
1671
|
|
1415
1672
|
// case_keyword_loc
|
1673
|
+
#line 173 "api_node.c.erb"
|
1416
1674
|
argv[3] = yp_location_new(parser, cast->case_keyword_loc.start, cast->case_keyword_loc.end, source);
|
1417
1675
|
|
1418
1676
|
// end_keyword_loc
|
1677
|
+
#line 173 "api_node.c.erb"
|
1419
1678
|
argv[4] = yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
|
1420
1679
|
|
1421
1680
|
// location
|
@@ -1425,36 +1684,46 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1425
1684
|
break;
|
1426
1685
|
}
|
1427
1686
|
#line 137 "api_node.c.erb"
|
1428
|
-
case
|
1687
|
+
case YP_CLASS_NODE: {
|
1429
1688
|
yp_class_node_t *cast = (yp_class_node_t *) node;
|
1430
1689
|
VALUE argv[9];
|
1431
1690
|
|
1432
1691
|
// locals
|
1692
|
+
#line 166 "api_node.c.erb"
|
1433
1693
|
argv[0] = rb_ary_new_capa(cast->locals.size);
|
1434
1694
|
for (size_t index = 0; index < cast->locals.size; index++) {
|
1695
|
+
assert(cast->locals.ids[index] != 0);
|
1435
1696
|
rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
|
1436
1697
|
}
|
1437
1698
|
|
1438
1699
|
// class_keyword_loc
|
1700
|
+
#line 173 "api_node.c.erb"
|
1439
1701
|
argv[1] = yp_location_new(parser, cast->class_keyword_loc.start, cast->class_keyword_loc.end, source);
|
1440
1702
|
|
1441
1703
|
// constant_path
|
1704
|
+
#line 148 "api_node.c.erb"
|
1442
1705
|
argv[2] = rb_ary_pop(value_stack);
|
1443
1706
|
|
1444
1707
|
// inheritance_operator_loc
|
1708
|
+
#line 176 "api_node.c.erb"
|
1445
1709
|
argv[3] = cast->inheritance_operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->inheritance_operator_loc.start, cast->inheritance_operator_loc.end, source);
|
1446
1710
|
|
1447
1711
|
// superclass
|
1712
|
+
#line 148 "api_node.c.erb"
|
1448
1713
|
argv[4] = rb_ary_pop(value_stack);
|
1449
1714
|
|
1450
1715
|
// body
|
1716
|
+
#line 148 "api_node.c.erb"
|
1451
1717
|
argv[5] = rb_ary_pop(value_stack);
|
1452
1718
|
|
1453
1719
|
// end_keyword_loc
|
1720
|
+
#line 173 "api_node.c.erb"
|
1454
1721
|
argv[6] = yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
|
1455
1722
|
|
1456
1723
|
// name
|
1457
|
-
|
1724
|
+
#line 160 "api_node.c.erb"
|
1725
|
+
assert(cast->name != 0);
|
1726
|
+
argv[7] = rb_id2sym(constants[cast->name - 1]);
|
1458
1727
|
|
1459
1728
|
// location
|
1460
1729
|
argv[8] = yp_location_new(parser, node->location.start, node->location.end, source);
|
@@ -1463,20 +1732,25 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1463
1732
|
break;
|
1464
1733
|
}
|
1465
1734
|
#line 137 "api_node.c.erb"
|
1466
|
-
case
|
1735
|
+
case YP_CLASS_VARIABLE_AND_WRITE_NODE: {
|
1467
1736
|
yp_class_variable_and_write_node_t *cast = (yp_class_variable_and_write_node_t *) node;
|
1468
1737
|
VALUE argv[5];
|
1469
1738
|
|
1470
1739
|
// name
|
1740
|
+
#line 160 "api_node.c.erb"
|
1741
|
+
assert(cast->name != 0);
|
1471
1742
|
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1472
1743
|
|
1473
1744
|
// name_loc
|
1745
|
+
#line 173 "api_node.c.erb"
|
1474
1746
|
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
1475
1747
|
|
1476
1748
|
// operator_loc
|
1749
|
+
#line 173 "api_node.c.erb"
|
1477
1750
|
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1478
1751
|
|
1479
1752
|
// value
|
1753
|
+
#line 148 "api_node.c.erb"
|
1480
1754
|
argv[3] = rb_ary_pop(value_stack);
|
1481
1755
|
|
1482
1756
|
// location
|
@@ -1486,23 +1760,30 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1486
1760
|
break;
|
1487
1761
|
}
|
1488
1762
|
#line 137 "api_node.c.erb"
|
1489
|
-
case
|
1763
|
+
case YP_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
|
1490
1764
|
yp_class_variable_operator_write_node_t *cast = (yp_class_variable_operator_write_node_t *) node;
|
1491
1765
|
VALUE argv[6];
|
1492
1766
|
|
1493
1767
|
// name
|
1768
|
+
#line 160 "api_node.c.erb"
|
1769
|
+
assert(cast->name != 0);
|
1494
1770
|
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1495
1771
|
|
1496
1772
|
// name_loc
|
1773
|
+
#line 173 "api_node.c.erb"
|
1497
1774
|
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
1498
1775
|
|
1499
1776
|
// operator_loc
|
1777
|
+
#line 173 "api_node.c.erb"
|
1500
1778
|
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1501
1779
|
|
1502
1780
|
// value
|
1781
|
+
#line 148 "api_node.c.erb"
|
1503
1782
|
argv[3] = rb_ary_pop(value_stack);
|
1504
1783
|
|
1505
1784
|
// operator
|
1785
|
+
#line 160 "api_node.c.erb"
|
1786
|
+
assert(cast->operator != 0);
|
1506
1787
|
argv[4] = rb_id2sym(constants[cast->operator - 1]);
|
1507
1788
|
|
1508
1789
|
// location
|
@@ -1512,20 +1793,25 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1512
1793
|
break;
|
1513
1794
|
}
|
1514
1795
|
#line 137 "api_node.c.erb"
|
1515
|
-
case
|
1796
|
+
case YP_CLASS_VARIABLE_OR_WRITE_NODE: {
|
1516
1797
|
yp_class_variable_or_write_node_t *cast = (yp_class_variable_or_write_node_t *) node;
|
1517
1798
|
VALUE argv[5];
|
1518
1799
|
|
1519
1800
|
// name
|
1801
|
+
#line 160 "api_node.c.erb"
|
1802
|
+
assert(cast->name != 0);
|
1520
1803
|
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1521
1804
|
|
1522
1805
|
// name_loc
|
1806
|
+
#line 173 "api_node.c.erb"
|
1523
1807
|
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
1524
1808
|
|
1525
1809
|
// operator_loc
|
1810
|
+
#line 173 "api_node.c.erb"
|
1526
1811
|
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1527
1812
|
|
1528
1813
|
// value
|
1814
|
+
#line 148 "api_node.c.erb"
|
1529
1815
|
argv[3] = rb_ary_pop(value_stack);
|
1530
1816
|
|
1531
1817
|
// location
|
@@ -1535,11 +1821,13 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1535
1821
|
break;
|
1536
1822
|
}
|
1537
1823
|
#line 137 "api_node.c.erb"
|
1538
|
-
case
|
1824
|
+
case YP_CLASS_VARIABLE_READ_NODE: {
|
1539
1825
|
yp_class_variable_read_node_t *cast = (yp_class_variable_read_node_t *) node;
|
1540
1826
|
VALUE argv[2];
|
1541
1827
|
|
1542
1828
|
// name
|
1829
|
+
#line 160 "api_node.c.erb"
|
1830
|
+
assert(cast->name != 0);
|
1543
1831
|
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1544
1832
|
|
1545
1833
|
// location
|
@@ -1549,11 +1837,13 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1549
1837
|
break;
|
1550
1838
|
}
|
1551
1839
|
#line 137 "api_node.c.erb"
|
1552
|
-
case
|
1840
|
+
case YP_CLASS_VARIABLE_TARGET_NODE: {
|
1553
1841
|
yp_class_variable_target_node_t *cast = (yp_class_variable_target_node_t *) node;
|
1554
1842
|
VALUE argv[2];
|
1555
1843
|
|
1556
1844
|
// name
|
1845
|
+
#line 160 "api_node.c.erb"
|
1846
|
+
assert(cast->name != 0);
|
1557
1847
|
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1558
1848
|
|
1559
1849
|
// location
|
@@ -1563,20 +1853,25 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1563
1853
|
break;
|
1564
1854
|
}
|
1565
1855
|
#line 137 "api_node.c.erb"
|
1566
|
-
case
|
1856
|
+
case YP_CLASS_VARIABLE_WRITE_NODE: {
|
1567
1857
|
yp_class_variable_write_node_t *cast = (yp_class_variable_write_node_t *) node;
|
1568
1858
|
VALUE argv[5];
|
1569
1859
|
|
1570
1860
|
// name
|
1861
|
+
#line 160 "api_node.c.erb"
|
1862
|
+
assert(cast->name != 0);
|
1571
1863
|
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1572
1864
|
|
1573
1865
|
// name_loc
|
1866
|
+
#line 173 "api_node.c.erb"
|
1574
1867
|
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
1575
1868
|
|
1576
1869
|
// value
|
1870
|
+
#line 148 "api_node.c.erb"
|
1577
1871
|
argv[2] = rb_ary_pop(value_stack);
|
1578
1872
|
|
1579
1873
|
// operator_loc
|
1874
|
+
#line 176 "api_node.c.erb"
|
1580
1875
|
argv[3] = cast->operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1581
1876
|
|
1582
1877
|
// location
|
@@ -1586,80 +1881,109 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1586
1881
|
break;
|
1587
1882
|
}
|
1588
1883
|
#line 137 "api_node.c.erb"
|
1589
|
-
case
|
1884
|
+
case YP_CONSTANT_AND_WRITE_NODE: {
|
1590
1885
|
yp_constant_and_write_node_t *cast = (yp_constant_and_write_node_t *) node;
|
1591
|
-
VALUE argv[
|
1886
|
+
VALUE argv[5];
|
1887
|
+
|
1888
|
+
// name
|
1889
|
+
#line 160 "api_node.c.erb"
|
1890
|
+
assert(cast->name != 0);
|
1891
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1592
1892
|
|
1593
1893
|
// name_loc
|
1594
|
-
|
1894
|
+
#line 173 "api_node.c.erb"
|
1895
|
+
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
1595
1896
|
|
1596
1897
|
// operator_loc
|
1597
|
-
|
1898
|
+
#line 173 "api_node.c.erb"
|
1899
|
+
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1598
1900
|
|
1599
1901
|
// value
|
1600
|
-
|
1902
|
+
#line 148 "api_node.c.erb"
|
1903
|
+
argv[3] = rb_ary_pop(value_stack);
|
1601
1904
|
|
1602
1905
|
// location
|
1603
|
-
argv[
|
1906
|
+
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1604
1907
|
|
1605
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
1908
|
+
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPConstantAndWriteNode));
|
1606
1909
|
break;
|
1607
1910
|
}
|
1608
1911
|
#line 137 "api_node.c.erb"
|
1609
|
-
case
|
1912
|
+
case YP_CONSTANT_OPERATOR_WRITE_NODE: {
|
1610
1913
|
yp_constant_operator_write_node_t *cast = (yp_constant_operator_write_node_t *) node;
|
1611
|
-
VALUE argv[
|
1914
|
+
VALUE argv[6];
|
1915
|
+
|
1916
|
+
// name
|
1917
|
+
#line 160 "api_node.c.erb"
|
1918
|
+
assert(cast->name != 0);
|
1919
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1612
1920
|
|
1613
1921
|
// name_loc
|
1614
|
-
|
1922
|
+
#line 173 "api_node.c.erb"
|
1923
|
+
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
1615
1924
|
|
1616
1925
|
// operator_loc
|
1617
|
-
|
1926
|
+
#line 173 "api_node.c.erb"
|
1927
|
+
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1618
1928
|
|
1619
1929
|
// value
|
1620
|
-
|
1930
|
+
#line 148 "api_node.c.erb"
|
1931
|
+
argv[3] = rb_ary_pop(value_stack);
|
1621
1932
|
|
1622
1933
|
// operator
|
1623
|
-
|
1934
|
+
#line 160 "api_node.c.erb"
|
1935
|
+
assert(cast->operator != 0);
|
1936
|
+
argv[4] = rb_id2sym(constants[cast->operator - 1]);
|
1624
1937
|
|
1625
1938
|
// location
|
1626
|
-
argv[
|
1939
|
+
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1627
1940
|
|
1628
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
1941
|
+
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPConstantOperatorWriteNode));
|
1629
1942
|
break;
|
1630
1943
|
}
|
1631
1944
|
#line 137 "api_node.c.erb"
|
1632
|
-
case
|
1945
|
+
case YP_CONSTANT_OR_WRITE_NODE: {
|
1633
1946
|
yp_constant_or_write_node_t *cast = (yp_constant_or_write_node_t *) node;
|
1634
|
-
VALUE argv[
|
1947
|
+
VALUE argv[5];
|
1948
|
+
|
1949
|
+
// name
|
1950
|
+
#line 160 "api_node.c.erb"
|
1951
|
+
assert(cast->name != 0);
|
1952
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1635
1953
|
|
1636
1954
|
// name_loc
|
1637
|
-
|
1955
|
+
#line 173 "api_node.c.erb"
|
1956
|
+
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
1638
1957
|
|
1639
1958
|
// operator_loc
|
1640
|
-
|
1959
|
+
#line 173 "api_node.c.erb"
|
1960
|
+
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1641
1961
|
|
1642
1962
|
// value
|
1643
|
-
|
1963
|
+
#line 148 "api_node.c.erb"
|
1964
|
+
argv[3] = rb_ary_pop(value_stack);
|
1644
1965
|
|
1645
1966
|
// location
|
1646
|
-
argv[
|
1967
|
+
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1647
1968
|
|
1648
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
1969
|
+
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPConstantOrWriteNode));
|
1649
1970
|
break;
|
1650
1971
|
}
|
1651
1972
|
#line 137 "api_node.c.erb"
|
1652
|
-
case
|
1973
|
+
case YP_CONSTANT_PATH_AND_WRITE_NODE: {
|
1653
1974
|
yp_constant_path_and_write_node_t *cast = (yp_constant_path_and_write_node_t *) node;
|
1654
1975
|
VALUE argv[4];
|
1655
1976
|
|
1656
1977
|
// target
|
1978
|
+
#line 148 "api_node.c.erb"
|
1657
1979
|
argv[0] = rb_ary_pop(value_stack);
|
1658
1980
|
|
1659
1981
|
// operator_loc
|
1982
|
+
#line 173 "api_node.c.erb"
|
1660
1983
|
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1661
1984
|
|
1662
1985
|
// value
|
1986
|
+
#line 148 "api_node.c.erb"
|
1663
1987
|
argv[2] = rb_ary_pop(value_stack);
|
1664
1988
|
|
1665
1989
|
// location
|
@@ -1669,17 +1993,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1669
1993
|
break;
|
1670
1994
|
}
|
1671
1995
|
#line 137 "api_node.c.erb"
|
1672
|
-
case
|
1996
|
+
case YP_CONSTANT_PATH_NODE: {
|
1673
1997
|
yp_constant_path_node_t *cast = (yp_constant_path_node_t *) node;
|
1674
1998
|
VALUE argv[4];
|
1675
1999
|
|
1676
2000
|
// parent
|
2001
|
+
#line 148 "api_node.c.erb"
|
1677
2002
|
argv[0] = rb_ary_pop(value_stack);
|
1678
2003
|
|
1679
2004
|
// child
|
2005
|
+
#line 148 "api_node.c.erb"
|
1680
2006
|
argv[1] = rb_ary_pop(value_stack);
|
1681
2007
|
|
1682
2008
|
// delimiter_loc
|
2009
|
+
#line 173 "api_node.c.erb"
|
1683
2010
|
argv[2] = yp_location_new(parser, cast->delimiter_loc.start, cast->delimiter_loc.end, source);
|
1684
2011
|
|
1685
2012
|
// location
|
@@ -1689,20 +2016,25 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1689
2016
|
break;
|
1690
2017
|
}
|
1691
2018
|
#line 137 "api_node.c.erb"
|
1692
|
-
case
|
2019
|
+
case YP_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
|
1693
2020
|
yp_constant_path_operator_write_node_t *cast = (yp_constant_path_operator_write_node_t *) node;
|
1694
2021
|
VALUE argv[5];
|
1695
2022
|
|
1696
2023
|
// target
|
2024
|
+
#line 148 "api_node.c.erb"
|
1697
2025
|
argv[0] = rb_ary_pop(value_stack);
|
1698
2026
|
|
1699
2027
|
// operator_loc
|
2028
|
+
#line 173 "api_node.c.erb"
|
1700
2029
|
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1701
2030
|
|
1702
2031
|
// value
|
2032
|
+
#line 148 "api_node.c.erb"
|
1703
2033
|
argv[2] = rb_ary_pop(value_stack);
|
1704
2034
|
|
1705
2035
|
// operator
|
2036
|
+
#line 160 "api_node.c.erb"
|
2037
|
+
assert(cast->operator != 0);
|
1706
2038
|
argv[3] = rb_id2sym(constants[cast->operator - 1]);
|
1707
2039
|
|
1708
2040
|
// location
|
@@ -1712,17 +2044,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1712
2044
|
break;
|
1713
2045
|
}
|
1714
2046
|
#line 137 "api_node.c.erb"
|
1715
|
-
case
|
2047
|
+
case YP_CONSTANT_PATH_OR_WRITE_NODE: {
|
1716
2048
|
yp_constant_path_or_write_node_t *cast = (yp_constant_path_or_write_node_t *) node;
|
1717
2049
|
VALUE argv[4];
|
1718
2050
|
|
1719
2051
|
// target
|
2052
|
+
#line 148 "api_node.c.erb"
|
1720
2053
|
argv[0] = rb_ary_pop(value_stack);
|
1721
2054
|
|
1722
2055
|
// operator_loc
|
2056
|
+
#line 173 "api_node.c.erb"
|
1723
2057
|
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1724
2058
|
|
1725
2059
|
// value
|
2060
|
+
#line 148 "api_node.c.erb"
|
1726
2061
|
argv[2] = rb_ary_pop(value_stack);
|
1727
2062
|
|
1728
2063
|
// location
|
@@ -1732,17 +2067,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1732
2067
|
break;
|
1733
2068
|
}
|
1734
2069
|
#line 137 "api_node.c.erb"
|
1735
|
-
case
|
2070
|
+
case YP_CONSTANT_PATH_TARGET_NODE: {
|
1736
2071
|
yp_constant_path_target_node_t *cast = (yp_constant_path_target_node_t *) node;
|
1737
2072
|
VALUE argv[4];
|
1738
2073
|
|
1739
2074
|
// parent
|
2075
|
+
#line 148 "api_node.c.erb"
|
1740
2076
|
argv[0] = rb_ary_pop(value_stack);
|
1741
2077
|
|
1742
2078
|
// child
|
2079
|
+
#line 148 "api_node.c.erb"
|
1743
2080
|
argv[1] = rb_ary_pop(value_stack);
|
1744
2081
|
|
1745
2082
|
// delimiter_loc
|
2083
|
+
#line 173 "api_node.c.erb"
|
1746
2084
|
argv[2] = yp_location_new(parser, cast->delimiter_loc.start, cast->delimiter_loc.end, source);
|
1747
2085
|
|
1748
2086
|
// location
|
@@ -1752,17 +2090,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1752
2090
|
break;
|
1753
2091
|
}
|
1754
2092
|
#line 137 "api_node.c.erb"
|
1755
|
-
case
|
2093
|
+
case YP_CONSTANT_PATH_WRITE_NODE: {
|
1756
2094
|
yp_constant_path_write_node_t *cast = (yp_constant_path_write_node_t *) node;
|
1757
2095
|
VALUE argv[4];
|
1758
2096
|
|
1759
2097
|
// target
|
2098
|
+
#line 148 "api_node.c.erb"
|
1760
2099
|
argv[0] = rb_ary_pop(value_stack);
|
1761
2100
|
|
1762
2101
|
// operator_loc
|
2102
|
+
#line 173 "api_node.c.erb"
|
1763
2103
|
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1764
2104
|
|
1765
2105
|
// value
|
2106
|
+
#line 148 "api_node.c.erb"
|
1766
2107
|
argv[2] = rb_ary_pop(value_stack);
|
1767
2108
|
|
1768
2109
|
// location
|
@@ -1772,107 +2113,148 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1772
2113
|
break;
|
1773
2114
|
}
|
1774
2115
|
#line 137 "api_node.c.erb"
|
1775
|
-
case
|
1776
|
-
|
2116
|
+
case YP_CONSTANT_READ_NODE: {
|
2117
|
+
yp_constant_read_node_t *cast = (yp_constant_read_node_t *) node;
|
2118
|
+
VALUE argv[2];
|
2119
|
+
|
2120
|
+
// name
|
2121
|
+
#line 160 "api_node.c.erb"
|
2122
|
+
assert(cast->name != 0);
|
2123
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1777
2124
|
|
1778
2125
|
// location
|
1779
|
-
argv[
|
2126
|
+
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1780
2127
|
|
1781
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
2128
|
+
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPConstantReadNode));
|
1782
2129
|
break;
|
1783
2130
|
}
|
1784
2131
|
#line 137 "api_node.c.erb"
|
1785
|
-
case
|
1786
|
-
|
2132
|
+
case YP_CONSTANT_TARGET_NODE: {
|
2133
|
+
yp_constant_target_node_t *cast = (yp_constant_target_node_t *) node;
|
2134
|
+
VALUE argv[2];
|
2135
|
+
|
2136
|
+
// name
|
2137
|
+
#line 160 "api_node.c.erb"
|
2138
|
+
assert(cast->name != 0);
|
2139
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1787
2140
|
|
1788
2141
|
// location
|
1789
|
-
argv[
|
2142
|
+
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1790
2143
|
|
1791
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
2144
|
+
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPConstantTargetNode));
|
1792
2145
|
break;
|
1793
2146
|
}
|
1794
2147
|
#line 137 "api_node.c.erb"
|
1795
|
-
case
|
2148
|
+
case YP_CONSTANT_WRITE_NODE: {
|
1796
2149
|
yp_constant_write_node_t *cast = (yp_constant_write_node_t *) node;
|
1797
|
-
VALUE argv[
|
2150
|
+
VALUE argv[5];
|
2151
|
+
|
2152
|
+
// name
|
2153
|
+
#line 160 "api_node.c.erb"
|
2154
|
+
assert(cast->name != 0);
|
2155
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1798
2156
|
|
1799
2157
|
// name_loc
|
1800
|
-
|
2158
|
+
#line 173 "api_node.c.erb"
|
2159
|
+
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
1801
2160
|
|
1802
2161
|
// value
|
1803
|
-
|
2162
|
+
#line 148 "api_node.c.erb"
|
2163
|
+
argv[2] = rb_ary_pop(value_stack);
|
1804
2164
|
|
1805
2165
|
// operator_loc
|
1806
|
-
|
2166
|
+
#line 173 "api_node.c.erb"
|
2167
|
+
argv[3] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1807
2168
|
|
1808
2169
|
// location
|
1809
|
-
argv[
|
2170
|
+
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1810
2171
|
|
1811
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
2172
|
+
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPConstantWriteNode));
|
1812
2173
|
break;
|
1813
2174
|
}
|
1814
2175
|
#line 137 "api_node.c.erb"
|
1815
|
-
case
|
2176
|
+
case YP_DEF_NODE: {
|
1816
2177
|
yp_def_node_t *cast = (yp_def_node_t *) node;
|
1817
|
-
VALUE argv[
|
2178
|
+
VALUE argv[13];
|
2179
|
+
|
2180
|
+
// name
|
2181
|
+
#line 160 "api_node.c.erb"
|
2182
|
+
assert(cast->name != 0);
|
2183
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1818
2184
|
|
1819
2185
|
// name_loc
|
1820
|
-
|
2186
|
+
#line 173 "api_node.c.erb"
|
2187
|
+
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
1821
2188
|
|
1822
2189
|
// receiver
|
1823
|
-
|
2190
|
+
#line 148 "api_node.c.erb"
|
2191
|
+
argv[2] = rb_ary_pop(value_stack);
|
1824
2192
|
|
1825
2193
|
// parameters
|
1826
|
-
|
2194
|
+
#line 148 "api_node.c.erb"
|
2195
|
+
argv[3] = rb_ary_pop(value_stack);
|
1827
2196
|
|
1828
2197
|
// body
|
1829
|
-
|
2198
|
+
#line 148 "api_node.c.erb"
|
2199
|
+
argv[4] = rb_ary_pop(value_stack);
|
1830
2200
|
|
1831
2201
|
// locals
|
1832
|
-
|
2202
|
+
#line 166 "api_node.c.erb"
|
2203
|
+
argv[5] = rb_ary_new_capa(cast->locals.size);
|
1833
2204
|
for (size_t index = 0; index < cast->locals.size; index++) {
|
1834
|
-
|
2205
|
+
assert(cast->locals.ids[index] != 0);
|
2206
|
+
rb_ary_push(argv[5], rb_id2sym(constants[cast->locals.ids[index] - 1]));
|
1835
2207
|
}
|
1836
2208
|
|
1837
2209
|
// def_keyword_loc
|
1838
|
-
|
2210
|
+
#line 173 "api_node.c.erb"
|
2211
|
+
argv[6] = yp_location_new(parser, cast->def_keyword_loc.start, cast->def_keyword_loc.end, source);
|
1839
2212
|
|
1840
2213
|
// operator_loc
|
1841
|
-
|
2214
|
+
#line 176 "api_node.c.erb"
|
2215
|
+
argv[7] = cast->operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1842
2216
|
|
1843
2217
|
// lparen_loc
|
1844
|
-
|
2218
|
+
#line 176 "api_node.c.erb"
|
2219
|
+
argv[8] = cast->lparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
|
1845
2220
|
|
1846
2221
|
// rparen_loc
|
1847
|
-
|
2222
|
+
#line 176 "api_node.c.erb"
|
2223
|
+
argv[9] = cast->rparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
|
1848
2224
|
|
1849
2225
|
// equal_loc
|
1850
|
-
|
2226
|
+
#line 176 "api_node.c.erb"
|
2227
|
+
argv[10] = cast->equal_loc.start == NULL ? Qnil : yp_location_new(parser, cast->equal_loc.start, cast->equal_loc.end, source);
|
1851
2228
|
|
1852
2229
|
// end_keyword_loc
|
1853
|
-
|
2230
|
+
#line 176 "api_node.c.erb"
|
2231
|
+
argv[11] = cast->end_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
|
1854
2232
|
|
1855
2233
|
// location
|
1856
|
-
argv[
|
2234
|
+
argv[12] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1857
2235
|
|
1858
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
2236
|
+
rb_ary_push(value_stack, rb_class_new_instance(13, argv, rb_cYARPDefNode));
|
1859
2237
|
break;
|
1860
2238
|
}
|
1861
2239
|
#line 137 "api_node.c.erb"
|
1862
|
-
case
|
2240
|
+
case YP_DEFINED_NODE: {
|
1863
2241
|
yp_defined_node_t *cast = (yp_defined_node_t *) node;
|
1864
2242
|
VALUE argv[5];
|
1865
2243
|
|
1866
2244
|
// lparen_loc
|
2245
|
+
#line 176 "api_node.c.erb"
|
1867
2246
|
argv[0] = cast->lparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
|
1868
2247
|
|
1869
2248
|
// value
|
2249
|
+
#line 148 "api_node.c.erb"
|
1870
2250
|
argv[1] = rb_ary_pop(value_stack);
|
1871
2251
|
|
1872
2252
|
// rparen_loc
|
2253
|
+
#line 176 "api_node.c.erb"
|
1873
2254
|
argv[2] = cast->rparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
|
1874
2255
|
|
1875
2256
|
// keyword_loc
|
2257
|
+
#line 173 "api_node.c.erb"
|
1876
2258
|
argv[3] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
|
1877
2259
|
|
1878
2260
|
// location
|
@@ -1882,17 +2264,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1882
2264
|
break;
|
1883
2265
|
}
|
1884
2266
|
#line 137 "api_node.c.erb"
|
1885
|
-
case
|
2267
|
+
case YP_ELSE_NODE: {
|
1886
2268
|
yp_else_node_t *cast = (yp_else_node_t *) node;
|
1887
2269
|
VALUE argv[4];
|
1888
2270
|
|
1889
2271
|
// else_keyword_loc
|
2272
|
+
#line 173 "api_node.c.erb"
|
1890
2273
|
argv[0] = yp_location_new(parser, cast->else_keyword_loc.start, cast->else_keyword_loc.end, source);
|
1891
2274
|
|
1892
2275
|
// statements
|
2276
|
+
#line 148 "api_node.c.erb"
|
1893
2277
|
argv[1] = rb_ary_pop(value_stack);
|
1894
2278
|
|
1895
2279
|
// end_keyword_loc
|
2280
|
+
#line 176 "api_node.c.erb"
|
1896
2281
|
argv[2] = cast->end_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
|
1897
2282
|
|
1898
2283
|
// location
|
@@ -1902,17 +2287,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1902
2287
|
break;
|
1903
2288
|
}
|
1904
2289
|
#line 137 "api_node.c.erb"
|
1905
|
-
case
|
2290
|
+
case YP_EMBEDDED_STATEMENTS_NODE: {
|
1906
2291
|
yp_embedded_statements_node_t *cast = (yp_embedded_statements_node_t *) node;
|
1907
2292
|
VALUE argv[4];
|
1908
2293
|
|
1909
2294
|
// opening_loc
|
2295
|
+
#line 173 "api_node.c.erb"
|
1910
2296
|
argv[0] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
1911
2297
|
|
1912
2298
|
// statements
|
2299
|
+
#line 148 "api_node.c.erb"
|
1913
2300
|
argv[1] = rb_ary_pop(value_stack);
|
1914
2301
|
|
1915
2302
|
// closing_loc
|
2303
|
+
#line 173 "api_node.c.erb"
|
1916
2304
|
argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
1917
2305
|
|
1918
2306
|
// location
|
@@ -1922,14 +2310,16 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1922
2310
|
break;
|
1923
2311
|
}
|
1924
2312
|
#line 137 "api_node.c.erb"
|
1925
|
-
case
|
2313
|
+
case YP_EMBEDDED_VARIABLE_NODE: {
|
1926
2314
|
yp_embedded_variable_node_t *cast = (yp_embedded_variable_node_t *) node;
|
1927
2315
|
VALUE argv[3];
|
1928
2316
|
|
1929
2317
|
// operator_loc
|
2318
|
+
#line 173 "api_node.c.erb"
|
1930
2319
|
argv[0] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1931
2320
|
|
1932
2321
|
// variable
|
2322
|
+
#line 148 "api_node.c.erb"
|
1933
2323
|
argv[1] = rb_ary_pop(value_stack);
|
1934
2324
|
|
1935
2325
|
// location
|
@@ -1939,17 +2329,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1939
2329
|
break;
|
1940
2330
|
}
|
1941
2331
|
#line 137 "api_node.c.erb"
|
1942
|
-
case
|
2332
|
+
case YP_ENSURE_NODE: {
|
1943
2333
|
yp_ensure_node_t *cast = (yp_ensure_node_t *) node;
|
1944
2334
|
VALUE argv[4];
|
1945
2335
|
|
1946
2336
|
// ensure_keyword_loc
|
2337
|
+
#line 173 "api_node.c.erb"
|
1947
2338
|
argv[0] = yp_location_new(parser, cast->ensure_keyword_loc.start, cast->ensure_keyword_loc.end, source);
|
1948
2339
|
|
1949
2340
|
// statements
|
2341
|
+
#line 148 "api_node.c.erb"
|
1950
2342
|
argv[1] = rb_ary_pop(value_stack);
|
1951
2343
|
|
1952
2344
|
// end_keyword_loc
|
2345
|
+
#line 173 "api_node.c.erb"
|
1953
2346
|
argv[2] = yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
|
1954
2347
|
|
1955
2348
|
// location
|
@@ -1959,7 +2352,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1959
2352
|
break;
|
1960
2353
|
}
|
1961
2354
|
#line 137 "api_node.c.erb"
|
1962
|
-
case
|
2355
|
+
case YP_FALSE_NODE: {
|
1963
2356
|
VALUE argv[1];
|
1964
2357
|
|
1965
2358
|
// location
|
@@ -1969,29 +2362,35 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1969
2362
|
break;
|
1970
2363
|
}
|
1971
2364
|
#line 137 "api_node.c.erb"
|
1972
|
-
case
|
2365
|
+
case YP_FIND_PATTERN_NODE: {
|
1973
2366
|
yp_find_pattern_node_t *cast = (yp_find_pattern_node_t *) node;
|
1974
2367
|
VALUE argv[7];
|
1975
2368
|
|
1976
2369
|
// constant
|
2370
|
+
#line 148 "api_node.c.erb"
|
1977
2371
|
argv[0] = rb_ary_pop(value_stack);
|
1978
2372
|
|
1979
2373
|
// left
|
2374
|
+
#line 148 "api_node.c.erb"
|
1980
2375
|
argv[1] = rb_ary_pop(value_stack);
|
1981
2376
|
|
1982
2377
|
// requireds
|
2378
|
+
#line 151 "api_node.c.erb"
|
1983
2379
|
argv[2] = rb_ary_new_capa(cast->requireds.size);
|
1984
2380
|
for (size_t index = 0; index < cast->requireds.size; index++) {
|
1985
2381
|
rb_ary_push(argv[2], rb_ary_pop(value_stack));
|
1986
2382
|
}
|
1987
2383
|
|
1988
2384
|
// right
|
2385
|
+
#line 148 "api_node.c.erb"
|
1989
2386
|
argv[3] = rb_ary_pop(value_stack);
|
1990
2387
|
|
1991
2388
|
// opening_loc
|
2389
|
+
#line 176 "api_node.c.erb"
|
1992
2390
|
argv[4] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
1993
2391
|
|
1994
2392
|
// closing_loc
|
2393
|
+
#line 176 "api_node.c.erb"
|
1995
2394
|
argv[5] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
1996
2395
|
|
1997
2396
|
// location
|
@@ -2001,21 +2400,25 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2001
2400
|
break;
|
2002
2401
|
}
|
2003
2402
|
#line 137 "api_node.c.erb"
|
2004
|
-
case
|
2403
|
+
case YP_FLIP_FLOP_NODE: {
|
2005
2404
|
yp_flip_flop_node_t *cast = (yp_flip_flop_node_t *) node;
|
2006
2405
|
VALUE argv[5];
|
2007
2406
|
|
2008
2407
|
// left
|
2408
|
+
#line 148 "api_node.c.erb"
|
2009
2409
|
argv[0] = rb_ary_pop(value_stack);
|
2010
2410
|
|
2011
2411
|
// right
|
2412
|
+
#line 148 "api_node.c.erb"
|
2012
2413
|
argv[1] = rb_ary_pop(value_stack);
|
2013
2414
|
|
2014
2415
|
// operator_loc
|
2416
|
+
#line 173 "api_node.c.erb"
|
2015
2417
|
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2016
2418
|
|
2017
2419
|
// flags
|
2018
|
-
|
2420
|
+
#line 182 "api_node.c.erb"
|
2421
|
+
argv[3] = ULONG2NUM(node->flags >> 2);
|
2019
2422
|
|
2020
2423
|
// location
|
2021
2424
|
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
|
@@ -2024,7 +2427,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2024
2427
|
break;
|
2025
2428
|
}
|
2026
2429
|
#line 137 "api_node.c.erb"
|
2027
|
-
case
|
2430
|
+
case YP_FLOAT_NODE: {
|
2028
2431
|
VALUE argv[1];
|
2029
2432
|
|
2030
2433
|
// location
|
@@ -2034,29 +2437,36 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2034
2437
|
break;
|
2035
2438
|
}
|
2036
2439
|
#line 137 "api_node.c.erb"
|
2037
|
-
case
|
2440
|
+
case YP_FOR_NODE: {
|
2038
2441
|
yp_for_node_t *cast = (yp_for_node_t *) node;
|
2039
2442
|
VALUE argv[8];
|
2040
2443
|
|
2041
2444
|
// index
|
2445
|
+
#line 148 "api_node.c.erb"
|
2042
2446
|
argv[0] = rb_ary_pop(value_stack);
|
2043
2447
|
|
2044
2448
|
// collection
|
2449
|
+
#line 148 "api_node.c.erb"
|
2045
2450
|
argv[1] = rb_ary_pop(value_stack);
|
2046
2451
|
|
2047
2452
|
// statements
|
2453
|
+
#line 148 "api_node.c.erb"
|
2048
2454
|
argv[2] = rb_ary_pop(value_stack);
|
2049
2455
|
|
2050
2456
|
// for_keyword_loc
|
2457
|
+
#line 173 "api_node.c.erb"
|
2051
2458
|
argv[3] = yp_location_new(parser, cast->for_keyword_loc.start, cast->for_keyword_loc.end, source);
|
2052
2459
|
|
2053
2460
|
// in_keyword_loc
|
2461
|
+
#line 173 "api_node.c.erb"
|
2054
2462
|
argv[4] = yp_location_new(parser, cast->in_keyword_loc.start, cast->in_keyword_loc.end, source);
|
2055
2463
|
|
2056
2464
|
// do_keyword_loc
|
2465
|
+
#line 176 "api_node.c.erb"
|
2057
2466
|
argv[5] = cast->do_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->do_keyword_loc.start, cast->do_keyword_loc.end, source);
|
2058
2467
|
|
2059
2468
|
// end_keyword_loc
|
2469
|
+
#line 173 "api_node.c.erb"
|
2060
2470
|
argv[6] = yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
|
2061
2471
|
|
2062
2472
|
// location
|
@@ -2066,7 +2476,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2066
2476
|
break;
|
2067
2477
|
}
|
2068
2478
|
#line 137 "api_node.c.erb"
|
2069
|
-
case
|
2479
|
+
case YP_FORWARDING_ARGUMENTS_NODE: {
|
2070
2480
|
VALUE argv[1];
|
2071
2481
|
|
2072
2482
|
// location
|
@@ -2076,7 +2486,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2076
2486
|
break;
|
2077
2487
|
}
|
2078
2488
|
#line 137 "api_node.c.erb"
|
2079
|
-
case
|
2489
|
+
case YP_FORWARDING_PARAMETER_NODE: {
|
2080
2490
|
VALUE argv[1];
|
2081
2491
|
|
2082
2492
|
// location
|
@@ -2086,10 +2496,11 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2086
2496
|
break;
|
2087
2497
|
}
|
2088
2498
|
#line 137 "api_node.c.erb"
|
2089
|
-
case
|
2499
|
+
case YP_FORWARDING_SUPER_NODE: {
|
2090
2500
|
VALUE argv[2];
|
2091
2501
|
|
2092
2502
|
// block
|
2503
|
+
#line 148 "api_node.c.erb"
|
2093
2504
|
argv[0] = rb_ary_pop(value_stack);
|
2094
2505
|
|
2095
2506
|
// location
|
@@ -2099,123 +2510,172 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2099
2510
|
break;
|
2100
2511
|
}
|
2101
2512
|
#line 137 "api_node.c.erb"
|
2102
|
-
case
|
2513
|
+
case YP_GLOBAL_VARIABLE_AND_WRITE_NODE: {
|
2103
2514
|
yp_global_variable_and_write_node_t *cast = (yp_global_variable_and_write_node_t *) node;
|
2104
|
-
VALUE argv[
|
2515
|
+
VALUE argv[5];
|
2516
|
+
|
2517
|
+
// name
|
2518
|
+
#line 160 "api_node.c.erb"
|
2519
|
+
assert(cast->name != 0);
|
2520
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2105
2521
|
|
2106
2522
|
// name_loc
|
2107
|
-
|
2523
|
+
#line 173 "api_node.c.erb"
|
2524
|
+
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2108
2525
|
|
2109
2526
|
// operator_loc
|
2110
|
-
|
2527
|
+
#line 173 "api_node.c.erb"
|
2528
|
+
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2111
2529
|
|
2112
2530
|
// value
|
2113
|
-
|
2531
|
+
#line 148 "api_node.c.erb"
|
2532
|
+
argv[3] = rb_ary_pop(value_stack);
|
2114
2533
|
|
2115
2534
|
// location
|
2116
|
-
argv[
|
2535
|
+
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2117
2536
|
|
2118
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
2537
|
+
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPGlobalVariableAndWriteNode));
|
2119
2538
|
break;
|
2120
2539
|
}
|
2121
2540
|
#line 137 "api_node.c.erb"
|
2122
|
-
case
|
2541
|
+
case YP_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
|
2123
2542
|
yp_global_variable_operator_write_node_t *cast = (yp_global_variable_operator_write_node_t *) node;
|
2124
|
-
VALUE argv[
|
2543
|
+
VALUE argv[6];
|
2544
|
+
|
2545
|
+
// name
|
2546
|
+
#line 160 "api_node.c.erb"
|
2547
|
+
assert(cast->name != 0);
|
2548
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2125
2549
|
|
2126
2550
|
// name_loc
|
2127
|
-
|
2551
|
+
#line 173 "api_node.c.erb"
|
2552
|
+
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2128
2553
|
|
2129
2554
|
// operator_loc
|
2130
|
-
|
2555
|
+
#line 173 "api_node.c.erb"
|
2556
|
+
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2131
2557
|
|
2132
2558
|
// value
|
2133
|
-
|
2559
|
+
#line 148 "api_node.c.erb"
|
2560
|
+
argv[3] = rb_ary_pop(value_stack);
|
2134
2561
|
|
2135
2562
|
// operator
|
2136
|
-
|
2563
|
+
#line 160 "api_node.c.erb"
|
2564
|
+
assert(cast->operator != 0);
|
2565
|
+
argv[4] = rb_id2sym(constants[cast->operator - 1]);
|
2137
2566
|
|
2138
2567
|
// location
|
2139
|
-
argv[
|
2568
|
+
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2140
2569
|
|
2141
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
2570
|
+
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPGlobalVariableOperatorWriteNode));
|
2142
2571
|
break;
|
2143
2572
|
}
|
2144
2573
|
#line 137 "api_node.c.erb"
|
2145
|
-
case
|
2574
|
+
case YP_GLOBAL_VARIABLE_OR_WRITE_NODE: {
|
2146
2575
|
yp_global_variable_or_write_node_t *cast = (yp_global_variable_or_write_node_t *) node;
|
2147
|
-
VALUE argv[
|
2576
|
+
VALUE argv[5];
|
2577
|
+
|
2578
|
+
// name
|
2579
|
+
#line 160 "api_node.c.erb"
|
2580
|
+
assert(cast->name != 0);
|
2581
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2148
2582
|
|
2149
2583
|
// name_loc
|
2150
|
-
|
2584
|
+
#line 173 "api_node.c.erb"
|
2585
|
+
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2151
2586
|
|
2152
2587
|
// operator_loc
|
2153
|
-
|
2588
|
+
#line 173 "api_node.c.erb"
|
2589
|
+
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2154
2590
|
|
2155
2591
|
// value
|
2156
|
-
|
2592
|
+
#line 148 "api_node.c.erb"
|
2593
|
+
argv[3] = rb_ary_pop(value_stack);
|
2157
2594
|
|
2158
2595
|
// location
|
2159
|
-
argv[
|
2596
|
+
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2160
2597
|
|
2161
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
2598
|
+
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPGlobalVariableOrWriteNode));
|
2162
2599
|
break;
|
2163
2600
|
}
|
2164
2601
|
#line 137 "api_node.c.erb"
|
2165
|
-
case
|
2166
|
-
|
2602
|
+
case YP_GLOBAL_VARIABLE_READ_NODE: {
|
2603
|
+
yp_global_variable_read_node_t *cast = (yp_global_variable_read_node_t *) node;
|
2604
|
+
VALUE argv[2];
|
2605
|
+
|
2606
|
+
// name
|
2607
|
+
#line 160 "api_node.c.erb"
|
2608
|
+
assert(cast->name != 0);
|
2609
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2167
2610
|
|
2168
2611
|
// location
|
2169
|
-
argv[
|
2612
|
+
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2170
2613
|
|
2171
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
2614
|
+
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPGlobalVariableReadNode));
|
2172
2615
|
break;
|
2173
2616
|
}
|
2174
2617
|
#line 137 "api_node.c.erb"
|
2175
|
-
case
|
2176
|
-
|
2618
|
+
case YP_GLOBAL_VARIABLE_TARGET_NODE: {
|
2619
|
+
yp_global_variable_target_node_t *cast = (yp_global_variable_target_node_t *) node;
|
2620
|
+
VALUE argv[2];
|
2621
|
+
|
2622
|
+
// name
|
2623
|
+
#line 160 "api_node.c.erb"
|
2624
|
+
assert(cast->name != 0);
|
2625
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2177
2626
|
|
2178
2627
|
// location
|
2179
|
-
argv[
|
2628
|
+
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2180
2629
|
|
2181
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
2630
|
+
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPGlobalVariableTargetNode));
|
2182
2631
|
break;
|
2183
2632
|
}
|
2184
2633
|
#line 137 "api_node.c.erb"
|
2185
|
-
case
|
2634
|
+
case YP_GLOBAL_VARIABLE_WRITE_NODE: {
|
2186
2635
|
yp_global_variable_write_node_t *cast = (yp_global_variable_write_node_t *) node;
|
2187
|
-
VALUE argv[
|
2636
|
+
VALUE argv[5];
|
2637
|
+
|
2638
|
+
// name
|
2639
|
+
#line 160 "api_node.c.erb"
|
2640
|
+
assert(cast->name != 0);
|
2641
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2188
2642
|
|
2189
2643
|
// name_loc
|
2190
|
-
|
2644
|
+
#line 173 "api_node.c.erb"
|
2645
|
+
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2191
2646
|
|
2192
2647
|
// value
|
2193
|
-
|
2648
|
+
#line 148 "api_node.c.erb"
|
2649
|
+
argv[2] = rb_ary_pop(value_stack);
|
2194
2650
|
|
2195
2651
|
// operator_loc
|
2196
|
-
|
2652
|
+
#line 173 "api_node.c.erb"
|
2653
|
+
argv[3] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2197
2654
|
|
2198
2655
|
// location
|
2199
|
-
argv[
|
2656
|
+
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2200
2657
|
|
2201
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
2658
|
+
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPGlobalVariableWriteNode));
|
2202
2659
|
break;
|
2203
2660
|
}
|
2204
2661
|
#line 137 "api_node.c.erb"
|
2205
|
-
case
|
2662
|
+
case YP_HASH_NODE: {
|
2206
2663
|
yp_hash_node_t *cast = (yp_hash_node_t *) node;
|
2207
2664
|
VALUE argv[4];
|
2208
2665
|
|
2209
2666
|
// opening_loc
|
2667
|
+
#line 173 "api_node.c.erb"
|
2210
2668
|
argv[0] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
2211
2669
|
|
2212
2670
|
// elements
|
2671
|
+
#line 151 "api_node.c.erb"
|
2213
2672
|
argv[1] = rb_ary_new_capa(cast->elements.size);
|
2214
2673
|
for (size_t index = 0; index < cast->elements.size; index++) {
|
2215
2674
|
rb_ary_push(argv[1], rb_ary_pop(value_stack));
|
2216
2675
|
}
|
2217
2676
|
|
2218
2677
|
// closing_loc
|
2678
|
+
#line 173 "api_node.c.erb"
|
2219
2679
|
argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
2220
2680
|
|
2221
2681
|
// location
|
@@ -2225,26 +2685,31 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2225
2685
|
break;
|
2226
2686
|
}
|
2227
2687
|
#line 137 "api_node.c.erb"
|
2228
|
-
case
|
2688
|
+
case YP_HASH_PATTERN_NODE: {
|
2229
2689
|
yp_hash_pattern_node_t *cast = (yp_hash_pattern_node_t *) node;
|
2230
2690
|
VALUE argv[6];
|
2231
2691
|
|
2232
2692
|
// constant
|
2693
|
+
#line 148 "api_node.c.erb"
|
2233
2694
|
argv[0] = rb_ary_pop(value_stack);
|
2234
2695
|
|
2235
2696
|
// assocs
|
2697
|
+
#line 151 "api_node.c.erb"
|
2236
2698
|
argv[1] = rb_ary_new_capa(cast->assocs.size);
|
2237
2699
|
for (size_t index = 0; index < cast->assocs.size; index++) {
|
2238
2700
|
rb_ary_push(argv[1], rb_ary_pop(value_stack));
|
2239
2701
|
}
|
2240
2702
|
|
2241
2703
|
// kwrest
|
2704
|
+
#line 148 "api_node.c.erb"
|
2242
2705
|
argv[2] = rb_ary_pop(value_stack);
|
2243
2706
|
|
2244
2707
|
// opening_loc
|
2708
|
+
#line 176 "api_node.c.erb"
|
2245
2709
|
argv[3] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
2246
2710
|
|
2247
2711
|
// closing_loc
|
2712
|
+
#line 176 "api_node.c.erb"
|
2248
2713
|
argv[4] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
2249
2714
|
|
2250
2715
|
// location
|
@@ -2254,23 +2719,28 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2254
2719
|
break;
|
2255
2720
|
}
|
2256
2721
|
#line 137 "api_node.c.erb"
|
2257
|
-
case
|
2722
|
+
case YP_IF_NODE: {
|
2258
2723
|
yp_if_node_t *cast = (yp_if_node_t *) node;
|
2259
2724
|
VALUE argv[6];
|
2260
2725
|
|
2261
2726
|
// if_keyword_loc
|
2727
|
+
#line 176 "api_node.c.erb"
|
2262
2728
|
argv[0] = cast->if_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->if_keyword_loc.start, cast->if_keyword_loc.end, source);
|
2263
2729
|
|
2264
2730
|
// predicate
|
2731
|
+
#line 148 "api_node.c.erb"
|
2265
2732
|
argv[1] = rb_ary_pop(value_stack);
|
2266
2733
|
|
2267
2734
|
// statements
|
2735
|
+
#line 148 "api_node.c.erb"
|
2268
2736
|
argv[2] = rb_ary_pop(value_stack);
|
2269
2737
|
|
2270
2738
|
// consequent
|
2739
|
+
#line 148 "api_node.c.erb"
|
2271
2740
|
argv[3] = rb_ary_pop(value_stack);
|
2272
2741
|
|
2273
2742
|
// end_keyword_loc
|
2743
|
+
#line 176 "api_node.c.erb"
|
2274
2744
|
argv[4] = cast->end_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
|
2275
2745
|
|
2276
2746
|
// location
|
@@ -2280,10 +2750,11 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2280
2750
|
break;
|
2281
2751
|
}
|
2282
2752
|
#line 137 "api_node.c.erb"
|
2283
|
-
case
|
2753
|
+
case YP_IMAGINARY_NODE: {
|
2284
2754
|
VALUE argv[2];
|
2285
2755
|
|
2286
2756
|
// numeric
|
2757
|
+
#line 148 "api_node.c.erb"
|
2287
2758
|
argv[0] = rb_ary_pop(value_stack);
|
2288
2759
|
|
2289
2760
|
// location
|
@@ -2293,20 +2764,38 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2293
2764
|
break;
|
2294
2765
|
}
|
2295
2766
|
#line 137 "api_node.c.erb"
|
2296
|
-
case
|
2767
|
+
case YP_IMPLICIT_NODE: {
|
2768
|
+
VALUE argv[2];
|
2769
|
+
|
2770
|
+
// value
|
2771
|
+
#line 148 "api_node.c.erb"
|
2772
|
+
argv[0] = rb_ary_pop(value_stack);
|
2773
|
+
|
2774
|
+
// location
|
2775
|
+
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2776
|
+
|
2777
|
+
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPImplicitNode));
|
2778
|
+
break;
|
2779
|
+
}
|
2780
|
+
#line 137 "api_node.c.erb"
|
2781
|
+
case YP_IN_NODE: {
|
2297
2782
|
yp_in_node_t *cast = (yp_in_node_t *) node;
|
2298
2783
|
VALUE argv[5];
|
2299
2784
|
|
2300
2785
|
// pattern
|
2786
|
+
#line 148 "api_node.c.erb"
|
2301
2787
|
argv[0] = rb_ary_pop(value_stack);
|
2302
2788
|
|
2303
2789
|
// statements
|
2790
|
+
#line 148 "api_node.c.erb"
|
2304
2791
|
argv[1] = rb_ary_pop(value_stack);
|
2305
2792
|
|
2306
2793
|
// in_loc
|
2794
|
+
#line 173 "api_node.c.erb"
|
2307
2795
|
argv[2] = yp_location_new(parser, cast->in_loc.start, cast->in_loc.end, source);
|
2308
2796
|
|
2309
2797
|
// then_loc
|
2798
|
+
#line 176 "api_node.c.erb"
|
2310
2799
|
argv[3] = cast->then_loc.start == NULL ? Qnil : yp_location_new(parser, cast->then_loc.start, cast->then_loc.end, source);
|
2311
2800
|
|
2312
2801
|
// location
|
@@ -2316,20 +2805,25 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2316
2805
|
break;
|
2317
2806
|
}
|
2318
2807
|
#line 137 "api_node.c.erb"
|
2319
|
-
case
|
2808
|
+
case YP_INSTANCE_VARIABLE_AND_WRITE_NODE: {
|
2320
2809
|
yp_instance_variable_and_write_node_t *cast = (yp_instance_variable_and_write_node_t *) node;
|
2321
2810
|
VALUE argv[5];
|
2322
2811
|
|
2323
2812
|
// name
|
2813
|
+
#line 160 "api_node.c.erb"
|
2814
|
+
assert(cast->name != 0);
|
2324
2815
|
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2325
2816
|
|
2326
2817
|
// name_loc
|
2818
|
+
#line 173 "api_node.c.erb"
|
2327
2819
|
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2328
2820
|
|
2329
2821
|
// operator_loc
|
2822
|
+
#line 173 "api_node.c.erb"
|
2330
2823
|
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2331
2824
|
|
2332
2825
|
// value
|
2826
|
+
#line 148 "api_node.c.erb"
|
2333
2827
|
argv[3] = rb_ary_pop(value_stack);
|
2334
2828
|
|
2335
2829
|
// location
|
@@ -2339,23 +2833,30 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2339
2833
|
break;
|
2340
2834
|
}
|
2341
2835
|
#line 137 "api_node.c.erb"
|
2342
|
-
case
|
2836
|
+
case YP_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
|
2343
2837
|
yp_instance_variable_operator_write_node_t *cast = (yp_instance_variable_operator_write_node_t *) node;
|
2344
2838
|
VALUE argv[6];
|
2345
2839
|
|
2346
2840
|
// name
|
2841
|
+
#line 160 "api_node.c.erb"
|
2842
|
+
assert(cast->name != 0);
|
2347
2843
|
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2348
2844
|
|
2349
2845
|
// name_loc
|
2846
|
+
#line 173 "api_node.c.erb"
|
2350
2847
|
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2351
2848
|
|
2352
2849
|
// operator_loc
|
2850
|
+
#line 173 "api_node.c.erb"
|
2353
2851
|
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2354
2852
|
|
2355
2853
|
// value
|
2854
|
+
#line 148 "api_node.c.erb"
|
2356
2855
|
argv[3] = rb_ary_pop(value_stack);
|
2357
2856
|
|
2358
2857
|
// operator
|
2858
|
+
#line 160 "api_node.c.erb"
|
2859
|
+
assert(cast->operator != 0);
|
2359
2860
|
argv[4] = rb_id2sym(constants[cast->operator - 1]);
|
2360
2861
|
|
2361
2862
|
// location
|
@@ -2365,20 +2866,25 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2365
2866
|
break;
|
2366
2867
|
}
|
2367
2868
|
#line 137 "api_node.c.erb"
|
2368
|
-
case
|
2869
|
+
case YP_INSTANCE_VARIABLE_OR_WRITE_NODE: {
|
2369
2870
|
yp_instance_variable_or_write_node_t *cast = (yp_instance_variable_or_write_node_t *) node;
|
2370
2871
|
VALUE argv[5];
|
2371
2872
|
|
2372
2873
|
// name
|
2874
|
+
#line 160 "api_node.c.erb"
|
2875
|
+
assert(cast->name != 0);
|
2373
2876
|
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2374
2877
|
|
2375
2878
|
// name_loc
|
2879
|
+
#line 173 "api_node.c.erb"
|
2376
2880
|
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2377
2881
|
|
2378
2882
|
// operator_loc
|
2883
|
+
#line 173 "api_node.c.erb"
|
2379
2884
|
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2380
2885
|
|
2381
2886
|
// value
|
2887
|
+
#line 148 "api_node.c.erb"
|
2382
2888
|
argv[3] = rb_ary_pop(value_stack);
|
2383
2889
|
|
2384
2890
|
// location
|
@@ -2388,11 +2894,13 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2388
2894
|
break;
|
2389
2895
|
}
|
2390
2896
|
#line 137 "api_node.c.erb"
|
2391
|
-
case
|
2897
|
+
case YP_INSTANCE_VARIABLE_READ_NODE: {
|
2392
2898
|
yp_instance_variable_read_node_t *cast = (yp_instance_variable_read_node_t *) node;
|
2393
2899
|
VALUE argv[2];
|
2394
2900
|
|
2395
2901
|
// name
|
2902
|
+
#line 160 "api_node.c.erb"
|
2903
|
+
assert(cast->name != 0);
|
2396
2904
|
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2397
2905
|
|
2398
2906
|
// location
|
@@ -2402,11 +2910,13 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2402
2910
|
break;
|
2403
2911
|
}
|
2404
2912
|
#line 137 "api_node.c.erb"
|
2405
|
-
case
|
2913
|
+
case YP_INSTANCE_VARIABLE_TARGET_NODE: {
|
2406
2914
|
yp_instance_variable_target_node_t *cast = (yp_instance_variable_target_node_t *) node;
|
2407
2915
|
VALUE argv[2];
|
2408
2916
|
|
2409
2917
|
// name
|
2918
|
+
#line 160 "api_node.c.erb"
|
2919
|
+
assert(cast->name != 0);
|
2410
2920
|
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2411
2921
|
|
2412
2922
|
// location
|
@@ -2416,20 +2926,25 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2416
2926
|
break;
|
2417
2927
|
}
|
2418
2928
|
#line 137 "api_node.c.erb"
|
2419
|
-
case
|
2929
|
+
case YP_INSTANCE_VARIABLE_WRITE_NODE: {
|
2420
2930
|
yp_instance_variable_write_node_t *cast = (yp_instance_variable_write_node_t *) node;
|
2421
2931
|
VALUE argv[5];
|
2422
2932
|
|
2423
2933
|
// name
|
2934
|
+
#line 160 "api_node.c.erb"
|
2935
|
+
assert(cast->name != 0);
|
2424
2936
|
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2425
2937
|
|
2426
2938
|
// name_loc
|
2939
|
+
#line 173 "api_node.c.erb"
|
2427
2940
|
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2428
2941
|
|
2429
2942
|
// value
|
2943
|
+
#line 148 "api_node.c.erb"
|
2430
2944
|
argv[2] = rb_ary_pop(value_stack);
|
2431
2945
|
|
2432
2946
|
// operator_loc
|
2947
|
+
#line 173 "api_node.c.erb"
|
2433
2948
|
argv[3] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2434
2949
|
|
2435
2950
|
// location
|
@@ -2439,34 +2954,72 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2439
2954
|
break;
|
2440
2955
|
}
|
2441
2956
|
#line 137 "api_node.c.erb"
|
2442
|
-
case
|
2443
|
-
VALUE argv[
|
2957
|
+
case YP_INTEGER_NODE: {
|
2958
|
+
VALUE argv[2];
|
2959
|
+
|
2960
|
+
// flags
|
2961
|
+
#line 182 "api_node.c.erb"
|
2962
|
+
argv[0] = ULONG2NUM(node->flags >> 2);
|
2444
2963
|
|
2445
2964
|
// location
|
2446
|
-
argv[
|
2965
|
+
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2966
|
+
|
2967
|
+
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPIntegerNode));
|
2968
|
+
break;
|
2969
|
+
}
|
2970
|
+
#line 137 "api_node.c.erb"
|
2971
|
+
case YP_INTERPOLATED_MATCH_LAST_LINE_NODE: {
|
2972
|
+
yp_interpolated_match_last_line_node_t *cast = (yp_interpolated_match_last_line_node_t *) node;
|
2973
|
+
VALUE argv[5];
|
2974
|
+
|
2975
|
+
// opening_loc
|
2976
|
+
#line 173 "api_node.c.erb"
|
2977
|
+
argv[0] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
2978
|
+
|
2979
|
+
// parts
|
2980
|
+
#line 151 "api_node.c.erb"
|
2981
|
+
argv[1] = rb_ary_new_capa(cast->parts.size);
|
2982
|
+
for (size_t index = 0; index < cast->parts.size; index++) {
|
2983
|
+
rb_ary_push(argv[1], rb_ary_pop(value_stack));
|
2984
|
+
}
|
2985
|
+
|
2986
|
+
// closing_loc
|
2987
|
+
#line 173 "api_node.c.erb"
|
2988
|
+
argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
2989
|
+
|
2990
|
+
// flags
|
2991
|
+
#line 182 "api_node.c.erb"
|
2992
|
+
argv[3] = ULONG2NUM(node->flags >> 2);
|
2993
|
+
|
2994
|
+
// location
|
2995
|
+
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2447
2996
|
|
2448
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
2997
|
+
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPInterpolatedMatchLastLineNode));
|
2449
2998
|
break;
|
2450
2999
|
}
|
2451
3000
|
#line 137 "api_node.c.erb"
|
2452
|
-
case
|
3001
|
+
case YP_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
|
2453
3002
|
yp_interpolated_regular_expression_node_t *cast = (yp_interpolated_regular_expression_node_t *) node;
|
2454
3003
|
VALUE argv[5];
|
2455
3004
|
|
2456
3005
|
// opening_loc
|
3006
|
+
#line 173 "api_node.c.erb"
|
2457
3007
|
argv[0] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
2458
3008
|
|
2459
3009
|
// parts
|
3010
|
+
#line 151 "api_node.c.erb"
|
2460
3011
|
argv[1] = rb_ary_new_capa(cast->parts.size);
|
2461
3012
|
for (size_t index = 0; index < cast->parts.size; index++) {
|
2462
3013
|
rb_ary_push(argv[1], rb_ary_pop(value_stack));
|
2463
3014
|
}
|
2464
3015
|
|
2465
3016
|
// closing_loc
|
3017
|
+
#line 173 "api_node.c.erb"
|
2466
3018
|
argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
2467
3019
|
|
2468
3020
|
// flags
|
2469
|
-
|
3021
|
+
#line 182 "api_node.c.erb"
|
3022
|
+
argv[3] = ULONG2NUM(node->flags >> 2);
|
2470
3023
|
|
2471
3024
|
// location
|
2472
3025
|
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
|
@@ -2475,20 +3028,23 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2475
3028
|
break;
|
2476
3029
|
}
|
2477
3030
|
#line 137 "api_node.c.erb"
|
2478
|
-
case
|
3031
|
+
case YP_INTERPOLATED_STRING_NODE: {
|
2479
3032
|
yp_interpolated_string_node_t *cast = (yp_interpolated_string_node_t *) node;
|
2480
3033
|
VALUE argv[4];
|
2481
3034
|
|
2482
3035
|
// opening_loc
|
3036
|
+
#line 176 "api_node.c.erb"
|
2483
3037
|
argv[0] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
2484
3038
|
|
2485
3039
|
// parts
|
3040
|
+
#line 151 "api_node.c.erb"
|
2486
3041
|
argv[1] = rb_ary_new_capa(cast->parts.size);
|
2487
3042
|
for (size_t index = 0; index < cast->parts.size; index++) {
|
2488
3043
|
rb_ary_push(argv[1], rb_ary_pop(value_stack));
|
2489
3044
|
}
|
2490
3045
|
|
2491
3046
|
// closing_loc
|
3047
|
+
#line 176 "api_node.c.erb"
|
2492
3048
|
argv[2] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
2493
3049
|
|
2494
3050
|
// location
|
@@ -2498,20 +3054,23 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2498
3054
|
break;
|
2499
3055
|
}
|
2500
3056
|
#line 137 "api_node.c.erb"
|
2501
|
-
case
|
3057
|
+
case YP_INTERPOLATED_SYMBOL_NODE: {
|
2502
3058
|
yp_interpolated_symbol_node_t *cast = (yp_interpolated_symbol_node_t *) node;
|
2503
3059
|
VALUE argv[4];
|
2504
3060
|
|
2505
3061
|
// opening_loc
|
3062
|
+
#line 176 "api_node.c.erb"
|
2506
3063
|
argv[0] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
2507
3064
|
|
2508
3065
|
// parts
|
3066
|
+
#line 151 "api_node.c.erb"
|
2509
3067
|
argv[1] = rb_ary_new_capa(cast->parts.size);
|
2510
3068
|
for (size_t index = 0; index < cast->parts.size; index++) {
|
2511
3069
|
rb_ary_push(argv[1], rb_ary_pop(value_stack));
|
2512
3070
|
}
|
2513
3071
|
|
2514
3072
|
// closing_loc
|
3073
|
+
#line 176 "api_node.c.erb"
|
2515
3074
|
argv[2] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
2516
3075
|
|
2517
3076
|
// location
|
@@ -2521,20 +3080,23 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2521
3080
|
break;
|
2522
3081
|
}
|
2523
3082
|
#line 137 "api_node.c.erb"
|
2524
|
-
case
|
3083
|
+
case YP_INTERPOLATED_X_STRING_NODE: {
|
2525
3084
|
yp_interpolated_x_string_node_t *cast = (yp_interpolated_x_string_node_t *) node;
|
2526
3085
|
VALUE argv[4];
|
2527
3086
|
|
2528
3087
|
// opening_loc
|
3088
|
+
#line 173 "api_node.c.erb"
|
2529
3089
|
argv[0] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
2530
3090
|
|
2531
3091
|
// parts
|
3092
|
+
#line 151 "api_node.c.erb"
|
2532
3093
|
argv[1] = rb_ary_new_capa(cast->parts.size);
|
2533
3094
|
for (size_t index = 0; index < cast->parts.size; index++) {
|
2534
3095
|
rb_ary_push(argv[1], rb_ary_pop(value_stack));
|
2535
3096
|
}
|
2536
3097
|
|
2537
3098
|
// closing_loc
|
3099
|
+
#line 173 "api_node.c.erb"
|
2538
3100
|
argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
2539
3101
|
|
2540
3102
|
// location
|
@@ -2544,11 +3106,12 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2544
3106
|
break;
|
2545
3107
|
}
|
2546
3108
|
#line 137 "api_node.c.erb"
|
2547
|
-
case
|
3109
|
+
case YP_KEYWORD_HASH_NODE: {
|
2548
3110
|
yp_keyword_hash_node_t *cast = (yp_keyword_hash_node_t *) node;
|
2549
3111
|
VALUE argv[2];
|
2550
3112
|
|
2551
3113
|
// elements
|
3114
|
+
#line 151 "api_node.c.erb"
|
2552
3115
|
argv[0] = rb_ary_new_capa(cast->elements.size);
|
2553
3116
|
for (size_t index = 0; index < cast->elements.size; index++) {
|
2554
3117
|
rb_ary_push(argv[0], rb_ary_pop(value_stack));
|
@@ -2561,63 +3124,82 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2561
3124
|
break;
|
2562
3125
|
}
|
2563
3126
|
#line 137 "api_node.c.erb"
|
2564
|
-
case
|
3127
|
+
case YP_KEYWORD_PARAMETER_NODE: {
|
2565
3128
|
yp_keyword_parameter_node_t *cast = (yp_keyword_parameter_node_t *) node;
|
2566
|
-
VALUE argv[
|
3129
|
+
VALUE argv[4];
|
3130
|
+
|
3131
|
+
// name
|
3132
|
+
#line 160 "api_node.c.erb"
|
3133
|
+
assert(cast->name != 0);
|
3134
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2567
3135
|
|
2568
3136
|
// name_loc
|
2569
|
-
|
3137
|
+
#line 173 "api_node.c.erb"
|
3138
|
+
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2570
3139
|
|
2571
3140
|
// value
|
2572
|
-
|
3141
|
+
#line 148 "api_node.c.erb"
|
3142
|
+
argv[2] = rb_ary_pop(value_stack);
|
2573
3143
|
|
2574
3144
|
// location
|
2575
|
-
argv[
|
3145
|
+
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2576
3146
|
|
2577
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
3147
|
+
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPKeywordParameterNode));
|
2578
3148
|
break;
|
2579
3149
|
}
|
2580
3150
|
#line 137 "api_node.c.erb"
|
2581
|
-
case
|
3151
|
+
case YP_KEYWORD_REST_PARAMETER_NODE: {
|
2582
3152
|
yp_keyword_rest_parameter_node_t *cast = (yp_keyword_rest_parameter_node_t *) node;
|
2583
|
-
VALUE argv[
|
3153
|
+
VALUE argv[4];
|
2584
3154
|
|
2585
|
-
//
|
2586
|
-
argv[0] =
|
3155
|
+
// name
|
3156
|
+
argv[0] = cast->name == 0 ? Qnil : rb_id2sym(constants[cast->name - 1]);
|
2587
3157
|
|
2588
3158
|
// name_loc
|
3159
|
+
#line 176 "api_node.c.erb"
|
2589
3160
|
argv[1] = cast->name_loc.start == NULL ? Qnil : yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2590
3161
|
|
3162
|
+
// operator_loc
|
3163
|
+
#line 173 "api_node.c.erb"
|
3164
|
+
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
3165
|
+
|
2591
3166
|
// location
|
2592
|
-
argv[
|
3167
|
+
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2593
3168
|
|
2594
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
3169
|
+
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPKeywordRestParameterNode));
|
2595
3170
|
break;
|
2596
3171
|
}
|
2597
3172
|
#line 137 "api_node.c.erb"
|
2598
|
-
case
|
3173
|
+
case YP_LAMBDA_NODE: {
|
2599
3174
|
yp_lambda_node_t *cast = (yp_lambda_node_t *) node;
|
2600
3175
|
VALUE argv[7];
|
2601
3176
|
|
2602
3177
|
// locals
|
3178
|
+
#line 166 "api_node.c.erb"
|
2603
3179
|
argv[0] = rb_ary_new_capa(cast->locals.size);
|
2604
3180
|
for (size_t index = 0; index < cast->locals.size; index++) {
|
3181
|
+
assert(cast->locals.ids[index] != 0);
|
2605
3182
|
rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
|
2606
3183
|
}
|
2607
3184
|
|
2608
3185
|
// operator_loc
|
3186
|
+
#line 173 "api_node.c.erb"
|
2609
3187
|
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2610
3188
|
|
2611
3189
|
// opening_loc
|
3190
|
+
#line 173 "api_node.c.erb"
|
2612
3191
|
argv[2] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
2613
3192
|
|
2614
3193
|
// closing_loc
|
3194
|
+
#line 173 "api_node.c.erb"
|
2615
3195
|
argv[3] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
2616
3196
|
|
2617
3197
|
// parameters
|
3198
|
+
#line 148 "api_node.c.erb"
|
2618
3199
|
argv[4] = rb_ary_pop(value_stack);
|
2619
3200
|
|
2620
3201
|
// body
|
3202
|
+
#line 148 "api_node.c.erb"
|
2621
3203
|
argv[5] = rb_ary_pop(value_stack);
|
2622
3204
|
|
2623
3205
|
// location
|
@@ -2627,23 +3209,29 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2627
3209
|
break;
|
2628
3210
|
}
|
2629
3211
|
#line 137 "api_node.c.erb"
|
2630
|
-
case
|
3212
|
+
case YP_LOCAL_VARIABLE_AND_WRITE_NODE: {
|
2631
3213
|
yp_local_variable_and_write_node_t *cast = (yp_local_variable_and_write_node_t *) node;
|
2632
3214
|
VALUE argv[6];
|
2633
3215
|
|
2634
3216
|
// name_loc
|
3217
|
+
#line 173 "api_node.c.erb"
|
2635
3218
|
argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2636
3219
|
|
2637
3220
|
// operator_loc
|
3221
|
+
#line 173 "api_node.c.erb"
|
2638
3222
|
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2639
3223
|
|
2640
3224
|
// value
|
3225
|
+
#line 148 "api_node.c.erb"
|
2641
3226
|
argv[2] = rb_ary_pop(value_stack);
|
2642
3227
|
|
2643
3228
|
// name
|
3229
|
+
#line 160 "api_node.c.erb"
|
3230
|
+
assert(cast->name != 0);
|
2644
3231
|
argv[3] = rb_id2sym(constants[cast->name - 1]);
|
2645
3232
|
|
2646
3233
|
// depth
|
3234
|
+
#line 179 "api_node.c.erb"
|
2647
3235
|
argv[4] = ULONG2NUM(cast->depth);
|
2648
3236
|
|
2649
3237
|
// location
|
@@ -2653,26 +3241,34 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2653
3241
|
break;
|
2654
3242
|
}
|
2655
3243
|
#line 137 "api_node.c.erb"
|
2656
|
-
case
|
3244
|
+
case YP_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
|
2657
3245
|
yp_local_variable_operator_write_node_t *cast = (yp_local_variable_operator_write_node_t *) node;
|
2658
3246
|
VALUE argv[7];
|
2659
3247
|
|
2660
3248
|
// name_loc
|
3249
|
+
#line 173 "api_node.c.erb"
|
2661
3250
|
argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2662
3251
|
|
2663
3252
|
// operator_loc
|
3253
|
+
#line 173 "api_node.c.erb"
|
2664
3254
|
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2665
3255
|
|
2666
3256
|
// value
|
3257
|
+
#line 148 "api_node.c.erb"
|
2667
3258
|
argv[2] = rb_ary_pop(value_stack);
|
2668
3259
|
|
2669
3260
|
// name
|
3261
|
+
#line 160 "api_node.c.erb"
|
3262
|
+
assert(cast->name != 0);
|
2670
3263
|
argv[3] = rb_id2sym(constants[cast->name - 1]);
|
2671
3264
|
|
2672
3265
|
// operator
|
3266
|
+
#line 160 "api_node.c.erb"
|
3267
|
+
assert(cast->operator != 0);
|
2673
3268
|
argv[4] = rb_id2sym(constants[cast->operator - 1]);
|
2674
3269
|
|
2675
3270
|
// depth
|
3271
|
+
#line 179 "api_node.c.erb"
|
2676
3272
|
argv[5] = ULONG2NUM(cast->depth);
|
2677
3273
|
|
2678
3274
|
// location
|
@@ -2682,23 +3278,29 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2682
3278
|
break;
|
2683
3279
|
}
|
2684
3280
|
#line 137 "api_node.c.erb"
|
2685
|
-
case
|
3281
|
+
case YP_LOCAL_VARIABLE_OR_WRITE_NODE: {
|
2686
3282
|
yp_local_variable_or_write_node_t *cast = (yp_local_variable_or_write_node_t *) node;
|
2687
3283
|
VALUE argv[6];
|
2688
3284
|
|
2689
3285
|
// name_loc
|
3286
|
+
#line 173 "api_node.c.erb"
|
2690
3287
|
argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2691
3288
|
|
2692
3289
|
// operator_loc
|
3290
|
+
#line 173 "api_node.c.erb"
|
2693
3291
|
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2694
3292
|
|
2695
3293
|
// value
|
3294
|
+
#line 148 "api_node.c.erb"
|
2696
3295
|
argv[2] = rb_ary_pop(value_stack);
|
2697
3296
|
|
2698
3297
|
// name
|
3298
|
+
#line 160 "api_node.c.erb"
|
3299
|
+
assert(cast->name != 0);
|
2699
3300
|
argv[3] = rb_id2sym(constants[cast->name - 1]);
|
2700
3301
|
|
2701
3302
|
// depth
|
3303
|
+
#line 179 "api_node.c.erb"
|
2702
3304
|
argv[4] = ULONG2NUM(cast->depth);
|
2703
3305
|
|
2704
3306
|
// location
|
@@ -2708,14 +3310,17 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2708
3310
|
break;
|
2709
3311
|
}
|
2710
3312
|
#line 137 "api_node.c.erb"
|
2711
|
-
case
|
3313
|
+
case YP_LOCAL_VARIABLE_READ_NODE: {
|
2712
3314
|
yp_local_variable_read_node_t *cast = (yp_local_variable_read_node_t *) node;
|
2713
3315
|
VALUE argv[3];
|
2714
3316
|
|
2715
3317
|
// name
|
3318
|
+
#line 160 "api_node.c.erb"
|
3319
|
+
assert(cast->name != 0);
|
2716
3320
|
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2717
3321
|
|
2718
3322
|
// depth
|
3323
|
+
#line 179 "api_node.c.erb"
|
2719
3324
|
argv[1] = ULONG2NUM(cast->depth);
|
2720
3325
|
|
2721
3326
|
// location
|
@@ -2725,14 +3330,17 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2725
3330
|
break;
|
2726
3331
|
}
|
2727
3332
|
#line 137 "api_node.c.erb"
|
2728
|
-
case
|
3333
|
+
case YP_LOCAL_VARIABLE_TARGET_NODE: {
|
2729
3334
|
yp_local_variable_target_node_t *cast = (yp_local_variable_target_node_t *) node;
|
2730
3335
|
VALUE argv[3];
|
2731
3336
|
|
2732
3337
|
// name
|
3338
|
+
#line 160 "api_node.c.erb"
|
3339
|
+
assert(cast->name != 0);
|
2733
3340
|
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2734
3341
|
|
2735
3342
|
// depth
|
3343
|
+
#line 179 "api_node.c.erb"
|
2736
3344
|
argv[1] = ULONG2NUM(cast->depth);
|
2737
3345
|
|
2738
3346
|
// location
|
@@ -2742,23 +3350,29 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2742
3350
|
break;
|
2743
3351
|
}
|
2744
3352
|
#line 137 "api_node.c.erb"
|
2745
|
-
case
|
3353
|
+
case YP_LOCAL_VARIABLE_WRITE_NODE: {
|
2746
3354
|
yp_local_variable_write_node_t *cast = (yp_local_variable_write_node_t *) node;
|
2747
3355
|
VALUE argv[6];
|
2748
3356
|
|
2749
3357
|
// name
|
3358
|
+
#line 160 "api_node.c.erb"
|
3359
|
+
assert(cast->name != 0);
|
2750
3360
|
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2751
3361
|
|
2752
3362
|
// depth
|
3363
|
+
#line 179 "api_node.c.erb"
|
2753
3364
|
argv[1] = ULONG2NUM(cast->depth);
|
2754
3365
|
|
2755
3366
|
// name_loc
|
3367
|
+
#line 173 "api_node.c.erb"
|
2756
3368
|
argv[2] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2757
3369
|
|
2758
3370
|
// value
|
3371
|
+
#line 148 "api_node.c.erb"
|
2759
3372
|
argv[3] = rb_ary_pop(value_stack);
|
2760
3373
|
|
2761
3374
|
// operator_loc
|
3375
|
+
#line 173 "api_node.c.erb"
|
2762
3376
|
argv[4] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2763
3377
|
|
2764
3378
|
// location
|
@@ -2768,17 +3382,51 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2768
3382
|
break;
|
2769
3383
|
}
|
2770
3384
|
#line 137 "api_node.c.erb"
|
2771
|
-
case
|
3385
|
+
case YP_MATCH_LAST_LINE_NODE: {
|
3386
|
+
yp_match_last_line_node_t *cast = (yp_match_last_line_node_t *) node;
|
3387
|
+
VALUE argv[6];
|
3388
|
+
|
3389
|
+
// opening_loc
|
3390
|
+
#line 173 "api_node.c.erb"
|
3391
|
+
argv[0] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
3392
|
+
|
3393
|
+
// content_loc
|
3394
|
+
#line 173 "api_node.c.erb"
|
3395
|
+
argv[1] = yp_location_new(parser, cast->content_loc.start, cast->content_loc.end, source);
|
3396
|
+
|
3397
|
+
// closing_loc
|
3398
|
+
#line 173 "api_node.c.erb"
|
3399
|
+
argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
3400
|
+
|
3401
|
+
// unescaped
|
3402
|
+
#line 157 "api_node.c.erb"
|
3403
|
+
argv[3] = yp_string_new(&cast->unescaped, encoding);
|
3404
|
+
|
3405
|
+
// flags
|
3406
|
+
#line 182 "api_node.c.erb"
|
3407
|
+
argv[4] = ULONG2NUM(node->flags >> 2);
|
3408
|
+
|
3409
|
+
// location
|
3410
|
+
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
|
3411
|
+
|
3412
|
+
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPMatchLastLineNode));
|
3413
|
+
break;
|
3414
|
+
}
|
3415
|
+
#line 137 "api_node.c.erb"
|
3416
|
+
case YP_MATCH_PREDICATE_NODE: {
|
2772
3417
|
yp_match_predicate_node_t *cast = (yp_match_predicate_node_t *) node;
|
2773
3418
|
VALUE argv[4];
|
2774
3419
|
|
2775
3420
|
// value
|
3421
|
+
#line 148 "api_node.c.erb"
|
2776
3422
|
argv[0] = rb_ary_pop(value_stack);
|
2777
3423
|
|
2778
3424
|
// pattern
|
3425
|
+
#line 148 "api_node.c.erb"
|
2779
3426
|
argv[1] = rb_ary_pop(value_stack);
|
2780
3427
|
|
2781
3428
|
// operator_loc
|
3429
|
+
#line 173 "api_node.c.erb"
|
2782
3430
|
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2783
3431
|
|
2784
3432
|
// location
|
@@ -2788,17 +3436,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2788
3436
|
break;
|
2789
3437
|
}
|
2790
3438
|
#line 137 "api_node.c.erb"
|
2791
|
-
case
|
3439
|
+
case YP_MATCH_REQUIRED_NODE: {
|
2792
3440
|
yp_match_required_node_t *cast = (yp_match_required_node_t *) node;
|
2793
3441
|
VALUE argv[4];
|
2794
3442
|
|
2795
3443
|
// value
|
3444
|
+
#line 148 "api_node.c.erb"
|
2796
3445
|
argv[0] = rb_ary_pop(value_stack);
|
2797
3446
|
|
2798
3447
|
// pattern
|
3448
|
+
#line 148 "api_node.c.erb"
|
2799
3449
|
argv[1] = rb_ary_pop(value_stack);
|
2800
3450
|
|
2801
3451
|
// operator_loc
|
3452
|
+
#line 173 "api_node.c.erb"
|
2802
3453
|
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2803
3454
|
|
2804
3455
|
// location
|
@@ -2808,7 +3459,30 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2808
3459
|
break;
|
2809
3460
|
}
|
2810
3461
|
#line 137 "api_node.c.erb"
|
2811
|
-
case
|
3462
|
+
case YP_MATCH_WRITE_NODE: {
|
3463
|
+
yp_match_write_node_t *cast = (yp_match_write_node_t *) node;
|
3464
|
+
VALUE argv[3];
|
3465
|
+
|
3466
|
+
// call
|
3467
|
+
#line 148 "api_node.c.erb"
|
3468
|
+
argv[0] = rb_ary_pop(value_stack);
|
3469
|
+
|
3470
|
+
// locals
|
3471
|
+
#line 166 "api_node.c.erb"
|
3472
|
+
argv[1] = rb_ary_new_capa(cast->locals.size);
|
3473
|
+
for (size_t index = 0; index < cast->locals.size; index++) {
|
3474
|
+
assert(cast->locals.ids[index] != 0);
|
3475
|
+
rb_ary_push(argv[1], rb_id2sym(constants[cast->locals.ids[index] - 1]));
|
3476
|
+
}
|
3477
|
+
|
3478
|
+
// location
|
3479
|
+
argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
|
3480
|
+
|
3481
|
+
rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPMatchWriteNode));
|
3482
|
+
break;
|
3483
|
+
}
|
3484
|
+
#line 137 "api_node.c.erb"
|
3485
|
+
case YP_MISSING_NODE: {
|
2812
3486
|
VALUE argv[1];
|
2813
3487
|
|
2814
3488
|
// location
|
@@ -2818,30 +3492,38 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2818
3492
|
break;
|
2819
3493
|
}
|
2820
3494
|
#line 137 "api_node.c.erb"
|
2821
|
-
case
|
3495
|
+
case YP_MODULE_NODE: {
|
2822
3496
|
yp_module_node_t *cast = (yp_module_node_t *) node;
|
2823
3497
|
VALUE argv[7];
|
2824
3498
|
|
2825
3499
|
// locals
|
3500
|
+
#line 166 "api_node.c.erb"
|
2826
3501
|
argv[0] = rb_ary_new_capa(cast->locals.size);
|
2827
3502
|
for (size_t index = 0; index < cast->locals.size; index++) {
|
3503
|
+
assert(cast->locals.ids[index] != 0);
|
2828
3504
|
rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
|
2829
3505
|
}
|
2830
3506
|
|
2831
3507
|
// module_keyword_loc
|
3508
|
+
#line 173 "api_node.c.erb"
|
2832
3509
|
argv[1] = yp_location_new(parser, cast->module_keyword_loc.start, cast->module_keyword_loc.end, source);
|
2833
3510
|
|
2834
3511
|
// constant_path
|
3512
|
+
#line 148 "api_node.c.erb"
|
2835
3513
|
argv[2] = rb_ary_pop(value_stack);
|
2836
3514
|
|
2837
3515
|
// body
|
3516
|
+
#line 148 "api_node.c.erb"
|
2838
3517
|
argv[3] = rb_ary_pop(value_stack);
|
2839
3518
|
|
2840
3519
|
// end_keyword_loc
|
3520
|
+
#line 173 "api_node.c.erb"
|
2841
3521
|
argv[4] = yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
|
2842
3522
|
|
2843
3523
|
// name
|
2844
|
-
|
3524
|
+
#line 160 "api_node.c.erb"
|
3525
|
+
assert(cast->name != 0);
|
3526
|
+
argv[5] = rb_id2sym(constants[cast->name - 1]);
|
2845
3527
|
|
2846
3528
|
// location
|
2847
3529
|
argv[6] = yp_location_new(parser, node->location.start, node->location.end, source);
|
@@ -2850,27 +3532,58 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2850
3532
|
break;
|
2851
3533
|
}
|
2852
3534
|
#line 137 "api_node.c.erb"
|
2853
|
-
case
|
2854
|
-
|
2855
|
-
VALUE argv[
|
3535
|
+
case YP_MULTI_TARGET_NODE: {
|
3536
|
+
yp_multi_target_node_t *cast = (yp_multi_target_node_t *) node;
|
3537
|
+
VALUE argv[4];
|
2856
3538
|
|
2857
3539
|
// targets
|
3540
|
+
#line 151 "api_node.c.erb"
|
2858
3541
|
argv[0] = rb_ary_new_capa(cast->targets.size);
|
2859
3542
|
for (size_t index = 0; index < cast->targets.size; index++) {
|
2860
3543
|
rb_ary_push(argv[0], rb_ary_pop(value_stack));
|
2861
3544
|
}
|
2862
3545
|
|
2863
|
-
//
|
2864
|
-
|
3546
|
+
// lparen_loc
|
3547
|
+
#line 176 "api_node.c.erb"
|
3548
|
+
argv[1] = cast->lparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
|
2865
3549
|
|
2866
|
-
//
|
2867
|
-
|
3550
|
+
// rparen_loc
|
3551
|
+
#line 176 "api_node.c.erb"
|
3552
|
+
argv[2] = cast->rparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
|
3553
|
+
|
3554
|
+
// location
|
3555
|
+
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
|
3556
|
+
|
3557
|
+
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPMultiTargetNode));
|
3558
|
+
break;
|
3559
|
+
}
|
3560
|
+
#line 137 "api_node.c.erb"
|
3561
|
+
case YP_MULTI_WRITE_NODE: {
|
3562
|
+
yp_multi_write_node_t *cast = (yp_multi_write_node_t *) node;
|
3563
|
+
VALUE argv[6];
|
3564
|
+
|
3565
|
+
// targets
|
3566
|
+
#line 151 "api_node.c.erb"
|
3567
|
+
argv[0] = rb_ary_new_capa(cast->targets.size);
|
3568
|
+
for (size_t index = 0; index < cast->targets.size; index++) {
|
3569
|
+
rb_ary_push(argv[0], rb_ary_pop(value_stack));
|
3570
|
+
}
|
2868
3571
|
|
2869
3572
|
// lparen_loc
|
2870
|
-
|
3573
|
+
#line 176 "api_node.c.erb"
|
3574
|
+
argv[1] = cast->lparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
|
2871
3575
|
|
2872
3576
|
// rparen_loc
|
2873
|
-
|
3577
|
+
#line 176 "api_node.c.erb"
|
3578
|
+
argv[2] = cast->rparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
|
3579
|
+
|
3580
|
+
// operator_loc
|
3581
|
+
#line 173 "api_node.c.erb"
|
3582
|
+
argv[3] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
3583
|
+
|
3584
|
+
// value
|
3585
|
+
#line 148 "api_node.c.erb"
|
3586
|
+
argv[4] = rb_ary_pop(value_stack);
|
2874
3587
|
|
2875
3588
|
// location
|
2876
3589
|
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
|
@@ -2879,14 +3592,16 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2879
3592
|
break;
|
2880
3593
|
}
|
2881
3594
|
#line 137 "api_node.c.erb"
|
2882
|
-
case
|
3595
|
+
case YP_NEXT_NODE: {
|
2883
3596
|
yp_next_node_t *cast = (yp_next_node_t *) node;
|
2884
3597
|
VALUE argv[3];
|
2885
3598
|
|
2886
3599
|
// arguments
|
3600
|
+
#line 148 "api_node.c.erb"
|
2887
3601
|
argv[0] = rb_ary_pop(value_stack);
|
2888
3602
|
|
2889
3603
|
// keyword_loc
|
3604
|
+
#line 173 "api_node.c.erb"
|
2890
3605
|
argv[1] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
|
2891
3606
|
|
2892
3607
|
// location
|
@@ -2896,7 +3611,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2896
3611
|
break;
|
2897
3612
|
}
|
2898
3613
|
#line 137 "api_node.c.erb"
|
2899
|
-
case
|
3614
|
+
case YP_NIL_NODE: {
|
2900
3615
|
VALUE argv[1];
|
2901
3616
|
|
2902
3617
|
// location
|
@@ -2906,14 +3621,16 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2906
3621
|
break;
|
2907
3622
|
}
|
2908
3623
|
#line 137 "api_node.c.erb"
|
2909
|
-
case
|
3624
|
+
case YP_NO_KEYWORDS_PARAMETER_NODE: {
|
2910
3625
|
yp_no_keywords_parameter_node_t *cast = (yp_no_keywords_parameter_node_t *) node;
|
2911
3626
|
VALUE argv[3];
|
2912
3627
|
|
2913
3628
|
// operator_loc
|
3629
|
+
#line 173 "api_node.c.erb"
|
2914
3630
|
argv[0] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2915
3631
|
|
2916
3632
|
// keyword_loc
|
3633
|
+
#line 173 "api_node.c.erb"
|
2917
3634
|
argv[1] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
|
2918
3635
|
|
2919
3636
|
// location
|
@@ -2923,11 +3640,12 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2923
3640
|
break;
|
2924
3641
|
}
|
2925
3642
|
#line 137 "api_node.c.erb"
|
2926
|
-
case
|
3643
|
+
case YP_NUMBERED_REFERENCE_READ_NODE: {
|
2927
3644
|
yp_numbered_reference_read_node_t *cast = (yp_numbered_reference_read_node_t *) node;
|
2928
3645
|
VALUE argv[2];
|
2929
3646
|
|
2930
3647
|
// number
|
3648
|
+
#line 179 "api_node.c.erb"
|
2931
3649
|
argv[0] = ULONG2NUM(cast->number);
|
2932
3650
|
|
2933
3651
|
// location
|
@@ -2937,20 +3655,25 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2937
3655
|
break;
|
2938
3656
|
}
|
2939
3657
|
#line 137 "api_node.c.erb"
|
2940
|
-
case
|
3658
|
+
case YP_OPTIONAL_PARAMETER_NODE: {
|
2941
3659
|
yp_optional_parameter_node_t *cast = (yp_optional_parameter_node_t *) node;
|
2942
3660
|
VALUE argv[5];
|
2943
3661
|
|
2944
3662
|
// name
|
3663
|
+
#line 160 "api_node.c.erb"
|
3664
|
+
assert(cast->name != 0);
|
2945
3665
|
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2946
3666
|
|
2947
3667
|
// name_loc
|
3668
|
+
#line 173 "api_node.c.erb"
|
2948
3669
|
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2949
3670
|
|
2950
3671
|
// operator_loc
|
3672
|
+
#line 173 "api_node.c.erb"
|
2951
3673
|
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2952
3674
|
|
2953
3675
|
// value
|
3676
|
+
#line 148 "api_node.c.erb"
|
2954
3677
|
argv[3] = rb_ary_pop(value_stack);
|
2955
3678
|
|
2956
3679
|
// location
|
@@ -2960,17 +3683,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2960
3683
|
break;
|
2961
3684
|
}
|
2962
3685
|
#line 137 "api_node.c.erb"
|
2963
|
-
case
|
3686
|
+
case YP_OR_NODE: {
|
2964
3687
|
yp_or_node_t *cast = (yp_or_node_t *) node;
|
2965
3688
|
VALUE argv[4];
|
2966
3689
|
|
2967
3690
|
// left
|
3691
|
+
#line 148 "api_node.c.erb"
|
2968
3692
|
argv[0] = rb_ary_pop(value_stack);
|
2969
3693
|
|
2970
3694
|
// right
|
3695
|
+
#line 148 "api_node.c.erb"
|
2971
3696
|
argv[1] = rb_ary_pop(value_stack);
|
2972
3697
|
|
2973
3698
|
// operator_loc
|
3699
|
+
#line 173 "api_node.c.erb"
|
2974
3700
|
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2975
3701
|
|
2976
3702
|
// location
|
@@ -2980,41 +3706,48 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2980
3706
|
break;
|
2981
3707
|
}
|
2982
3708
|
#line 137 "api_node.c.erb"
|
2983
|
-
case
|
3709
|
+
case YP_PARAMETERS_NODE: {
|
2984
3710
|
yp_parameters_node_t *cast = (yp_parameters_node_t *) node;
|
2985
3711
|
VALUE argv[8];
|
2986
3712
|
|
2987
3713
|
// requireds
|
3714
|
+
#line 151 "api_node.c.erb"
|
2988
3715
|
argv[0] = rb_ary_new_capa(cast->requireds.size);
|
2989
3716
|
for (size_t index = 0; index < cast->requireds.size; index++) {
|
2990
3717
|
rb_ary_push(argv[0], rb_ary_pop(value_stack));
|
2991
3718
|
}
|
2992
3719
|
|
2993
3720
|
// optionals
|
3721
|
+
#line 151 "api_node.c.erb"
|
2994
3722
|
argv[1] = rb_ary_new_capa(cast->optionals.size);
|
2995
3723
|
for (size_t index = 0; index < cast->optionals.size; index++) {
|
2996
3724
|
rb_ary_push(argv[1], rb_ary_pop(value_stack));
|
2997
3725
|
}
|
2998
3726
|
|
3727
|
+
// rest
|
3728
|
+
#line 148 "api_node.c.erb"
|
3729
|
+
argv[2] = rb_ary_pop(value_stack);
|
3730
|
+
|
2999
3731
|
// posts
|
3000
|
-
|
3732
|
+
#line 151 "api_node.c.erb"
|
3733
|
+
argv[3] = rb_ary_new_capa(cast->posts.size);
|
3001
3734
|
for (size_t index = 0; index < cast->posts.size; index++) {
|
3002
|
-
rb_ary_push(argv[
|
3735
|
+
rb_ary_push(argv[3], rb_ary_pop(value_stack));
|
3003
3736
|
}
|
3004
3737
|
|
3005
|
-
// rest
|
3006
|
-
argv[3] = rb_ary_pop(value_stack);
|
3007
|
-
|
3008
3738
|
// keywords
|
3739
|
+
#line 151 "api_node.c.erb"
|
3009
3740
|
argv[4] = rb_ary_new_capa(cast->keywords.size);
|
3010
3741
|
for (size_t index = 0; index < cast->keywords.size; index++) {
|
3011
3742
|
rb_ary_push(argv[4], rb_ary_pop(value_stack));
|
3012
3743
|
}
|
3013
3744
|
|
3014
3745
|
// keyword_rest
|
3746
|
+
#line 148 "api_node.c.erb"
|
3015
3747
|
argv[5] = rb_ary_pop(value_stack);
|
3016
3748
|
|
3017
3749
|
// block
|
3750
|
+
#line 148 "api_node.c.erb"
|
3018
3751
|
argv[6] = rb_ary_pop(value_stack);
|
3019
3752
|
|
3020
3753
|
// location
|
@@ -3024,17 +3757,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3024
3757
|
break;
|
3025
3758
|
}
|
3026
3759
|
#line 137 "api_node.c.erb"
|
3027
|
-
case
|
3760
|
+
case YP_PARENTHESES_NODE: {
|
3028
3761
|
yp_parentheses_node_t *cast = (yp_parentheses_node_t *) node;
|
3029
3762
|
VALUE argv[4];
|
3030
3763
|
|
3031
3764
|
// body
|
3765
|
+
#line 148 "api_node.c.erb"
|
3032
3766
|
argv[0] = rb_ary_pop(value_stack);
|
3033
3767
|
|
3034
3768
|
// opening_loc
|
3769
|
+
#line 173 "api_node.c.erb"
|
3035
3770
|
argv[1] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
3036
3771
|
|
3037
3772
|
// closing_loc
|
3773
|
+
#line 173 "api_node.c.erb"
|
3038
3774
|
argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
3039
3775
|
|
3040
3776
|
// location
|
@@ -3044,20 +3780,24 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3044
3780
|
break;
|
3045
3781
|
}
|
3046
3782
|
#line 137 "api_node.c.erb"
|
3047
|
-
case
|
3783
|
+
case YP_PINNED_EXPRESSION_NODE: {
|
3048
3784
|
yp_pinned_expression_node_t *cast = (yp_pinned_expression_node_t *) node;
|
3049
3785
|
VALUE argv[5];
|
3050
3786
|
|
3051
3787
|
// expression
|
3788
|
+
#line 148 "api_node.c.erb"
|
3052
3789
|
argv[0] = rb_ary_pop(value_stack);
|
3053
3790
|
|
3054
3791
|
// operator_loc
|
3792
|
+
#line 173 "api_node.c.erb"
|
3055
3793
|
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
3056
3794
|
|
3057
3795
|
// lparen_loc
|
3796
|
+
#line 173 "api_node.c.erb"
|
3058
3797
|
argv[2] = yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
|
3059
3798
|
|
3060
3799
|
// rparen_loc
|
3800
|
+
#line 173 "api_node.c.erb"
|
3061
3801
|
argv[3] = yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
|
3062
3802
|
|
3063
3803
|
// location
|
@@ -3067,14 +3807,16 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3067
3807
|
break;
|
3068
3808
|
}
|
3069
3809
|
#line 137 "api_node.c.erb"
|
3070
|
-
case
|
3810
|
+
case YP_PINNED_VARIABLE_NODE: {
|
3071
3811
|
yp_pinned_variable_node_t *cast = (yp_pinned_variable_node_t *) node;
|
3072
3812
|
VALUE argv[3];
|
3073
3813
|
|
3074
3814
|
// variable
|
3815
|
+
#line 148 "api_node.c.erb"
|
3075
3816
|
argv[0] = rb_ary_pop(value_stack);
|
3076
3817
|
|
3077
3818
|
// operator_loc
|
3819
|
+
#line 173 "api_node.c.erb"
|
3078
3820
|
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
3079
3821
|
|
3080
3822
|
// location
|
@@ -3084,20 +3826,24 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3084
3826
|
break;
|
3085
3827
|
}
|
3086
3828
|
#line 137 "api_node.c.erb"
|
3087
|
-
case
|
3829
|
+
case YP_POST_EXECUTION_NODE: {
|
3088
3830
|
yp_post_execution_node_t *cast = (yp_post_execution_node_t *) node;
|
3089
3831
|
VALUE argv[5];
|
3090
3832
|
|
3091
3833
|
// statements
|
3834
|
+
#line 148 "api_node.c.erb"
|
3092
3835
|
argv[0] = rb_ary_pop(value_stack);
|
3093
3836
|
|
3094
3837
|
// keyword_loc
|
3838
|
+
#line 173 "api_node.c.erb"
|
3095
3839
|
argv[1] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
|
3096
3840
|
|
3097
3841
|
// opening_loc
|
3842
|
+
#line 173 "api_node.c.erb"
|
3098
3843
|
argv[2] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
3099
3844
|
|
3100
3845
|
// closing_loc
|
3846
|
+
#line 173 "api_node.c.erb"
|
3101
3847
|
argv[3] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
3102
3848
|
|
3103
3849
|
// location
|
@@ -3107,20 +3853,24 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3107
3853
|
break;
|
3108
3854
|
}
|
3109
3855
|
#line 137 "api_node.c.erb"
|
3110
|
-
case
|
3856
|
+
case YP_PRE_EXECUTION_NODE: {
|
3111
3857
|
yp_pre_execution_node_t *cast = (yp_pre_execution_node_t *) node;
|
3112
3858
|
VALUE argv[5];
|
3113
3859
|
|
3114
3860
|
// statements
|
3861
|
+
#line 148 "api_node.c.erb"
|
3115
3862
|
argv[0] = rb_ary_pop(value_stack);
|
3116
3863
|
|
3117
3864
|
// keyword_loc
|
3865
|
+
#line 173 "api_node.c.erb"
|
3118
3866
|
argv[1] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
|
3119
3867
|
|
3120
3868
|
// opening_loc
|
3869
|
+
#line 173 "api_node.c.erb"
|
3121
3870
|
argv[2] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
3122
3871
|
|
3123
3872
|
// closing_loc
|
3873
|
+
#line 173 "api_node.c.erb"
|
3124
3874
|
argv[3] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
3125
3875
|
|
3126
3876
|
// location
|
@@ -3130,17 +3880,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3130
3880
|
break;
|
3131
3881
|
}
|
3132
3882
|
#line 137 "api_node.c.erb"
|
3133
|
-
case
|
3883
|
+
case YP_PROGRAM_NODE: {
|
3134
3884
|
yp_program_node_t *cast = (yp_program_node_t *) node;
|
3135
3885
|
VALUE argv[3];
|
3136
3886
|
|
3137
3887
|
// locals
|
3888
|
+
#line 166 "api_node.c.erb"
|
3138
3889
|
argv[0] = rb_ary_new_capa(cast->locals.size);
|
3139
3890
|
for (size_t index = 0; index < cast->locals.size; index++) {
|
3891
|
+
assert(cast->locals.ids[index] != 0);
|
3140
3892
|
rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
|
3141
3893
|
}
|
3142
3894
|
|
3143
3895
|
// statements
|
3896
|
+
#line 148 "api_node.c.erb"
|
3144
3897
|
argv[1] = rb_ary_pop(value_stack);
|
3145
3898
|
|
3146
3899
|
// location
|
@@ -3150,21 +3903,25 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3150
3903
|
break;
|
3151
3904
|
}
|
3152
3905
|
#line 137 "api_node.c.erb"
|
3153
|
-
case
|
3906
|
+
case YP_RANGE_NODE: {
|
3154
3907
|
yp_range_node_t *cast = (yp_range_node_t *) node;
|
3155
3908
|
VALUE argv[5];
|
3156
3909
|
|
3157
3910
|
// left
|
3911
|
+
#line 148 "api_node.c.erb"
|
3158
3912
|
argv[0] = rb_ary_pop(value_stack);
|
3159
3913
|
|
3160
3914
|
// right
|
3915
|
+
#line 148 "api_node.c.erb"
|
3161
3916
|
argv[1] = rb_ary_pop(value_stack);
|
3162
3917
|
|
3163
3918
|
// operator_loc
|
3919
|
+
#line 173 "api_node.c.erb"
|
3164
3920
|
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
3165
3921
|
|
3166
3922
|
// flags
|
3167
|
-
|
3923
|
+
#line 182 "api_node.c.erb"
|
3924
|
+
argv[3] = ULONG2NUM(node->flags >> 2);
|
3168
3925
|
|
3169
3926
|
// location
|
3170
3927
|
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
|
@@ -3173,10 +3930,11 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3173
3930
|
break;
|
3174
3931
|
}
|
3175
3932
|
#line 137 "api_node.c.erb"
|
3176
|
-
case
|
3933
|
+
case YP_RATIONAL_NODE: {
|
3177
3934
|
VALUE argv[2];
|
3178
3935
|
|
3179
3936
|
// numeric
|
3937
|
+
#line 148 "api_node.c.erb"
|
3180
3938
|
argv[0] = rb_ary_pop(value_stack);
|
3181
3939
|
|
3182
3940
|
// location
|
@@ -3186,7 +3944,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3186
3944
|
break;
|
3187
3945
|
}
|
3188
3946
|
#line 137 "api_node.c.erb"
|
3189
|
-
case
|
3947
|
+
case YP_REDO_NODE: {
|
3190
3948
|
VALUE argv[1];
|
3191
3949
|
|
3192
3950
|
// location
|
@@ -3196,24 +3954,29 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3196
3954
|
break;
|
3197
3955
|
}
|
3198
3956
|
#line 137 "api_node.c.erb"
|
3199
|
-
case
|
3957
|
+
case YP_REGULAR_EXPRESSION_NODE: {
|
3200
3958
|
yp_regular_expression_node_t *cast = (yp_regular_expression_node_t *) node;
|
3201
3959
|
VALUE argv[6];
|
3202
3960
|
|
3203
3961
|
// opening_loc
|
3962
|
+
#line 173 "api_node.c.erb"
|
3204
3963
|
argv[0] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
3205
3964
|
|
3206
3965
|
// content_loc
|
3966
|
+
#line 173 "api_node.c.erb"
|
3207
3967
|
argv[1] = yp_location_new(parser, cast->content_loc.start, cast->content_loc.end, source);
|
3208
3968
|
|
3209
3969
|
// closing_loc
|
3970
|
+
#line 173 "api_node.c.erb"
|
3210
3971
|
argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
3211
3972
|
|
3212
3973
|
// unescaped
|
3974
|
+
#line 157 "api_node.c.erb"
|
3213
3975
|
argv[3] = yp_string_new(&cast->unescaped, encoding);
|
3214
3976
|
|
3215
3977
|
// flags
|
3216
|
-
|
3978
|
+
#line 182 "api_node.c.erb"
|
3979
|
+
argv[4] = ULONG2NUM(node->flags >> 2);
|
3217
3980
|
|
3218
3981
|
// location
|
3219
3982
|
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
|
@@ -3222,20 +3985,23 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3222
3985
|
break;
|
3223
3986
|
}
|
3224
3987
|
#line 137 "api_node.c.erb"
|
3225
|
-
case
|
3988
|
+
case YP_REQUIRED_DESTRUCTURED_PARAMETER_NODE: {
|
3226
3989
|
yp_required_destructured_parameter_node_t *cast = (yp_required_destructured_parameter_node_t *) node;
|
3227
3990
|
VALUE argv[4];
|
3228
3991
|
|
3229
3992
|
// parameters
|
3993
|
+
#line 151 "api_node.c.erb"
|
3230
3994
|
argv[0] = rb_ary_new_capa(cast->parameters.size);
|
3231
3995
|
for (size_t index = 0; index < cast->parameters.size; index++) {
|
3232
3996
|
rb_ary_push(argv[0], rb_ary_pop(value_stack));
|
3233
3997
|
}
|
3234
3998
|
|
3235
3999
|
// opening_loc
|
4000
|
+
#line 173 "api_node.c.erb"
|
3236
4001
|
argv[1] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
3237
4002
|
|
3238
4003
|
// closing_loc
|
4004
|
+
#line 173 "api_node.c.erb"
|
3239
4005
|
argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
3240
4006
|
|
3241
4007
|
// location
|
@@ -3245,11 +4011,13 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3245
4011
|
break;
|
3246
4012
|
}
|
3247
4013
|
#line 137 "api_node.c.erb"
|
3248
|
-
case
|
4014
|
+
case YP_REQUIRED_PARAMETER_NODE: {
|
3249
4015
|
yp_required_parameter_node_t *cast = (yp_required_parameter_node_t *) node;
|
3250
4016
|
VALUE argv[2];
|
3251
4017
|
|
3252
4018
|
// name
|
4019
|
+
#line 160 "api_node.c.erb"
|
4020
|
+
assert(cast->name != 0);
|
3253
4021
|
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
3254
4022
|
|
3255
4023
|
// location
|
@@ -3259,17 +4027,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3259
4027
|
break;
|
3260
4028
|
}
|
3261
4029
|
#line 137 "api_node.c.erb"
|
3262
|
-
case
|
4030
|
+
case YP_RESCUE_MODIFIER_NODE: {
|
3263
4031
|
yp_rescue_modifier_node_t *cast = (yp_rescue_modifier_node_t *) node;
|
3264
4032
|
VALUE argv[4];
|
3265
4033
|
|
3266
4034
|
// expression
|
4035
|
+
#line 148 "api_node.c.erb"
|
3267
4036
|
argv[0] = rb_ary_pop(value_stack);
|
3268
4037
|
|
3269
4038
|
// keyword_loc
|
4039
|
+
#line 173 "api_node.c.erb"
|
3270
4040
|
argv[1] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
|
3271
4041
|
|
3272
4042
|
// rescue_expression
|
4043
|
+
#line 148 "api_node.c.erb"
|
3273
4044
|
argv[2] = rb_ary_pop(value_stack);
|
3274
4045
|
|
3275
4046
|
// location
|
@@ -3279,29 +4050,35 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3279
4050
|
break;
|
3280
4051
|
}
|
3281
4052
|
#line 137 "api_node.c.erb"
|
3282
|
-
case
|
4053
|
+
case YP_RESCUE_NODE: {
|
3283
4054
|
yp_rescue_node_t *cast = (yp_rescue_node_t *) node;
|
3284
4055
|
VALUE argv[7];
|
3285
4056
|
|
3286
4057
|
// keyword_loc
|
4058
|
+
#line 173 "api_node.c.erb"
|
3287
4059
|
argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
|
3288
4060
|
|
3289
4061
|
// exceptions
|
4062
|
+
#line 151 "api_node.c.erb"
|
3290
4063
|
argv[1] = rb_ary_new_capa(cast->exceptions.size);
|
3291
4064
|
for (size_t index = 0; index < cast->exceptions.size; index++) {
|
3292
4065
|
rb_ary_push(argv[1], rb_ary_pop(value_stack));
|
3293
4066
|
}
|
3294
4067
|
|
3295
4068
|
// operator_loc
|
4069
|
+
#line 176 "api_node.c.erb"
|
3296
4070
|
argv[2] = cast->operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
3297
4071
|
|
3298
4072
|
// reference
|
4073
|
+
#line 148 "api_node.c.erb"
|
3299
4074
|
argv[3] = rb_ary_pop(value_stack);
|
3300
4075
|
|
3301
4076
|
// statements
|
4077
|
+
#line 148 "api_node.c.erb"
|
3302
4078
|
argv[4] = rb_ary_pop(value_stack);
|
3303
4079
|
|
3304
4080
|
// consequent
|
4081
|
+
#line 148 "api_node.c.erb"
|
3305
4082
|
argv[5] = rb_ary_pop(value_stack);
|
3306
4083
|
|
3307
4084
|
// location
|
@@ -3311,24 +4088,29 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3311
4088
|
break;
|
3312
4089
|
}
|
3313
4090
|
#line 137 "api_node.c.erb"
|
3314
|
-
case
|
4091
|
+
case YP_REST_PARAMETER_NODE: {
|
3315
4092
|
yp_rest_parameter_node_t *cast = (yp_rest_parameter_node_t *) node;
|
3316
|
-
VALUE argv[
|
4093
|
+
VALUE argv[4];
|
3317
4094
|
|
3318
|
-
//
|
3319
|
-
argv[0] =
|
4095
|
+
// name
|
4096
|
+
argv[0] = cast->name == 0 ? Qnil : rb_id2sym(constants[cast->name - 1]);
|
3320
4097
|
|
3321
4098
|
// name_loc
|
4099
|
+
#line 176 "api_node.c.erb"
|
3322
4100
|
argv[1] = cast->name_loc.start == NULL ? Qnil : yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
3323
4101
|
|
4102
|
+
// operator_loc
|
4103
|
+
#line 173 "api_node.c.erb"
|
4104
|
+
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
4105
|
+
|
3324
4106
|
// location
|
3325
|
-
argv[
|
4107
|
+
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
|
3326
4108
|
|
3327
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
4109
|
+
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPRestParameterNode));
|
3328
4110
|
break;
|
3329
4111
|
}
|
3330
4112
|
#line 137 "api_node.c.erb"
|
3331
|
-
case
|
4113
|
+
case YP_RETRY_NODE: {
|
3332
4114
|
VALUE argv[1];
|
3333
4115
|
|
3334
4116
|
// location
|
@@ -3338,14 +4120,16 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3338
4120
|
break;
|
3339
4121
|
}
|
3340
4122
|
#line 137 "api_node.c.erb"
|
3341
|
-
case
|
4123
|
+
case YP_RETURN_NODE: {
|
3342
4124
|
yp_return_node_t *cast = (yp_return_node_t *) node;
|
3343
4125
|
VALUE argv[3];
|
3344
4126
|
|
3345
4127
|
// keyword_loc
|
4128
|
+
#line 173 "api_node.c.erb"
|
3346
4129
|
argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
|
3347
4130
|
|
3348
4131
|
// arguments
|
4132
|
+
#line 148 "api_node.c.erb"
|
3349
4133
|
argv[1] = rb_ary_pop(value_stack);
|
3350
4134
|
|
3351
4135
|
// location
|
@@ -3355,7 +4139,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3355
4139
|
break;
|
3356
4140
|
}
|
3357
4141
|
#line 137 "api_node.c.erb"
|
3358
|
-
case
|
4142
|
+
case YP_SELF_NODE: {
|
3359
4143
|
VALUE argv[1];
|
3360
4144
|
|
3361
4145
|
// location
|
@@ -3365,29 +4149,36 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3365
4149
|
break;
|
3366
4150
|
}
|
3367
4151
|
#line 137 "api_node.c.erb"
|
3368
|
-
case
|
4152
|
+
case YP_SINGLETON_CLASS_NODE: {
|
3369
4153
|
yp_singleton_class_node_t *cast = (yp_singleton_class_node_t *) node;
|
3370
4154
|
VALUE argv[7];
|
3371
4155
|
|
3372
4156
|
// locals
|
4157
|
+
#line 166 "api_node.c.erb"
|
3373
4158
|
argv[0] = rb_ary_new_capa(cast->locals.size);
|
3374
4159
|
for (size_t index = 0; index < cast->locals.size; index++) {
|
4160
|
+
assert(cast->locals.ids[index] != 0);
|
3375
4161
|
rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
|
3376
4162
|
}
|
3377
4163
|
|
3378
4164
|
// class_keyword_loc
|
4165
|
+
#line 173 "api_node.c.erb"
|
3379
4166
|
argv[1] = yp_location_new(parser, cast->class_keyword_loc.start, cast->class_keyword_loc.end, source);
|
3380
4167
|
|
3381
4168
|
// operator_loc
|
4169
|
+
#line 173 "api_node.c.erb"
|
3382
4170
|
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
3383
4171
|
|
3384
4172
|
// expression
|
4173
|
+
#line 148 "api_node.c.erb"
|
3385
4174
|
argv[3] = rb_ary_pop(value_stack);
|
3386
4175
|
|
3387
4176
|
// body
|
4177
|
+
#line 148 "api_node.c.erb"
|
3388
4178
|
argv[4] = rb_ary_pop(value_stack);
|
3389
4179
|
|
3390
4180
|
// end_keyword_loc
|
4181
|
+
#line 173 "api_node.c.erb"
|
3391
4182
|
argv[5] = yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
|
3392
4183
|
|
3393
4184
|
// location
|
@@ -3397,7 +4188,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3397
4188
|
break;
|
3398
4189
|
}
|
3399
4190
|
#line 137 "api_node.c.erb"
|
3400
|
-
case
|
4191
|
+
case YP_SOURCE_ENCODING_NODE: {
|
3401
4192
|
VALUE argv[1];
|
3402
4193
|
|
3403
4194
|
// location
|
@@ -3407,11 +4198,12 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3407
4198
|
break;
|
3408
4199
|
}
|
3409
4200
|
#line 137 "api_node.c.erb"
|
3410
|
-
case
|
4201
|
+
case YP_SOURCE_FILE_NODE: {
|
3411
4202
|
yp_source_file_node_t *cast = (yp_source_file_node_t *) node;
|
3412
4203
|
VALUE argv[2];
|
3413
4204
|
|
3414
4205
|
// filepath
|
4206
|
+
#line 157 "api_node.c.erb"
|
3415
4207
|
argv[0] = yp_string_new(&cast->filepath, encoding);
|
3416
4208
|
|
3417
4209
|
// location
|
@@ -3421,7 +4213,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3421
4213
|
break;
|
3422
4214
|
}
|
3423
4215
|
#line 137 "api_node.c.erb"
|
3424
|
-
case
|
4216
|
+
case YP_SOURCE_LINE_NODE: {
|
3425
4217
|
VALUE argv[1];
|
3426
4218
|
|
3427
4219
|
// location
|
@@ -3431,14 +4223,16 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3431
4223
|
break;
|
3432
4224
|
}
|
3433
4225
|
#line 137 "api_node.c.erb"
|
3434
|
-
case
|
4226
|
+
case YP_SPLAT_NODE: {
|
3435
4227
|
yp_splat_node_t *cast = (yp_splat_node_t *) node;
|
3436
4228
|
VALUE argv[3];
|
3437
4229
|
|
3438
4230
|
// operator_loc
|
4231
|
+
#line 173 "api_node.c.erb"
|
3439
4232
|
argv[0] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
3440
4233
|
|
3441
4234
|
// expression
|
4235
|
+
#line 148 "api_node.c.erb"
|
3442
4236
|
argv[1] = rb_ary_pop(value_stack);
|
3443
4237
|
|
3444
4238
|
// location
|
@@ -3448,11 +4242,12 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3448
4242
|
break;
|
3449
4243
|
}
|
3450
4244
|
#line 137 "api_node.c.erb"
|
3451
|
-
case
|
4245
|
+
case YP_STATEMENTS_NODE: {
|
3452
4246
|
yp_statements_node_t *cast = (yp_statements_node_t *) node;
|
3453
4247
|
VALUE argv[2];
|
3454
4248
|
|
3455
4249
|
// body
|
4250
|
+
#line 151 "api_node.c.erb"
|
3456
4251
|
argv[0] = rb_ary_new_capa(cast->body.size);
|
3457
4252
|
for (size_t index = 0; index < cast->body.size; index++) {
|
3458
4253
|
rb_ary_push(argv[0], rb_ary_pop(value_stack));
|
@@ -3465,13 +4260,15 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3465
4260
|
break;
|
3466
4261
|
}
|
3467
4262
|
#line 137 "api_node.c.erb"
|
3468
|
-
case
|
4263
|
+
case YP_STRING_CONCAT_NODE: {
|
3469
4264
|
VALUE argv[3];
|
3470
4265
|
|
3471
4266
|
// left
|
4267
|
+
#line 148 "api_node.c.erb"
|
3472
4268
|
argv[0] = rb_ary_pop(value_stack);
|
3473
4269
|
|
3474
4270
|
// right
|
4271
|
+
#line 148 "api_node.c.erb"
|
3475
4272
|
argv[1] = rb_ary_pop(value_stack);
|
3476
4273
|
|
3477
4274
|
// location
|
@@ -3481,46 +4278,59 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3481
4278
|
break;
|
3482
4279
|
}
|
3483
4280
|
#line 137 "api_node.c.erb"
|
3484
|
-
case
|
4281
|
+
case YP_STRING_NODE: {
|
3485
4282
|
yp_string_node_t *cast = (yp_string_node_t *) node;
|
3486
|
-
VALUE argv[
|
4283
|
+
VALUE argv[6];
|
4284
|
+
|
4285
|
+
// flags
|
4286
|
+
#line 182 "api_node.c.erb"
|
4287
|
+
argv[0] = ULONG2NUM(node->flags >> 2);
|
3487
4288
|
|
3488
4289
|
// opening_loc
|
3489
|
-
|
4290
|
+
#line 176 "api_node.c.erb"
|
4291
|
+
argv[1] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
3490
4292
|
|
3491
4293
|
// content_loc
|
3492
|
-
|
4294
|
+
#line 173 "api_node.c.erb"
|
4295
|
+
argv[2] = yp_location_new(parser, cast->content_loc.start, cast->content_loc.end, source);
|
3493
4296
|
|
3494
4297
|
// closing_loc
|
3495
|
-
|
4298
|
+
#line 176 "api_node.c.erb"
|
4299
|
+
argv[3] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
3496
4300
|
|
3497
4301
|
// unescaped
|
3498
|
-
|
4302
|
+
#line 157 "api_node.c.erb"
|
4303
|
+
argv[4] = yp_string_new(&cast->unescaped, encoding);
|
3499
4304
|
|
3500
4305
|
// location
|
3501
|
-
argv[
|
4306
|
+
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
|
3502
4307
|
|
3503
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
4308
|
+
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPStringNode));
|
3504
4309
|
break;
|
3505
4310
|
}
|
3506
4311
|
#line 137 "api_node.c.erb"
|
3507
|
-
case
|
4312
|
+
case YP_SUPER_NODE: {
|
3508
4313
|
yp_super_node_t *cast = (yp_super_node_t *) node;
|
3509
4314
|
VALUE argv[6];
|
3510
4315
|
|
3511
4316
|
// keyword_loc
|
4317
|
+
#line 173 "api_node.c.erb"
|
3512
4318
|
argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
|
3513
4319
|
|
3514
4320
|
// lparen_loc
|
4321
|
+
#line 176 "api_node.c.erb"
|
3515
4322
|
argv[1] = cast->lparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
|
3516
4323
|
|
3517
4324
|
// arguments
|
4325
|
+
#line 148 "api_node.c.erb"
|
3518
4326
|
argv[2] = rb_ary_pop(value_stack);
|
3519
4327
|
|
3520
4328
|
// rparen_loc
|
4329
|
+
#line 176 "api_node.c.erb"
|
3521
4330
|
argv[3] = cast->rparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
|
3522
4331
|
|
3523
4332
|
// block
|
4333
|
+
#line 148 "api_node.c.erb"
|
3524
4334
|
argv[4] = rb_ary_pop(value_stack);
|
3525
4335
|
|
3526
4336
|
// location
|
@@ -3530,20 +4340,24 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3530
4340
|
break;
|
3531
4341
|
}
|
3532
4342
|
#line 137 "api_node.c.erb"
|
3533
|
-
case
|
4343
|
+
case YP_SYMBOL_NODE: {
|
3534
4344
|
yp_symbol_node_t *cast = (yp_symbol_node_t *) node;
|
3535
4345
|
VALUE argv[5];
|
3536
4346
|
|
3537
4347
|
// opening_loc
|
4348
|
+
#line 176 "api_node.c.erb"
|
3538
4349
|
argv[0] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
3539
4350
|
|
3540
4351
|
// value_loc
|
4352
|
+
#line 176 "api_node.c.erb"
|
3541
4353
|
argv[1] = cast->value_loc.start == NULL ? Qnil : yp_location_new(parser, cast->value_loc.start, cast->value_loc.end, source);
|
3542
4354
|
|
3543
4355
|
// closing_loc
|
4356
|
+
#line 176 "api_node.c.erb"
|
3544
4357
|
argv[2] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
3545
4358
|
|
3546
4359
|
// unescaped
|
4360
|
+
#line 157 "api_node.c.erb"
|
3547
4361
|
argv[3] = yp_string_new(&cast->unescaped, encoding);
|
3548
4362
|
|
3549
4363
|
// location
|
@@ -3553,7 +4367,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3553
4367
|
break;
|
3554
4368
|
}
|
3555
4369
|
#line 137 "api_node.c.erb"
|
3556
|
-
case
|
4370
|
+
case YP_TRUE_NODE: {
|
3557
4371
|
VALUE argv[1];
|
3558
4372
|
|
3559
4373
|
// location
|
@@ -3563,17 +4377,19 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3563
4377
|
break;
|
3564
4378
|
}
|
3565
4379
|
#line 137 "api_node.c.erb"
|
3566
|
-
case
|
4380
|
+
case YP_UNDEF_NODE: {
|
3567
4381
|
yp_undef_node_t *cast = (yp_undef_node_t *) node;
|
3568
4382
|
VALUE argv[3];
|
3569
4383
|
|
3570
4384
|
// names
|
4385
|
+
#line 151 "api_node.c.erb"
|
3571
4386
|
argv[0] = rb_ary_new_capa(cast->names.size);
|
3572
4387
|
for (size_t index = 0; index < cast->names.size; index++) {
|
3573
4388
|
rb_ary_push(argv[0], rb_ary_pop(value_stack));
|
3574
4389
|
}
|
3575
4390
|
|
3576
4391
|
// keyword_loc
|
4392
|
+
#line 173 "api_node.c.erb"
|
3577
4393
|
argv[1] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
|
3578
4394
|
|
3579
4395
|
// location
|
@@ -3583,23 +4399,28 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3583
4399
|
break;
|
3584
4400
|
}
|
3585
4401
|
#line 137 "api_node.c.erb"
|
3586
|
-
case
|
4402
|
+
case YP_UNLESS_NODE: {
|
3587
4403
|
yp_unless_node_t *cast = (yp_unless_node_t *) node;
|
3588
4404
|
VALUE argv[6];
|
3589
4405
|
|
3590
4406
|
// keyword_loc
|
4407
|
+
#line 173 "api_node.c.erb"
|
3591
4408
|
argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
|
3592
4409
|
|
3593
4410
|
// predicate
|
4411
|
+
#line 148 "api_node.c.erb"
|
3594
4412
|
argv[1] = rb_ary_pop(value_stack);
|
3595
4413
|
|
3596
4414
|
// statements
|
4415
|
+
#line 148 "api_node.c.erb"
|
3597
4416
|
argv[2] = rb_ary_pop(value_stack);
|
3598
4417
|
|
3599
4418
|
// consequent
|
4419
|
+
#line 148 "api_node.c.erb"
|
3600
4420
|
argv[3] = rb_ary_pop(value_stack);
|
3601
4421
|
|
3602
4422
|
// end_keyword_loc
|
4423
|
+
#line 176 "api_node.c.erb"
|
3603
4424
|
argv[4] = cast->end_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
|
3604
4425
|
|
3605
4426
|
// location
|
@@ -3609,24 +4430,29 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3609
4430
|
break;
|
3610
4431
|
}
|
3611
4432
|
#line 137 "api_node.c.erb"
|
3612
|
-
case
|
4433
|
+
case YP_UNTIL_NODE: {
|
3613
4434
|
yp_until_node_t *cast = (yp_until_node_t *) node;
|
3614
4435
|
VALUE argv[6];
|
3615
4436
|
|
3616
4437
|
// keyword_loc
|
4438
|
+
#line 173 "api_node.c.erb"
|
3617
4439
|
argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
|
3618
4440
|
|
3619
4441
|
// closing_loc
|
4442
|
+
#line 176 "api_node.c.erb"
|
3620
4443
|
argv[1] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
3621
4444
|
|
3622
4445
|
// predicate
|
4446
|
+
#line 148 "api_node.c.erb"
|
3623
4447
|
argv[2] = rb_ary_pop(value_stack);
|
3624
4448
|
|
3625
4449
|
// statements
|
4450
|
+
#line 148 "api_node.c.erb"
|
3626
4451
|
argv[3] = rb_ary_pop(value_stack);
|
3627
4452
|
|
3628
4453
|
// flags
|
3629
|
-
|
4454
|
+
#line 182 "api_node.c.erb"
|
4455
|
+
argv[4] = ULONG2NUM(node->flags >> 2);
|
3630
4456
|
|
3631
4457
|
// location
|
3632
4458
|
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
|
@@ -3635,20 +4461,23 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3635
4461
|
break;
|
3636
4462
|
}
|
3637
4463
|
#line 137 "api_node.c.erb"
|
3638
|
-
case
|
4464
|
+
case YP_WHEN_NODE: {
|
3639
4465
|
yp_when_node_t *cast = (yp_when_node_t *) node;
|
3640
4466
|
VALUE argv[4];
|
3641
4467
|
|
3642
4468
|
// keyword_loc
|
4469
|
+
#line 173 "api_node.c.erb"
|
3643
4470
|
argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
|
3644
4471
|
|
3645
4472
|
// conditions
|
4473
|
+
#line 151 "api_node.c.erb"
|
3646
4474
|
argv[1] = rb_ary_new_capa(cast->conditions.size);
|
3647
4475
|
for (size_t index = 0; index < cast->conditions.size; index++) {
|
3648
4476
|
rb_ary_push(argv[1], rb_ary_pop(value_stack));
|
3649
4477
|
}
|
3650
4478
|
|
3651
4479
|
// statements
|
4480
|
+
#line 148 "api_node.c.erb"
|
3652
4481
|
argv[2] = rb_ary_pop(value_stack);
|
3653
4482
|
|
3654
4483
|
// location
|
@@ -3658,24 +4487,29 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3658
4487
|
break;
|
3659
4488
|
}
|
3660
4489
|
#line 137 "api_node.c.erb"
|
3661
|
-
case
|
4490
|
+
case YP_WHILE_NODE: {
|
3662
4491
|
yp_while_node_t *cast = (yp_while_node_t *) node;
|
3663
4492
|
VALUE argv[6];
|
3664
4493
|
|
3665
4494
|
// keyword_loc
|
4495
|
+
#line 173 "api_node.c.erb"
|
3666
4496
|
argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
|
3667
4497
|
|
3668
4498
|
// closing_loc
|
4499
|
+
#line 176 "api_node.c.erb"
|
3669
4500
|
argv[1] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
3670
4501
|
|
3671
4502
|
// predicate
|
4503
|
+
#line 148 "api_node.c.erb"
|
3672
4504
|
argv[2] = rb_ary_pop(value_stack);
|
3673
4505
|
|
3674
4506
|
// statements
|
4507
|
+
#line 148 "api_node.c.erb"
|
3675
4508
|
argv[3] = rb_ary_pop(value_stack);
|
3676
4509
|
|
3677
4510
|
// flags
|
3678
|
-
|
4511
|
+
#line 182 "api_node.c.erb"
|
4512
|
+
argv[4] = ULONG2NUM(node->flags >> 2);
|
3679
4513
|
|
3680
4514
|
// location
|
3681
4515
|
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
|
@@ -3684,20 +4518,24 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3684
4518
|
break;
|
3685
4519
|
}
|
3686
4520
|
#line 137 "api_node.c.erb"
|
3687
|
-
case
|
4521
|
+
case YP_X_STRING_NODE: {
|
3688
4522
|
yp_x_string_node_t *cast = (yp_x_string_node_t *) node;
|
3689
4523
|
VALUE argv[5];
|
3690
4524
|
|
3691
4525
|
// opening_loc
|
4526
|
+
#line 173 "api_node.c.erb"
|
3692
4527
|
argv[0] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
3693
4528
|
|
3694
4529
|
// content_loc
|
4530
|
+
#line 173 "api_node.c.erb"
|
3695
4531
|
argv[1] = yp_location_new(parser, cast->content_loc.start, cast->content_loc.end, source);
|
3696
4532
|
|
3697
4533
|
// closing_loc
|
4534
|
+
#line 173 "api_node.c.erb"
|
3698
4535
|
argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
3699
4536
|
|
3700
4537
|
// unescaped
|
4538
|
+
#line 157 "api_node.c.erb"
|
3701
4539
|
argv[3] = yp_string_new(&cast->unescaped, encoding);
|
3702
4540
|
|
3703
4541
|
// location
|
@@ -3707,20 +4545,24 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3707
4545
|
break;
|
3708
4546
|
}
|
3709
4547
|
#line 137 "api_node.c.erb"
|
3710
|
-
case
|
4548
|
+
case YP_YIELD_NODE: {
|
3711
4549
|
yp_yield_node_t *cast = (yp_yield_node_t *) node;
|
3712
4550
|
VALUE argv[5];
|
3713
4551
|
|
3714
4552
|
// keyword_loc
|
4553
|
+
#line 173 "api_node.c.erb"
|
3715
4554
|
argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
|
3716
4555
|
|
3717
4556
|
// lparen_loc
|
4557
|
+
#line 176 "api_node.c.erb"
|
3718
4558
|
argv[1] = cast->lparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
|
3719
4559
|
|
3720
4560
|
// arguments
|
4561
|
+
#line 148 "api_node.c.erb"
|
3721
4562
|
argv[2] = rb_ary_pop(value_stack);
|
3722
4563
|
|
3723
4564
|
// rparen_loc
|
4565
|
+
#line 176 "api_node.c.erb"
|
3724
4566
|
argv[3] = cast->rparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
|
3725
4567
|
|
3726
4568
|
// location
|
@@ -3742,7 +4584,8 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3742
4584
|
|
3743
4585
|
void
|
3744
4586
|
Init_yarp_api_node(void) {
|
3745
|
-
|
4587
|
+
rb_cYARPAliasGlobalVariableNode = rb_define_class_under(rb_cYARP, "AliasGlobalVariableNode", rb_cYARPNode);
|
4588
|
+
rb_cYARPAliasMethodNode = rb_define_class_under(rb_cYARP, "AliasMethodNode", rb_cYARPNode);
|
3746
4589
|
rb_cYARPAlternationPatternNode = rb_define_class_under(rb_cYARP, "AlternationPatternNode", rb_cYARPNode);
|
3747
4590
|
rb_cYARPAndNode = rb_define_class_under(rb_cYARP, "AndNode", rb_cYARPNode);
|
3748
4591
|
rb_cYARPArgumentsNode = rb_define_class_under(rb_cYARP, "ArgumentsNode", rb_cYARPNode);
|
@@ -3753,14 +4596,15 @@ Init_yarp_api_node(void) {
|
|
3753
4596
|
rb_cYARPBackReferenceReadNode = rb_define_class_under(rb_cYARP, "BackReferenceReadNode", rb_cYARPNode);
|
3754
4597
|
rb_cYARPBeginNode = rb_define_class_under(rb_cYARP, "BeginNode", rb_cYARPNode);
|
3755
4598
|
rb_cYARPBlockArgumentNode = rb_define_class_under(rb_cYARP, "BlockArgumentNode", rb_cYARPNode);
|
4599
|
+
rb_cYARPBlockLocalVariableNode = rb_define_class_under(rb_cYARP, "BlockLocalVariableNode", rb_cYARPNode);
|
3756
4600
|
rb_cYARPBlockNode = rb_define_class_under(rb_cYARP, "BlockNode", rb_cYARPNode);
|
3757
4601
|
rb_cYARPBlockParameterNode = rb_define_class_under(rb_cYARP, "BlockParameterNode", rb_cYARPNode);
|
3758
4602
|
rb_cYARPBlockParametersNode = rb_define_class_under(rb_cYARP, "BlockParametersNode", rb_cYARPNode);
|
3759
4603
|
rb_cYARPBreakNode = rb_define_class_under(rb_cYARP, "BreakNode", rb_cYARPNode);
|
4604
|
+
rb_cYARPCallAndWriteNode = rb_define_class_under(rb_cYARP, "CallAndWriteNode", rb_cYARPNode);
|
3760
4605
|
rb_cYARPCallNode = rb_define_class_under(rb_cYARP, "CallNode", rb_cYARPNode);
|
3761
|
-
rb_cYARPCallOperatorAndWriteNode = rb_define_class_under(rb_cYARP, "CallOperatorAndWriteNode", rb_cYARPNode);
|
3762
|
-
rb_cYARPCallOperatorOrWriteNode = rb_define_class_under(rb_cYARP, "CallOperatorOrWriteNode", rb_cYARPNode);
|
3763
4606
|
rb_cYARPCallOperatorWriteNode = rb_define_class_under(rb_cYARP, "CallOperatorWriteNode", rb_cYARPNode);
|
4607
|
+
rb_cYARPCallOrWriteNode = rb_define_class_under(rb_cYARP, "CallOrWriteNode", rb_cYARPNode);
|
3764
4608
|
rb_cYARPCapturePatternNode = rb_define_class_under(rb_cYARP, "CapturePatternNode", rb_cYARPNode);
|
3765
4609
|
rb_cYARPCaseNode = rb_define_class_under(rb_cYARP, "CaseNode", rb_cYARPNode);
|
3766
4610
|
rb_cYARPClassNode = rb_define_class_under(rb_cYARP, "ClassNode", rb_cYARPNode);
|
@@ -3806,6 +4650,7 @@ Init_yarp_api_node(void) {
|
|
3806
4650
|
rb_cYARPHashPatternNode = rb_define_class_under(rb_cYARP, "HashPatternNode", rb_cYARPNode);
|
3807
4651
|
rb_cYARPIfNode = rb_define_class_under(rb_cYARP, "IfNode", rb_cYARPNode);
|
3808
4652
|
rb_cYARPImaginaryNode = rb_define_class_under(rb_cYARP, "ImaginaryNode", rb_cYARPNode);
|
4653
|
+
rb_cYARPImplicitNode = rb_define_class_under(rb_cYARP, "ImplicitNode", rb_cYARPNode);
|
3809
4654
|
rb_cYARPInNode = rb_define_class_under(rb_cYARP, "InNode", rb_cYARPNode);
|
3810
4655
|
rb_cYARPInstanceVariableAndWriteNode = rb_define_class_under(rb_cYARP, "InstanceVariableAndWriteNode", rb_cYARPNode);
|
3811
4656
|
rb_cYARPInstanceVariableOperatorWriteNode = rb_define_class_under(rb_cYARP, "InstanceVariableOperatorWriteNode", rb_cYARPNode);
|
@@ -3814,6 +4659,7 @@ Init_yarp_api_node(void) {
|
|
3814
4659
|
rb_cYARPInstanceVariableTargetNode = rb_define_class_under(rb_cYARP, "InstanceVariableTargetNode", rb_cYARPNode);
|
3815
4660
|
rb_cYARPInstanceVariableWriteNode = rb_define_class_under(rb_cYARP, "InstanceVariableWriteNode", rb_cYARPNode);
|
3816
4661
|
rb_cYARPIntegerNode = rb_define_class_under(rb_cYARP, "IntegerNode", rb_cYARPNode);
|
4662
|
+
rb_cYARPInterpolatedMatchLastLineNode = rb_define_class_under(rb_cYARP, "InterpolatedMatchLastLineNode", rb_cYARPNode);
|
3817
4663
|
rb_cYARPInterpolatedRegularExpressionNode = rb_define_class_under(rb_cYARP, "InterpolatedRegularExpressionNode", rb_cYARPNode);
|
3818
4664
|
rb_cYARPInterpolatedStringNode = rb_define_class_under(rb_cYARP, "InterpolatedStringNode", rb_cYARPNode);
|
3819
4665
|
rb_cYARPInterpolatedSymbolNode = rb_define_class_under(rb_cYARP, "InterpolatedSymbolNode", rb_cYARPNode);
|
@@ -3828,10 +4674,13 @@ Init_yarp_api_node(void) {
|
|
3828
4674
|
rb_cYARPLocalVariableReadNode = rb_define_class_under(rb_cYARP, "LocalVariableReadNode", rb_cYARPNode);
|
3829
4675
|
rb_cYARPLocalVariableTargetNode = rb_define_class_under(rb_cYARP, "LocalVariableTargetNode", rb_cYARPNode);
|
3830
4676
|
rb_cYARPLocalVariableWriteNode = rb_define_class_under(rb_cYARP, "LocalVariableWriteNode", rb_cYARPNode);
|
4677
|
+
rb_cYARPMatchLastLineNode = rb_define_class_under(rb_cYARP, "MatchLastLineNode", rb_cYARPNode);
|
3831
4678
|
rb_cYARPMatchPredicateNode = rb_define_class_under(rb_cYARP, "MatchPredicateNode", rb_cYARPNode);
|
3832
4679
|
rb_cYARPMatchRequiredNode = rb_define_class_under(rb_cYARP, "MatchRequiredNode", rb_cYARPNode);
|
4680
|
+
rb_cYARPMatchWriteNode = rb_define_class_under(rb_cYARP, "MatchWriteNode", rb_cYARPNode);
|
3833
4681
|
rb_cYARPMissingNode = rb_define_class_under(rb_cYARP, "MissingNode", rb_cYARPNode);
|
3834
4682
|
rb_cYARPModuleNode = rb_define_class_under(rb_cYARP, "ModuleNode", rb_cYARPNode);
|
4683
|
+
rb_cYARPMultiTargetNode = rb_define_class_under(rb_cYARP, "MultiTargetNode", rb_cYARPNode);
|
3835
4684
|
rb_cYARPMultiWriteNode = rb_define_class_under(rb_cYARP, "MultiWriteNode", rb_cYARPNode);
|
3836
4685
|
rb_cYARPNextNode = rb_define_class_under(rb_cYARP, "NextNode", rb_cYARPNode);
|
3837
4686
|
rb_cYARPNilNode = rb_define_class_under(rb_cYARP, "NilNode", rb_cYARPNode);
|