yarp 0.8.0 → 0.10.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 +48 -1
- data/Makefile +5 -1
- data/README.md +4 -3
- data/config.yml +461 -150
- data/docs/configuration.md +1 -0
- data/docs/encoding.md +5 -5
- data/docs/ruby_api.md +2 -0
- data/docs/serialization.md +3 -3
- data/docs/testing.md +2 -2
- data/ext/yarp/api_node.c +810 -199
- data/ext/yarp/extension.c +94 -31
- data/ext/yarp/extension.h +2 -2
- data/include/yarp/ast.h +653 -150
- data/include/yarp/defines.h +2 -1
- data/include/yarp/diagnostic.h +3 -3
- data/include/yarp/enc/yp_encoding.h +10 -10
- data/include/yarp/node.h +10 -0
- data/include/yarp/parser.h +19 -19
- data/include/yarp/regexp.h +1 -1
- data/include/yarp/unescape.h +7 -5
- 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 +2 -2
- data/include/yarp/util/yp_newline_list.h +7 -4
- 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 +14 -3
- data/lib/yarp/desugar_visitor.rb +204 -0
- data/lib/yarp/ffi.rb +27 -1
- data/lib/yarp/lex_compat.rb +93 -25
- data/lib/yarp/mutation_visitor.rb +683 -0
- data/lib/yarp/node.rb +3121 -597
- data/lib/yarp/serialize.rb +198 -126
- data/lib/yarp.rb +53 -7
- data/src/diagnostic.c +1 -1
- 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 +1444 -836
- data/src/prettyprint.c +324 -103
- data/src/regexp.c +21 -21
- data/src/serialize.c +429 -276
- data/src/token_type.c +2 -2
- data/src/unescape.c +184 -136
- data/src/util/yp_buffer.c +7 -2
- data/src/util/yp_char.c +34 -34
- data/src/util/yp_constant_pool.c +4 -4
- data/src/util/yp_memchr.c +1 -1
- data/src/util/yp_newline_list.c +14 -3
- data/src/util/yp_string.c +22 -20
- data/src/util/yp_string_list.c +0 -6
- data/src/util/yp_strncasecmp.c +3 -6
- data/src/util/yp_strpbrk.c +8 -8
- data/src/yarp.c +1504 -615
- data/yarp.gemspec +3 -1
- metadata +4 -2
data/ext/yarp/api_node.c
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/******************************************************************************/
|
2
|
-
/* This file is generated by the
|
3
|
-
/* modified manually. See
|
2
|
+
/* This file is generated by the templates/template.rb script and should not */
|
3
|
+
/* be modified manually. See */
|
4
4
|
/* templates/ext/yarp/api_node.c.erb */
|
5
5
|
/* if you are looking to modify the */
|
6
6
|
/* template */
|
@@ -17,7 +17,6 @@ extern VALUE rb_cYARPLocation;
|
|
17
17
|
static VALUE rb_cYARPAliasNode;
|
18
18
|
static VALUE rb_cYARPAlternationPatternNode;
|
19
19
|
static VALUE rb_cYARPAndNode;
|
20
|
-
static VALUE rb_cYARPAndWriteNode;
|
21
20
|
static VALUE rb_cYARPArgumentsNode;
|
22
21
|
static VALUE rb_cYARPArrayNode;
|
23
22
|
static VALUE rb_cYARPArrayPatternNode;
|
@@ -37,11 +36,23 @@ static VALUE rb_cYARPCallOperatorWriteNode;
|
|
37
36
|
static VALUE rb_cYARPCapturePatternNode;
|
38
37
|
static VALUE rb_cYARPCaseNode;
|
39
38
|
static VALUE rb_cYARPClassNode;
|
39
|
+
static VALUE rb_cYARPClassVariableAndWriteNode;
|
40
|
+
static VALUE rb_cYARPClassVariableOperatorWriteNode;
|
41
|
+
static VALUE rb_cYARPClassVariableOrWriteNode;
|
40
42
|
static VALUE rb_cYARPClassVariableReadNode;
|
43
|
+
static VALUE rb_cYARPClassVariableTargetNode;
|
41
44
|
static VALUE rb_cYARPClassVariableWriteNode;
|
45
|
+
static VALUE rb_cYARPConstantAndWriteNode;
|
46
|
+
static VALUE rb_cYARPConstantOperatorWriteNode;
|
47
|
+
static VALUE rb_cYARPConstantOrWriteNode;
|
48
|
+
static VALUE rb_cYARPConstantPathAndWriteNode;
|
42
49
|
static VALUE rb_cYARPConstantPathNode;
|
50
|
+
static VALUE rb_cYARPConstantPathOperatorWriteNode;
|
51
|
+
static VALUE rb_cYARPConstantPathOrWriteNode;
|
52
|
+
static VALUE rb_cYARPConstantPathTargetNode;
|
43
53
|
static VALUE rb_cYARPConstantPathWriteNode;
|
44
54
|
static VALUE rb_cYARPConstantReadNode;
|
55
|
+
static VALUE rb_cYARPConstantTargetNode;
|
45
56
|
static VALUE rb_cYARPConstantWriteNode;
|
46
57
|
static VALUE rb_cYARPDefNode;
|
47
58
|
static VALUE rb_cYARPDefinedNode;
|
@@ -57,14 +68,22 @@ static VALUE rb_cYARPForNode;
|
|
57
68
|
static VALUE rb_cYARPForwardingArgumentsNode;
|
58
69
|
static VALUE rb_cYARPForwardingParameterNode;
|
59
70
|
static VALUE rb_cYARPForwardingSuperNode;
|
71
|
+
static VALUE rb_cYARPGlobalVariableAndWriteNode;
|
72
|
+
static VALUE rb_cYARPGlobalVariableOperatorWriteNode;
|
73
|
+
static VALUE rb_cYARPGlobalVariableOrWriteNode;
|
60
74
|
static VALUE rb_cYARPGlobalVariableReadNode;
|
75
|
+
static VALUE rb_cYARPGlobalVariableTargetNode;
|
61
76
|
static VALUE rb_cYARPGlobalVariableWriteNode;
|
62
77
|
static VALUE rb_cYARPHashNode;
|
63
78
|
static VALUE rb_cYARPHashPatternNode;
|
64
79
|
static VALUE rb_cYARPIfNode;
|
65
80
|
static VALUE rb_cYARPImaginaryNode;
|
66
81
|
static VALUE rb_cYARPInNode;
|
82
|
+
static VALUE rb_cYARPInstanceVariableAndWriteNode;
|
83
|
+
static VALUE rb_cYARPInstanceVariableOperatorWriteNode;
|
84
|
+
static VALUE rb_cYARPInstanceVariableOrWriteNode;
|
67
85
|
static VALUE rb_cYARPInstanceVariableReadNode;
|
86
|
+
static VALUE rb_cYARPInstanceVariableTargetNode;
|
68
87
|
static VALUE rb_cYARPInstanceVariableWriteNode;
|
69
88
|
static VALUE rb_cYARPIntegerNode;
|
70
89
|
static VALUE rb_cYARPInterpolatedRegularExpressionNode;
|
@@ -75,7 +94,11 @@ static VALUE rb_cYARPKeywordHashNode;
|
|
75
94
|
static VALUE rb_cYARPKeywordParameterNode;
|
76
95
|
static VALUE rb_cYARPKeywordRestParameterNode;
|
77
96
|
static VALUE rb_cYARPLambdaNode;
|
97
|
+
static VALUE rb_cYARPLocalVariableAndWriteNode;
|
98
|
+
static VALUE rb_cYARPLocalVariableOperatorWriteNode;
|
99
|
+
static VALUE rb_cYARPLocalVariableOrWriteNode;
|
78
100
|
static VALUE rb_cYARPLocalVariableReadNode;
|
101
|
+
static VALUE rb_cYARPLocalVariableTargetNode;
|
79
102
|
static VALUE rb_cYARPLocalVariableWriteNode;
|
80
103
|
static VALUE rb_cYARPMatchPredicateNode;
|
81
104
|
static VALUE rb_cYARPMatchRequiredNode;
|
@@ -86,10 +109,8 @@ static VALUE rb_cYARPNextNode;
|
|
86
109
|
static VALUE rb_cYARPNilNode;
|
87
110
|
static VALUE rb_cYARPNoKeywordsParameterNode;
|
88
111
|
static VALUE rb_cYARPNumberedReferenceReadNode;
|
89
|
-
static VALUE rb_cYARPOperatorWriteNode;
|
90
112
|
static VALUE rb_cYARPOptionalParameterNode;
|
91
113
|
static VALUE rb_cYARPOrNode;
|
92
|
-
static VALUE rb_cYARPOrWriteNode;
|
93
114
|
static VALUE rb_cYARPParametersNode;
|
94
115
|
static VALUE rb_cYARPParenthesesNode;
|
95
116
|
static VALUE rb_cYARPPinnedExpressionNode;
|
@@ -129,7 +150,7 @@ static VALUE rb_cYARPXStringNode;
|
|
129
150
|
static VALUE rb_cYARPYieldNode;
|
130
151
|
|
131
152
|
static VALUE
|
132
|
-
yp_location_new(yp_parser_t *parser, const
|
153
|
+
yp_location_new(yp_parser_t *parser, const uint8_t *start, const uint8_t *end, VALUE source) {
|
133
154
|
VALUE argv[] = { source, LONG2FIX(start - parser->start), LONG2FIX(end - start) };
|
134
155
|
return rb_class_new_instance(3, argv, rb_cYARPLocation);
|
135
156
|
}
|
@@ -141,7 +162,7 @@ yp_token_new(yp_parser_t *parser, yp_token_t *token, rb_encoding *encoding, VALU
|
|
141
162
|
|
142
163
|
VALUE argv[] = {
|
143
164
|
ID2SYM(type),
|
144
|
-
rb_enc_str_new(token->start, token->end - token->start, encoding),
|
165
|
+
rb_enc_str_new((const char *) token->start, token->end - token->start, encoding),
|
145
166
|
location
|
146
167
|
};
|
147
168
|
|
@@ -150,13 +171,13 @@ yp_token_new(yp_parser_t *parser, yp_token_t *token, rb_encoding *encoding, VALU
|
|
150
171
|
|
151
172
|
static VALUE
|
152
173
|
yp_string_new(yp_string_t *string, rb_encoding *encoding) {
|
153
|
-
return rb_enc_str_new(yp_string_source(string), yp_string_length(string), encoding);
|
174
|
+
return rb_enc_str_new((const char *) yp_string_source(string), yp_string_length(string), encoding);
|
154
175
|
}
|
155
176
|
|
156
177
|
// Create a YARP::Source object from the given parser.
|
157
178
|
VALUE
|
158
179
|
yp_source_new(yp_parser_t *parser) {
|
159
|
-
VALUE source = rb_str_new(parser->start, parser->end - parser->start);
|
180
|
+
VALUE source = rb_str_new((const char *) parser->start, parser->end - parser->start);
|
160
181
|
VALUE offsets = rb_ary_new_capa(parser->newline_list.size);
|
161
182
|
|
162
183
|
for (size_t index = 0; index < parser->newline_list.size; index++) {
|
@@ -202,7 +223,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
202
223
|
yp_constant_t constant = parser->constant_pool.constants[index];
|
203
224
|
|
204
225
|
if (constant.id != 0) {
|
205
|
-
constants[constant.id - 1] = rb_intern3(constant.start, constant.length, encoding);
|
226
|
+
constants[constant.id - 1] = rb_intern3((const char *) constant.start, constant.length, encoding);
|
206
227
|
}
|
207
228
|
}
|
208
229
|
|
@@ -243,13 +264,6 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
243
264
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->right);
|
244
265
|
break;
|
245
266
|
}
|
246
|
-
#line 111 "api_node.c.erb"
|
247
|
-
case YP_NODE_AND_WRITE_NODE: {
|
248
|
-
yp_and_write_node_t *cast = (yp_and_write_node_t *) node;
|
249
|
-
yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
|
250
|
-
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
251
|
-
break;
|
252
|
-
}
|
253
267
|
#line 111 "api_node.c.erb"
|
254
268
|
case YP_NODE_ARGUMENTS_NODE: {
|
255
269
|
yp_arguments_node_t *cast = (yp_arguments_node_t *) node;
|
@@ -380,12 +394,55 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
380
394
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->body);
|
381
395
|
break;
|
382
396
|
}
|
397
|
+
#line 111 "api_node.c.erb"
|
398
|
+
case YP_NODE_CLASS_VARIABLE_AND_WRITE_NODE: {
|
399
|
+
yp_class_variable_and_write_node_t *cast = (yp_class_variable_and_write_node_t *) node;
|
400
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
401
|
+
break;
|
402
|
+
}
|
403
|
+
#line 111 "api_node.c.erb"
|
404
|
+
case YP_NODE_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
|
405
|
+
yp_class_variable_operator_write_node_t *cast = (yp_class_variable_operator_write_node_t *) node;
|
406
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
407
|
+
break;
|
408
|
+
}
|
409
|
+
#line 111 "api_node.c.erb"
|
410
|
+
case YP_NODE_CLASS_VARIABLE_OR_WRITE_NODE: {
|
411
|
+
yp_class_variable_or_write_node_t *cast = (yp_class_variable_or_write_node_t *) node;
|
412
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
413
|
+
break;
|
414
|
+
}
|
383
415
|
#line 111 "api_node.c.erb"
|
384
416
|
case YP_NODE_CLASS_VARIABLE_WRITE_NODE: {
|
385
417
|
yp_class_variable_write_node_t *cast = (yp_class_variable_write_node_t *) node;
|
386
418
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
387
419
|
break;
|
388
420
|
}
|
421
|
+
#line 111 "api_node.c.erb"
|
422
|
+
case YP_NODE_CONSTANT_AND_WRITE_NODE: {
|
423
|
+
yp_constant_and_write_node_t *cast = (yp_constant_and_write_node_t *) node;
|
424
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
425
|
+
break;
|
426
|
+
}
|
427
|
+
#line 111 "api_node.c.erb"
|
428
|
+
case YP_NODE_CONSTANT_OPERATOR_WRITE_NODE: {
|
429
|
+
yp_constant_operator_write_node_t *cast = (yp_constant_operator_write_node_t *) node;
|
430
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
431
|
+
break;
|
432
|
+
}
|
433
|
+
#line 111 "api_node.c.erb"
|
434
|
+
case YP_NODE_CONSTANT_OR_WRITE_NODE: {
|
435
|
+
yp_constant_or_write_node_t *cast = (yp_constant_or_write_node_t *) node;
|
436
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
437
|
+
break;
|
438
|
+
}
|
439
|
+
#line 111 "api_node.c.erb"
|
440
|
+
case YP_NODE_CONSTANT_PATH_AND_WRITE_NODE: {
|
441
|
+
yp_constant_path_and_write_node_t *cast = (yp_constant_path_and_write_node_t *) node;
|
442
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
|
443
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
444
|
+
break;
|
445
|
+
}
|
389
446
|
#line 111 "api_node.c.erb"
|
390
447
|
case YP_NODE_CONSTANT_PATH_NODE: {
|
391
448
|
yp_constant_path_node_t *cast = (yp_constant_path_node_t *) node;
|
@@ -393,6 +450,27 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
393
450
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->child);
|
394
451
|
break;
|
395
452
|
}
|
453
|
+
#line 111 "api_node.c.erb"
|
454
|
+
case YP_NODE_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
|
455
|
+
yp_constant_path_operator_write_node_t *cast = (yp_constant_path_operator_write_node_t *) node;
|
456
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
|
457
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
458
|
+
break;
|
459
|
+
}
|
460
|
+
#line 111 "api_node.c.erb"
|
461
|
+
case YP_NODE_CONSTANT_PATH_OR_WRITE_NODE: {
|
462
|
+
yp_constant_path_or_write_node_t *cast = (yp_constant_path_or_write_node_t *) node;
|
463
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
|
464
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
465
|
+
break;
|
466
|
+
}
|
467
|
+
#line 111 "api_node.c.erb"
|
468
|
+
case YP_NODE_CONSTANT_PATH_TARGET_NODE: {
|
469
|
+
yp_constant_path_target_node_t *cast = (yp_constant_path_target_node_t *) node;
|
470
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parent);
|
471
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->child);
|
472
|
+
break;
|
473
|
+
}
|
396
474
|
#line 111 "api_node.c.erb"
|
397
475
|
case YP_NODE_CONSTANT_PATH_WRITE_NODE: {
|
398
476
|
yp_constant_path_write_node_t *cast = (yp_constant_path_write_node_t *) node;
|
@@ -476,6 +554,24 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
476
554
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->block);
|
477
555
|
break;
|
478
556
|
}
|
557
|
+
#line 111 "api_node.c.erb"
|
558
|
+
case YP_NODE_GLOBAL_VARIABLE_AND_WRITE_NODE: {
|
559
|
+
yp_global_variable_and_write_node_t *cast = (yp_global_variable_and_write_node_t *) node;
|
560
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
561
|
+
break;
|
562
|
+
}
|
563
|
+
#line 111 "api_node.c.erb"
|
564
|
+
case YP_NODE_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
|
565
|
+
yp_global_variable_operator_write_node_t *cast = (yp_global_variable_operator_write_node_t *) node;
|
566
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
567
|
+
break;
|
568
|
+
}
|
569
|
+
#line 111 "api_node.c.erb"
|
570
|
+
case YP_NODE_GLOBAL_VARIABLE_OR_WRITE_NODE: {
|
571
|
+
yp_global_variable_or_write_node_t *cast = (yp_global_variable_or_write_node_t *) node;
|
572
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
573
|
+
break;
|
574
|
+
}
|
479
575
|
#line 111 "api_node.c.erb"
|
480
576
|
case YP_NODE_GLOBAL_VARIABLE_WRITE_NODE: {
|
481
577
|
yp_global_variable_write_node_t *cast = (yp_global_variable_write_node_t *) node;
|
@@ -521,6 +617,24 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
521
617
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
|
522
618
|
break;
|
523
619
|
}
|
620
|
+
#line 111 "api_node.c.erb"
|
621
|
+
case YP_NODE_INSTANCE_VARIABLE_AND_WRITE_NODE: {
|
622
|
+
yp_instance_variable_and_write_node_t *cast = (yp_instance_variable_and_write_node_t *) node;
|
623
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
624
|
+
break;
|
625
|
+
}
|
626
|
+
#line 111 "api_node.c.erb"
|
627
|
+
case YP_NODE_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
|
628
|
+
yp_instance_variable_operator_write_node_t *cast = (yp_instance_variable_operator_write_node_t *) node;
|
629
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
630
|
+
break;
|
631
|
+
}
|
632
|
+
#line 111 "api_node.c.erb"
|
633
|
+
case YP_NODE_INSTANCE_VARIABLE_OR_WRITE_NODE: {
|
634
|
+
yp_instance_variable_or_write_node_t *cast = (yp_instance_variable_or_write_node_t *) node;
|
635
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
636
|
+
break;
|
637
|
+
}
|
524
638
|
#line 111 "api_node.c.erb"
|
525
639
|
case YP_NODE_INSTANCE_VARIABLE_WRITE_NODE: {
|
526
640
|
yp_instance_variable_write_node_t *cast = (yp_instance_variable_write_node_t *) node;
|
@@ -580,6 +694,24 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
580
694
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->body);
|
581
695
|
break;
|
582
696
|
}
|
697
|
+
#line 111 "api_node.c.erb"
|
698
|
+
case YP_NODE_LOCAL_VARIABLE_AND_WRITE_NODE: {
|
699
|
+
yp_local_variable_and_write_node_t *cast = (yp_local_variable_and_write_node_t *) node;
|
700
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
701
|
+
break;
|
702
|
+
}
|
703
|
+
#line 111 "api_node.c.erb"
|
704
|
+
case YP_NODE_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
|
705
|
+
yp_local_variable_operator_write_node_t *cast = (yp_local_variable_operator_write_node_t *) node;
|
706
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
707
|
+
break;
|
708
|
+
}
|
709
|
+
#line 111 "api_node.c.erb"
|
710
|
+
case YP_NODE_LOCAL_VARIABLE_OR_WRITE_NODE: {
|
711
|
+
yp_local_variable_or_write_node_t *cast = (yp_local_variable_or_write_node_t *) node;
|
712
|
+
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
713
|
+
break;
|
714
|
+
}
|
583
715
|
#line 111 "api_node.c.erb"
|
584
716
|
case YP_NODE_LOCAL_VARIABLE_WRITE_NODE: {
|
585
717
|
yp_local_variable_write_node_t *cast = (yp_local_variable_write_node_t *) node;
|
@@ -622,13 +754,6 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
622
754
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
|
623
755
|
break;
|
624
756
|
}
|
625
|
-
#line 111 "api_node.c.erb"
|
626
|
-
case YP_NODE_OPERATOR_WRITE_NODE: {
|
627
|
-
yp_operator_write_node_t *cast = (yp_operator_write_node_t *) node;
|
628
|
-
yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
|
629
|
-
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
630
|
-
break;
|
631
|
-
}
|
632
757
|
#line 111 "api_node.c.erb"
|
633
758
|
case YP_NODE_OPTIONAL_PARAMETER_NODE: {
|
634
759
|
yp_optional_parameter_node_t *cast = (yp_optional_parameter_node_t *) node;
|
@@ -642,13 +767,6 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
642
767
|
yp_node_stack_push(&node_stack, (yp_node_t *) cast->right);
|
643
768
|
break;
|
644
769
|
}
|
645
|
-
#line 111 "api_node.c.erb"
|
646
|
-
case YP_NODE_OR_WRITE_NODE: {
|
647
|
-
yp_or_write_node_t *cast = (yp_or_write_node_t *) node;
|
648
|
-
yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
|
649
|
-
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
|
650
|
-
break;
|
651
|
-
}
|
652
770
|
#line 111 "api_node.c.erb"
|
653
771
|
case YP_NODE_PARAMETERS_NODE: {
|
654
772
|
yp_parameters_node_t *cast = (yp_parameters_node_t *) node;
|
@@ -898,26 +1016,6 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
898
1016
|
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPAndNode));
|
899
1017
|
break;
|
900
1018
|
}
|
901
|
-
#line 137 "api_node.c.erb"
|
902
|
-
case YP_NODE_AND_WRITE_NODE: {
|
903
|
-
yp_and_write_node_t *cast = (yp_and_write_node_t *) node;
|
904
|
-
VALUE argv[4];
|
905
|
-
|
906
|
-
// target
|
907
|
-
argv[0] = rb_ary_pop(value_stack);
|
908
|
-
|
909
|
-
// value
|
910
|
-
argv[1] = rb_ary_pop(value_stack);
|
911
|
-
|
912
|
-
// operator_loc
|
913
|
-
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
914
|
-
|
915
|
-
// location
|
916
|
-
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
|
917
|
-
|
918
|
-
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPAndWriteNode));
|
919
|
-
break;
|
920
|
-
}
|
921
1019
|
#line 137 "api_node.c.erb"
|
922
1020
|
case YP_NODE_ARGUMENTS_NODE: {
|
923
1021
|
yp_arguments_node_t *cast = (yp_arguments_node_t *) node;
|
@@ -1268,8 +1366,8 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1268
1366
|
// value
|
1269
1367
|
argv[2] = rb_ary_pop(value_stack);
|
1270
1368
|
|
1271
|
-
//
|
1272
|
-
argv[3] = rb_id2sym(constants[cast->
|
1369
|
+
// operator
|
1370
|
+
argv[3] = rb_id2sym(constants[cast->operator - 1]);
|
1273
1371
|
|
1274
1372
|
// location
|
1275
1373
|
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
|
@@ -1329,7 +1427,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1329
1427
|
#line 137 "api_node.c.erb"
|
1330
1428
|
case YP_NODE_CLASS_NODE: {
|
1331
1429
|
yp_class_node_t *cast = (yp_class_node_t *) node;
|
1332
|
-
VALUE argv[
|
1430
|
+
VALUE argv[9];
|
1333
1431
|
|
1334
1432
|
// locals
|
1335
1433
|
argv[0] = rb_ary_new_capa(cast->locals.size);
|
@@ -1355,40 +1453,219 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1355
1453
|
// end_keyword_loc
|
1356
1454
|
argv[6] = yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
|
1357
1455
|
|
1456
|
+
// name
|
1457
|
+
argv[7] = yp_string_new(&cast->name, encoding);
|
1458
|
+
|
1358
1459
|
// location
|
1359
|
-
argv[
|
1460
|
+
argv[8] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1360
1461
|
|
1361
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
1462
|
+
rb_ary_push(value_stack, rb_class_new_instance(9, argv, rb_cYARPClassNode));
|
1463
|
+
break;
|
1464
|
+
}
|
1465
|
+
#line 137 "api_node.c.erb"
|
1466
|
+
case YP_NODE_CLASS_VARIABLE_AND_WRITE_NODE: {
|
1467
|
+
yp_class_variable_and_write_node_t *cast = (yp_class_variable_and_write_node_t *) node;
|
1468
|
+
VALUE argv[5];
|
1469
|
+
|
1470
|
+
// name
|
1471
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1472
|
+
|
1473
|
+
// name_loc
|
1474
|
+
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
1475
|
+
|
1476
|
+
// operator_loc
|
1477
|
+
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1478
|
+
|
1479
|
+
// value
|
1480
|
+
argv[3] = rb_ary_pop(value_stack);
|
1481
|
+
|
1482
|
+
// location
|
1483
|
+
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1484
|
+
|
1485
|
+
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPClassVariableAndWriteNode));
|
1486
|
+
break;
|
1487
|
+
}
|
1488
|
+
#line 137 "api_node.c.erb"
|
1489
|
+
case YP_NODE_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
|
1490
|
+
yp_class_variable_operator_write_node_t *cast = (yp_class_variable_operator_write_node_t *) node;
|
1491
|
+
VALUE argv[6];
|
1492
|
+
|
1493
|
+
// name
|
1494
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1495
|
+
|
1496
|
+
// name_loc
|
1497
|
+
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
1498
|
+
|
1499
|
+
// operator_loc
|
1500
|
+
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1501
|
+
|
1502
|
+
// value
|
1503
|
+
argv[3] = rb_ary_pop(value_stack);
|
1504
|
+
|
1505
|
+
// operator
|
1506
|
+
argv[4] = rb_id2sym(constants[cast->operator - 1]);
|
1507
|
+
|
1508
|
+
// location
|
1509
|
+
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1510
|
+
|
1511
|
+
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPClassVariableOperatorWriteNode));
|
1512
|
+
break;
|
1513
|
+
}
|
1514
|
+
#line 137 "api_node.c.erb"
|
1515
|
+
case YP_NODE_CLASS_VARIABLE_OR_WRITE_NODE: {
|
1516
|
+
yp_class_variable_or_write_node_t *cast = (yp_class_variable_or_write_node_t *) node;
|
1517
|
+
VALUE argv[5];
|
1518
|
+
|
1519
|
+
// name
|
1520
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1521
|
+
|
1522
|
+
// name_loc
|
1523
|
+
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
1524
|
+
|
1525
|
+
// operator_loc
|
1526
|
+
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1527
|
+
|
1528
|
+
// value
|
1529
|
+
argv[3] = rb_ary_pop(value_stack);
|
1530
|
+
|
1531
|
+
// location
|
1532
|
+
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1533
|
+
|
1534
|
+
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPClassVariableOrWriteNode));
|
1362
1535
|
break;
|
1363
1536
|
}
|
1364
1537
|
#line 137 "api_node.c.erb"
|
1365
1538
|
case YP_NODE_CLASS_VARIABLE_READ_NODE: {
|
1366
|
-
|
1539
|
+
yp_class_variable_read_node_t *cast = (yp_class_variable_read_node_t *) node;
|
1540
|
+
VALUE argv[2];
|
1541
|
+
|
1542
|
+
// name
|
1543
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1367
1544
|
|
1368
1545
|
// location
|
1369
|
-
argv[
|
1546
|
+
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1370
1547
|
|
1371
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
1548
|
+
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPClassVariableReadNode));
|
1549
|
+
break;
|
1550
|
+
}
|
1551
|
+
#line 137 "api_node.c.erb"
|
1552
|
+
case YP_NODE_CLASS_VARIABLE_TARGET_NODE: {
|
1553
|
+
yp_class_variable_target_node_t *cast = (yp_class_variable_target_node_t *) node;
|
1554
|
+
VALUE argv[2];
|
1555
|
+
|
1556
|
+
// name
|
1557
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1558
|
+
|
1559
|
+
// location
|
1560
|
+
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1561
|
+
|
1562
|
+
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPClassVariableTargetNode));
|
1372
1563
|
break;
|
1373
1564
|
}
|
1374
1565
|
#line 137 "api_node.c.erb"
|
1375
1566
|
case YP_NODE_CLASS_VARIABLE_WRITE_NODE: {
|
1376
1567
|
yp_class_variable_write_node_t *cast = (yp_class_variable_write_node_t *) node;
|
1568
|
+
VALUE argv[5];
|
1569
|
+
|
1570
|
+
// name
|
1571
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1572
|
+
|
1573
|
+
// name_loc
|
1574
|
+
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
1575
|
+
|
1576
|
+
// value
|
1577
|
+
argv[2] = rb_ary_pop(value_stack);
|
1578
|
+
|
1579
|
+
// operator_loc
|
1580
|
+
argv[3] = cast->operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1581
|
+
|
1582
|
+
// location
|
1583
|
+
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1584
|
+
|
1585
|
+
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPClassVariableWriteNode));
|
1586
|
+
break;
|
1587
|
+
}
|
1588
|
+
#line 137 "api_node.c.erb"
|
1589
|
+
case YP_NODE_CONSTANT_AND_WRITE_NODE: {
|
1590
|
+
yp_constant_and_write_node_t *cast = (yp_constant_and_write_node_t *) node;
|
1377
1591
|
VALUE argv[4];
|
1378
1592
|
|
1379
1593
|
// name_loc
|
1380
1594
|
argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
1381
1595
|
|
1596
|
+
// operator_loc
|
1597
|
+
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1598
|
+
|
1382
1599
|
// value
|
1383
|
-
argv[
|
1600
|
+
argv[2] = rb_ary_pop(value_stack);
|
1601
|
+
|
1602
|
+
// location
|
1603
|
+
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1604
|
+
|
1605
|
+
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPConstantAndWriteNode));
|
1606
|
+
break;
|
1607
|
+
}
|
1608
|
+
#line 137 "api_node.c.erb"
|
1609
|
+
case YP_NODE_CONSTANT_OPERATOR_WRITE_NODE: {
|
1610
|
+
yp_constant_operator_write_node_t *cast = (yp_constant_operator_write_node_t *) node;
|
1611
|
+
VALUE argv[5];
|
1612
|
+
|
1613
|
+
// name_loc
|
1614
|
+
argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
1384
1615
|
|
1385
1616
|
// operator_loc
|
1386
|
-
argv[
|
1617
|
+
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1618
|
+
|
1619
|
+
// value
|
1620
|
+
argv[2] = rb_ary_pop(value_stack);
|
1621
|
+
|
1622
|
+
// operator
|
1623
|
+
argv[3] = rb_id2sym(constants[cast->operator - 1]);
|
1624
|
+
|
1625
|
+
// location
|
1626
|
+
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1627
|
+
|
1628
|
+
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPConstantOperatorWriteNode));
|
1629
|
+
break;
|
1630
|
+
}
|
1631
|
+
#line 137 "api_node.c.erb"
|
1632
|
+
case YP_NODE_CONSTANT_OR_WRITE_NODE: {
|
1633
|
+
yp_constant_or_write_node_t *cast = (yp_constant_or_write_node_t *) node;
|
1634
|
+
VALUE argv[4];
|
1635
|
+
|
1636
|
+
// name_loc
|
1637
|
+
argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
1638
|
+
|
1639
|
+
// operator_loc
|
1640
|
+
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1641
|
+
|
1642
|
+
// value
|
1643
|
+
argv[2] = rb_ary_pop(value_stack);
|
1387
1644
|
|
1388
1645
|
// location
|
1389
1646
|
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1390
1647
|
|
1391
|
-
rb_ary_push(value_stack, rb_class_new_instance(4, argv,
|
1648
|
+
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPConstantOrWriteNode));
|
1649
|
+
break;
|
1650
|
+
}
|
1651
|
+
#line 137 "api_node.c.erb"
|
1652
|
+
case YP_NODE_CONSTANT_PATH_AND_WRITE_NODE: {
|
1653
|
+
yp_constant_path_and_write_node_t *cast = (yp_constant_path_and_write_node_t *) node;
|
1654
|
+
VALUE argv[4];
|
1655
|
+
|
1656
|
+
// target
|
1657
|
+
argv[0] = rb_ary_pop(value_stack);
|
1658
|
+
|
1659
|
+
// operator_loc
|
1660
|
+
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1661
|
+
|
1662
|
+
// value
|
1663
|
+
argv[2] = rb_ary_pop(value_stack);
|
1664
|
+
|
1665
|
+
// location
|
1666
|
+
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1667
|
+
|
1668
|
+
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPConstantPathAndWriteNode));
|
1392
1669
|
break;
|
1393
1670
|
}
|
1394
1671
|
#line 137 "api_node.c.erb"
|
@@ -1411,6 +1688,69 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1411
1688
|
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPConstantPathNode));
|
1412
1689
|
break;
|
1413
1690
|
}
|
1691
|
+
#line 137 "api_node.c.erb"
|
1692
|
+
case YP_NODE_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
|
1693
|
+
yp_constant_path_operator_write_node_t *cast = (yp_constant_path_operator_write_node_t *) node;
|
1694
|
+
VALUE argv[5];
|
1695
|
+
|
1696
|
+
// target
|
1697
|
+
argv[0] = rb_ary_pop(value_stack);
|
1698
|
+
|
1699
|
+
// operator_loc
|
1700
|
+
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1701
|
+
|
1702
|
+
// value
|
1703
|
+
argv[2] = rb_ary_pop(value_stack);
|
1704
|
+
|
1705
|
+
// operator
|
1706
|
+
argv[3] = rb_id2sym(constants[cast->operator - 1]);
|
1707
|
+
|
1708
|
+
// location
|
1709
|
+
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1710
|
+
|
1711
|
+
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPConstantPathOperatorWriteNode));
|
1712
|
+
break;
|
1713
|
+
}
|
1714
|
+
#line 137 "api_node.c.erb"
|
1715
|
+
case YP_NODE_CONSTANT_PATH_OR_WRITE_NODE: {
|
1716
|
+
yp_constant_path_or_write_node_t *cast = (yp_constant_path_or_write_node_t *) node;
|
1717
|
+
VALUE argv[4];
|
1718
|
+
|
1719
|
+
// target
|
1720
|
+
argv[0] = rb_ary_pop(value_stack);
|
1721
|
+
|
1722
|
+
// operator_loc
|
1723
|
+
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1724
|
+
|
1725
|
+
// value
|
1726
|
+
argv[2] = rb_ary_pop(value_stack);
|
1727
|
+
|
1728
|
+
// location
|
1729
|
+
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1730
|
+
|
1731
|
+
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPConstantPathOrWriteNode));
|
1732
|
+
break;
|
1733
|
+
}
|
1734
|
+
#line 137 "api_node.c.erb"
|
1735
|
+
case YP_NODE_CONSTANT_PATH_TARGET_NODE: {
|
1736
|
+
yp_constant_path_target_node_t *cast = (yp_constant_path_target_node_t *) node;
|
1737
|
+
VALUE argv[4];
|
1738
|
+
|
1739
|
+
// parent
|
1740
|
+
argv[0] = rb_ary_pop(value_stack);
|
1741
|
+
|
1742
|
+
// child
|
1743
|
+
argv[1] = rb_ary_pop(value_stack);
|
1744
|
+
|
1745
|
+
// delimiter_loc
|
1746
|
+
argv[2] = yp_location_new(parser, cast->delimiter_loc.start, cast->delimiter_loc.end, source);
|
1747
|
+
|
1748
|
+
// location
|
1749
|
+
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1750
|
+
|
1751
|
+
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPConstantPathTargetNode));
|
1752
|
+
break;
|
1753
|
+
}
|
1414
1754
|
#line 137 "api_node.c.erb"
|
1415
1755
|
case YP_NODE_CONSTANT_PATH_WRITE_NODE: {
|
1416
1756
|
yp_constant_path_write_node_t *cast = (yp_constant_path_write_node_t *) node;
|
@@ -1420,7 +1760,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1420
1760
|
argv[0] = rb_ary_pop(value_stack);
|
1421
1761
|
|
1422
1762
|
// operator_loc
|
1423
|
-
argv[1] =
|
1763
|
+
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1424
1764
|
|
1425
1765
|
// value
|
1426
1766
|
argv[2] = rb_ary_pop(value_stack);
|
@@ -1441,6 +1781,16 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1441
1781
|
rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPConstantReadNode));
|
1442
1782
|
break;
|
1443
1783
|
}
|
1784
|
+
#line 137 "api_node.c.erb"
|
1785
|
+
case YP_NODE_CONSTANT_TARGET_NODE: {
|
1786
|
+
VALUE argv[1];
|
1787
|
+
|
1788
|
+
// location
|
1789
|
+
argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1790
|
+
|
1791
|
+
rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPConstantTargetNode));
|
1792
|
+
break;
|
1793
|
+
}
|
1444
1794
|
#line 137 "api_node.c.erb"
|
1445
1795
|
case YP_NODE_CONSTANT_WRITE_NODE: {
|
1446
1796
|
yp_constant_write_node_t *cast = (yp_constant_write_node_t *) node;
|
@@ -1453,7 +1803,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1453
1803
|
argv[1] = rb_ary_pop(value_stack);
|
1454
1804
|
|
1455
1805
|
// operator_loc
|
1456
|
-
argv[2] =
|
1806
|
+
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1457
1807
|
|
1458
1808
|
// location
|
1459
1809
|
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
|
@@ -1748,6 +2098,69 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1748
2098
|
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPForwardingSuperNode));
|
1749
2099
|
break;
|
1750
2100
|
}
|
2101
|
+
#line 137 "api_node.c.erb"
|
2102
|
+
case YP_NODE_GLOBAL_VARIABLE_AND_WRITE_NODE: {
|
2103
|
+
yp_global_variable_and_write_node_t *cast = (yp_global_variable_and_write_node_t *) node;
|
2104
|
+
VALUE argv[4];
|
2105
|
+
|
2106
|
+
// name_loc
|
2107
|
+
argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2108
|
+
|
2109
|
+
// operator_loc
|
2110
|
+
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2111
|
+
|
2112
|
+
// value
|
2113
|
+
argv[2] = rb_ary_pop(value_stack);
|
2114
|
+
|
2115
|
+
// location
|
2116
|
+
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2117
|
+
|
2118
|
+
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPGlobalVariableAndWriteNode));
|
2119
|
+
break;
|
2120
|
+
}
|
2121
|
+
#line 137 "api_node.c.erb"
|
2122
|
+
case YP_NODE_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
|
2123
|
+
yp_global_variable_operator_write_node_t *cast = (yp_global_variable_operator_write_node_t *) node;
|
2124
|
+
VALUE argv[5];
|
2125
|
+
|
2126
|
+
// name_loc
|
2127
|
+
argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2128
|
+
|
2129
|
+
// operator_loc
|
2130
|
+
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2131
|
+
|
2132
|
+
// value
|
2133
|
+
argv[2] = rb_ary_pop(value_stack);
|
2134
|
+
|
2135
|
+
// operator
|
2136
|
+
argv[3] = rb_id2sym(constants[cast->operator - 1]);
|
2137
|
+
|
2138
|
+
// location
|
2139
|
+
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2140
|
+
|
2141
|
+
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPGlobalVariableOperatorWriteNode));
|
2142
|
+
break;
|
2143
|
+
}
|
2144
|
+
#line 137 "api_node.c.erb"
|
2145
|
+
case YP_NODE_GLOBAL_VARIABLE_OR_WRITE_NODE: {
|
2146
|
+
yp_global_variable_or_write_node_t *cast = (yp_global_variable_or_write_node_t *) node;
|
2147
|
+
VALUE argv[4];
|
2148
|
+
|
2149
|
+
// name_loc
|
2150
|
+
argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2151
|
+
|
2152
|
+
// operator_loc
|
2153
|
+
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2154
|
+
|
2155
|
+
// value
|
2156
|
+
argv[2] = rb_ary_pop(value_stack);
|
2157
|
+
|
2158
|
+
// location
|
2159
|
+
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2160
|
+
|
2161
|
+
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPGlobalVariableOrWriteNode));
|
2162
|
+
break;
|
2163
|
+
}
|
1751
2164
|
#line 137 "api_node.c.erb"
|
1752
2165
|
case YP_NODE_GLOBAL_VARIABLE_READ_NODE: {
|
1753
2166
|
VALUE argv[1];
|
@@ -1758,6 +2171,16 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1758
2171
|
rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPGlobalVariableReadNode));
|
1759
2172
|
break;
|
1760
2173
|
}
|
2174
|
+
#line 137 "api_node.c.erb"
|
2175
|
+
case YP_NODE_GLOBAL_VARIABLE_TARGET_NODE: {
|
2176
|
+
VALUE argv[1];
|
2177
|
+
|
2178
|
+
// location
|
2179
|
+
argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2180
|
+
|
2181
|
+
rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPGlobalVariableTargetNode));
|
2182
|
+
break;
|
2183
|
+
}
|
1761
2184
|
#line 137 "api_node.c.erb"
|
1762
2185
|
case YP_NODE_GLOBAL_VARIABLE_WRITE_NODE: {
|
1763
2186
|
yp_global_variable_write_node_t *cast = (yp_global_variable_write_node_t *) node;
|
@@ -1766,11 +2189,11 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1766
2189
|
// name_loc
|
1767
2190
|
argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
1768
2191
|
|
1769
|
-
// operator_loc
|
1770
|
-
argv[1] = cast->operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1771
|
-
|
1772
2192
|
// value
|
1773
|
-
argv[
|
2193
|
+
argv[1] = rb_ary_pop(value_stack);
|
2194
|
+
|
2195
|
+
// operator_loc
|
2196
|
+
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1774
2197
|
|
1775
2198
|
// location
|
1776
2199
|
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
|
@@ -1821,105 +2244,198 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
1821
2244
|
// opening_loc
|
1822
2245
|
argv[3] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
1823
2246
|
|
1824
|
-
// closing_loc
|
1825
|
-
argv[4] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
2247
|
+
// closing_loc
|
2248
|
+
argv[4] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
2249
|
+
|
2250
|
+
// location
|
2251
|
+
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2252
|
+
|
2253
|
+
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPHashPatternNode));
|
2254
|
+
break;
|
2255
|
+
}
|
2256
|
+
#line 137 "api_node.c.erb"
|
2257
|
+
case YP_NODE_IF_NODE: {
|
2258
|
+
yp_if_node_t *cast = (yp_if_node_t *) node;
|
2259
|
+
VALUE argv[6];
|
2260
|
+
|
2261
|
+
// if_keyword_loc
|
2262
|
+
argv[0] = cast->if_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->if_keyword_loc.start, cast->if_keyword_loc.end, source);
|
2263
|
+
|
2264
|
+
// predicate
|
2265
|
+
argv[1] = rb_ary_pop(value_stack);
|
2266
|
+
|
2267
|
+
// statements
|
2268
|
+
argv[2] = rb_ary_pop(value_stack);
|
2269
|
+
|
2270
|
+
// consequent
|
2271
|
+
argv[3] = rb_ary_pop(value_stack);
|
2272
|
+
|
2273
|
+
// end_keyword_loc
|
2274
|
+
argv[4] = cast->end_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
|
2275
|
+
|
2276
|
+
// location
|
2277
|
+
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2278
|
+
|
2279
|
+
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPIfNode));
|
2280
|
+
break;
|
2281
|
+
}
|
2282
|
+
#line 137 "api_node.c.erb"
|
2283
|
+
case YP_NODE_IMAGINARY_NODE: {
|
2284
|
+
VALUE argv[2];
|
2285
|
+
|
2286
|
+
// numeric
|
2287
|
+
argv[0] = rb_ary_pop(value_stack);
|
2288
|
+
|
2289
|
+
// location
|
2290
|
+
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2291
|
+
|
2292
|
+
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPImaginaryNode));
|
2293
|
+
break;
|
2294
|
+
}
|
2295
|
+
#line 137 "api_node.c.erb"
|
2296
|
+
case YP_NODE_IN_NODE: {
|
2297
|
+
yp_in_node_t *cast = (yp_in_node_t *) node;
|
2298
|
+
VALUE argv[5];
|
2299
|
+
|
2300
|
+
// pattern
|
2301
|
+
argv[0] = rb_ary_pop(value_stack);
|
2302
|
+
|
2303
|
+
// statements
|
2304
|
+
argv[1] = rb_ary_pop(value_stack);
|
2305
|
+
|
2306
|
+
// in_loc
|
2307
|
+
argv[2] = yp_location_new(parser, cast->in_loc.start, cast->in_loc.end, source);
|
2308
|
+
|
2309
|
+
// then_loc
|
2310
|
+
argv[3] = cast->then_loc.start == NULL ? Qnil : yp_location_new(parser, cast->then_loc.start, cast->then_loc.end, source);
|
2311
|
+
|
2312
|
+
// location
|
2313
|
+
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2314
|
+
|
2315
|
+
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPInNode));
|
2316
|
+
break;
|
2317
|
+
}
|
2318
|
+
#line 137 "api_node.c.erb"
|
2319
|
+
case YP_NODE_INSTANCE_VARIABLE_AND_WRITE_NODE: {
|
2320
|
+
yp_instance_variable_and_write_node_t *cast = (yp_instance_variable_and_write_node_t *) node;
|
2321
|
+
VALUE argv[5];
|
2322
|
+
|
2323
|
+
// name
|
2324
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2325
|
+
|
2326
|
+
// name_loc
|
2327
|
+
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2328
|
+
|
2329
|
+
// operator_loc
|
2330
|
+
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2331
|
+
|
2332
|
+
// value
|
2333
|
+
argv[3] = rb_ary_pop(value_stack);
|
1826
2334
|
|
1827
2335
|
// location
|
1828
|
-
argv[
|
2336
|
+
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1829
2337
|
|
1830
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
2338
|
+
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPInstanceVariableAndWriteNode));
|
1831
2339
|
break;
|
1832
2340
|
}
|
1833
2341
|
#line 137 "api_node.c.erb"
|
1834
|
-
case
|
1835
|
-
|
2342
|
+
case YP_NODE_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
|
2343
|
+
yp_instance_variable_operator_write_node_t *cast = (yp_instance_variable_operator_write_node_t *) node;
|
1836
2344
|
VALUE argv[6];
|
1837
2345
|
|
1838
|
-
//
|
1839
|
-
argv[0] =
|
2346
|
+
// name
|
2347
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1840
2348
|
|
1841
|
-
//
|
1842
|
-
argv[1] =
|
2349
|
+
// name_loc
|
2350
|
+
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
1843
2351
|
|
1844
|
-
//
|
1845
|
-
argv[2] =
|
2352
|
+
// operator_loc
|
2353
|
+
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1846
2354
|
|
1847
|
-
//
|
2355
|
+
// value
|
1848
2356
|
argv[3] = rb_ary_pop(value_stack);
|
1849
2357
|
|
1850
|
-
//
|
1851
|
-
argv[4] =
|
2358
|
+
// operator
|
2359
|
+
argv[4] = rb_id2sym(constants[cast->operator - 1]);
|
1852
2360
|
|
1853
2361
|
// location
|
1854
2362
|
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1855
2363
|
|
1856
|
-
rb_ary_push(value_stack, rb_class_new_instance(6, argv,
|
2364
|
+
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPInstanceVariableOperatorWriteNode));
|
1857
2365
|
break;
|
1858
2366
|
}
|
1859
2367
|
#line 137 "api_node.c.erb"
|
1860
|
-
case
|
1861
|
-
|
2368
|
+
case YP_NODE_INSTANCE_VARIABLE_OR_WRITE_NODE: {
|
2369
|
+
yp_instance_variable_or_write_node_t *cast = (yp_instance_variable_or_write_node_t *) node;
|
2370
|
+
VALUE argv[5];
|
1862
2371
|
|
1863
|
-
//
|
1864
|
-
argv[0] =
|
2372
|
+
// name
|
2373
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2374
|
+
|
2375
|
+
// name_loc
|
2376
|
+
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2377
|
+
|
2378
|
+
// operator_loc
|
2379
|
+
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2380
|
+
|
2381
|
+
// value
|
2382
|
+
argv[3] = rb_ary_pop(value_stack);
|
1865
2383
|
|
1866
2384
|
// location
|
1867
|
-
argv[
|
2385
|
+
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1868
2386
|
|
1869
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
2387
|
+
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPInstanceVariableOrWriteNode));
|
1870
2388
|
break;
|
1871
2389
|
}
|
1872
2390
|
#line 137 "api_node.c.erb"
|
1873
|
-
case
|
1874
|
-
|
1875
|
-
VALUE argv[
|
1876
|
-
|
1877
|
-
// pattern
|
1878
|
-
argv[0] = rb_ary_pop(value_stack);
|
1879
|
-
|
1880
|
-
// statements
|
1881
|
-
argv[1] = rb_ary_pop(value_stack);
|
1882
|
-
|
1883
|
-
// in_loc
|
1884
|
-
argv[2] = yp_location_new(parser, cast->in_loc.start, cast->in_loc.end, source);
|
2391
|
+
case YP_NODE_INSTANCE_VARIABLE_READ_NODE: {
|
2392
|
+
yp_instance_variable_read_node_t *cast = (yp_instance_variable_read_node_t *) node;
|
2393
|
+
VALUE argv[2];
|
1885
2394
|
|
1886
|
-
//
|
1887
|
-
argv[
|
2395
|
+
// name
|
2396
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1888
2397
|
|
1889
2398
|
// location
|
1890
|
-
argv[
|
2399
|
+
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1891
2400
|
|
1892
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
2401
|
+
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPInstanceVariableReadNode));
|
1893
2402
|
break;
|
1894
2403
|
}
|
1895
2404
|
#line 137 "api_node.c.erb"
|
1896
|
-
case
|
1897
|
-
|
2405
|
+
case YP_NODE_INSTANCE_VARIABLE_TARGET_NODE: {
|
2406
|
+
yp_instance_variable_target_node_t *cast = (yp_instance_variable_target_node_t *) node;
|
2407
|
+
VALUE argv[2];
|
2408
|
+
|
2409
|
+
// name
|
2410
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1898
2411
|
|
1899
2412
|
// location
|
1900
|
-
argv[
|
2413
|
+
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1901
2414
|
|
1902
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
2415
|
+
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPInstanceVariableTargetNode));
|
1903
2416
|
break;
|
1904
2417
|
}
|
1905
2418
|
#line 137 "api_node.c.erb"
|
1906
2419
|
case YP_NODE_INSTANCE_VARIABLE_WRITE_NODE: {
|
1907
2420
|
yp_instance_variable_write_node_t *cast = (yp_instance_variable_write_node_t *) node;
|
1908
|
-
VALUE argv[
|
2421
|
+
VALUE argv[5];
|
2422
|
+
|
2423
|
+
// name
|
2424
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
1909
2425
|
|
1910
2426
|
// name_loc
|
1911
|
-
argv[
|
2427
|
+
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
1912
2428
|
|
1913
2429
|
// value
|
1914
|
-
argv[
|
2430
|
+
argv[2] = rb_ary_pop(value_stack);
|
1915
2431
|
|
1916
2432
|
// operator_loc
|
1917
|
-
argv[
|
2433
|
+
argv[3] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
1918
2434
|
|
1919
2435
|
// location
|
1920
|
-
argv[
|
2436
|
+
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
|
1921
2437
|
|
1922
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
2438
|
+
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPInstanceVariableWriteNode));
|
1923
2439
|
break;
|
1924
2440
|
}
|
1925
2441
|
#line 137 "api_node.c.erb"
|
@@ -2081,7 +2597,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2081
2597
|
#line 137 "api_node.c.erb"
|
2082
2598
|
case YP_NODE_LAMBDA_NODE: {
|
2083
2599
|
yp_lambda_node_t *cast = (yp_lambda_node_t *) node;
|
2084
|
-
VALUE argv[
|
2600
|
+
VALUE argv[7];
|
2085
2601
|
|
2086
2602
|
// locals
|
2087
2603
|
argv[0] = rb_ary_new_capa(cast->locals.size);
|
@@ -2089,19 +2605,106 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2089
2605
|
rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
|
2090
2606
|
}
|
2091
2607
|
|
2608
|
+
// operator_loc
|
2609
|
+
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2610
|
+
|
2092
2611
|
// opening_loc
|
2093
|
-
argv[
|
2612
|
+
argv[2] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
2613
|
+
|
2614
|
+
// closing_loc
|
2615
|
+
argv[3] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
2094
2616
|
|
2095
2617
|
// parameters
|
2096
|
-
argv[
|
2618
|
+
argv[4] = rb_ary_pop(value_stack);
|
2097
2619
|
|
2098
2620
|
// body
|
2099
|
-
argv[
|
2621
|
+
argv[5] = rb_ary_pop(value_stack);
|
2100
2622
|
|
2101
2623
|
// location
|
2102
|
-
argv[
|
2624
|
+
argv[6] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2625
|
+
|
2626
|
+
rb_ary_push(value_stack, rb_class_new_instance(7, argv, rb_cYARPLambdaNode));
|
2627
|
+
break;
|
2628
|
+
}
|
2629
|
+
#line 137 "api_node.c.erb"
|
2630
|
+
case YP_NODE_LOCAL_VARIABLE_AND_WRITE_NODE: {
|
2631
|
+
yp_local_variable_and_write_node_t *cast = (yp_local_variable_and_write_node_t *) node;
|
2632
|
+
VALUE argv[6];
|
2633
|
+
|
2634
|
+
// name_loc
|
2635
|
+
argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2636
|
+
|
2637
|
+
// operator_loc
|
2638
|
+
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2639
|
+
|
2640
|
+
// value
|
2641
|
+
argv[2] = rb_ary_pop(value_stack);
|
2642
|
+
|
2643
|
+
// name
|
2644
|
+
argv[3] = rb_id2sym(constants[cast->name - 1]);
|
2645
|
+
|
2646
|
+
// depth
|
2647
|
+
argv[4] = ULONG2NUM(cast->depth);
|
2648
|
+
|
2649
|
+
// location
|
2650
|
+
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2651
|
+
|
2652
|
+
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPLocalVariableAndWriteNode));
|
2653
|
+
break;
|
2654
|
+
}
|
2655
|
+
#line 137 "api_node.c.erb"
|
2656
|
+
case YP_NODE_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
|
2657
|
+
yp_local_variable_operator_write_node_t *cast = (yp_local_variable_operator_write_node_t *) node;
|
2658
|
+
VALUE argv[7];
|
2659
|
+
|
2660
|
+
// name_loc
|
2661
|
+
argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2103
2662
|
|
2104
|
-
|
2663
|
+
// operator_loc
|
2664
|
+
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2665
|
+
|
2666
|
+
// value
|
2667
|
+
argv[2] = rb_ary_pop(value_stack);
|
2668
|
+
|
2669
|
+
// name
|
2670
|
+
argv[3] = rb_id2sym(constants[cast->name - 1]);
|
2671
|
+
|
2672
|
+
// operator
|
2673
|
+
argv[4] = rb_id2sym(constants[cast->operator - 1]);
|
2674
|
+
|
2675
|
+
// depth
|
2676
|
+
argv[5] = ULONG2NUM(cast->depth);
|
2677
|
+
|
2678
|
+
// location
|
2679
|
+
argv[6] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2680
|
+
|
2681
|
+
rb_ary_push(value_stack, rb_class_new_instance(7, argv, rb_cYARPLocalVariableOperatorWriteNode));
|
2682
|
+
break;
|
2683
|
+
}
|
2684
|
+
#line 137 "api_node.c.erb"
|
2685
|
+
case YP_NODE_LOCAL_VARIABLE_OR_WRITE_NODE: {
|
2686
|
+
yp_local_variable_or_write_node_t *cast = (yp_local_variable_or_write_node_t *) node;
|
2687
|
+
VALUE argv[6];
|
2688
|
+
|
2689
|
+
// name_loc
|
2690
|
+
argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2691
|
+
|
2692
|
+
// operator_loc
|
2693
|
+
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2694
|
+
|
2695
|
+
// value
|
2696
|
+
argv[2] = rb_ary_pop(value_stack);
|
2697
|
+
|
2698
|
+
// name
|
2699
|
+
argv[3] = rb_id2sym(constants[cast->name - 1]);
|
2700
|
+
|
2701
|
+
// depth
|
2702
|
+
argv[4] = ULONG2NUM(cast->depth);
|
2703
|
+
|
2704
|
+
// location
|
2705
|
+
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2706
|
+
|
2707
|
+
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPLocalVariableOrWriteNode));
|
2105
2708
|
break;
|
2106
2709
|
}
|
2107
2710
|
#line 137 "api_node.c.erb"
|
@@ -2109,8 +2712,8 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2109
2712
|
yp_local_variable_read_node_t *cast = (yp_local_variable_read_node_t *) node;
|
2110
2713
|
VALUE argv[3];
|
2111
2714
|
|
2112
|
-
//
|
2113
|
-
argv[0] = rb_id2sym(constants[cast->
|
2715
|
+
// name
|
2716
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2114
2717
|
|
2115
2718
|
// depth
|
2116
2719
|
argv[1] = ULONG2NUM(cast->depth);
|
@@ -2121,25 +2724,42 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2121
2724
|
rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPLocalVariableReadNode));
|
2122
2725
|
break;
|
2123
2726
|
}
|
2727
|
+
#line 137 "api_node.c.erb"
|
2728
|
+
case YP_NODE_LOCAL_VARIABLE_TARGET_NODE: {
|
2729
|
+
yp_local_variable_target_node_t *cast = (yp_local_variable_target_node_t *) node;
|
2730
|
+
VALUE argv[3];
|
2731
|
+
|
2732
|
+
// name
|
2733
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2734
|
+
|
2735
|
+
// depth
|
2736
|
+
argv[1] = ULONG2NUM(cast->depth);
|
2737
|
+
|
2738
|
+
// location
|
2739
|
+
argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2740
|
+
|
2741
|
+
rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPLocalVariableTargetNode));
|
2742
|
+
break;
|
2743
|
+
}
|
2124
2744
|
#line 137 "api_node.c.erb"
|
2125
2745
|
case YP_NODE_LOCAL_VARIABLE_WRITE_NODE: {
|
2126
2746
|
yp_local_variable_write_node_t *cast = (yp_local_variable_write_node_t *) node;
|
2127
2747
|
VALUE argv[6];
|
2128
2748
|
|
2129
|
-
//
|
2130
|
-
argv[0] = rb_id2sym(constants[cast->
|
2749
|
+
// name
|
2750
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2131
2751
|
|
2132
2752
|
// depth
|
2133
2753
|
argv[1] = ULONG2NUM(cast->depth);
|
2134
2754
|
|
2135
|
-
// value
|
2136
|
-
argv[2] = rb_ary_pop(value_stack);
|
2137
|
-
|
2138
2755
|
// name_loc
|
2139
|
-
argv[
|
2756
|
+
argv[2] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
2757
|
+
|
2758
|
+
// value
|
2759
|
+
argv[3] = rb_ary_pop(value_stack);
|
2140
2760
|
|
2141
2761
|
// operator_loc
|
2142
|
-
argv[4] =
|
2762
|
+
argv[4] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2143
2763
|
|
2144
2764
|
// location
|
2145
2765
|
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
|
@@ -2200,7 +2820,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2200
2820
|
#line 137 "api_node.c.erb"
|
2201
2821
|
case YP_NODE_MODULE_NODE: {
|
2202
2822
|
yp_module_node_t *cast = (yp_module_node_t *) node;
|
2203
|
-
VALUE argv[
|
2823
|
+
VALUE argv[7];
|
2204
2824
|
|
2205
2825
|
// locals
|
2206
2826
|
argv[0] = rb_ary_new_capa(cast->locals.size);
|
@@ -2220,10 +2840,13 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2220
2840
|
// end_keyword_loc
|
2221
2841
|
argv[4] = yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
|
2222
2842
|
|
2843
|
+
// name
|
2844
|
+
argv[5] = yp_string_new(&cast->name, encoding);
|
2845
|
+
|
2223
2846
|
// location
|
2224
|
-
argv[
|
2847
|
+
argv[6] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2225
2848
|
|
2226
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
2849
|
+
rb_ary_push(value_stack, rb_class_new_instance(7, argv, rb_cYARPModuleNode));
|
2227
2850
|
break;
|
2228
2851
|
}
|
2229
2852
|
#line 137 "api_node.c.erb"
|
@@ -2301,35 +2924,16 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2301
2924
|
}
|
2302
2925
|
#line 137 "api_node.c.erb"
|
2303
2926
|
case YP_NODE_NUMBERED_REFERENCE_READ_NODE: {
|
2304
|
-
|
2305
|
-
|
2306
|
-
// location
|
2307
|
-
argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2308
|
-
|
2309
|
-
rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPNumberedReferenceReadNode));
|
2310
|
-
break;
|
2311
|
-
}
|
2312
|
-
#line 137 "api_node.c.erb"
|
2313
|
-
case YP_NODE_OPERATOR_WRITE_NODE: {
|
2314
|
-
yp_operator_write_node_t *cast = (yp_operator_write_node_t *) node;
|
2315
|
-
VALUE argv[5];
|
2316
|
-
|
2317
|
-
// target
|
2318
|
-
argv[0] = rb_ary_pop(value_stack);
|
2319
|
-
|
2320
|
-
// operator_loc
|
2321
|
-
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2322
|
-
|
2323
|
-
// operator
|
2324
|
-
argv[2] = rb_id2sym(constants[cast->operator - 1]);
|
2927
|
+
yp_numbered_reference_read_node_t *cast = (yp_numbered_reference_read_node_t *) node;
|
2928
|
+
VALUE argv[2];
|
2325
2929
|
|
2326
|
-
//
|
2327
|
-
argv[
|
2930
|
+
// number
|
2931
|
+
argv[0] = ULONG2NUM(cast->number);
|
2328
2932
|
|
2329
2933
|
// location
|
2330
|
-
argv[
|
2934
|
+
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2331
2935
|
|
2332
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
2936
|
+
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPNumberedReferenceReadNode));
|
2333
2937
|
break;
|
2334
2938
|
}
|
2335
2939
|
#line 137 "api_node.c.erb"
|
@@ -2337,8 +2941,8 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2337
2941
|
yp_optional_parameter_node_t *cast = (yp_optional_parameter_node_t *) node;
|
2338
2942
|
VALUE argv[5];
|
2339
2943
|
|
2340
|
-
//
|
2341
|
-
argv[0] = rb_id2sym(constants[cast->
|
2944
|
+
// name
|
2945
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2342
2946
|
|
2343
2947
|
// name_loc
|
2344
2948
|
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
|
@@ -2375,26 +2979,6 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2375
2979
|
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPOrNode));
|
2376
2980
|
break;
|
2377
2981
|
}
|
2378
|
-
#line 137 "api_node.c.erb"
|
2379
|
-
case YP_NODE_OR_WRITE_NODE: {
|
2380
|
-
yp_or_write_node_t *cast = (yp_or_write_node_t *) node;
|
2381
|
-
VALUE argv[4];
|
2382
|
-
|
2383
|
-
// target
|
2384
|
-
argv[0] = rb_ary_pop(value_stack);
|
2385
|
-
|
2386
|
-
// value
|
2387
|
-
argv[1] = rb_ary_pop(value_stack);
|
2388
|
-
|
2389
|
-
// operator_loc
|
2390
|
-
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
|
2391
|
-
|
2392
|
-
// location
|
2393
|
-
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
|
2394
|
-
|
2395
|
-
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPOrWriteNode));
|
2396
|
-
break;
|
2397
|
-
}
|
2398
2982
|
#line 137 "api_node.c.erb"
|
2399
2983
|
case YP_NODE_PARAMETERS_NODE: {
|
2400
2984
|
yp_parameters_node_t *cast = (yp_parameters_node_t *) node;
|
@@ -2665,8 +3249,8 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2665
3249
|
yp_required_parameter_node_t *cast = (yp_required_parameter_node_t *) node;
|
2666
3250
|
VALUE argv[2];
|
2667
3251
|
|
2668
|
-
//
|
2669
|
-
argv[0] = rb_id2sym(constants[cast->
|
3252
|
+
// name
|
3253
|
+
argv[0] = rb_id2sym(constants[cast->name - 1]);
|
2670
3254
|
|
2671
3255
|
// location
|
2672
3256
|
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
|
@@ -2954,7 +3538,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
2954
3538
|
argv[0] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
|
2955
3539
|
|
2956
3540
|
// value_loc
|
2957
|
-
argv[1] = yp_location_new(parser, cast->value_loc.start, cast->value_loc.end, source);
|
3541
|
+
argv[1] = cast->value_loc.start == NULL ? Qnil : yp_location_new(parser, cast->value_loc.start, cast->value_loc.end, source);
|
2958
3542
|
|
2959
3543
|
// closing_loc
|
2960
3544
|
argv[2] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
@@ -3027,24 +3611,27 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3027
3611
|
#line 137 "api_node.c.erb"
|
3028
3612
|
case YP_NODE_UNTIL_NODE: {
|
3029
3613
|
yp_until_node_t *cast = (yp_until_node_t *) node;
|
3030
|
-
VALUE argv[
|
3614
|
+
VALUE argv[6];
|
3031
3615
|
|
3032
3616
|
// keyword_loc
|
3033
3617
|
argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
|
3034
3618
|
|
3619
|
+
// closing_loc
|
3620
|
+
argv[1] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
3621
|
+
|
3035
3622
|
// predicate
|
3036
|
-
argv[
|
3623
|
+
argv[2] = rb_ary_pop(value_stack);
|
3037
3624
|
|
3038
3625
|
// statements
|
3039
|
-
argv[
|
3626
|
+
argv[3] = rb_ary_pop(value_stack);
|
3040
3627
|
|
3041
3628
|
// flags
|
3042
|
-
argv[
|
3629
|
+
argv[4] = ULONG2NUM(node->flags >> 1);
|
3043
3630
|
|
3044
3631
|
// location
|
3045
|
-
argv[
|
3632
|
+
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
|
3046
3633
|
|
3047
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
3634
|
+
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPUntilNode));
|
3048
3635
|
break;
|
3049
3636
|
}
|
3050
3637
|
#line 137 "api_node.c.erb"
|
@@ -3073,24 +3660,27 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
|
|
3073
3660
|
#line 137 "api_node.c.erb"
|
3074
3661
|
case YP_NODE_WHILE_NODE: {
|
3075
3662
|
yp_while_node_t *cast = (yp_while_node_t *) node;
|
3076
|
-
VALUE argv[
|
3663
|
+
VALUE argv[6];
|
3077
3664
|
|
3078
3665
|
// keyword_loc
|
3079
3666
|
argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
|
3080
3667
|
|
3668
|
+
// closing_loc
|
3669
|
+
argv[1] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
|
3670
|
+
|
3081
3671
|
// predicate
|
3082
|
-
argv[
|
3672
|
+
argv[2] = rb_ary_pop(value_stack);
|
3083
3673
|
|
3084
3674
|
// statements
|
3085
|
-
argv[
|
3675
|
+
argv[3] = rb_ary_pop(value_stack);
|
3086
3676
|
|
3087
3677
|
// flags
|
3088
|
-
argv[
|
3678
|
+
argv[4] = ULONG2NUM(node->flags >> 1);
|
3089
3679
|
|
3090
3680
|
// location
|
3091
|
-
argv[
|
3681
|
+
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
|
3092
3682
|
|
3093
|
-
rb_ary_push(value_stack, rb_class_new_instance(
|
3683
|
+
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPWhileNode));
|
3094
3684
|
break;
|
3095
3685
|
}
|
3096
3686
|
#line 137 "api_node.c.erb"
|
@@ -3155,7 +3745,6 @@ Init_yarp_api_node(void) {
|
|
3155
3745
|
rb_cYARPAliasNode = rb_define_class_under(rb_cYARP, "AliasNode", rb_cYARPNode);
|
3156
3746
|
rb_cYARPAlternationPatternNode = rb_define_class_under(rb_cYARP, "AlternationPatternNode", rb_cYARPNode);
|
3157
3747
|
rb_cYARPAndNode = rb_define_class_under(rb_cYARP, "AndNode", rb_cYARPNode);
|
3158
|
-
rb_cYARPAndWriteNode = rb_define_class_under(rb_cYARP, "AndWriteNode", rb_cYARPNode);
|
3159
3748
|
rb_cYARPArgumentsNode = rb_define_class_under(rb_cYARP, "ArgumentsNode", rb_cYARPNode);
|
3160
3749
|
rb_cYARPArrayNode = rb_define_class_under(rb_cYARP, "ArrayNode", rb_cYARPNode);
|
3161
3750
|
rb_cYARPArrayPatternNode = rb_define_class_under(rb_cYARP, "ArrayPatternNode", rb_cYARPNode);
|
@@ -3175,11 +3764,23 @@ Init_yarp_api_node(void) {
|
|
3175
3764
|
rb_cYARPCapturePatternNode = rb_define_class_under(rb_cYARP, "CapturePatternNode", rb_cYARPNode);
|
3176
3765
|
rb_cYARPCaseNode = rb_define_class_under(rb_cYARP, "CaseNode", rb_cYARPNode);
|
3177
3766
|
rb_cYARPClassNode = rb_define_class_under(rb_cYARP, "ClassNode", rb_cYARPNode);
|
3767
|
+
rb_cYARPClassVariableAndWriteNode = rb_define_class_under(rb_cYARP, "ClassVariableAndWriteNode", rb_cYARPNode);
|
3768
|
+
rb_cYARPClassVariableOperatorWriteNode = rb_define_class_under(rb_cYARP, "ClassVariableOperatorWriteNode", rb_cYARPNode);
|
3769
|
+
rb_cYARPClassVariableOrWriteNode = rb_define_class_under(rb_cYARP, "ClassVariableOrWriteNode", rb_cYARPNode);
|
3178
3770
|
rb_cYARPClassVariableReadNode = rb_define_class_under(rb_cYARP, "ClassVariableReadNode", rb_cYARPNode);
|
3771
|
+
rb_cYARPClassVariableTargetNode = rb_define_class_under(rb_cYARP, "ClassVariableTargetNode", rb_cYARPNode);
|
3179
3772
|
rb_cYARPClassVariableWriteNode = rb_define_class_under(rb_cYARP, "ClassVariableWriteNode", rb_cYARPNode);
|
3773
|
+
rb_cYARPConstantAndWriteNode = rb_define_class_under(rb_cYARP, "ConstantAndWriteNode", rb_cYARPNode);
|
3774
|
+
rb_cYARPConstantOperatorWriteNode = rb_define_class_under(rb_cYARP, "ConstantOperatorWriteNode", rb_cYARPNode);
|
3775
|
+
rb_cYARPConstantOrWriteNode = rb_define_class_under(rb_cYARP, "ConstantOrWriteNode", rb_cYARPNode);
|
3776
|
+
rb_cYARPConstantPathAndWriteNode = rb_define_class_under(rb_cYARP, "ConstantPathAndWriteNode", rb_cYARPNode);
|
3180
3777
|
rb_cYARPConstantPathNode = rb_define_class_under(rb_cYARP, "ConstantPathNode", rb_cYARPNode);
|
3778
|
+
rb_cYARPConstantPathOperatorWriteNode = rb_define_class_under(rb_cYARP, "ConstantPathOperatorWriteNode", rb_cYARPNode);
|
3779
|
+
rb_cYARPConstantPathOrWriteNode = rb_define_class_under(rb_cYARP, "ConstantPathOrWriteNode", rb_cYARPNode);
|
3780
|
+
rb_cYARPConstantPathTargetNode = rb_define_class_under(rb_cYARP, "ConstantPathTargetNode", rb_cYARPNode);
|
3181
3781
|
rb_cYARPConstantPathWriteNode = rb_define_class_under(rb_cYARP, "ConstantPathWriteNode", rb_cYARPNode);
|
3182
3782
|
rb_cYARPConstantReadNode = rb_define_class_under(rb_cYARP, "ConstantReadNode", rb_cYARPNode);
|
3783
|
+
rb_cYARPConstantTargetNode = rb_define_class_under(rb_cYARP, "ConstantTargetNode", rb_cYARPNode);
|
3183
3784
|
rb_cYARPConstantWriteNode = rb_define_class_under(rb_cYARP, "ConstantWriteNode", rb_cYARPNode);
|
3184
3785
|
rb_cYARPDefNode = rb_define_class_under(rb_cYARP, "DefNode", rb_cYARPNode);
|
3185
3786
|
rb_cYARPDefinedNode = rb_define_class_under(rb_cYARP, "DefinedNode", rb_cYARPNode);
|
@@ -3195,14 +3796,22 @@ Init_yarp_api_node(void) {
|
|
3195
3796
|
rb_cYARPForwardingArgumentsNode = rb_define_class_under(rb_cYARP, "ForwardingArgumentsNode", rb_cYARPNode);
|
3196
3797
|
rb_cYARPForwardingParameterNode = rb_define_class_under(rb_cYARP, "ForwardingParameterNode", rb_cYARPNode);
|
3197
3798
|
rb_cYARPForwardingSuperNode = rb_define_class_under(rb_cYARP, "ForwardingSuperNode", rb_cYARPNode);
|
3799
|
+
rb_cYARPGlobalVariableAndWriteNode = rb_define_class_under(rb_cYARP, "GlobalVariableAndWriteNode", rb_cYARPNode);
|
3800
|
+
rb_cYARPGlobalVariableOperatorWriteNode = rb_define_class_under(rb_cYARP, "GlobalVariableOperatorWriteNode", rb_cYARPNode);
|
3801
|
+
rb_cYARPGlobalVariableOrWriteNode = rb_define_class_under(rb_cYARP, "GlobalVariableOrWriteNode", rb_cYARPNode);
|
3198
3802
|
rb_cYARPGlobalVariableReadNode = rb_define_class_under(rb_cYARP, "GlobalVariableReadNode", rb_cYARPNode);
|
3803
|
+
rb_cYARPGlobalVariableTargetNode = rb_define_class_under(rb_cYARP, "GlobalVariableTargetNode", rb_cYARPNode);
|
3199
3804
|
rb_cYARPGlobalVariableWriteNode = rb_define_class_under(rb_cYARP, "GlobalVariableWriteNode", rb_cYARPNode);
|
3200
3805
|
rb_cYARPHashNode = rb_define_class_under(rb_cYARP, "HashNode", rb_cYARPNode);
|
3201
3806
|
rb_cYARPHashPatternNode = rb_define_class_under(rb_cYARP, "HashPatternNode", rb_cYARPNode);
|
3202
3807
|
rb_cYARPIfNode = rb_define_class_under(rb_cYARP, "IfNode", rb_cYARPNode);
|
3203
3808
|
rb_cYARPImaginaryNode = rb_define_class_under(rb_cYARP, "ImaginaryNode", rb_cYARPNode);
|
3204
3809
|
rb_cYARPInNode = rb_define_class_under(rb_cYARP, "InNode", rb_cYARPNode);
|
3810
|
+
rb_cYARPInstanceVariableAndWriteNode = rb_define_class_under(rb_cYARP, "InstanceVariableAndWriteNode", rb_cYARPNode);
|
3811
|
+
rb_cYARPInstanceVariableOperatorWriteNode = rb_define_class_under(rb_cYARP, "InstanceVariableOperatorWriteNode", rb_cYARPNode);
|
3812
|
+
rb_cYARPInstanceVariableOrWriteNode = rb_define_class_under(rb_cYARP, "InstanceVariableOrWriteNode", rb_cYARPNode);
|
3205
3813
|
rb_cYARPInstanceVariableReadNode = rb_define_class_under(rb_cYARP, "InstanceVariableReadNode", rb_cYARPNode);
|
3814
|
+
rb_cYARPInstanceVariableTargetNode = rb_define_class_under(rb_cYARP, "InstanceVariableTargetNode", rb_cYARPNode);
|
3206
3815
|
rb_cYARPInstanceVariableWriteNode = rb_define_class_under(rb_cYARP, "InstanceVariableWriteNode", rb_cYARPNode);
|
3207
3816
|
rb_cYARPIntegerNode = rb_define_class_under(rb_cYARP, "IntegerNode", rb_cYARPNode);
|
3208
3817
|
rb_cYARPInterpolatedRegularExpressionNode = rb_define_class_under(rb_cYARP, "InterpolatedRegularExpressionNode", rb_cYARPNode);
|
@@ -3213,7 +3822,11 @@ Init_yarp_api_node(void) {
|
|
3213
3822
|
rb_cYARPKeywordParameterNode = rb_define_class_under(rb_cYARP, "KeywordParameterNode", rb_cYARPNode);
|
3214
3823
|
rb_cYARPKeywordRestParameterNode = rb_define_class_under(rb_cYARP, "KeywordRestParameterNode", rb_cYARPNode);
|
3215
3824
|
rb_cYARPLambdaNode = rb_define_class_under(rb_cYARP, "LambdaNode", rb_cYARPNode);
|
3825
|
+
rb_cYARPLocalVariableAndWriteNode = rb_define_class_under(rb_cYARP, "LocalVariableAndWriteNode", rb_cYARPNode);
|
3826
|
+
rb_cYARPLocalVariableOperatorWriteNode = rb_define_class_under(rb_cYARP, "LocalVariableOperatorWriteNode", rb_cYARPNode);
|
3827
|
+
rb_cYARPLocalVariableOrWriteNode = rb_define_class_under(rb_cYARP, "LocalVariableOrWriteNode", rb_cYARPNode);
|
3216
3828
|
rb_cYARPLocalVariableReadNode = rb_define_class_under(rb_cYARP, "LocalVariableReadNode", rb_cYARPNode);
|
3829
|
+
rb_cYARPLocalVariableTargetNode = rb_define_class_under(rb_cYARP, "LocalVariableTargetNode", rb_cYARPNode);
|
3217
3830
|
rb_cYARPLocalVariableWriteNode = rb_define_class_under(rb_cYARP, "LocalVariableWriteNode", rb_cYARPNode);
|
3218
3831
|
rb_cYARPMatchPredicateNode = rb_define_class_under(rb_cYARP, "MatchPredicateNode", rb_cYARPNode);
|
3219
3832
|
rb_cYARPMatchRequiredNode = rb_define_class_under(rb_cYARP, "MatchRequiredNode", rb_cYARPNode);
|
@@ -3224,10 +3837,8 @@ Init_yarp_api_node(void) {
|
|
3224
3837
|
rb_cYARPNilNode = rb_define_class_under(rb_cYARP, "NilNode", rb_cYARPNode);
|
3225
3838
|
rb_cYARPNoKeywordsParameterNode = rb_define_class_under(rb_cYARP, "NoKeywordsParameterNode", rb_cYARPNode);
|
3226
3839
|
rb_cYARPNumberedReferenceReadNode = rb_define_class_under(rb_cYARP, "NumberedReferenceReadNode", rb_cYARPNode);
|
3227
|
-
rb_cYARPOperatorWriteNode = rb_define_class_under(rb_cYARP, "OperatorWriteNode", rb_cYARPNode);
|
3228
3840
|
rb_cYARPOptionalParameterNode = rb_define_class_under(rb_cYARP, "OptionalParameterNode", rb_cYARPNode);
|
3229
3841
|
rb_cYARPOrNode = rb_define_class_under(rb_cYARP, "OrNode", rb_cYARPNode);
|
3230
|
-
rb_cYARPOrWriteNode = rb_define_class_under(rb_cYARP, "OrWriteNode", rb_cYARPNode);
|
3231
3842
|
rb_cYARPParametersNode = rb_define_class_under(rb_cYARP, "ParametersNode", rb_cYARPNode);
|
3232
3843
|
rb_cYARPParenthesesNode = rb_define_class_under(rb_cYARP, "ParenthesesNode", rb_cYARPNode);
|
3233
3844
|
rb_cYARPPinnedExpressionNode = rb_define_class_under(rb_cYARP, "PinnedExpressionNode", rb_cYARPNode);
|