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