Ruby 4.1.0dev (2026-08-15 revision 75d53029986f6c95f3fd66d8b05c3222d63f21b2)
api_node.c
1/*----------------------------------------------------------------------------*/
2/* This file is generated by the templates/template.rb script and should not */
3/* be modified manually. See */
4/* templates/ext/prism/api_node.c.erb */
5/* if you are looking to modify the */
6/* template */
7/*----------------------------------------------------------------------------*/
8
9#line 2 "prism/templates/ext/prism/api_node.c.erb"
10#include "prism/extension.h"
11#include "prism/internal/allocator.h"
12#include "prism/internal/arena.h"
13
14#include <assert.h>
15
16extern VALUE rb_cPrism;
17extern VALUE rb_cPrismNode;
18extern VALUE rb_cPrismSource;
19extern VALUE rb_cPrismToken;
20extern VALUE rb_cPrismLocation;
21
22static VALUE rb_cPrismAliasGlobalVariableNode;
23static VALUE rb_cPrismAliasMethodNode;
24static VALUE rb_cPrismAlternationPatternNode;
25static VALUE rb_cPrismAndNode;
26static VALUE rb_cPrismArgumentsNode;
27static VALUE rb_cPrismArrayNode;
28static VALUE rb_cPrismArrayPatternNode;
29static VALUE rb_cPrismAssocNode;
30static VALUE rb_cPrismAssocSplatNode;
31static VALUE rb_cPrismBackReferenceReadNode;
32static VALUE rb_cPrismBeginNode;
33static VALUE rb_cPrismBlockArgumentNode;
34static VALUE rb_cPrismBlockLocalVariableNode;
35static VALUE rb_cPrismBlockNode;
36static VALUE rb_cPrismBlockParameterNode;
37static VALUE rb_cPrismBlockParametersNode;
38static VALUE rb_cPrismBreakNode;
39static VALUE rb_cPrismCallAndWriteNode;
40static VALUE rb_cPrismCallNode;
41static VALUE rb_cPrismCallOperatorWriteNode;
42static VALUE rb_cPrismCallOrWriteNode;
43static VALUE rb_cPrismCallTargetNode;
44static VALUE rb_cPrismCapturePatternNode;
45static VALUE rb_cPrismCaseMatchNode;
46static VALUE rb_cPrismCaseNode;
47static VALUE rb_cPrismClassNode;
48static VALUE rb_cPrismClassVariableAndWriteNode;
49static VALUE rb_cPrismClassVariableOperatorWriteNode;
50static VALUE rb_cPrismClassVariableOrWriteNode;
51static VALUE rb_cPrismClassVariableReadNode;
52static VALUE rb_cPrismClassVariableTargetNode;
53static VALUE rb_cPrismClassVariableWriteNode;
54static VALUE rb_cPrismConstantAndWriteNode;
55static VALUE rb_cPrismConstantOperatorWriteNode;
56static VALUE rb_cPrismConstantOrWriteNode;
57static VALUE rb_cPrismConstantPathAndWriteNode;
58static VALUE rb_cPrismConstantPathNode;
59static VALUE rb_cPrismConstantPathOperatorWriteNode;
60static VALUE rb_cPrismConstantPathOrWriteNode;
61static VALUE rb_cPrismConstantPathTargetNode;
62static VALUE rb_cPrismConstantPathWriteNode;
63static VALUE rb_cPrismConstantReadNode;
64static VALUE rb_cPrismConstantTargetNode;
65static VALUE rb_cPrismConstantWriteNode;
66static VALUE rb_cPrismDefNode;
67static VALUE rb_cPrismDefinedNode;
68static VALUE rb_cPrismElseNode;
69static VALUE rb_cPrismEmbeddedStatementsNode;
70static VALUE rb_cPrismEmbeddedVariableNode;
71static VALUE rb_cPrismEnsureNode;
72static VALUE rb_cPrismErrorRecoveryNode;
73static VALUE rb_cPrismFalseNode;
74static VALUE rb_cPrismFindPatternNode;
75static VALUE rb_cPrismFlipFlopNode;
76static VALUE rb_cPrismFloatNode;
77static VALUE rb_cPrismForNode;
78static VALUE rb_cPrismForwardingArgumentsNode;
79static VALUE rb_cPrismForwardingParameterNode;
80static VALUE rb_cPrismForwardingSuperNode;
81static VALUE rb_cPrismGlobalVariableAndWriteNode;
82static VALUE rb_cPrismGlobalVariableOperatorWriteNode;
83static VALUE rb_cPrismGlobalVariableOrWriteNode;
84static VALUE rb_cPrismGlobalVariableReadNode;
85static VALUE rb_cPrismGlobalVariableTargetNode;
86static VALUE rb_cPrismGlobalVariableWriteNode;
87static VALUE rb_cPrismHashNode;
88static VALUE rb_cPrismHashPatternNode;
89static VALUE rb_cPrismIfNode;
90static VALUE rb_cPrismImaginaryNode;
91static VALUE rb_cPrismImplicitNode;
92static VALUE rb_cPrismImplicitRestNode;
93static VALUE rb_cPrismInNode;
94static VALUE rb_cPrismIndexAndWriteNode;
95static VALUE rb_cPrismIndexOperatorWriteNode;
96static VALUE rb_cPrismIndexOrWriteNode;
97static VALUE rb_cPrismIndexTargetNode;
98static VALUE rb_cPrismInstanceVariableAndWriteNode;
99static VALUE rb_cPrismInstanceVariableOperatorWriteNode;
100static VALUE rb_cPrismInstanceVariableOrWriteNode;
101static VALUE rb_cPrismInstanceVariableReadNode;
102static VALUE rb_cPrismInstanceVariableTargetNode;
103static VALUE rb_cPrismInstanceVariableWriteNode;
104static VALUE rb_cPrismIntegerNode;
105static VALUE rb_cPrismInterpolatedMatchLastLineNode;
106static VALUE rb_cPrismInterpolatedRegularExpressionNode;
107static VALUE rb_cPrismInterpolatedStringNode;
108static VALUE rb_cPrismInterpolatedSymbolNode;
109static VALUE rb_cPrismInterpolatedXStringNode;
110static VALUE rb_cPrismItLocalVariableReadNode;
111static VALUE rb_cPrismItParametersNode;
112static VALUE rb_cPrismKeywordHashNode;
113static VALUE rb_cPrismKeywordRestParameterNode;
114static VALUE rb_cPrismLambdaNode;
115static VALUE rb_cPrismLocalVariableAndWriteNode;
116static VALUE rb_cPrismLocalVariableOperatorWriteNode;
117static VALUE rb_cPrismLocalVariableOrWriteNode;
118static VALUE rb_cPrismLocalVariableReadNode;
119static VALUE rb_cPrismLocalVariableTargetNode;
120static VALUE rb_cPrismLocalVariableWriteNode;
121static VALUE rb_cPrismMatchLastLineNode;
122static VALUE rb_cPrismMatchPredicateNode;
123static VALUE rb_cPrismMatchRequiredNode;
124static VALUE rb_cPrismMatchWriteNode;
125static VALUE rb_cPrismModuleNode;
126static VALUE rb_cPrismMultiTargetNode;
127static VALUE rb_cPrismMultiWriteNode;
128static VALUE rb_cPrismNextNode;
129static VALUE rb_cPrismNilNode;
130static VALUE rb_cPrismNoBlockParameterNode;
131static VALUE rb_cPrismNoKeywordsParameterNode;
132static VALUE rb_cPrismNumberedParametersNode;
133static VALUE rb_cPrismNumberedReferenceReadNode;
134static VALUE rb_cPrismOptionalKeywordParameterNode;
135static VALUE rb_cPrismOptionalParameterNode;
136static VALUE rb_cPrismOrNode;
137static VALUE rb_cPrismParametersNode;
138static VALUE rb_cPrismParenthesesNode;
139static VALUE rb_cPrismPinnedExpressionNode;
140static VALUE rb_cPrismPinnedVariableNode;
141static VALUE rb_cPrismPostExecutionNode;
142static VALUE rb_cPrismPreExecutionNode;
143static VALUE rb_cPrismProgramNode;
144static VALUE rb_cPrismRangeNode;
145static VALUE rb_cPrismRationalNode;
146static VALUE rb_cPrismRedoNode;
147static VALUE rb_cPrismRegularExpressionNode;
148static VALUE rb_cPrismRequiredKeywordParameterNode;
149static VALUE rb_cPrismRequiredParameterNode;
150static VALUE rb_cPrismRescueModifierNode;
151static VALUE rb_cPrismRescueNode;
152static VALUE rb_cPrismRestParameterNode;
153static VALUE rb_cPrismRetryNode;
154static VALUE rb_cPrismReturnNode;
155static VALUE rb_cPrismSelfNode;
156static VALUE rb_cPrismShareableConstantNode;
157static VALUE rb_cPrismSingletonClassNode;
158static VALUE rb_cPrismSourceEncodingNode;
159static VALUE rb_cPrismSourceFileNode;
160static VALUE rb_cPrismSourceLineNode;
161static VALUE rb_cPrismSplatNode;
162static VALUE rb_cPrismStatementsNode;
163static VALUE rb_cPrismStringNode;
164static VALUE rb_cPrismSuperNode;
165static VALUE rb_cPrismSymbolNode;
166static VALUE rb_cPrismTrueNode;
167static VALUE rb_cPrismUndefNode;
168static VALUE rb_cPrismUnlessNode;
169static VALUE rb_cPrismUntilNode;
170static VALUE rb_cPrismWhenNode;
171static VALUE rb_cPrismWhileNode;
172static VALUE rb_cPrismXStringNode;
173static VALUE rb_cPrismYieldNode;
174
175static VALUE
176pm_location_new(const uint32_t start, const uint32_t length, VALUE source, bool freeze) {
177 if (freeze) {
178 VALUE location_argv[] = { source, LONG2FIX(start), LONG2FIX(length) };
179 return rb_obj_freeze(rb_class_new_instance(3, location_argv, rb_cPrismLocation));
180 } else {
181 uint64_t value = ((((uint64_t) start) << 32) | ((uint64_t) length));
182 return ULL2NUM(value);
183 }
184}
185
186VALUE
187pm_token_new(const pm_parser_t *parser, const pm_token_t *token, rb_encoding *encoding, VALUE source, bool freeze) {
188 ID type = rb_intern(pm_token_type(token->type));
189 VALUE location = pm_location_new((uint32_t) (token->start - pm_parser_start(parser)), (uint32_t) (token->end - token->start), source, freeze);
190
191 VALUE slice = rb_enc_str_new((const char *) token->start, token->end - token->start, encoding);
192 if (freeze) rb_obj_freeze(slice);
193
194 VALUE argv[] = { source, ID2SYM(type), slice, location };
195 VALUE value = rb_class_new_instance(4, argv, rb_cPrismToken);
196 if (freeze) rb_obj_freeze(value);
197
198 return value;
199}
200
201static VALUE
202pm_string_new(const pm_string_t *string, rb_encoding *encoding) {
203 return rb_obj_freeze(rb_enc_str_new((const char *) pm_string_source(string), pm_string_length(string), encoding));
204}
205
206VALUE
207pm_integer_new(const pm_integer_t *integer) {
208 VALUE result;
209 if (integer->values == NULL) {
210 result = UINT2NUM(integer->value);
211 } else {
212 VALUE string = rb_str_new(NULL, integer->length * 8);
213 unsigned char *bytes = (unsigned char *) RSTRING_PTR(string);
214
215 size_t offset = integer->length * 8;
216 for (size_t value_index = 0; value_index < integer->length; value_index++) {
217 uint32_t value = integer->values[value_index];
218
219 for (int index = 0; index < 8; index++) {
220 int byte = (value >> (4 * index)) & 0xf;
221 bytes[--offset] = byte < 10 ? byte + '0' : byte - 10 + 'a';
222 }
223 }
224
225 result = rb_funcall(string, rb_intern("to_i"), 1, UINT2NUM(16));
226 }
227
228 if (integer->negative) {
229 result = rb_funcall(result, rb_intern("-@"), 0);
230 }
231
232 return result;
233}
234
235// Create a Prism::Source object from the given parser, after pm_parse() was called.
236VALUE
237pm_source_new(const pm_parser_t *parser, rb_encoding *encoding, bool freeze) {
238 const uint8_t *start = pm_parser_start(parser);
239 VALUE source_string = rb_enc_str_new((const char *) start, pm_parser_end(parser) - start, encoding);
240
241 const pm_line_offset_list_t *line_offsets = pm_parser_line_offsets(parser);
242 VALUE offsets;
243
244 if (freeze) {
245 offsets = rb_ary_new_capa(line_offsets->size);
246 for (size_t index = 0; index < line_offsets->size; index++) {
247 rb_ary_push(offsets, ULONG2NUM(line_offsets->offsets[index]));
248 }
249
250 rb_obj_freeze(source_string);
251 rb_obj_freeze(offsets);
252 } else {
253 offsets = rb_str_new((const char *) line_offsets->offsets, line_offsets->size * sizeof(uint32_t));
254 }
255
256 VALUE source = rb_funcall(rb_cPrismSource, rb_intern("for"), 3, source_string, LONG2NUM(pm_parser_start_line(parser)), offsets);
257 if (freeze) rb_obj_freeze(source);
258
259 return source;
260}
261
262typedef struct pm_node_stack_node {
263 struct pm_node_stack_node *prev;
264 const pm_node_t *visit;
265 bool visited;
267
268static void
269pm_node_stack_push(pm_arena_t *arena, pm_node_stack_node_t **stack, const pm_node_t *visit) {
271 node->prev = *stack;
272 node->visit = visit;
273 node->visited = false;
274 *stack = node;
275}
276
277static const pm_node_t *
278pm_node_stack_pop(pm_node_stack_node_t **stack) {
279 pm_node_stack_node_t *current = *stack;
280 const pm_node_t *visit = current->visit;
281
282 *stack = current->prev;
283
284 return visit;
285}
286
287typedef struct {
288 VALUE constants;
289 rb_encoding *encoding;
291
292static void
293pm_ast_constants_each(const pm_constant_t *constant, void *data) {
295 int state = 0;
296
297 VALUE string = rb_enc_str_new((const char *) pm_constant_start(constant), pm_constant_length(constant), constants_data->encoding);
298 VALUE value = rb_protect(rb_str_intern, string, &state);
299
300 if (state != 0) {
301 value = ID2SYM(rb_intern_const("?"));
302 rb_set_errinfo(Qnil);
303 }
304
305 rb_ary_push(constants_data->constants, value);
306}
307
308VALUE
309pm_ast_new(const pm_parser_t *parser, const pm_node_t *node, rb_encoding *encoding, VALUE source, bool freeze) {
310 VALUE constants = rb_ary_new_capa(pm_parser_constants_size(parser));
311 pm_ast_constants_each_data_t constants_data = { .constants = constants, .encoding = encoding };
312 pm_parser_constants_each(parser, pm_ast_constants_each, &constants_data);
313
314 pm_arena_t *node_arena = pm_arena_new();
315 pm_node_stack_node_t *node_stack = NULL;
316 pm_node_stack_push(node_arena, &node_stack, node);
317 VALUE value_stack = rb_ary_new();
318
319 while (node_stack != NULL) {
320 if (!node_stack->visited) {
321 if (node_stack->visit == NULL) {
322 pm_node_stack_pop(&node_stack);
323 rb_ary_push(value_stack, Qnil);
324 continue;
325 }
326
327 const pm_node_t *node = node_stack->visit;
328 node_stack->visited = true;
329
330 switch (PM_NODE_TYPE(node)) {
331#line 177 "prism/templates/ext/prism/api_node.c.erb"
332 case PM_ALIAS_GLOBAL_VARIABLE_NODE: {
334 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->new_name);
335 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->old_name);
336 break;
337 }
338#line 177 "prism/templates/ext/prism/api_node.c.erb"
339 case PM_ALIAS_METHOD_NODE: {
341 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->new_name);
342 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->old_name);
343 break;
344 }
345#line 177 "prism/templates/ext/prism/api_node.c.erb"
346 case PM_ALTERNATION_PATTERN_NODE: {
348 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->left);
349 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->right);
350 break;
351 }
352#line 177 "prism/templates/ext/prism/api_node.c.erb"
353 case PM_AND_NODE: {
354 pm_and_node_t *cast = (pm_and_node_t *) node;
355 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->left);
356 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->right);
357 break;
358 }
359#line 177 "prism/templates/ext/prism/api_node.c.erb"
360 case PM_ARGUMENTS_NODE: {
362 for (size_t index = 0; index < cast->arguments.size; index++) {
363 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->arguments.nodes[index]);
364 }
365 break;
366 }
367#line 177 "prism/templates/ext/prism/api_node.c.erb"
368 case PM_ARRAY_NODE: {
369 pm_array_node_t *cast = (pm_array_node_t *) node;
370 for (size_t index = 0; index < cast->elements.size; index++) {
371 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->elements.nodes[index]);
372 }
373 break;
374 }
375#line 177 "prism/templates/ext/prism/api_node.c.erb"
376 case PM_ARRAY_PATTERN_NODE: {
378 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->constant);
379 for (size_t index = 0; index < cast->requireds.size; index++) {
380 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->requireds.nodes[index]);
381 }
382 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->rest);
383 for (size_t index = 0; index < cast->posts.size; index++) {
384 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->posts.nodes[index]);
385 }
386 break;
387 }
388#line 177 "prism/templates/ext/prism/api_node.c.erb"
389 case PM_ASSOC_NODE: {
390 pm_assoc_node_t *cast = (pm_assoc_node_t *) node;
391 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->key);
392 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
393 break;
394 }
395#line 177 "prism/templates/ext/prism/api_node.c.erb"
396 case PM_ASSOC_SPLAT_NODE: {
398 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
399 break;
400 }
401#line 177 "prism/templates/ext/prism/api_node.c.erb"
402 case PM_BEGIN_NODE: {
403 pm_begin_node_t *cast = (pm_begin_node_t *) node;
404 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->statements);
405 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->rescue_clause);
406 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->else_clause);
407 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->ensure_clause);
408 break;
409 }
410#line 177 "prism/templates/ext/prism/api_node.c.erb"
411 case PM_BLOCK_ARGUMENT_NODE: {
413 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->expression);
414 break;
415 }
416#line 177 "prism/templates/ext/prism/api_node.c.erb"
417 case PM_BLOCK_NODE: {
418 pm_block_node_t *cast = (pm_block_node_t *) node;
419 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->parameters);
420 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->body);
421 break;
422 }
423#line 177 "prism/templates/ext/prism/api_node.c.erb"
424 case PM_BLOCK_PARAMETERS_NODE: {
426 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->parameters);
427 for (size_t index = 0; index < cast->locals.size; index++) {
428 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->locals.nodes[index]);
429 }
430 break;
431 }
432#line 177 "prism/templates/ext/prism/api_node.c.erb"
433 case PM_BREAK_NODE: {
434 pm_break_node_t *cast = (pm_break_node_t *) node;
435 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->arguments);
436 break;
437 }
438#line 177 "prism/templates/ext/prism/api_node.c.erb"
439 case PM_CALL_AND_WRITE_NODE: {
441 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->receiver);
442 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
443 break;
444 }
445#line 177 "prism/templates/ext/prism/api_node.c.erb"
446 case PM_CALL_NODE: {
447 pm_call_node_t *cast = (pm_call_node_t *) node;
448 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->receiver);
449 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->arguments);
450 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->block);
451 break;
452 }
453#line 177 "prism/templates/ext/prism/api_node.c.erb"
454 case PM_CALL_OPERATOR_WRITE_NODE: {
456 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->receiver);
457 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
458 break;
459 }
460#line 177 "prism/templates/ext/prism/api_node.c.erb"
461 case PM_CALL_OR_WRITE_NODE: {
463 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->receiver);
464 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
465 break;
466 }
467#line 177 "prism/templates/ext/prism/api_node.c.erb"
468 case PM_CALL_TARGET_NODE: {
470 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->receiver);
471 break;
472 }
473#line 177 "prism/templates/ext/prism/api_node.c.erb"
474 case PM_CAPTURE_PATTERN_NODE: {
476 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
477 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->target);
478 break;
479 }
480#line 177 "prism/templates/ext/prism/api_node.c.erb"
481 case PM_CASE_MATCH_NODE: {
483 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->predicate);
484 for (size_t index = 0; index < cast->conditions.size; index++) {
485 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->conditions.nodes[index]);
486 }
487 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->else_clause);
488 break;
489 }
490#line 177 "prism/templates/ext/prism/api_node.c.erb"
491 case PM_CASE_NODE: {
492 pm_case_node_t *cast = (pm_case_node_t *) node;
493 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->predicate);
494 for (size_t index = 0; index < cast->conditions.size; index++) {
495 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->conditions.nodes[index]);
496 }
497 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->else_clause);
498 break;
499 }
500#line 177 "prism/templates/ext/prism/api_node.c.erb"
501 case PM_CLASS_NODE: {
502 pm_class_node_t *cast = (pm_class_node_t *) node;
503 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->constant_path);
504 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->superclass);
505 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->body);
506 break;
507 }
508#line 177 "prism/templates/ext/prism/api_node.c.erb"
509 case PM_CLASS_VARIABLE_AND_WRITE_NODE: {
511 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
512 break;
513 }
514#line 177 "prism/templates/ext/prism/api_node.c.erb"
515 case PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
517 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
518 break;
519 }
520#line 177 "prism/templates/ext/prism/api_node.c.erb"
521 case PM_CLASS_VARIABLE_OR_WRITE_NODE: {
523 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
524 break;
525 }
526#line 177 "prism/templates/ext/prism/api_node.c.erb"
527 case PM_CLASS_VARIABLE_WRITE_NODE: {
529 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
530 break;
531 }
532#line 177 "prism/templates/ext/prism/api_node.c.erb"
533 case PM_CONSTANT_AND_WRITE_NODE: {
535 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
536 break;
537 }
538#line 177 "prism/templates/ext/prism/api_node.c.erb"
539 case PM_CONSTANT_OPERATOR_WRITE_NODE: {
541 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
542 break;
543 }
544#line 177 "prism/templates/ext/prism/api_node.c.erb"
545 case PM_CONSTANT_OR_WRITE_NODE: {
547 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
548 break;
549 }
550#line 177 "prism/templates/ext/prism/api_node.c.erb"
551 case PM_CONSTANT_PATH_AND_WRITE_NODE: {
553 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->target);
554 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
555 break;
556 }
557#line 177 "prism/templates/ext/prism/api_node.c.erb"
558 case PM_CONSTANT_PATH_NODE: {
560 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->parent);
561 break;
562 }
563#line 177 "prism/templates/ext/prism/api_node.c.erb"
564 case PM_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
566 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->target);
567 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
568 break;
569 }
570#line 177 "prism/templates/ext/prism/api_node.c.erb"
571 case PM_CONSTANT_PATH_OR_WRITE_NODE: {
573 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->target);
574 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
575 break;
576 }
577#line 177 "prism/templates/ext/prism/api_node.c.erb"
578 case PM_CONSTANT_PATH_TARGET_NODE: {
580 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->parent);
581 break;
582 }
583#line 177 "prism/templates/ext/prism/api_node.c.erb"
584 case PM_CONSTANT_PATH_WRITE_NODE: {
586 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->target);
587 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
588 break;
589 }
590#line 177 "prism/templates/ext/prism/api_node.c.erb"
591 case PM_CONSTANT_WRITE_NODE: {
593 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
594 break;
595 }
596#line 177 "prism/templates/ext/prism/api_node.c.erb"
597 case PM_DEF_NODE: {
598 pm_def_node_t *cast = (pm_def_node_t *) node;
599 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->receiver);
600 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->parameters);
601 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->body);
602 break;
603 }
604#line 177 "prism/templates/ext/prism/api_node.c.erb"
605 case PM_DEFINED_NODE: {
606 pm_defined_node_t *cast = (pm_defined_node_t *) node;
607 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
608 break;
609 }
610#line 177 "prism/templates/ext/prism/api_node.c.erb"
611 case PM_ELSE_NODE: {
612 pm_else_node_t *cast = (pm_else_node_t *) node;
613 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->statements);
614 break;
615 }
616#line 177 "prism/templates/ext/prism/api_node.c.erb"
617 case PM_EMBEDDED_STATEMENTS_NODE: {
619 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->statements);
620 break;
621 }
622#line 177 "prism/templates/ext/prism/api_node.c.erb"
623 case PM_EMBEDDED_VARIABLE_NODE: {
625 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->variable);
626 break;
627 }
628#line 177 "prism/templates/ext/prism/api_node.c.erb"
629 case PM_ENSURE_NODE: {
630 pm_ensure_node_t *cast = (pm_ensure_node_t *) node;
631 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->statements);
632 break;
633 }
634#line 177 "prism/templates/ext/prism/api_node.c.erb"
635 case PM_ERROR_RECOVERY_NODE: {
637 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->unexpected);
638 break;
639 }
640#line 177 "prism/templates/ext/prism/api_node.c.erb"
641 case PM_FIND_PATTERN_NODE: {
643 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->constant);
644 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->left);
645 for (size_t index = 0; index < cast->requireds.size; index++) {
646 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->requireds.nodes[index]);
647 }
648 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->right);
649 break;
650 }
651#line 177 "prism/templates/ext/prism/api_node.c.erb"
652 case PM_FLIP_FLOP_NODE: {
654 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->left);
655 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->right);
656 break;
657 }
658#line 177 "prism/templates/ext/prism/api_node.c.erb"
659 case PM_FOR_NODE: {
660 pm_for_node_t *cast = (pm_for_node_t *) node;
661 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->index);
662 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->collection);
663 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->statements);
664 break;
665 }
666#line 177 "prism/templates/ext/prism/api_node.c.erb"
667 case PM_FORWARDING_SUPER_NODE: {
669 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->block);
670 break;
671 }
672#line 177 "prism/templates/ext/prism/api_node.c.erb"
673 case PM_GLOBAL_VARIABLE_AND_WRITE_NODE: {
675 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
676 break;
677 }
678#line 177 "prism/templates/ext/prism/api_node.c.erb"
679 case PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
681 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
682 break;
683 }
684#line 177 "prism/templates/ext/prism/api_node.c.erb"
685 case PM_GLOBAL_VARIABLE_OR_WRITE_NODE: {
687 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
688 break;
689 }
690#line 177 "prism/templates/ext/prism/api_node.c.erb"
691 case PM_GLOBAL_VARIABLE_WRITE_NODE: {
693 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
694 break;
695 }
696#line 177 "prism/templates/ext/prism/api_node.c.erb"
697 case PM_HASH_NODE: {
698 pm_hash_node_t *cast = (pm_hash_node_t *) node;
699 for (size_t index = 0; index < cast->elements.size; index++) {
700 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->elements.nodes[index]);
701 }
702 break;
703 }
704#line 177 "prism/templates/ext/prism/api_node.c.erb"
705 case PM_HASH_PATTERN_NODE: {
707 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->constant);
708 for (size_t index = 0; index < cast->elements.size; index++) {
709 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->elements.nodes[index]);
710 }
711 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->rest);
712 break;
713 }
714#line 177 "prism/templates/ext/prism/api_node.c.erb"
715 case PM_IF_NODE: {
716 pm_if_node_t *cast = (pm_if_node_t *) node;
717 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->predicate);
718 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->statements);
719 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->subsequent);
720 break;
721 }
722#line 177 "prism/templates/ext/prism/api_node.c.erb"
723 case PM_IMAGINARY_NODE: {
725 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->numeric);
726 break;
727 }
728#line 177 "prism/templates/ext/prism/api_node.c.erb"
729 case PM_IMPLICIT_NODE: {
730 pm_implicit_node_t *cast = (pm_implicit_node_t *) node;
731 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
732 break;
733 }
734#line 177 "prism/templates/ext/prism/api_node.c.erb"
735 case PM_IN_NODE: {
736 pm_in_node_t *cast = (pm_in_node_t *) node;
737 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->pattern);
738 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->statements);
739 break;
740 }
741#line 177 "prism/templates/ext/prism/api_node.c.erb"
742 case PM_INDEX_AND_WRITE_NODE: {
744 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->receiver);
745 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->arguments);
746 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->block);
747 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
748 break;
749 }
750#line 177 "prism/templates/ext/prism/api_node.c.erb"
751 case PM_INDEX_OPERATOR_WRITE_NODE: {
753 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->receiver);
754 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->arguments);
755 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->block);
756 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
757 break;
758 }
759#line 177 "prism/templates/ext/prism/api_node.c.erb"
760 case PM_INDEX_OR_WRITE_NODE: {
762 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->receiver);
763 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->arguments);
764 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->block);
765 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
766 break;
767 }
768#line 177 "prism/templates/ext/prism/api_node.c.erb"
769 case PM_INDEX_TARGET_NODE: {
771 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->receiver);
772 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->arguments);
773 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->block);
774 break;
775 }
776#line 177 "prism/templates/ext/prism/api_node.c.erb"
777 case PM_INSTANCE_VARIABLE_AND_WRITE_NODE: {
779 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
780 break;
781 }
782#line 177 "prism/templates/ext/prism/api_node.c.erb"
783 case PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
785 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
786 break;
787 }
788#line 177 "prism/templates/ext/prism/api_node.c.erb"
789 case PM_INSTANCE_VARIABLE_OR_WRITE_NODE: {
791 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
792 break;
793 }
794#line 177 "prism/templates/ext/prism/api_node.c.erb"
795 case PM_INSTANCE_VARIABLE_WRITE_NODE: {
797 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
798 break;
799 }
800#line 177 "prism/templates/ext/prism/api_node.c.erb"
801 case PM_INTERPOLATED_MATCH_LAST_LINE_NODE: {
803 for (size_t index = 0; index < cast->parts.size; index++) {
804 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->parts.nodes[index]);
805 }
806 break;
807 }
808#line 177 "prism/templates/ext/prism/api_node.c.erb"
809 case PM_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
811 for (size_t index = 0; index < cast->parts.size; index++) {
812 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->parts.nodes[index]);
813 }
814 break;
815 }
816#line 177 "prism/templates/ext/prism/api_node.c.erb"
817 case PM_INTERPOLATED_STRING_NODE: {
819 for (size_t index = 0; index < cast->parts.size; index++) {
820 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->parts.nodes[index]);
821 }
822 break;
823 }
824#line 177 "prism/templates/ext/prism/api_node.c.erb"
825 case PM_INTERPOLATED_SYMBOL_NODE: {
827 for (size_t index = 0; index < cast->parts.size; index++) {
828 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->parts.nodes[index]);
829 }
830 break;
831 }
832#line 177 "prism/templates/ext/prism/api_node.c.erb"
833 case PM_INTERPOLATED_X_STRING_NODE: {
835 for (size_t index = 0; index < cast->parts.size; index++) {
836 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->parts.nodes[index]);
837 }
838 break;
839 }
840#line 177 "prism/templates/ext/prism/api_node.c.erb"
841 case PM_KEYWORD_HASH_NODE: {
843 for (size_t index = 0; index < cast->elements.size; index++) {
844 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->elements.nodes[index]);
845 }
846 break;
847 }
848#line 177 "prism/templates/ext/prism/api_node.c.erb"
849 case PM_LAMBDA_NODE: {
850 pm_lambda_node_t *cast = (pm_lambda_node_t *) node;
851 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->parameters);
852 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->body);
853 break;
854 }
855#line 177 "prism/templates/ext/prism/api_node.c.erb"
856 case PM_LOCAL_VARIABLE_AND_WRITE_NODE: {
858 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
859 break;
860 }
861#line 177 "prism/templates/ext/prism/api_node.c.erb"
862 case PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
864 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
865 break;
866 }
867#line 177 "prism/templates/ext/prism/api_node.c.erb"
868 case PM_LOCAL_VARIABLE_OR_WRITE_NODE: {
870 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
871 break;
872 }
873#line 177 "prism/templates/ext/prism/api_node.c.erb"
874 case PM_LOCAL_VARIABLE_WRITE_NODE: {
876 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
877 break;
878 }
879#line 177 "prism/templates/ext/prism/api_node.c.erb"
880 case PM_MATCH_PREDICATE_NODE: {
882 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
883 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->pattern);
884 break;
885 }
886#line 177 "prism/templates/ext/prism/api_node.c.erb"
887 case PM_MATCH_REQUIRED_NODE: {
889 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
890 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->pattern);
891 break;
892 }
893#line 177 "prism/templates/ext/prism/api_node.c.erb"
894 case PM_MATCH_WRITE_NODE: {
896 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->call);
897 for (size_t index = 0; index < cast->targets.size; index++) {
898 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->targets.nodes[index]);
899 }
900 break;
901 }
902#line 177 "prism/templates/ext/prism/api_node.c.erb"
903 case PM_MODULE_NODE: {
904 pm_module_node_t *cast = (pm_module_node_t *) node;
905 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->constant_path);
906 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->body);
907 break;
908 }
909#line 177 "prism/templates/ext/prism/api_node.c.erb"
910 case PM_MULTI_TARGET_NODE: {
912 for (size_t index = 0; index < cast->lefts.size; index++) {
913 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->lefts.nodes[index]);
914 }
915 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->rest);
916 for (size_t index = 0; index < cast->rights.size; index++) {
917 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->rights.nodes[index]);
918 }
919 break;
920 }
921#line 177 "prism/templates/ext/prism/api_node.c.erb"
922 case PM_MULTI_WRITE_NODE: {
924 for (size_t index = 0; index < cast->lefts.size; index++) {
925 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->lefts.nodes[index]);
926 }
927 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->rest);
928 for (size_t index = 0; index < cast->rights.size; index++) {
929 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->rights.nodes[index]);
930 }
931 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
932 break;
933 }
934#line 177 "prism/templates/ext/prism/api_node.c.erb"
935 case PM_NEXT_NODE: {
936 pm_next_node_t *cast = (pm_next_node_t *) node;
937 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->arguments);
938 break;
939 }
940#line 177 "prism/templates/ext/prism/api_node.c.erb"
941 case PM_OPTIONAL_KEYWORD_PARAMETER_NODE: {
943 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
944 break;
945 }
946#line 177 "prism/templates/ext/prism/api_node.c.erb"
947 case PM_OPTIONAL_PARAMETER_NODE: {
949 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->value);
950 break;
951 }
952#line 177 "prism/templates/ext/prism/api_node.c.erb"
953 case PM_OR_NODE: {
954 pm_or_node_t *cast = (pm_or_node_t *) node;
955 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->left);
956 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->right);
957 break;
958 }
959#line 177 "prism/templates/ext/prism/api_node.c.erb"
960 case PM_PARAMETERS_NODE: {
962 for (size_t index = 0; index < cast->requireds.size; index++) {
963 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->requireds.nodes[index]);
964 }
965 for (size_t index = 0; index < cast->optionals.size; index++) {
966 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->optionals.nodes[index]);
967 }
968 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->rest);
969 for (size_t index = 0; index < cast->posts.size; index++) {
970 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->posts.nodes[index]);
971 }
972 for (size_t index = 0; index < cast->keywords.size; index++) {
973 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->keywords.nodes[index]);
974 }
975 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->keyword_rest);
976 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->block);
977 break;
978 }
979#line 177 "prism/templates/ext/prism/api_node.c.erb"
980 case PM_PARENTHESES_NODE: {
982 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->body);
983 break;
984 }
985#line 177 "prism/templates/ext/prism/api_node.c.erb"
986 case PM_PINNED_EXPRESSION_NODE: {
988 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->expression);
989 break;
990 }
991#line 177 "prism/templates/ext/prism/api_node.c.erb"
992 case PM_PINNED_VARIABLE_NODE: {
994 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->variable);
995 break;
996 }
997#line 177 "prism/templates/ext/prism/api_node.c.erb"
998 case PM_POST_EXECUTION_NODE: {
1000 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->statements);
1001 break;
1002 }
1003#line 177 "prism/templates/ext/prism/api_node.c.erb"
1004 case PM_PRE_EXECUTION_NODE: {
1006 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->statements);
1007 break;
1008 }
1009#line 177 "prism/templates/ext/prism/api_node.c.erb"
1010 case PM_PROGRAM_NODE: {
1011 pm_program_node_t *cast = (pm_program_node_t *) node;
1012 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->statements);
1013 break;
1014 }
1015#line 177 "prism/templates/ext/prism/api_node.c.erb"
1016 case PM_RANGE_NODE: {
1017 pm_range_node_t *cast = (pm_range_node_t *) node;
1018 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->left);
1019 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->right);
1020 break;
1021 }
1022#line 177 "prism/templates/ext/prism/api_node.c.erb"
1023 case PM_RESCUE_MODIFIER_NODE: {
1025 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->expression);
1026 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->rescue_expression);
1027 break;
1028 }
1029#line 177 "prism/templates/ext/prism/api_node.c.erb"
1030 case PM_RESCUE_NODE: {
1031 pm_rescue_node_t *cast = (pm_rescue_node_t *) node;
1032 for (size_t index = 0; index < cast->exceptions.size; index++) {
1033 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->exceptions.nodes[index]);
1034 }
1035 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->reference);
1036 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->statements);
1037 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->subsequent);
1038 break;
1039 }
1040#line 177 "prism/templates/ext/prism/api_node.c.erb"
1041 case PM_RETURN_NODE: {
1042 pm_return_node_t *cast = (pm_return_node_t *) node;
1043 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->arguments);
1044 break;
1045 }
1046#line 177 "prism/templates/ext/prism/api_node.c.erb"
1047 case PM_SHAREABLE_CONSTANT_NODE: {
1049 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->write);
1050 break;
1051 }
1052#line 177 "prism/templates/ext/prism/api_node.c.erb"
1053 case PM_SINGLETON_CLASS_NODE: {
1055 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->expression);
1056 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->body);
1057 break;
1058 }
1059#line 177 "prism/templates/ext/prism/api_node.c.erb"
1060 case PM_SPLAT_NODE: {
1061 pm_splat_node_t *cast = (pm_splat_node_t *) node;
1062 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->expression);
1063 break;
1064 }
1065#line 177 "prism/templates/ext/prism/api_node.c.erb"
1066 case PM_STATEMENTS_NODE: {
1068 for (size_t index = 0; index < cast->body.size; index++) {
1069 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->body.nodes[index]);
1070 }
1071 break;
1072 }
1073#line 177 "prism/templates/ext/prism/api_node.c.erb"
1074 case PM_SUPER_NODE: {
1075 pm_super_node_t *cast = (pm_super_node_t *) node;
1076 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->arguments);
1077 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->block);
1078 break;
1079 }
1080#line 177 "prism/templates/ext/prism/api_node.c.erb"
1081 case PM_UNDEF_NODE: {
1082 pm_undef_node_t *cast = (pm_undef_node_t *) node;
1083 for (size_t index = 0; index < cast->names.size; index++) {
1084 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->names.nodes[index]);
1085 }
1086 break;
1087 }
1088#line 177 "prism/templates/ext/prism/api_node.c.erb"
1089 case PM_UNLESS_NODE: {
1090 pm_unless_node_t *cast = (pm_unless_node_t *) node;
1091 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->predicate);
1092 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->statements);
1093 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->else_clause);
1094 break;
1095 }
1096#line 177 "prism/templates/ext/prism/api_node.c.erb"
1097 case PM_UNTIL_NODE: {
1098 pm_until_node_t *cast = (pm_until_node_t *) node;
1099 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->predicate);
1100 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->statements);
1101 break;
1102 }
1103#line 177 "prism/templates/ext/prism/api_node.c.erb"
1104 case PM_WHEN_NODE: {
1105 pm_when_node_t *cast = (pm_when_node_t *) node;
1106 for (size_t index = 0; index < cast->conditions.size; index++) {
1107 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->conditions.nodes[index]);
1108 }
1109 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->statements);
1110 break;
1111 }
1112#line 177 "prism/templates/ext/prism/api_node.c.erb"
1113 case PM_WHILE_NODE: {
1114 pm_while_node_t *cast = (pm_while_node_t *) node;
1115 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->predicate);
1116 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->statements);
1117 break;
1118 }
1119#line 177 "prism/templates/ext/prism/api_node.c.erb"
1120 case PM_YIELD_NODE: {
1121 pm_yield_node_t *cast = (pm_yield_node_t *) node;
1122 pm_node_stack_push(node_arena, &node_stack, (pm_node_t *) cast->arguments);
1123 break;
1124 }
1125 default:
1126 break;
1127 }
1128#line 197 "prism/templates/ext/prism/api_node.c.erb"
1129 } else {
1130 const pm_node_t *node = pm_node_stack_pop(&node_stack);
1131
1132 switch (PM_NODE_TYPE(node)) {
1133#line 203 "prism/templates/ext/prism/api_node.c.erb"
1134 case PM_ALIAS_GLOBAL_VARIABLE_NODE: {
1136 VALUE argv[7];
1137
1138 // source
1139 argv[0] = source;
1140
1141 // node_id
1142 argv[1] = ULONG2NUM(node->node_id);
1143
1144 // location
1145 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
1146
1147 // flags
1148 argv[3] = ULONG2NUM(node->flags);
1149
1150 // new_name
1151#line 226 "prism/templates/ext/prism/api_node.c.erb"
1152 argv[4] = rb_ary_pop(value_stack);
1153
1154 // old_name
1155#line 226 "prism/templates/ext/prism/api_node.c.erb"
1156 argv[5] = rb_ary_pop(value_stack);
1157
1158 // keyword_loc
1159#line 253 "prism/templates/ext/prism/api_node.c.erb"
1160 argv[6] = pm_location_new(cast->keyword_loc.start, cast->keyword_loc.length, source, freeze);
1161
1162 VALUE value = rb_class_new_instance(7, argv, rb_cPrismAliasGlobalVariableNode);
1163 if (freeze) rb_obj_freeze(value);
1164
1165 rb_ary_push(value_stack, value);
1166 break;
1167 }
1168#line 203 "prism/templates/ext/prism/api_node.c.erb"
1169 case PM_ALIAS_METHOD_NODE: {
1171 VALUE argv[7];
1172
1173 // source
1174 argv[0] = source;
1175
1176 // node_id
1177 argv[1] = ULONG2NUM(node->node_id);
1178
1179 // location
1180 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
1181
1182 // flags
1183 argv[3] = ULONG2NUM(node->flags);
1184
1185 // new_name
1186#line 226 "prism/templates/ext/prism/api_node.c.erb"
1187 argv[4] = rb_ary_pop(value_stack);
1188
1189 // old_name
1190#line 226 "prism/templates/ext/prism/api_node.c.erb"
1191 argv[5] = rb_ary_pop(value_stack);
1192
1193 // keyword_loc
1194#line 253 "prism/templates/ext/prism/api_node.c.erb"
1195 argv[6] = pm_location_new(cast->keyword_loc.start, cast->keyword_loc.length, source, freeze);
1196
1197 VALUE value = rb_class_new_instance(7, argv, rb_cPrismAliasMethodNode);
1198 if (freeze) rb_obj_freeze(value);
1199
1200 rb_ary_push(value_stack, value);
1201 break;
1202 }
1203#line 203 "prism/templates/ext/prism/api_node.c.erb"
1204 case PM_ALTERNATION_PATTERN_NODE: {
1206 VALUE argv[7];
1207
1208 // source
1209 argv[0] = source;
1210
1211 // node_id
1212 argv[1] = ULONG2NUM(node->node_id);
1213
1214 // location
1215 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
1216
1217 // flags
1218 argv[3] = ULONG2NUM(node->flags);
1219
1220 // left
1221#line 226 "prism/templates/ext/prism/api_node.c.erb"
1222 argv[4] = rb_ary_pop(value_stack);
1223
1224 // right
1225#line 226 "prism/templates/ext/prism/api_node.c.erb"
1226 argv[5] = rb_ary_pop(value_stack);
1227
1228 // operator_loc
1229#line 253 "prism/templates/ext/prism/api_node.c.erb"
1230 argv[6] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
1231
1232 VALUE value = rb_class_new_instance(7, argv, rb_cPrismAlternationPatternNode);
1233 if (freeze) rb_obj_freeze(value);
1234
1235 rb_ary_push(value_stack, value);
1236 break;
1237 }
1238#line 203 "prism/templates/ext/prism/api_node.c.erb"
1239 case PM_AND_NODE: {
1240 pm_and_node_t *cast = (pm_and_node_t *) node;
1241 VALUE argv[7];
1242
1243 // source
1244 argv[0] = source;
1245
1246 // node_id
1247 argv[1] = ULONG2NUM(node->node_id);
1248
1249 // location
1250 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
1251
1252 // flags
1253 argv[3] = ULONG2NUM(node->flags);
1254
1255 // left
1256#line 226 "prism/templates/ext/prism/api_node.c.erb"
1257 argv[4] = rb_ary_pop(value_stack);
1258
1259 // right
1260#line 226 "prism/templates/ext/prism/api_node.c.erb"
1261 argv[5] = rb_ary_pop(value_stack);
1262
1263 // operator_loc
1264#line 253 "prism/templates/ext/prism/api_node.c.erb"
1265 argv[6] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
1266
1267 VALUE value = rb_class_new_instance(7, argv, rb_cPrismAndNode);
1268 if (freeze) rb_obj_freeze(value);
1269
1270 rb_ary_push(value_stack, value);
1271 break;
1272 }
1273#line 203 "prism/templates/ext/prism/api_node.c.erb"
1274 case PM_ARGUMENTS_NODE: {
1276 VALUE argv[5];
1277
1278 // source
1279 argv[0] = source;
1280
1281 // node_id
1282 argv[1] = ULONG2NUM(node->node_id);
1283
1284 // location
1285 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
1286
1287 // flags
1288 argv[3] = ULONG2NUM(node->flags);
1289
1290 // arguments
1291#line 229 "prism/templates/ext/prism/api_node.c.erb"
1292 argv[4] = rb_ary_new_capa(cast->arguments.size);
1293 for (size_t index = 0; index < cast->arguments.size; index++) {
1294 rb_ary_push(argv[4], rb_ary_pop(value_stack));
1295 }
1296 if (freeze) rb_obj_freeze(argv[4]);
1297
1298 VALUE value = rb_class_new_instance(5, argv, rb_cPrismArgumentsNode);
1299 if (freeze) rb_obj_freeze(value);
1300
1301 rb_ary_push(value_stack, value);
1302 break;
1303 }
1304#line 203 "prism/templates/ext/prism/api_node.c.erb"
1305 case PM_ARRAY_NODE: {
1306 pm_array_node_t *cast = (pm_array_node_t *) node;
1307 VALUE argv[7];
1308
1309 // source
1310 argv[0] = source;
1311
1312 // node_id
1313 argv[1] = ULONG2NUM(node->node_id);
1314
1315 // location
1316 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
1317
1318 // flags
1319 argv[3] = ULONG2NUM(node->flags);
1320
1321 // elements
1322#line 229 "prism/templates/ext/prism/api_node.c.erb"
1323 argv[4] = rb_ary_new_capa(cast->elements.size);
1324 for (size_t index = 0; index < cast->elements.size; index++) {
1325 rb_ary_push(argv[4], rb_ary_pop(value_stack));
1326 }
1327 if (freeze) rb_obj_freeze(argv[4]);
1328
1329 // opening_loc
1330#line 256 "prism/templates/ext/prism/api_node.c.erb"
1331 argv[5] = cast->opening_loc.length == 0 ? Qnil : pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
1332
1333 // closing_loc
1334#line 256 "prism/templates/ext/prism/api_node.c.erb"
1335 argv[6] = cast->closing_loc.length == 0 ? Qnil : pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
1336
1337 VALUE value = rb_class_new_instance(7, argv, rb_cPrismArrayNode);
1338 if (freeze) rb_obj_freeze(value);
1339
1340 rb_ary_push(value_stack, value);
1341 break;
1342 }
1343#line 203 "prism/templates/ext/prism/api_node.c.erb"
1344 case PM_ARRAY_PATTERN_NODE: {
1346 VALUE argv[10];
1347
1348 // source
1349 argv[0] = source;
1350
1351 // node_id
1352 argv[1] = ULONG2NUM(node->node_id);
1353
1354 // location
1355 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
1356
1357 // flags
1358 argv[3] = ULONG2NUM(node->flags);
1359
1360 // constant
1361#line 226 "prism/templates/ext/prism/api_node.c.erb"
1362 argv[4] = rb_ary_pop(value_stack);
1363
1364 // requireds
1365#line 229 "prism/templates/ext/prism/api_node.c.erb"
1366 argv[5] = rb_ary_new_capa(cast->requireds.size);
1367 for (size_t index = 0; index < cast->requireds.size; index++) {
1368 rb_ary_push(argv[5], rb_ary_pop(value_stack));
1369 }
1370 if (freeze) rb_obj_freeze(argv[5]);
1371
1372 // rest
1373#line 226 "prism/templates/ext/prism/api_node.c.erb"
1374 argv[6] = rb_ary_pop(value_stack);
1375
1376 // posts
1377#line 229 "prism/templates/ext/prism/api_node.c.erb"
1378 argv[7] = rb_ary_new_capa(cast->posts.size);
1379 for (size_t index = 0; index < cast->posts.size; index++) {
1380 rb_ary_push(argv[7], rb_ary_pop(value_stack));
1381 }
1382 if (freeze) rb_obj_freeze(argv[7]);
1383
1384 // opening_loc
1385#line 256 "prism/templates/ext/prism/api_node.c.erb"
1386 argv[8] = cast->opening_loc.length == 0 ? Qnil : pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
1387
1388 // closing_loc
1389#line 256 "prism/templates/ext/prism/api_node.c.erb"
1390 argv[9] = cast->closing_loc.length == 0 ? Qnil : pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
1391
1392 VALUE value = rb_class_new_instance(10, argv, rb_cPrismArrayPatternNode);
1393 if (freeze) rb_obj_freeze(value);
1394
1395 rb_ary_push(value_stack, value);
1396 break;
1397 }
1398#line 203 "prism/templates/ext/prism/api_node.c.erb"
1399 case PM_ASSOC_NODE: {
1400 pm_assoc_node_t *cast = (pm_assoc_node_t *) node;
1401 VALUE argv[7];
1402
1403 // source
1404 argv[0] = source;
1405
1406 // node_id
1407 argv[1] = ULONG2NUM(node->node_id);
1408
1409 // location
1410 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
1411
1412 // flags
1413 argv[3] = ULONG2NUM(node->flags);
1414
1415 // key
1416#line 226 "prism/templates/ext/prism/api_node.c.erb"
1417 argv[4] = rb_ary_pop(value_stack);
1418
1419 // value
1420#line 226 "prism/templates/ext/prism/api_node.c.erb"
1421 argv[5] = rb_ary_pop(value_stack);
1422
1423 // operator_loc
1424#line 256 "prism/templates/ext/prism/api_node.c.erb"
1425 argv[6] = cast->operator_loc.length == 0 ? Qnil : pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
1426
1427 VALUE value = rb_class_new_instance(7, argv, rb_cPrismAssocNode);
1428 if (freeze) rb_obj_freeze(value);
1429
1430 rb_ary_push(value_stack, value);
1431 break;
1432 }
1433#line 203 "prism/templates/ext/prism/api_node.c.erb"
1434 case PM_ASSOC_SPLAT_NODE: {
1436 VALUE argv[6];
1437
1438 // source
1439 argv[0] = source;
1440
1441 // node_id
1442 argv[1] = ULONG2NUM(node->node_id);
1443
1444 // location
1445 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
1446
1447 // flags
1448 argv[3] = ULONG2NUM(node->flags);
1449
1450 // value
1451#line 226 "prism/templates/ext/prism/api_node.c.erb"
1452 argv[4] = rb_ary_pop(value_stack);
1453
1454 // operator_loc
1455#line 253 "prism/templates/ext/prism/api_node.c.erb"
1456 argv[5] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
1457
1458 VALUE value = rb_class_new_instance(6, argv, rb_cPrismAssocSplatNode);
1459 if (freeze) rb_obj_freeze(value);
1460
1461 rb_ary_push(value_stack, value);
1462 break;
1463 }
1464#line 203 "prism/templates/ext/prism/api_node.c.erb"
1465 case PM_BACK_REFERENCE_READ_NODE: {
1467 VALUE argv[5];
1468
1469 // source
1470 argv[0] = source;
1471
1472 // node_id
1473 argv[1] = ULONG2NUM(node->node_id);
1474
1475 // location
1476 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
1477
1478 // flags
1479 argv[3] = ULONG2NUM(node->flags);
1480
1481 // name
1482#line 239 "prism/templates/ext/prism/api_node.c.erb"
1483 assert(cast->name != 0);
1484 argv[4] = RARRAY_AREF(constants, cast->name - 1);
1485
1486 VALUE value = rb_class_new_instance(5, argv, rb_cPrismBackReferenceReadNode);
1487 if (freeze) rb_obj_freeze(value);
1488
1489 rb_ary_push(value_stack, value);
1490 break;
1491 }
1492#line 203 "prism/templates/ext/prism/api_node.c.erb"
1493 case PM_BEGIN_NODE: {
1494 pm_begin_node_t *cast = (pm_begin_node_t *) node;
1495 VALUE argv[10];
1496
1497 // source
1498 argv[0] = source;
1499
1500 // node_id
1501 argv[1] = ULONG2NUM(node->node_id);
1502
1503 // location
1504 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
1505
1506 // flags
1507 argv[3] = ULONG2NUM(node->flags);
1508
1509 // begin_keyword_loc
1510#line 256 "prism/templates/ext/prism/api_node.c.erb"
1511 argv[4] = cast->begin_keyword_loc.length == 0 ? Qnil : pm_location_new(cast->begin_keyword_loc.start, cast->begin_keyword_loc.length, source, freeze);
1512
1513 // statements
1514#line 226 "prism/templates/ext/prism/api_node.c.erb"
1515 argv[5] = rb_ary_pop(value_stack);
1516
1517 // rescue_clause
1518#line 226 "prism/templates/ext/prism/api_node.c.erb"
1519 argv[6] = rb_ary_pop(value_stack);
1520
1521 // else_clause
1522#line 226 "prism/templates/ext/prism/api_node.c.erb"
1523 argv[7] = rb_ary_pop(value_stack);
1524
1525 // ensure_clause
1526#line 226 "prism/templates/ext/prism/api_node.c.erb"
1527 argv[8] = rb_ary_pop(value_stack);
1528
1529 // end_keyword_loc
1530#line 256 "prism/templates/ext/prism/api_node.c.erb"
1531 argv[9] = cast->end_keyword_loc.length == 0 ? Qnil : pm_location_new(cast->end_keyword_loc.start, cast->end_keyword_loc.length, source, freeze);
1532
1533 VALUE value = rb_class_new_instance(10, argv, rb_cPrismBeginNode);
1534 if (freeze) rb_obj_freeze(value);
1535
1536 rb_ary_push(value_stack, value);
1537 break;
1538 }
1539#line 203 "prism/templates/ext/prism/api_node.c.erb"
1540 case PM_BLOCK_ARGUMENT_NODE: {
1542 VALUE argv[6];
1543
1544 // source
1545 argv[0] = source;
1546
1547 // node_id
1548 argv[1] = ULONG2NUM(node->node_id);
1549
1550 // location
1551 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
1552
1553 // flags
1554 argv[3] = ULONG2NUM(node->flags);
1555
1556 // expression
1557#line 226 "prism/templates/ext/prism/api_node.c.erb"
1558 argv[4] = rb_ary_pop(value_stack);
1559
1560 // operator_loc
1561#line 253 "prism/templates/ext/prism/api_node.c.erb"
1562 argv[5] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
1563
1564 VALUE value = rb_class_new_instance(6, argv, rb_cPrismBlockArgumentNode);
1565 if (freeze) rb_obj_freeze(value);
1566
1567 rb_ary_push(value_stack, value);
1568 break;
1569 }
1570#line 203 "prism/templates/ext/prism/api_node.c.erb"
1571 case PM_BLOCK_LOCAL_VARIABLE_NODE: {
1573 VALUE argv[5];
1574
1575 // source
1576 argv[0] = source;
1577
1578 // node_id
1579 argv[1] = ULONG2NUM(node->node_id);
1580
1581 // location
1582 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
1583
1584 // flags
1585 argv[3] = ULONG2NUM(node->flags);
1586
1587 // name
1588#line 239 "prism/templates/ext/prism/api_node.c.erb"
1589 assert(cast->name != 0);
1590 argv[4] = RARRAY_AREF(constants, cast->name - 1);
1591
1592 VALUE value = rb_class_new_instance(5, argv, rb_cPrismBlockLocalVariableNode);
1593 if (freeze) rb_obj_freeze(value);
1594
1595 rb_ary_push(value_stack, value);
1596 break;
1597 }
1598#line 203 "prism/templates/ext/prism/api_node.c.erb"
1599 case PM_BLOCK_NODE: {
1600 pm_block_node_t *cast = (pm_block_node_t *) node;
1601 VALUE argv[9];
1602
1603 // source
1604 argv[0] = source;
1605
1606 // node_id
1607 argv[1] = ULONG2NUM(node->node_id);
1608
1609 // location
1610 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
1611
1612 // flags
1613 argv[3] = ULONG2NUM(node->flags);
1614
1615 // locals
1616#line 245 "prism/templates/ext/prism/api_node.c.erb"
1617 argv[4] = rb_ary_new_capa(cast->locals.size);
1618 for (size_t index = 0; index < cast->locals.size; index++) {
1619 assert(cast->locals.ids[index] != 0);
1620 rb_ary_push(argv[4], RARRAY_AREF(constants, cast->locals.ids[index] - 1));
1621 }
1622 if (freeze) rb_obj_freeze(argv[4]);
1623
1624 // parameters
1625#line 226 "prism/templates/ext/prism/api_node.c.erb"
1626 argv[5] = rb_ary_pop(value_stack);
1627
1628 // body
1629#line 226 "prism/templates/ext/prism/api_node.c.erb"
1630 argv[6] = rb_ary_pop(value_stack);
1631
1632 // opening_loc
1633#line 253 "prism/templates/ext/prism/api_node.c.erb"
1634 argv[7] = pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
1635
1636 // closing_loc
1637#line 253 "prism/templates/ext/prism/api_node.c.erb"
1638 argv[8] = pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
1639
1640 VALUE value = rb_class_new_instance(9, argv, rb_cPrismBlockNode);
1641 if (freeze) rb_obj_freeze(value);
1642
1643 rb_ary_push(value_stack, value);
1644 break;
1645 }
1646#line 203 "prism/templates/ext/prism/api_node.c.erb"
1647 case PM_BLOCK_PARAMETER_NODE: {
1649 VALUE argv[7];
1650
1651 // source
1652 argv[0] = source;
1653
1654 // node_id
1655 argv[1] = ULONG2NUM(node->node_id);
1656
1657 // location
1658 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
1659
1660 // flags
1661 argv[3] = ULONG2NUM(node->flags);
1662
1663 // name
1664 argv[4] = cast->name == 0 ? Qnil : RARRAY_AREF(constants, cast->name - 1);
1665
1666 // name_loc
1667#line 256 "prism/templates/ext/prism/api_node.c.erb"
1668 argv[5] = cast->name_loc.length == 0 ? Qnil : pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
1669
1670 // operator_loc
1671#line 253 "prism/templates/ext/prism/api_node.c.erb"
1672 argv[6] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
1673
1674 VALUE value = rb_class_new_instance(7, argv, rb_cPrismBlockParameterNode);
1675 if (freeze) rb_obj_freeze(value);
1676
1677 rb_ary_push(value_stack, value);
1678 break;
1679 }
1680#line 203 "prism/templates/ext/prism/api_node.c.erb"
1681 case PM_BLOCK_PARAMETERS_NODE: {
1683 VALUE argv[8];
1684
1685 // source
1686 argv[0] = source;
1687
1688 // node_id
1689 argv[1] = ULONG2NUM(node->node_id);
1690
1691 // location
1692 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
1693
1694 // flags
1695 argv[3] = ULONG2NUM(node->flags);
1696
1697 // parameters
1698#line 226 "prism/templates/ext/prism/api_node.c.erb"
1699 argv[4] = rb_ary_pop(value_stack);
1700
1701 // locals
1702#line 229 "prism/templates/ext/prism/api_node.c.erb"
1703 argv[5] = rb_ary_new_capa(cast->locals.size);
1704 for (size_t index = 0; index < cast->locals.size; index++) {
1705 rb_ary_push(argv[5], rb_ary_pop(value_stack));
1706 }
1707 if (freeze) rb_obj_freeze(argv[5]);
1708
1709 // opening_loc
1710#line 256 "prism/templates/ext/prism/api_node.c.erb"
1711 argv[6] = cast->opening_loc.length == 0 ? Qnil : pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
1712
1713 // closing_loc
1714#line 256 "prism/templates/ext/prism/api_node.c.erb"
1715 argv[7] = cast->closing_loc.length == 0 ? Qnil : pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
1716
1717 VALUE value = rb_class_new_instance(8, argv, rb_cPrismBlockParametersNode);
1718 if (freeze) rb_obj_freeze(value);
1719
1720 rb_ary_push(value_stack, value);
1721 break;
1722 }
1723#line 203 "prism/templates/ext/prism/api_node.c.erb"
1724 case PM_BREAK_NODE: {
1725 pm_break_node_t *cast = (pm_break_node_t *) node;
1726 VALUE argv[6];
1727
1728 // source
1729 argv[0] = source;
1730
1731 // node_id
1732 argv[1] = ULONG2NUM(node->node_id);
1733
1734 // location
1735 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
1736
1737 // flags
1738 argv[3] = ULONG2NUM(node->flags);
1739
1740 // arguments
1741#line 226 "prism/templates/ext/prism/api_node.c.erb"
1742 argv[4] = rb_ary_pop(value_stack);
1743
1744 // keyword_loc
1745#line 253 "prism/templates/ext/prism/api_node.c.erb"
1746 argv[5] = pm_location_new(cast->keyword_loc.start, cast->keyword_loc.length, source, freeze);
1747
1748 VALUE value = rb_class_new_instance(6, argv, rb_cPrismBreakNode);
1749 if (freeze) rb_obj_freeze(value);
1750
1751 rb_ary_push(value_stack, value);
1752 break;
1753 }
1754#line 203 "prism/templates/ext/prism/api_node.c.erb"
1755 case PM_CALL_AND_WRITE_NODE: {
1757 VALUE argv[11];
1758
1759 // source
1760 argv[0] = source;
1761
1762 // node_id
1763 argv[1] = ULONG2NUM(node->node_id);
1764
1765 // location
1766 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
1767
1768 // flags
1769 argv[3] = ULONG2NUM(node->flags);
1770
1771 // receiver
1772#line 226 "prism/templates/ext/prism/api_node.c.erb"
1773 argv[4] = rb_ary_pop(value_stack);
1774
1775 // call_operator_loc
1776#line 256 "prism/templates/ext/prism/api_node.c.erb"
1777 argv[5] = cast->call_operator_loc.length == 0 ? Qnil : pm_location_new(cast->call_operator_loc.start, cast->call_operator_loc.length, source, freeze);
1778
1779 // message_loc
1780#line 256 "prism/templates/ext/prism/api_node.c.erb"
1781 argv[6] = cast->message_loc.length == 0 ? Qnil : pm_location_new(cast->message_loc.start, cast->message_loc.length, source, freeze);
1782
1783 // read_name
1784#line 239 "prism/templates/ext/prism/api_node.c.erb"
1785 assert(cast->read_name != 0);
1786 argv[7] = RARRAY_AREF(constants, cast->read_name - 1);
1787
1788 // write_name
1789#line 239 "prism/templates/ext/prism/api_node.c.erb"
1790 assert(cast->write_name != 0);
1791 argv[8] = RARRAY_AREF(constants, cast->write_name - 1);
1792
1793 // operator_loc
1794#line 253 "prism/templates/ext/prism/api_node.c.erb"
1795 argv[9] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
1796
1797 // value
1798#line 226 "prism/templates/ext/prism/api_node.c.erb"
1799 argv[10] = rb_ary_pop(value_stack);
1800
1801 VALUE value = rb_class_new_instance(11, argv, rb_cPrismCallAndWriteNode);
1802 if (freeze) rb_obj_freeze(value);
1803
1804 rb_ary_push(value_stack, value);
1805 break;
1806 }
1807#line 203 "prism/templates/ext/prism/api_node.c.erb"
1808 case PM_CALL_NODE: {
1809 pm_call_node_t *cast = (pm_call_node_t *) node;
1810 VALUE argv[13];
1811
1812 // source
1813 argv[0] = source;
1814
1815 // node_id
1816 argv[1] = ULONG2NUM(node->node_id);
1817
1818 // location
1819 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
1820
1821 // flags
1822 argv[3] = ULONG2NUM(node->flags);
1823
1824 // receiver
1825#line 226 "prism/templates/ext/prism/api_node.c.erb"
1826 argv[4] = rb_ary_pop(value_stack);
1827
1828 // call_operator_loc
1829#line 256 "prism/templates/ext/prism/api_node.c.erb"
1830 argv[5] = cast->call_operator_loc.length == 0 ? Qnil : pm_location_new(cast->call_operator_loc.start, cast->call_operator_loc.length, source, freeze);
1831
1832 // name
1833#line 239 "prism/templates/ext/prism/api_node.c.erb"
1834 assert(cast->name != 0);
1835 argv[6] = RARRAY_AREF(constants, cast->name - 1);
1836
1837 // message_loc
1838#line 256 "prism/templates/ext/prism/api_node.c.erb"
1839 argv[7] = cast->message_loc.length == 0 ? Qnil : pm_location_new(cast->message_loc.start, cast->message_loc.length, source, freeze);
1840
1841 // opening_loc
1842#line 256 "prism/templates/ext/prism/api_node.c.erb"
1843 argv[8] = cast->opening_loc.length == 0 ? Qnil : pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
1844
1845 // arguments
1846#line 226 "prism/templates/ext/prism/api_node.c.erb"
1847 argv[9] = rb_ary_pop(value_stack);
1848
1849 // closing_loc
1850#line 256 "prism/templates/ext/prism/api_node.c.erb"
1851 argv[10] = cast->closing_loc.length == 0 ? Qnil : pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
1852
1853 // equal_loc
1854#line 256 "prism/templates/ext/prism/api_node.c.erb"
1855 argv[11] = cast->equal_loc.length == 0 ? Qnil : pm_location_new(cast->equal_loc.start, cast->equal_loc.length, source, freeze);
1856
1857 // block
1858#line 226 "prism/templates/ext/prism/api_node.c.erb"
1859 argv[12] = rb_ary_pop(value_stack);
1860
1861 VALUE value = rb_class_new_instance(13, argv, rb_cPrismCallNode);
1862 if (freeze) rb_obj_freeze(value);
1863
1864 rb_ary_push(value_stack, value);
1865 break;
1866 }
1867#line 203 "prism/templates/ext/prism/api_node.c.erb"
1868 case PM_CALL_OPERATOR_WRITE_NODE: {
1870 VALUE argv[12];
1871
1872 // source
1873 argv[0] = source;
1874
1875 // node_id
1876 argv[1] = ULONG2NUM(node->node_id);
1877
1878 // location
1879 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
1880
1881 // flags
1882 argv[3] = ULONG2NUM(node->flags);
1883
1884 // receiver
1885#line 226 "prism/templates/ext/prism/api_node.c.erb"
1886 argv[4] = rb_ary_pop(value_stack);
1887
1888 // call_operator_loc
1889#line 256 "prism/templates/ext/prism/api_node.c.erb"
1890 argv[5] = cast->call_operator_loc.length == 0 ? Qnil : pm_location_new(cast->call_operator_loc.start, cast->call_operator_loc.length, source, freeze);
1891
1892 // message_loc
1893#line 256 "prism/templates/ext/prism/api_node.c.erb"
1894 argv[6] = cast->message_loc.length == 0 ? Qnil : pm_location_new(cast->message_loc.start, cast->message_loc.length, source, freeze);
1895
1896 // read_name
1897#line 239 "prism/templates/ext/prism/api_node.c.erb"
1898 assert(cast->read_name != 0);
1899 argv[7] = RARRAY_AREF(constants, cast->read_name - 1);
1900
1901 // write_name
1902#line 239 "prism/templates/ext/prism/api_node.c.erb"
1903 assert(cast->write_name != 0);
1904 argv[8] = RARRAY_AREF(constants, cast->write_name - 1);
1905
1906 // binary_operator
1907#line 239 "prism/templates/ext/prism/api_node.c.erb"
1908 assert(cast->binary_operator != 0);
1909 argv[9] = RARRAY_AREF(constants, cast->binary_operator - 1);
1910
1911 // binary_operator_loc
1912#line 253 "prism/templates/ext/prism/api_node.c.erb"
1913 argv[10] = pm_location_new(cast->binary_operator_loc.start, cast->binary_operator_loc.length, source, freeze);
1914
1915 // value
1916#line 226 "prism/templates/ext/prism/api_node.c.erb"
1917 argv[11] = rb_ary_pop(value_stack);
1918
1919 VALUE value = rb_class_new_instance(12, argv, rb_cPrismCallOperatorWriteNode);
1920 if (freeze) rb_obj_freeze(value);
1921
1922 rb_ary_push(value_stack, value);
1923 break;
1924 }
1925#line 203 "prism/templates/ext/prism/api_node.c.erb"
1926 case PM_CALL_OR_WRITE_NODE: {
1928 VALUE argv[11];
1929
1930 // source
1931 argv[0] = source;
1932
1933 // node_id
1934 argv[1] = ULONG2NUM(node->node_id);
1935
1936 // location
1937 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
1938
1939 // flags
1940 argv[3] = ULONG2NUM(node->flags);
1941
1942 // receiver
1943#line 226 "prism/templates/ext/prism/api_node.c.erb"
1944 argv[4] = rb_ary_pop(value_stack);
1945
1946 // call_operator_loc
1947#line 256 "prism/templates/ext/prism/api_node.c.erb"
1948 argv[5] = cast->call_operator_loc.length == 0 ? Qnil : pm_location_new(cast->call_operator_loc.start, cast->call_operator_loc.length, source, freeze);
1949
1950 // message_loc
1951#line 256 "prism/templates/ext/prism/api_node.c.erb"
1952 argv[6] = cast->message_loc.length == 0 ? Qnil : pm_location_new(cast->message_loc.start, cast->message_loc.length, source, freeze);
1953
1954 // read_name
1955#line 239 "prism/templates/ext/prism/api_node.c.erb"
1956 assert(cast->read_name != 0);
1957 argv[7] = RARRAY_AREF(constants, cast->read_name - 1);
1958
1959 // write_name
1960#line 239 "prism/templates/ext/prism/api_node.c.erb"
1961 assert(cast->write_name != 0);
1962 argv[8] = RARRAY_AREF(constants, cast->write_name - 1);
1963
1964 // operator_loc
1965#line 253 "prism/templates/ext/prism/api_node.c.erb"
1966 argv[9] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
1967
1968 // value
1969#line 226 "prism/templates/ext/prism/api_node.c.erb"
1970 argv[10] = rb_ary_pop(value_stack);
1971
1972 VALUE value = rb_class_new_instance(11, argv, rb_cPrismCallOrWriteNode);
1973 if (freeze) rb_obj_freeze(value);
1974
1975 rb_ary_push(value_stack, value);
1976 break;
1977 }
1978#line 203 "prism/templates/ext/prism/api_node.c.erb"
1979 case PM_CALL_TARGET_NODE: {
1981 VALUE argv[8];
1982
1983 // source
1984 argv[0] = source;
1985
1986 // node_id
1987 argv[1] = ULONG2NUM(node->node_id);
1988
1989 // location
1990 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
1991
1992 // flags
1993 argv[3] = ULONG2NUM(node->flags);
1994
1995 // receiver
1996#line 226 "prism/templates/ext/prism/api_node.c.erb"
1997 argv[4] = rb_ary_pop(value_stack);
1998
1999 // call_operator_loc
2000#line 253 "prism/templates/ext/prism/api_node.c.erb"
2001 argv[5] = pm_location_new(cast->call_operator_loc.start, cast->call_operator_loc.length, source, freeze);
2002
2003 // name
2004#line 239 "prism/templates/ext/prism/api_node.c.erb"
2005 assert(cast->name != 0);
2006 argv[6] = RARRAY_AREF(constants, cast->name - 1);
2007
2008 // message_loc
2009#line 253 "prism/templates/ext/prism/api_node.c.erb"
2010 argv[7] = pm_location_new(cast->message_loc.start, cast->message_loc.length, source, freeze);
2011
2012 VALUE value = rb_class_new_instance(8, argv, rb_cPrismCallTargetNode);
2013 if (freeze) rb_obj_freeze(value);
2014
2015 rb_ary_push(value_stack, value);
2016 break;
2017 }
2018#line 203 "prism/templates/ext/prism/api_node.c.erb"
2019 case PM_CAPTURE_PATTERN_NODE: {
2021 VALUE argv[7];
2022
2023 // source
2024 argv[0] = source;
2025
2026 // node_id
2027 argv[1] = ULONG2NUM(node->node_id);
2028
2029 // location
2030 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2031
2032 // flags
2033 argv[3] = ULONG2NUM(node->flags);
2034
2035 // value
2036#line 226 "prism/templates/ext/prism/api_node.c.erb"
2037 argv[4] = rb_ary_pop(value_stack);
2038
2039 // target
2040#line 226 "prism/templates/ext/prism/api_node.c.erb"
2041 argv[5] = rb_ary_pop(value_stack);
2042
2043 // operator_loc
2044#line 253 "prism/templates/ext/prism/api_node.c.erb"
2045 argv[6] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
2046
2047 VALUE value = rb_class_new_instance(7, argv, rb_cPrismCapturePatternNode);
2048 if (freeze) rb_obj_freeze(value);
2049
2050 rb_ary_push(value_stack, value);
2051 break;
2052 }
2053#line 203 "prism/templates/ext/prism/api_node.c.erb"
2054 case PM_CASE_MATCH_NODE: {
2056 VALUE argv[9];
2057
2058 // source
2059 argv[0] = source;
2060
2061 // node_id
2062 argv[1] = ULONG2NUM(node->node_id);
2063
2064 // location
2065 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2066
2067 // flags
2068 argv[3] = ULONG2NUM(node->flags);
2069
2070 // predicate
2071#line 226 "prism/templates/ext/prism/api_node.c.erb"
2072 argv[4] = rb_ary_pop(value_stack);
2073
2074 // conditions
2075#line 229 "prism/templates/ext/prism/api_node.c.erb"
2076 argv[5] = rb_ary_new_capa(cast->conditions.size);
2077 for (size_t index = 0; index < cast->conditions.size; index++) {
2078 rb_ary_push(argv[5], rb_ary_pop(value_stack));
2079 }
2080 if (freeze) rb_obj_freeze(argv[5]);
2081
2082 // else_clause
2083#line 226 "prism/templates/ext/prism/api_node.c.erb"
2084 argv[6] = rb_ary_pop(value_stack);
2085
2086 // case_keyword_loc
2087#line 253 "prism/templates/ext/prism/api_node.c.erb"
2088 argv[7] = pm_location_new(cast->case_keyword_loc.start, cast->case_keyword_loc.length, source, freeze);
2089
2090 // end_keyword_loc
2091#line 253 "prism/templates/ext/prism/api_node.c.erb"
2092 argv[8] = pm_location_new(cast->end_keyword_loc.start, cast->end_keyword_loc.length, source, freeze);
2093
2094 VALUE value = rb_class_new_instance(9, argv, rb_cPrismCaseMatchNode);
2095 if (freeze) rb_obj_freeze(value);
2096
2097 rb_ary_push(value_stack, value);
2098 break;
2099 }
2100#line 203 "prism/templates/ext/prism/api_node.c.erb"
2101 case PM_CASE_NODE: {
2102 pm_case_node_t *cast = (pm_case_node_t *) node;
2103 VALUE argv[9];
2104
2105 // source
2106 argv[0] = source;
2107
2108 // node_id
2109 argv[1] = ULONG2NUM(node->node_id);
2110
2111 // location
2112 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2113
2114 // flags
2115 argv[3] = ULONG2NUM(node->flags);
2116
2117 // predicate
2118#line 226 "prism/templates/ext/prism/api_node.c.erb"
2119 argv[4] = rb_ary_pop(value_stack);
2120
2121 // conditions
2122#line 229 "prism/templates/ext/prism/api_node.c.erb"
2123 argv[5] = rb_ary_new_capa(cast->conditions.size);
2124 for (size_t index = 0; index < cast->conditions.size; index++) {
2125 rb_ary_push(argv[5], rb_ary_pop(value_stack));
2126 }
2127 if (freeze) rb_obj_freeze(argv[5]);
2128
2129 // else_clause
2130#line 226 "prism/templates/ext/prism/api_node.c.erb"
2131 argv[6] = rb_ary_pop(value_stack);
2132
2133 // case_keyword_loc
2134#line 253 "prism/templates/ext/prism/api_node.c.erb"
2135 argv[7] = pm_location_new(cast->case_keyword_loc.start, cast->case_keyword_loc.length, source, freeze);
2136
2137 // end_keyword_loc
2138#line 253 "prism/templates/ext/prism/api_node.c.erb"
2139 argv[8] = pm_location_new(cast->end_keyword_loc.start, cast->end_keyword_loc.length, source, freeze);
2140
2141 VALUE value = rb_class_new_instance(9, argv, rb_cPrismCaseNode);
2142 if (freeze) rb_obj_freeze(value);
2143
2144 rb_ary_push(value_stack, value);
2145 break;
2146 }
2147#line 203 "prism/templates/ext/prism/api_node.c.erb"
2148 case PM_CLASS_NODE: {
2149 pm_class_node_t *cast = (pm_class_node_t *) node;
2150 VALUE argv[12];
2151
2152 // source
2153 argv[0] = source;
2154
2155 // node_id
2156 argv[1] = ULONG2NUM(node->node_id);
2157
2158 // location
2159 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2160
2161 // flags
2162 argv[3] = ULONG2NUM(node->flags);
2163
2164 // locals
2165#line 245 "prism/templates/ext/prism/api_node.c.erb"
2166 argv[4] = rb_ary_new_capa(cast->locals.size);
2167 for (size_t index = 0; index < cast->locals.size; index++) {
2168 assert(cast->locals.ids[index] != 0);
2169 rb_ary_push(argv[4], RARRAY_AREF(constants, cast->locals.ids[index] - 1));
2170 }
2171 if (freeze) rb_obj_freeze(argv[4]);
2172
2173 // class_keyword_loc
2174#line 253 "prism/templates/ext/prism/api_node.c.erb"
2175 argv[5] = pm_location_new(cast->class_keyword_loc.start, cast->class_keyword_loc.length, source, freeze);
2176
2177 // constant_path
2178#line 226 "prism/templates/ext/prism/api_node.c.erb"
2179 argv[6] = rb_ary_pop(value_stack);
2180
2181 // inheritance_operator_loc
2182#line 256 "prism/templates/ext/prism/api_node.c.erb"
2183 argv[7] = cast->inheritance_operator_loc.length == 0 ? Qnil : pm_location_new(cast->inheritance_operator_loc.start, cast->inheritance_operator_loc.length, source, freeze);
2184
2185 // superclass
2186#line 226 "prism/templates/ext/prism/api_node.c.erb"
2187 argv[8] = rb_ary_pop(value_stack);
2188
2189 // body
2190#line 226 "prism/templates/ext/prism/api_node.c.erb"
2191 argv[9] = rb_ary_pop(value_stack);
2192
2193 // end_keyword_loc
2194#line 253 "prism/templates/ext/prism/api_node.c.erb"
2195 argv[10] = pm_location_new(cast->end_keyword_loc.start, cast->end_keyword_loc.length, source, freeze);
2196
2197 // name
2198#line 239 "prism/templates/ext/prism/api_node.c.erb"
2199 assert(cast->name != 0);
2200 argv[11] = RARRAY_AREF(constants, cast->name - 1);
2201
2202 VALUE value = rb_class_new_instance(12, argv, rb_cPrismClassNode);
2203 if (freeze) rb_obj_freeze(value);
2204
2205 rb_ary_push(value_stack, value);
2206 break;
2207 }
2208#line 203 "prism/templates/ext/prism/api_node.c.erb"
2209 case PM_CLASS_VARIABLE_AND_WRITE_NODE: {
2211 VALUE argv[8];
2212
2213 // source
2214 argv[0] = source;
2215
2216 // node_id
2217 argv[1] = ULONG2NUM(node->node_id);
2218
2219 // location
2220 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2221
2222 // flags
2223 argv[3] = ULONG2NUM(node->flags);
2224
2225 // name
2226#line 239 "prism/templates/ext/prism/api_node.c.erb"
2227 assert(cast->name != 0);
2228 argv[4] = RARRAY_AREF(constants, cast->name - 1);
2229
2230 // name_loc
2231#line 253 "prism/templates/ext/prism/api_node.c.erb"
2232 argv[5] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
2233
2234 // operator_loc
2235#line 253 "prism/templates/ext/prism/api_node.c.erb"
2236 argv[6] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
2237
2238 // value
2239#line 226 "prism/templates/ext/prism/api_node.c.erb"
2240 argv[7] = rb_ary_pop(value_stack);
2241
2242 VALUE value = rb_class_new_instance(8, argv, rb_cPrismClassVariableAndWriteNode);
2243 if (freeze) rb_obj_freeze(value);
2244
2245 rb_ary_push(value_stack, value);
2246 break;
2247 }
2248#line 203 "prism/templates/ext/prism/api_node.c.erb"
2249 case PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
2251 VALUE argv[9];
2252
2253 // source
2254 argv[0] = source;
2255
2256 // node_id
2257 argv[1] = ULONG2NUM(node->node_id);
2258
2259 // location
2260 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2261
2262 // flags
2263 argv[3] = ULONG2NUM(node->flags);
2264
2265 // name
2266#line 239 "prism/templates/ext/prism/api_node.c.erb"
2267 assert(cast->name != 0);
2268 argv[4] = RARRAY_AREF(constants, cast->name - 1);
2269
2270 // name_loc
2271#line 253 "prism/templates/ext/prism/api_node.c.erb"
2272 argv[5] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
2273
2274 // binary_operator_loc
2275#line 253 "prism/templates/ext/prism/api_node.c.erb"
2276 argv[6] = pm_location_new(cast->binary_operator_loc.start, cast->binary_operator_loc.length, source, freeze);
2277
2278 // value
2279#line 226 "prism/templates/ext/prism/api_node.c.erb"
2280 argv[7] = rb_ary_pop(value_stack);
2281
2282 // binary_operator
2283#line 239 "prism/templates/ext/prism/api_node.c.erb"
2284 assert(cast->binary_operator != 0);
2285 argv[8] = RARRAY_AREF(constants, cast->binary_operator - 1);
2286
2287 VALUE value = rb_class_new_instance(9, argv, rb_cPrismClassVariableOperatorWriteNode);
2288 if (freeze) rb_obj_freeze(value);
2289
2290 rb_ary_push(value_stack, value);
2291 break;
2292 }
2293#line 203 "prism/templates/ext/prism/api_node.c.erb"
2294 case PM_CLASS_VARIABLE_OR_WRITE_NODE: {
2296 VALUE argv[8];
2297
2298 // source
2299 argv[0] = source;
2300
2301 // node_id
2302 argv[1] = ULONG2NUM(node->node_id);
2303
2304 // location
2305 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2306
2307 // flags
2308 argv[3] = ULONG2NUM(node->flags);
2309
2310 // name
2311#line 239 "prism/templates/ext/prism/api_node.c.erb"
2312 assert(cast->name != 0);
2313 argv[4] = RARRAY_AREF(constants, cast->name - 1);
2314
2315 // name_loc
2316#line 253 "prism/templates/ext/prism/api_node.c.erb"
2317 argv[5] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
2318
2319 // operator_loc
2320#line 253 "prism/templates/ext/prism/api_node.c.erb"
2321 argv[6] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
2322
2323 // value
2324#line 226 "prism/templates/ext/prism/api_node.c.erb"
2325 argv[7] = rb_ary_pop(value_stack);
2326
2327 VALUE value = rb_class_new_instance(8, argv, rb_cPrismClassVariableOrWriteNode);
2328 if (freeze) rb_obj_freeze(value);
2329
2330 rb_ary_push(value_stack, value);
2331 break;
2332 }
2333#line 203 "prism/templates/ext/prism/api_node.c.erb"
2334 case PM_CLASS_VARIABLE_READ_NODE: {
2336 VALUE argv[5];
2337
2338 // source
2339 argv[0] = source;
2340
2341 // node_id
2342 argv[1] = ULONG2NUM(node->node_id);
2343
2344 // location
2345 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2346
2347 // flags
2348 argv[3] = ULONG2NUM(node->flags);
2349
2350 // name
2351#line 239 "prism/templates/ext/prism/api_node.c.erb"
2352 assert(cast->name != 0);
2353 argv[4] = RARRAY_AREF(constants, cast->name - 1);
2354
2355 VALUE value = rb_class_new_instance(5, argv, rb_cPrismClassVariableReadNode);
2356 if (freeze) rb_obj_freeze(value);
2357
2358 rb_ary_push(value_stack, value);
2359 break;
2360 }
2361#line 203 "prism/templates/ext/prism/api_node.c.erb"
2362 case PM_CLASS_VARIABLE_TARGET_NODE: {
2364 VALUE argv[5];
2365
2366 // source
2367 argv[0] = source;
2368
2369 // node_id
2370 argv[1] = ULONG2NUM(node->node_id);
2371
2372 // location
2373 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2374
2375 // flags
2376 argv[3] = ULONG2NUM(node->flags);
2377
2378 // name
2379#line 239 "prism/templates/ext/prism/api_node.c.erb"
2380 assert(cast->name != 0);
2381 argv[4] = RARRAY_AREF(constants, cast->name - 1);
2382
2383 VALUE value = rb_class_new_instance(5, argv, rb_cPrismClassVariableTargetNode);
2384 if (freeze) rb_obj_freeze(value);
2385
2386 rb_ary_push(value_stack, value);
2387 break;
2388 }
2389#line 203 "prism/templates/ext/prism/api_node.c.erb"
2390 case PM_CLASS_VARIABLE_WRITE_NODE: {
2392 VALUE argv[8];
2393
2394 // source
2395 argv[0] = source;
2396
2397 // node_id
2398 argv[1] = ULONG2NUM(node->node_id);
2399
2400 // location
2401 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2402
2403 // flags
2404 argv[3] = ULONG2NUM(node->flags);
2405
2406 // name
2407#line 239 "prism/templates/ext/prism/api_node.c.erb"
2408 assert(cast->name != 0);
2409 argv[4] = RARRAY_AREF(constants, cast->name - 1);
2410
2411 // name_loc
2412#line 253 "prism/templates/ext/prism/api_node.c.erb"
2413 argv[5] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
2414
2415 // value
2416#line 226 "prism/templates/ext/prism/api_node.c.erb"
2417 argv[6] = rb_ary_pop(value_stack);
2418
2419 // operator_loc
2420#line 253 "prism/templates/ext/prism/api_node.c.erb"
2421 argv[7] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
2422
2423 VALUE value = rb_class_new_instance(8, argv, rb_cPrismClassVariableWriteNode);
2424 if (freeze) rb_obj_freeze(value);
2425
2426 rb_ary_push(value_stack, value);
2427 break;
2428 }
2429#line 203 "prism/templates/ext/prism/api_node.c.erb"
2430 case PM_CONSTANT_AND_WRITE_NODE: {
2432 VALUE argv[8];
2433
2434 // source
2435 argv[0] = source;
2436
2437 // node_id
2438 argv[1] = ULONG2NUM(node->node_id);
2439
2440 // location
2441 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2442
2443 // flags
2444 argv[3] = ULONG2NUM(node->flags);
2445
2446 // name
2447#line 239 "prism/templates/ext/prism/api_node.c.erb"
2448 assert(cast->name != 0);
2449 argv[4] = RARRAY_AREF(constants, cast->name - 1);
2450
2451 // name_loc
2452#line 253 "prism/templates/ext/prism/api_node.c.erb"
2453 argv[5] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
2454
2455 // operator_loc
2456#line 253 "prism/templates/ext/prism/api_node.c.erb"
2457 argv[6] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
2458
2459 // value
2460#line 226 "prism/templates/ext/prism/api_node.c.erb"
2461 argv[7] = rb_ary_pop(value_stack);
2462
2463 VALUE value = rb_class_new_instance(8, argv, rb_cPrismConstantAndWriteNode);
2464 if (freeze) rb_obj_freeze(value);
2465
2466 rb_ary_push(value_stack, value);
2467 break;
2468 }
2469#line 203 "prism/templates/ext/prism/api_node.c.erb"
2470 case PM_CONSTANT_OPERATOR_WRITE_NODE: {
2472 VALUE argv[9];
2473
2474 // source
2475 argv[0] = source;
2476
2477 // node_id
2478 argv[1] = ULONG2NUM(node->node_id);
2479
2480 // location
2481 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2482
2483 // flags
2484 argv[3] = ULONG2NUM(node->flags);
2485
2486 // name
2487#line 239 "prism/templates/ext/prism/api_node.c.erb"
2488 assert(cast->name != 0);
2489 argv[4] = RARRAY_AREF(constants, cast->name - 1);
2490
2491 // name_loc
2492#line 253 "prism/templates/ext/prism/api_node.c.erb"
2493 argv[5] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
2494
2495 // binary_operator_loc
2496#line 253 "prism/templates/ext/prism/api_node.c.erb"
2497 argv[6] = pm_location_new(cast->binary_operator_loc.start, cast->binary_operator_loc.length, source, freeze);
2498
2499 // value
2500#line 226 "prism/templates/ext/prism/api_node.c.erb"
2501 argv[7] = rb_ary_pop(value_stack);
2502
2503 // binary_operator
2504#line 239 "prism/templates/ext/prism/api_node.c.erb"
2505 assert(cast->binary_operator != 0);
2506 argv[8] = RARRAY_AREF(constants, cast->binary_operator - 1);
2507
2508 VALUE value = rb_class_new_instance(9, argv, rb_cPrismConstantOperatorWriteNode);
2509 if (freeze) rb_obj_freeze(value);
2510
2511 rb_ary_push(value_stack, value);
2512 break;
2513 }
2514#line 203 "prism/templates/ext/prism/api_node.c.erb"
2515 case PM_CONSTANT_OR_WRITE_NODE: {
2517 VALUE argv[8];
2518
2519 // source
2520 argv[0] = source;
2521
2522 // node_id
2523 argv[1] = ULONG2NUM(node->node_id);
2524
2525 // location
2526 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2527
2528 // flags
2529 argv[3] = ULONG2NUM(node->flags);
2530
2531 // name
2532#line 239 "prism/templates/ext/prism/api_node.c.erb"
2533 assert(cast->name != 0);
2534 argv[4] = RARRAY_AREF(constants, cast->name - 1);
2535
2536 // name_loc
2537#line 253 "prism/templates/ext/prism/api_node.c.erb"
2538 argv[5] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
2539
2540 // operator_loc
2541#line 253 "prism/templates/ext/prism/api_node.c.erb"
2542 argv[6] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
2543
2544 // value
2545#line 226 "prism/templates/ext/prism/api_node.c.erb"
2546 argv[7] = rb_ary_pop(value_stack);
2547
2548 VALUE value = rb_class_new_instance(8, argv, rb_cPrismConstantOrWriteNode);
2549 if (freeze) rb_obj_freeze(value);
2550
2551 rb_ary_push(value_stack, value);
2552 break;
2553 }
2554#line 203 "prism/templates/ext/prism/api_node.c.erb"
2555 case PM_CONSTANT_PATH_AND_WRITE_NODE: {
2557 VALUE argv[7];
2558
2559 // source
2560 argv[0] = source;
2561
2562 // node_id
2563 argv[1] = ULONG2NUM(node->node_id);
2564
2565 // location
2566 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2567
2568 // flags
2569 argv[3] = ULONG2NUM(node->flags);
2570
2571 // target
2572#line 226 "prism/templates/ext/prism/api_node.c.erb"
2573 argv[4] = rb_ary_pop(value_stack);
2574
2575 // operator_loc
2576#line 253 "prism/templates/ext/prism/api_node.c.erb"
2577 argv[5] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
2578
2579 // value
2580#line 226 "prism/templates/ext/prism/api_node.c.erb"
2581 argv[6] = rb_ary_pop(value_stack);
2582
2583 VALUE value = rb_class_new_instance(7, argv, rb_cPrismConstantPathAndWriteNode);
2584 if (freeze) rb_obj_freeze(value);
2585
2586 rb_ary_push(value_stack, value);
2587 break;
2588 }
2589#line 203 "prism/templates/ext/prism/api_node.c.erb"
2590 case PM_CONSTANT_PATH_NODE: {
2592 VALUE argv[8];
2593
2594 // source
2595 argv[0] = source;
2596
2597 // node_id
2598 argv[1] = ULONG2NUM(node->node_id);
2599
2600 // location
2601 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2602
2603 // flags
2604 argv[3] = ULONG2NUM(node->flags);
2605
2606 // parent
2607#line 226 "prism/templates/ext/prism/api_node.c.erb"
2608 argv[4] = rb_ary_pop(value_stack);
2609
2610 // name
2611 argv[5] = cast->name == 0 ? Qnil : RARRAY_AREF(constants, cast->name - 1);
2612
2613 // delimiter_loc
2614#line 253 "prism/templates/ext/prism/api_node.c.erb"
2615 argv[6] = pm_location_new(cast->delimiter_loc.start, cast->delimiter_loc.length, source, freeze);
2616
2617 // name_loc
2618#line 253 "prism/templates/ext/prism/api_node.c.erb"
2619 argv[7] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
2620
2621 VALUE value = rb_class_new_instance(8, argv, rb_cPrismConstantPathNode);
2622 if (freeze) rb_obj_freeze(value);
2623
2624 rb_ary_push(value_stack, value);
2625 break;
2626 }
2627#line 203 "prism/templates/ext/prism/api_node.c.erb"
2628 case PM_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
2630 VALUE argv[8];
2631
2632 // source
2633 argv[0] = source;
2634
2635 // node_id
2636 argv[1] = ULONG2NUM(node->node_id);
2637
2638 // location
2639 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2640
2641 // flags
2642 argv[3] = ULONG2NUM(node->flags);
2643
2644 // target
2645#line 226 "prism/templates/ext/prism/api_node.c.erb"
2646 argv[4] = rb_ary_pop(value_stack);
2647
2648 // binary_operator_loc
2649#line 253 "prism/templates/ext/prism/api_node.c.erb"
2650 argv[5] = pm_location_new(cast->binary_operator_loc.start, cast->binary_operator_loc.length, source, freeze);
2651
2652 // value
2653#line 226 "prism/templates/ext/prism/api_node.c.erb"
2654 argv[6] = rb_ary_pop(value_stack);
2655
2656 // binary_operator
2657#line 239 "prism/templates/ext/prism/api_node.c.erb"
2658 assert(cast->binary_operator != 0);
2659 argv[7] = RARRAY_AREF(constants, cast->binary_operator - 1);
2660
2661 VALUE value = rb_class_new_instance(8, argv, rb_cPrismConstantPathOperatorWriteNode);
2662 if (freeze) rb_obj_freeze(value);
2663
2664 rb_ary_push(value_stack, value);
2665 break;
2666 }
2667#line 203 "prism/templates/ext/prism/api_node.c.erb"
2668 case PM_CONSTANT_PATH_OR_WRITE_NODE: {
2670 VALUE argv[7];
2671
2672 // source
2673 argv[0] = source;
2674
2675 // node_id
2676 argv[1] = ULONG2NUM(node->node_id);
2677
2678 // location
2679 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2680
2681 // flags
2682 argv[3] = ULONG2NUM(node->flags);
2683
2684 // target
2685#line 226 "prism/templates/ext/prism/api_node.c.erb"
2686 argv[4] = rb_ary_pop(value_stack);
2687
2688 // operator_loc
2689#line 253 "prism/templates/ext/prism/api_node.c.erb"
2690 argv[5] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
2691
2692 // value
2693#line 226 "prism/templates/ext/prism/api_node.c.erb"
2694 argv[6] = rb_ary_pop(value_stack);
2695
2696 VALUE value = rb_class_new_instance(7, argv, rb_cPrismConstantPathOrWriteNode);
2697 if (freeze) rb_obj_freeze(value);
2698
2699 rb_ary_push(value_stack, value);
2700 break;
2701 }
2702#line 203 "prism/templates/ext/prism/api_node.c.erb"
2703 case PM_CONSTANT_PATH_TARGET_NODE: {
2705 VALUE argv[8];
2706
2707 // source
2708 argv[0] = source;
2709
2710 // node_id
2711 argv[1] = ULONG2NUM(node->node_id);
2712
2713 // location
2714 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2715
2716 // flags
2717 argv[3] = ULONG2NUM(node->flags);
2718
2719 // parent
2720#line 226 "prism/templates/ext/prism/api_node.c.erb"
2721 argv[4] = rb_ary_pop(value_stack);
2722
2723 // name
2724 argv[5] = cast->name == 0 ? Qnil : RARRAY_AREF(constants, cast->name - 1);
2725
2726 // delimiter_loc
2727#line 253 "prism/templates/ext/prism/api_node.c.erb"
2728 argv[6] = pm_location_new(cast->delimiter_loc.start, cast->delimiter_loc.length, source, freeze);
2729
2730 // name_loc
2731#line 253 "prism/templates/ext/prism/api_node.c.erb"
2732 argv[7] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
2733
2734 VALUE value = rb_class_new_instance(8, argv, rb_cPrismConstantPathTargetNode);
2735 if (freeze) rb_obj_freeze(value);
2736
2737 rb_ary_push(value_stack, value);
2738 break;
2739 }
2740#line 203 "prism/templates/ext/prism/api_node.c.erb"
2741 case PM_CONSTANT_PATH_WRITE_NODE: {
2743 VALUE argv[7];
2744
2745 // source
2746 argv[0] = source;
2747
2748 // node_id
2749 argv[1] = ULONG2NUM(node->node_id);
2750
2751 // location
2752 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2753
2754 // flags
2755 argv[3] = ULONG2NUM(node->flags);
2756
2757 // target
2758#line 226 "prism/templates/ext/prism/api_node.c.erb"
2759 argv[4] = rb_ary_pop(value_stack);
2760
2761 // operator_loc
2762#line 253 "prism/templates/ext/prism/api_node.c.erb"
2763 argv[5] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
2764
2765 // value
2766#line 226 "prism/templates/ext/prism/api_node.c.erb"
2767 argv[6] = rb_ary_pop(value_stack);
2768
2769 VALUE value = rb_class_new_instance(7, argv, rb_cPrismConstantPathWriteNode);
2770 if (freeze) rb_obj_freeze(value);
2771
2772 rb_ary_push(value_stack, value);
2773 break;
2774 }
2775#line 203 "prism/templates/ext/prism/api_node.c.erb"
2776 case PM_CONSTANT_READ_NODE: {
2778 VALUE argv[5];
2779
2780 // source
2781 argv[0] = source;
2782
2783 // node_id
2784 argv[1] = ULONG2NUM(node->node_id);
2785
2786 // location
2787 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2788
2789 // flags
2790 argv[3] = ULONG2NUM(node->flags);
2791
2792 // name
2793#line 239 "prism/templates/ext/prism/api_node.c.erb"
2794 assert(cast->name != 0);
2795 argv[4] = RARRAY_AREF(constants, cast->name - 1);
2796
2797 VALUE value = rb_class_new_instance(5, argv, rb_cPrismConstantReadNode);
2798 if (freeze) rb_obj_freeze(value);
2799
2800 rb_ary_push(value_stack, value);
2801 break;
2802 }
2803#line 203 "prism/templates/ext/prism/api_node.c.erb"
2804 case PM_CONSTANT_TARGET_NODE: {
2806 VALUE argv[5];
2807
2808 // source
2809 argv[0] = source;
2810
2811 // node_id
2812 argv[1] = ULONG2NUM(node->node_id);
2813
2814 // location
2815 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2816
2817 // flags
2818 argv[3] = ULONG2NUM(node->flags);
2819
2820 // name
2821#line 239 "prism/templates/ext/prism/api_node.c.erb"
2822 assert(cast->name != 0);
2823 argv[4] = RARRAY_AREF(constants, cast->name - 1);
2824
2825 VALUE value = rb_class_new_instance(5, argv, rb_cPrismConstantTargetNode);
2826 if (freeze) rb_obj_freeze(value);
2827
2828 rb_ary_push(value_stack, value);
2829 break;
2830 }
2831#line 203 "prism/templates/ext/prism/api_node.c.erb"
2832 case PM_CONSTANT_WRITE_NODE: {
2834 VALUE argv[8];
2835
2836 // source
2837 argv[0] = source;
2838
2839 // node_id
2840 argv[1] = ULONG2NUM(node->node_id);
2841
2842 // location
2843 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2844
2845 // flags
2846 argv[3] = ULONG2NUM(node->flags);
2847
2848 // name
2849#line 239 "prism/templates/ext/prism/api_node.c.erb"
2850 assert(cast->name != 0);
2851 argv[4] = RARRAY_AREF(constants, cast->name - 1);
2852
2853 // name_loc
2854#line 253 "prism/templates/ext/prism/api_node.c.erb"
2855 argv[5] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
2856
2857 // value
2858#line 226 "prism/templates/ext/prism/api_node.c.erb"
2859 argv[6] = rb_ary_pop(value_stack);
2860
2861 // operator_loc
2862#line 253 "prism/templates/ext/prism/api_node.c.erb"
2863 argv[7] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
2864
2865 VALUE value = rb_class_new_instance(8, argv, rb_cPrismConstantWriteNode);
2866 if (freeze) rb_obj_freeze(value);
2867
2868 rb_ary_push(value_stack, value);
2869 break;
2870 }
2871#line 203 "prism/templates/ext/prism/api_node.c.erb"
2872 case PM_DEF_NODE: {
2873 pm_def_node_t *cast = (pm_def_node_t *) node;
2874 VALUE argv[16];
2875
2876 // source
2877 argv[0] = source;
2878
2879 // node_id
2880 argv[1] = ULONG2NUM(node->node_id);
2881
2882 // location
2883 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2884
2885 // flags
2886 argv[3] = ULONG2NUM(node->flags);
2887
2888 // name
2889#line 239 "prism/templates/ext/prism/api_node.c.erb"
2890 assert(cast->name != 0);
2891 argv[4] = RARRAY_AREF(constants, cast->name - 1);
2892
2893 // name_loc
2894#line 253 "prism/templates/ext/prism/api_node.c.erb"
2895 argv[5] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
2896
2897 // receiver
2898#line 226 "prism/templates/ext/prism/api_node.c.erb"
2899 argv[6] = rb_ary_pop(value_stack);
2900
2901 // parameters
2902#line 226 "prism/templates/ext/prism/api_node.c.erb"
2903 argv[7] = rb_ary_pop(value_stack);
2904
2905 // body
2906#line 226 "prism/templates/ext/prism/api_node.c.erb"
2907 argv[8] = rb_ary_pop(value_stack);
2908
2909 // locals
2910#line 245 "prism/templates/ext/prism/api_node.c.erb"
2911 argv[9] = rb_ary_new_capa(cast->locals.size);
2912 for (size_t index = 0; index < cast->locals.size; index++) {
2913 assert(cast->locals.ids[index] != 0);
2914 rb_ary_push(argv[9], RARRAY_AREF(constants, cast->locals.ids[index] - 1));
2915 }
2916 if (freeze) rb_obj_freeze(argv[9]);
2917
2918 // def_keyword_loc
2919#line 253 "prism/templates/ext/prism/api_node.c.erb"
2920 argv[10] = pm_location_new(cast->def_keyword_loc.start, cast->def_keyword_loc.length, source, freeze);
2921
2922 // operator_loc
2923#line 256 "prism/templates/ext/prism/api_node.c.erb"
2924 argv[11] = cast->operator_loc.length == 0 ? Qnil : pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
2925
2926 // lparen_loc
2927#line 256 "prism/templates/ext/prism/api_node.c.erb"
2928 argv[12] = cast->lparen_loc.length == 0 ? Qnil : pm_location_new(cast->lparen_loc.start, cast->lparen_loc.length, source, freeze);
2929
2930 // rparen_loc
2931#line 256 "prism/templates/ext/prism/api_node.c.erb"
2932 argv[13] = cast->rparen_loc.length == 0 ? Qnil : pm_location_new(cast->rparen_loc.start, cast->rparen_loc.length, source, freeze);
2933
2934 // equal_loc
2935#line 256 "prism/templates/ext/prism/api_node.c.erb"
2936 argv[14] = cast->equal_loc.length == 0 ? Qnil : pm_location_new(cast->equal_loc.start, cast->equal_loc.length, source, freeze);
2937
2938 // end_keyword_loc
2939#line 256 "prism/templates/ext/prism/api_node.c.erb"
2940 argv[15] = cast->end_keyword_loc.length == 0 ? Qnil : pm_location_new(cast->end_keyword_loc.start, cast->end_keyword_loc.length, source, freeze);
2941
2942 VALUE value = rb_class_new_instance(16, argv, rb_cPrismDefNode);
2943 if (freeze) rb_obj_freeze(value);
2944
2945 rb_ary_push(value_stack, value);
2946 break;
2947 }
2948#line 203 "prism/templates/ext/prism/api_node.c.erb"
2949 case PM_DEFINED_NODE: {
2950 pm_defined_node_t *cast = (pm_defined_node_t *) node;
2951 VALUE argv[8];
2952
2953 // source
2954 argv[0] = source;
2955
2956 // node_id
2957 argv[1] = ULONG2NUM(node->node_id);
2958
2959 // location
2960 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
2961
2962 // flags
2963 argv[3] = ULONG2NUM(node->flags);
2964
2965 // lparen_loc
2966#line 256 "prism/templates/ext/prism/api_node.c.erb"
2967 argv[4] = cast->lparen_loc.length == 0 ? Qnil : pm_location_new(cast->lparen_loc.start, cast->lparen_loc.length, source, freeze);
2968
2969 // value
2970#line 226 "prism/templates/ext/prism/api_node.c.erb"
2971 argv[5] = rb_ary_pop(value_stack);
2972
2973 // rparen_loc
2974#line 256 "prism/templates/ext/prism/api_node.c.erb"
2975 argv[6] = cast->rparen_loc.length == 0 ? Qnil : pm_location_new(cast->rparen_loc.start, cast->rparen_loc.length, source, freeze);
2976
2977 // keyword_loc
2978#line 253 "prism/templates/ext/prism/api_node.c.erb"
2979 argv[7] = pm_location_new(cast->keyword_loc.start, cast->keyword_loc.length, source, freeze);
2980
2981 VALUE value = rb_class_new_instance(8, argv, rb_cPrismDefinedNode);
2982 if (freeze) rb_obj_freeze(value);
2983
2984 rb_ary_push(value_stack, value);
2985 break;
2986 }
2987#line 203 "prism/templates/ext/prism/api_node.c.erb"
2988 case PM_ELSE_NODE: {
2989 pm_else_node_t *cast = (pm_else_node_t *) node;
2990 VALUE argv[7];
2991
2992 // source
2993 argv[0] = source;
2994
2995 // node_id
2996 argv[1] = ULONG2NUM(node->node_id);
2997
2998 // location
2999 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3000
3001 // flags
3002 argv[3] = ULONG2NUM(node->flags);
3003
3004 // else_keyword_loc
3005#line 253 "prism/templates/ext/prism/api_node.c.erb"
3006 argv[4] = pm_location_new(cast->else_keyword_loc.start, cast->else_keyword_loc.length, source, freeze);
3007
3008 // statements
3009#line 226 "prism/templates/ext/prism/api_node.c.erb"
3010 argv[5] = rb_ary_pop(value_stack);
3011
3012 // end_keyword_loc
3013#line 256 "prism/templates/ext/prism/api_node.c.erb"
3014 argv[6] = cast->end_keyword_loc.length == 0 ? Qnil : pm_location_new(cast->end_keyword_loc.start, cast->end_keyword_loc.length, source, freeze);
3015
3016 VALUE value = rb_class_new_instance(7, argv, rb_cPrismElseNode);
3017 if (freeze) rb_obj_freeze(value);
3018
3019 rb_ary_push(value_stack, value);
3020 break;
3021 }
3022#line 203 "prism/templates/ext/prism/api_node.c.erb"
3023 case PM_EMBEDDED_STATEMENTS_NODE: {
3025 VALUE argv[7];
3026
3027 // source
3028 argv[0] = source;
3029
3030 // node_id
3031 argv[1] = ULONG2NUM(node->node_id);
3032
3033 // location
3034 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3035
3036 // flags
3037 argv[3] = ULONG2NUM(node->flags);
3038
3039 // opening_loc
3040#line 253 "prism/templates/ext/prism/api_node.c.erb"
3041 argv[4] = pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
3042
3043 // statements
3044#line 226 "prism/templates/ext/prism/api_node.c.erb"
3045 argv[5] = rb_ary_pop(value_stack);
3046
3047 // closing_loc
3048#line 253 "prism/templates/ext/prism/api_node.c.erb"
3049 argv[6] = pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
3050
3051 VALUE value = rb_class_new_instance(7, argv, rb_cPrismEmbeddedStatementsNode);
3052 if (freeze) rb_obj_freeze(value);
3053
3054 rb_ary_push(value_stack, value);
3055 break;
3056 }
3057#line 203 "prism/templates/ext/prism/api_node.c.erb"
3058 case PM_EMBEDDED_VARIABLE_NODE: {
3060 VALUE argv[6];
3061
3062 // source
3063 argv[0] = source;
3064
3065 // node_id
3066 argv[1] = ULONG2NUM(node->node_id);
3067
3068 // location
3069 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3070
3071 // flags
3072 argv[3] = ULONG2NUM(node->flags);
3073
3074 // operator_loc
3075#line 253 "prism/templates/ext/prism/api_node.c.erb"
3076 argv[4] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
3077
3078 // variable
3079#line 226 "prism/templates/ext/prism/api_node.c.erb"
3080 argv[5] = rb_ary_pop(value_stack);
3081
3082 VALUE value = rb_class_new_instance(6, argv, rb_cPrismEmbeddedVariableNode);
3083 if (freeze) rb_obj_freeze(value);
3084
3085 rb_ary_push(value_stack, value);
3086 break;
3087 }
3088#line 203 "prism/templates/ext/prism/api_node.c.erb"
3089 case PM_ENSURE_NODE: {
3090 pm_ensure_node_t *cast = (pm_ensure_node_t *) node;
3091 VALUE argv[7];
3092
3093 // source
3094 argv[0] = source;
3095
3096 // node_id
3097 argv[1] = ULONG2NUM(node->node_id);
3098
3099 // location
3100 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3101
3102 // flags
3103 argv[3] = ULONG2NUM(node->flags);
3104
3105 // ensure_keyword_loc
3106#line 253 "prism/templates/ext/prism/api_node.c.erb"
3107 argv[4] = pm_location_new(cast->ensure_keyword_loc.start, cast->ensure_keyword_loc.length, source, freeze);
3108
3109 // statements
3110#line 226 "prism/templates/ext/prism/api_node.c.erb"
3111 argv[5] = rb_ary_pop(value_stack);
3112
3113 // end_keyword_loc
3114#line 253 "prism/templates/ext/prism/api_node.c.erb"
3115 argv[6] = pm_location_new(cast->end_keyword_loc.start, cast->end_keyword_loc.length, source, freeze);
3116
3117 VALUE value = rb_class_new_instance(7, argv, rb_cPrismEnsureNode);
3118 if (freeze) rb_obj_freeze(value);
3119
3120 rb_ary_push(value_stack, value);
3121 break;
3122 }
3123#line 203 "prism/templates/ext/prism/api_node.c.erb"
3124 case PM_ERROR_RECOVERY_NODE: {
3125 VALUE argv[5];
3126
3127 // source
3128 argv[0] = source;
3129
3130 // node_id
3131 argv[1] = ULONG2NUM(node->node_id);
3132
3133 // location
3134 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3135
3136 // flags
3137 argv[3] = ULONG2NUM(node->flags);
3138
3139 // unexpected
3140#line 226 "prism/templates/ext/prism/api_node.c.erb"
3141 argv[4] = rb_ary_pop(value_stack);
3142
3143 VALUE value = rb_class_new_instance(5, argv, rb_cPrismErrorRecoveryNode);
3144 if (freeze) rb_obj_freeze(value);
3145
3146 rb_ary_push(value_stack, value);
3147 break;
3148 }
3149#line 203 "prism/templates/ext/prism/api_node.c.erb"
3150 case PM_FALSE_NODE: {
3151 VALUE argv[4];
3152
3153 // source
3154 argv[0] = source;
3155
3156 // node_id
3157 argv[1] = ULONG2NUM(node->node_id);
3158
3159 // location
3160 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3161
3162 // flags
3163 argv[3] = ULONG2NUM(node->flags);
3164
3165 VALUE value = rb_class_new_instance(4, argv, rb_cPrismFalseNode);
3166 if (freeze) rb_obj_freeze(value);
3167
3168 rb_ary_push(value_stack, value);
3169 break;
3170 }
3171#line 203 "prism/templates/ext/prism/api_node.c.erb"
3172 case PM_FIND_PATTERN_NODE: {
3174 VALUE argv[10];
3175
3176 // source
3177 argv[0] = source;
3178
3179 // node_id
3180 argv[1] = ULONG2NUM(node->node_id);
3181
3182 // location
3183 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3184
3185 // flags
3186 argv[3] = ULONG2NUM(node->flags);
3187
3188 // constant
3189#line 226 "prism/templates/ext/prism/api_node.c.erb"
3190 argv[4] = rb_ary_pop(value_stack);
3191
3192 // left
3193#line 226 "prism/templates/ext/prism/api_node.c.erb"
3194 argv[5] = rb_ary_pop(value_stack);
3195
3196 // requireds
3197#line 229 "prism/templates/ext/prism/api_node.c.erb"
3198 argv[6] = rb_ary_new_capa(cast->requireds.size);
3199 for (size_t index = 0; index < cast->requireds.size; index++) {
3200 rb_ary_push(argv[6], rb_ary_pop(value_stack));
3201 }
3202 if (freeze) rb_obj_freeze(argv[6]);
3203
3204 // right
3205#line 226 "prism/templates/ext/prism/api_node.c.erb"
3206 argv[7] = rb_ary_pop(value_stack);
3207
3208 // opening_loc
3209#line 256 "prism/templates/ext/prism/api_node.c.erb"
3210 argv[8] = cast->opening_loc.length == 0 ? Qnil : pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
3211
3212 // closing_loc
3213#line 256 "prism/templates/ext/prism/api_node.c.erb"
3214 argv[9] = cast->closing_loc.length == 0 ? Qnil : pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
3215
3216 VALUE value = rb_class_new_instance(10, argv, rb_cPrismFindPatternNode);
3217 if (freeze) rb_obj_freeze(value);
3218
3219 rb_ary_push(value_stack, value);
3220 break;
3221 }
3222#line 203 "prism/templates/ext/prism/api_node.c.erb"
3223 case PM_FLIP_FLOP_NODE: {
3225 VALUE argv[7];
3226
3227 // source
3228 argv[0] = source;
3229
3230 // node_id
3231 argv[1] = ULONG2NUM(node->node_id);
3232
3233 // location
3234 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3235
3236 // flags
3237 argv[3] = ULONG2NUM(node->flags);
3238
3239 // left
3240#line 226 "prism/templates/ext/prism/api_node.c.erb"
3241 argv[4] = rb_ary_pop(value_stack);
3242
3243 // right
3244#line 226 "prism/templates/ext/prism/api_node.c.erb"
3245 argv[5] = rb_ary_pop(value_stack);
3246
3247 // operator_loc
3248#line 253 "prism/templates/ext/prism/api_node.c.erb"
3249 argv[6] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
3250
3251 VALUE value = rb_class_new_instance(7, argv, rb_cPrismFlipFlopNode);
3252 if (freeze) rb_obj_freeze(value);
3253
3254 rb_ary_push(value_stack, value);
3255 break;
3256 }
3257#line 203 "prism/templates/ext/prism/api_node.c.erb"
3258 case PM_FLOAT_NODE: {
3259 pm_float_node_t *cast = (pm_float_node_t *) node;
3260 VALUE argv[5];
3261
3262 // source
3263 argv[0] = source;
3264
3265 // node_id
3266 argv[1] = ULONG2NUM(node->node_id);
3267
3268 // location
3269 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3270
3271 // flags
3272 argv[3] = ULONG2NUM(node->flags);
3273
3274 // value
3275#line 268 "prism/templates/ext/prism/api_node.c.erb"
3276 argv[4] = DBL2NUM(cast->value);
3277
3278 VALUE value = rb_class_new_instance(5, argv, rb_cPrismFloatNode);
3279 if (freeze) rb_obj_freeze(value);
3280
3281 rb_ary_push(value_stack, value);
3282 break;
3283 }
3284#line 203 "prism/templates/ext/prism/api_node.c.erb"
3285 case PM_FOR_NODE: {
3286 pm_for_node_t *cast = (pm_for_node_t *) node;
3287 VALUE argv[11];
3288
3289 // source
3290 argv[0] = source;
3291
3292 // node_id
3293 argv[1] = ULONG2NUM(node->node_id);
3294
3295 // location
3296 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3297
3298 // flags
3299 argv[3] = ULONG2NUM(node->flags);
3300
3301 // index
3302#line 226 "prism/templates/ext/prism/api_node.c.erb"
3303 argv[4] = rb_ary_pop(value_stack);
3304
3305 // collection
3306#line 226 "prism/templates/ext/prism/api_node.c.erb"
3307 argv[5] = rb_ary_pop(value_stack);
3308
3309 // statements
3310#line 226 "prism/templates/ext/prism/api_node.c.erb"
3311 argv[6] = rb_ary_pop(value_stack);
3312
3313 // for_keyword_loc
3314#line 253 "prism/templates/ext/prism/api_node.c.erb"
3315 argv[7] = pm_location_new(cast->for_keyword_loc.start, cast->for_keyword_loc.length, source, freeze);
3316
3317 // in_keyword_loc
3318#line 253 "prism/templates/ext/prism/api_node.c.erb"
3319 argv[8] = pm_location_new(cast->in_keyword_loc.start, cast->in_keyword_loc.length, source, freeze);
3320
3321 // do_keyword_loc
3322#line 256 "prism/templates/ext/prism/api_node.c.erb"
3323 argv[9] = cast->do_keyword_loc.length == 0 ? Qnil : pm_location_new(cast->do_keyword_loc.start, cast->do_keyword_loc.length, source, freeze);
3324
3325 // end_keyword_loc
3326#line 253 "prism/templates/ext/prism/api_node.c.erb"
3327 argv[10] = pm_location_new(cast->end_keyword_loc.start, cast->end_keyword_loc.length, source, freeze);
3328
3329 VALUE value = rb_class_new_instance(11, argv, rb_cPrismForNode);
3330 if (freeze) rb_obj_freeze(value);
3331
3332 rb_ary_push(value_stack, value);
3333 break;
3334 }
3335#line 203 "prism/templates/ext/prism/api_node.c.erb"
3336 case PM_FORWARDING_ARGUMENTS_NODE: {
3337 VALUE argv[4];
3338
3339 // source
3340 argv[0] = source;
3341
3342 // node_id
3343 argv[1] = ULONG2NUM(node->node_id);
3344
3345 // location
3346 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3347
3348 // flags
3349 argv[3] = ULONG2NUM(node->flags);
3350
3351 VALUE value = rb_class_new_instance(4, argv, rb_cPrismForwardingArgumentsNode);
3352 if (freeze) rb_obj_freeze(value);
3353
3354 rb_ary_push(value_stack, value);
3355 break;
3356 }
3357#line 203 "prism/templates/ext/prism/api_node.c.erb"
3358 case PM_FORWARDING_PARAMETER_NODE: {
3359 VALUE argv[4];
3360
3361 // source
3362 argv[0] = source;
3363
3364 // node_id
3365 argv[1] = ULONG2NUM(node->node_id);
3366
3367 // location
3368 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3369
3370 // flags
3371 argv[3] = ULONG2NUM(node->flags);
3372
3373 VALUE value = rb_class_new_instance(4, argv, rb_cPrismForwardingParameterNode);
3374 if (freeze) rb_obj_freeze(value);
3375
3376 rb_ary_push(value_stack, value);
3377 break;
3378 }
3379#line 203 "prism/templates/ext/prism/api_node.c.erb"
3380 case PM_FORWARDING_SUPER_NODE: {
3382 VALUE argv[6];
3383
3384 // source
3385 argv[0] = source;
3386
3387 // node_id
3388 argv[1] = ULONG2NUM(node->node_id);
3389
3390 // location
3391 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3392
3393 // flags
3394 argv[3] = ULONG2NUM(node->flags);
3395
3396 // keyword_loc
3397#line 253 "prism/templates/ext/prism/api_node.c.erb"
3398 argv[4] = pm_location_new(cast->keyword_loc.start, cast->keyword_loc.length, source, freeze);
3399
3400 // block
3401#line 226 "prism/templates/ext/prism/api_node.c.erb"
3402 argv[5] = rb_ary_pop(value_stack);
3403
3404 VALUE value = rb_class_new_instance(6, argv, rb_cPrismForwardingSuperNode);
3405 if (freeze) rb_obj_freeze(value);
3406
3407 rb_ary_push(value_stack, value);
3408 break;
3409 }
3410#line 203 "prism/templates/ext/prism/api_node.c.erb"
3411 case PM_GLOBAL_VARIABLE_AND_WRITE_NODE: {
3413 VALUE argv[8];
3414
3415 // source
3416 argv[0] = source;
3417
3418 // node_id
3419 argv[1] = ULONG2NUM(node->node_id);
3420
3421 // location
3422 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3423
3424 // flags
3425 argv[3] = ULONG2NUM(node->flags);
3426
3427 // name
3428#line 239 "prism/templates/ext/prism/api_node.c.erb"
3429 assert(cast->name != 0);
3430 argv[4] = RARRAY_AREF(constants, cast->name - 1);
3431
3432 // name_loc
3433#line 253 "prism/templates/ext/prism/api_node.c.erb"
3434 argv[5] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
3435
3436 // operator_loc
3437#line 253 "prism/templates/ext/prism/api_node.c.erb"
3438 argv[6] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
3439
3440 // value
3441#line 226 "prism/templates/ext/prism/api_node.c.erb"
3442 argv[7] = rb_ary_pop(value_stack);
3443
3444 VALUE value = rb_class_new_instance(8, argv, rb_cPrismGlobalVariableAndWriteNode);
3445 if (freeze) rb_obj_freeze(value);
3446
3447 rb_ary_push(value_stack, value);
3448 break;
3449 }
3450#line 203 "prism/templates/ext/prism/api_node.c.erb"
3451 case PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
3453 VALUE argv[9];
3454
3455 // source
3456 argv[0] = source;
3457
3458 // node_id
3459 argv[1] = ULONG2NUM(node->node_id);
3460
3461 // location
3462 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3463
3464 // flags
3465 argv[3] = ULONG2NUM(node->flags);
3466
3467 // name
3468#line 239 "prism/templates/ext/prism/api_node.c.erb"
3469 assert(cast->name != 0);
3470 argv[4] = RARRAY_AREF(constants, cast->name - 1);
3471
3472 // name_loc
3473#line 253 "prism/templates/ext/prism/api_node.c.erb"
3474 argv[5] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
3475
3476 // binary_operator_loc
3477#line 253 "prism/templates/ext/prism/api_node.c.erb"
3478 argv[6] = pm_location_new(cast->binary_operator_loc.start, cast->binary_operator_loc.length, source, freeze);
3479
3480 // value
3481#line 226 "prism/templates/ext/prism/api_node.c.erb"
3482 argv[7] = rb_ary_pop(value_stack);
3483
3484 // binary_operator
3485#line 239 "prism/templates/ext/prism/api_node.c.erb"
3486 assert(cast->binary_operator != 0);
3487 argv[8] = RARRAY_AREF(constants, cast->binary_operator - 1);
3488
3489 VALUE value = rb_class_new_instance(9, argv, rb_cPrismGlobalVariableOperatorWriteNode);
3490 if (freeze) rb_obj_freeze(value);
3491
3492 rb_ary_push(value_stack, value);
3493 break;
3494 }
3495#line 203 "prism/templates/ext/prism/api_node.c.erb"
3496 case PM_GLOBAL_VARIABLE_OR_WRITE_NODE: {
3498 VALUE argv[8];
3499
3500 // source
3501 argv[0] = source;
3502
3503 // node_id
3504 argv[1] = ULONG2NUM(node->node_id);
3505
3506 // location
3507 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3508
3509 // flags
3510 argv[3] = ULONG2NUM(node->flags);
3511
3512 // name
3513#line 239 "prism/templates/ext/prism/api_node.c.erb"
3514 assert(cast->name != 0);
3515 argv[4] = RARRAY_AREF(constants, cast->name - 1);
3516
3517 // name_loc
3518#line 253 "prism/templates/ext/prism/api_node.c.erb"
3519 argv[5] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
3520
3521 // operator_loc
3522#line 253 "prism/templates/ext/prism/api_node.c.erb"
3523 argv[6] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
3524
3525 // value
3526#line 226 "prism/templates/ext/prism/api_node.c.erb"
3527 argv[7] = rb_ary_pop(value_stack);
3528
3529 VALUE value = rb_class_new_instance(8, argv, rb_cPrismGlobalVariableOrWriteNode);
3530 if (freeze) rb_obj_freeze(value);
3531
3532 rb_ary_push(value_stack, value);
3533 break;
3534 }
3535#line 203 "prism/templates/ext/prism/api_node.c.erb"
3536 case PM_GLOBAL_VARIABLE_READ_NODE: {
3538 VALUE argv[5];
3539
3540 // source
3541 argv[0] = source;
3542
3543 // node_id
3544 argv[1] = ULONG2NUM(node->node_id);
3545
3546 // location
3547 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3548
3549 // flags
3550 argv[3] = ULONG2NUM(node->flags);
3551
3552 // name
3553#line 239 "prism/templates/ext/prism/api_node.c.erb"
3554 assert(cast->name != 0);
3555 argv[4] = RARRAY_AREF(constants, cast->name - 1);
3556
3557 VALUE value = rb_class_new_instance(5, argv, rb_cPrismGlobalVariableReadNode);
3558 if (freeze) rb_obj_freeze(value);
3559
3560 rb_ary_push(value_stack, value);
3561 break;
3562 }
3563#line 203 "prism/templates/ext/prism/api_node.c.erb"
3564 case PM_GLOBAL_VARIABLE_TARGET_NODE: {
3566 VALUE argv[5];
3567
3568 // source
3569 argv[0] = source;
3570
3571 // node_id
3572 argv[1] = ULONG2NUM(node->node_id);
3573
3574 // location
3575 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3576
3577 // flags
3578 argv[3] = ULONG2NUM(node->flags);
3579
3580 // name
3581#line 239 "prism/templates/ext/prism/api_node.c.erb"
3582 assert(cast->name != 0);
3583 argv[4] = RARRAY_AREF(constants, cast->name - 1);
3584
3585 VALUE value = rb_class_new_instance(5, argv, rb_cPrismGlobalVariableTargetNode);
3586 if (freeze) rb_obj_freeze(value);
3587
3588 rb_ary_push(value_stack, value);
3589 break;
3590 }
3591#line 203 "prism/templates/ext/prism/api_node.c.erb"
3592 case PM_GLOBAL_VARIABLE_WRITE_NODE: {
3594 VALUE argv[8];
3595
3596 // source
3597 argv[0] = source;
3598
3599 // node_id
3600 argv[1] = ULONG2NUM(node->node_id);
3601
3602 // location
3603 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3604
3605 // flags
3606 argv[3] = ULONG2NUM(node->flags);
3607
3608 // name
3609#line 239 "prism/templates/ext/prism/api_node.c.erb"
3610 assert(cast->name != 0);
3611 argv[4] = RARRAY_AREF(constants, cast->name - 1);
3612
3613 // name_loc
3614#line 253 "prism/templates/ext/prism/api_node.c.erb"
3615 argv[5] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
3616
3617 // value
3618#line 226 "prism/templates/ext/prism/api_node.c.erb"
3619 argv[6] = rb_ary_pop(value_stack);
3620
3621 // operator_loc
3622#line 253 "prism/templates/ext/prism/api_node.c.erb"
3623 argv[7] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
3624
3625 VALUE value = rb_class_new_instance(8, argv, rb_cPrismGlobalVariableWriteNode);
3626 if (freeze) rb_obj_freeze(value);
3627
3628 rb_ary_push(value_stack, value);
3629 break;
3630 }
3631#line 203 "prism/templates/ext/prism/api_node.c.erb"
3632 case PM_HASH_NODE: {
3633 pm_hash_node_t *cast = (pm_hash_node_t *) node;
3634 VALUE argv[7];
3635
3636 // source
3637 argv[0] = source;
3638
3639 // node_id
3640 argv[1] = ULONG2NUM(node->node_id);
3641
3642 // location
3643 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3644
3645 // flags
3646 argv[3] = ULONG2NUM(node->flags);
3647
3648 // opening_loc
3649#line 253 "prism/templates/ext/prism/api_node.c.erb"
3650 argv[4] = pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
3651
3652 // elements
3653#line 229 "prism/templates/ext/prism/api_node.c.erb"
3654 argv[5] = rb_ary_new_capa(cast->elements.size);
3655 for (size_t index = 0; index < cast->elements.size; index++) {
3656 rb_ary_push(argv[5], rb_ary_pop(value_stack));
3657 }
3658 if (freeze) rb_obj_freeze(argv[5]);
3659
3660 // closing_loc
3661#line 253 "prism/templates/ext/prism/api_node.c.erb"
3662 argv[6] = pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
3663
3664 VALUE value = rb_class_new_instance(7, argv, rb_cPrismHashNode);
3665 if (freeze) rb_obj_freeze(value);
3666
3667 rb_ary_push(value_stack, value);
3668 break;
3669 }
3670#line 203 "prism/templates/ext/prism/api_node.c.erb"
3671 case PM_HASH_PATTERN_NODE: {
3673 VALUE argv[9];
3674
3675 // source
3676 argv[0] = source;
3677
3678 // node_id
3679 argv[1] = ULONG2NUM(node->node_id);
3680
3681 // location
3682 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3683
3684 // flags
3685 argv[3] = ULONG2NUM(node->flags);
3686
3687 // constant
3688#line 226 "prism/templates/ext/prism/api_node.c.erb"
3689 argv[4] = rb_ary_pop(value_stack);
3690
3691 // elements
3692#line 229 "prism/templates/ext/prism/api_node.c.erb"
3693 argv[5] = rb_ary_new_capa(cast->elements.size);
3694 for (size_t index = 0; index < cast->elements.size; index++) {
3695 rb_ary_push(argv[5], rb_ary_pop(value_stack));
3696 }
3697 if (freeze) rb_obj_freeze(argv[5]);
3698
3699 // rest
3700#line 226 "prism/templates/ext/prism/api_node.c.erb"
3701 argv[6] = rb_ary_pop(value_stack);
3702
3703 // opening_loc
3704#line 256 "prism/templates/ext/prism/api_node.c.erb"
3705 argv[7] = cast->opening_loc.length == 0 ? Qnil : pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
3706
3707 // closing_loc
3708#line 256 "prism/templates/ext/prism/api_node.c.erb"
3709 argv[8] = cast->closing_loc.length == 0 ? Qnil : pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
3710
3711 VALUE value = rb_class_new_instance(9, argv, rb_cPrismHashPatternNode);
3712 if (freeze) rb_obj_freeze(value);
3713
3714 rb_ary_push(value_stack, value);
3715 break;
3716 }
3717#line 203 "prism/templates/ext/prism/api_node.c.erb"
3718 case PM_IF_NODE: {
3719 pm_if_node_t *cast = (pm_if_node_t *) node;
3720 VALUE argv[10];
3721
3722 // source
3723 argv[0] = source;
3724
3725 // node_id
3726 argv[1] = ULONG2NUM(node->node_id);
3727
3728 // location
3729 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3730
3731 // flags
3732 argv[3] = ULONG2NUM(node->flags);
3733
3734 // if_keyword_loc
3735#line 256 "prism/templates/ext/prism/api_node.c.erb"
3736 argv[4] = cast->if_keyword_loc.length == 0 ? Qnil : pm_location_new(cast->if_keyword_loc.start, cast->if_keyword_loc.length, source, freeze);
3737
3738 // predicate
3739#line 226 "prism/templates/ext/prism/api_node.c.erb"
3740 argv[5] = rb_ary_pop(value_stack);
3741
3742 // then_keyword_loc
3743#line 256 "prism/templates/ext/prism/api_node.c.erb"
3744 argv[6] = cast->then_keyword_loc.length == 0 ? Qnil : pm_location_new(cast->then_keyword_loc.start, cast->then_keyword_loc.length, source, freeze);
3745
3746 // statements
3747#line 226 "prism/templates/ext/prism/api_node.c.erb"
3748 argv[7] = rb_ary_pop(value_stack);
3749
3750 // subsequent
3751#line 226 "prism/templates/ext/prism/api_node.c.erb"
3752 argv[8] = rb_ary_pop(value_stack);
3753
3754 // end_keyword_loc
3755#line 256 "prism/templates/ext/prism/api_node.c.erb"
3756 argv[9] = cast->end_keyword_loc.length == 0 ? Qnil : pm_location_new(cast->end_keyword_loc.start, cast->end_keyword_loc.length, source, freeze);
3757
3758 VALUE value = rb_class_new_instance(10, argv, rb_cPrismIfNode);
3759 if (freeze) rb_obj_freeze(value);
3760
3761 rb_ary_push(value_stack, value);
3762 break;
3763 }
3764#line 203 "prism/templates/ext/prism/api_node.c.erb"
3765 case PM_IMAGINARY_NODE: {
3766 VALUE argv[5];
3767
3768 // source
3769 argv[0] = source;
3770
3771 // node_id
3772 argv[1] = ULONG2NUM(node->node_id);
3773
3774 // location
3775 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3776
3777 // flags
3778 argv[3] = ULONG2NUM(node->flags);
3779
3780 // numeric
3781#line 226 "prism/templates/ext/prism/api_node.c.erb"
3782 argv[4] = rb_ary_pop(value_stack);
3783
3784 VALUE value = rb_class_new_instance(5, argv, rb_cPrismImaginaryNode);
3785 if (freeze) rb_obj_freeze(value);
3786
3787 rb_ary_push(value_stack, value);
3788 break;
3789 }
3790#line 203 "prism/templates/ext/prism/api_node.c.erb"
3791 case PM_IMPLICIT_NODE: {
3792 VALUE argv[5];
3793
3794 // source
3795 argv[0] = source;
3796
3797 // node_id
3798 argv[1] = ULONG2NUM(node->node_id);
3799
3800 // location
3801 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3802
3803 // flags
3804 argv[3] = ULONG2NUM(node->flags);
3805
3806 // value
3807#line 226 "prism/templates/ext/prism/api_node.c.erb"
3808 argv[4] = rb_ary_pop(value_stack);
3809
3810 VALUE value = rb_class_new_instance(5, argv, rb_cPrismImplicitNode);
3811 if (freeze) rb_obj_freeze(value);
3812
3813 rb_ary_push(value_stack, value);
3814 break;
3815 }
3816#line 203 "prism/templates/ext/prism/api_node.c.erb"
3817 case PM_IMPLICIT_REST_NODE: {
3818 VALUE argv[4];
3819
3820 // source
3821 argv[0] = source;
3822
3823 // node_id
3824 argv[1] = ULONG2NUM(node->node_id);
3825
3826 // location
3827 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3828
3829 // flags
3830 argv[3] = ULONG2NUM(node->flags);
3831
3832 VALUE value = rb_class_new_instance(4, argv, rb_cPrismImplicitRestNode);
3833 if (freeze) rb_obj_freeze(value);
3834
3835 rb_ary_push(value_stack, value);
3836 break;
3837 }
3838#line 203 "prism/templates/ext/prism/api_node.c.erb"
3839 case PM_IN_NODE: {
3840 pm_in_node_t *cast = (pm_in_node_t *) node;
3841 VALUE argv[8];
3842
3843 // source
3844 argv[0] = source;
3845
3846 // node_id
3847 argv[1] = ULONG2NUM(node->node_id);
3848
3849 // location
3850 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3851
3852 // flags
3853 argv[3] = ULONG2NUM(node->flags);
3854
3855 // pattern
3856#line 226 "prism/templates/ext/prism/api_node.c.erb"
3857 argv[4] = rb_ary_pop(value_stack);
3858
3859 // statements
3860#line 226 "prism/templates/ext/prism/api_node.c.erb"
3861 argv[5] = rb_ary_pop(value_stack);
3862
3863 // in_keyword_loc
3864#line 253 "prism/templates/ext/prism/api_node.c.erb"
3865 argv[6] = pm_location_new(cast->in_keyword_loc.start, cast->in_keyword_loc.length, source, freeze);
3866
3867 // then_keyword_loc
3868#line 256 "prism/templates/ext/prism/api_node.c.erb"
3869 argv[7] = cast->then_keyword_loc.length == 0 ? Qnil : pm_location_new(cast->then_keyword_loc.start, cast->then_keyword_loc.length, source, freeze);
3870
3871 VALUE value = rb_class_new_instance(8, argv, rb_cPrismInNode);
3872 if (freeze) rb_obj_freeze(value);
3873
3874 rb_ary_push(value_stack, value);
3875 break;
3876 }
3877#line 203 "prism/templates/ext/prism/api_node.c.erb"
3878 case PM_INDEX_AND_WRITE_NODE: {
3880 VALUE argv[12];
3881
3882 // source
3883 argv[0] = source;
3884
3885 // node_id
3886 argv[1] = ULONG2NUM(node->node_id);
3887
3888 // location
3889 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3890
3891 // flags
3892 argv[3] = ULONG2NUM(node->flags);
3893
3894 // receiver
3895#line 226 "prism/templates/ext/prism/api_node.c.erb"
3896 argv[4] = rb_ary_pop(value_stack);
3897
3898 // call_operator_loc
3899#line 256 "prism/templates/ext/prism/api_node.c.erb"
3900 argv[5] = cast->call_operator_loc.length == 0 ? Qnil : pm_location_new(cast->call_operator_loc.start, cast->call_operator_loc.length, source, freeze);
3901
3902 // opening_loc
3903#line 253 "prism/templates/ext/prism/api_node.c.erb"
3904 argv[6] = pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
3905
3906 // arguments
3907#line 226 "prism/templates/ext/prism/api_node.c.erb"
3908 argv[7] = rb_ary_pop(value_stack);
3909
3910 // closing_loc
3911#line 253 "prism/templates/ext/prism/api_node.c.erb"
3912 argv[8] = pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
3913
3914 // block
3915#line 226 "prism/templates/ext/prism/api_node.c.erb"
3916 argv[9] = rb_ary_pop(value_stack);
3917
3918 // operator_loc
3919#line 253 "prism/templates/ext/prism/api_node.c.erb"
3920 argv[10] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
3921
3922 // value
3923#line 226 "prism/templates/ext/prism/api_node.c.erb"
3924 argv[11] = rb_ary_pop(value_stack);
3925
3926 VALUE value = rb_class_new_instance(12, argv, rb_cPrismIndexAndWriteNode);
3927 if (freeze) rb_obj_freeze(value);
3928
3929 rb_ary_push(value_stack, value);
3930 break;
3931 }
3932#line 203 "prism/templates/ext/prism/api_node.c.erb"
3933 case PM_INDEX_OPERATOR_WRITE_NODE: {
3935 VALUE argv[13];
3936
3937 // source
3938 argv[0] = source;
3939
3940 // node_id
3941 argv[1] = ULONG2NUM(node->node_id);
3942
3943 // location
3944 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
3945
3946 // flags
3947 argv[3] = ULONG2NUM(node->flags);
3948
3949 // receiver
3950#line 226 "prism/templates/ext/prism/api_node.c.erb"
3951 argv[4] = rb_ary_pop(value_stack);
3952
3953 // call_operator_loc
3954#line 256 "prism/templates/ext/prism/api_node.c.erb"
3955 argv[5] = cast->call_operator_loc.length == 0 ? Qnil : pm_location_new(cast->call_operator_loc.start, cast->call_operator_loc.length, source, freeze);
3956
3957 // opening_loc
3958#line 253 "prism/templates/ext/prism/api_node.c.erb"
3959 argv[6] = pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
3960
3961 // arguments
3962#line 226 "prism/templates/ext/prism/api_node.c.erb"
3963 argv[7] = rb_ary_pop(value_stack);
3964
3965 // closing_loc
3966#line 253 "prism/templates/ext/prism/api_node.c.erb"
3967 argv[8] = pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
3968
3969 // block
3970#line 226 "prism/templates/ext/prism/api_node.c.erb"
3971 argv[9] = rb_ary_pop(value_stack);
3972
3973 // binary_operator
3974#line 239 "prism/templates/ext/prism/api_node.c.erb"
3975 assert(cast->binary_operator != 0);
3976 argv[10] = RARRAY_AREF(constants, cast->binary_operator - 1);
3977
3978 // binary_operator_loc
3979#line 253 "prism/templates/ext/prism/api_node.c.erb"
3980 argv[11] = pm_location_new(cast->binary_operator_loc.start, cast->binary_operator_loc.length, source, freeze);
3981
3982 // value
3983#line 226 "prism/templates/ext/prism/api_node.c.erb"
3984 argv[12] = rb_ary_pop(value_stack);
3985
3986 VALUE value = rb_class_new_instance(13, argv, rb_cPrismIndexOperatorWriteNode);
3987 if (freeze) rb_obj_freeze(value);
3988
3989 rb_ary_push(value_stack, value);
3990 break;
3991 }
3992#line 203 "prism/templates/ext/prism/api_node.c.erb"
3993 case PM_INDEX_OR_WRITE_NODE: {
3995 VALUE argv[12];
3996
3997 // source
3998 argv[0] = source;
3999
4000 // node_id
4001 argv[1] = ULONG2NUM(node->node_id);
4002
4003 // location
4004 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4005
4006 // flags
4007 argv[3] = ULONG2NUM(node->flags);
4008
4009 // receiver
4010#line 226 "prism/templates/ext/prism/api_node.c.erb"
4011 argv[4] = rb_ary_pop(value_stack);
4012
4013 // call_operator_loc
4014#line 256 "prism/templates/ext/prism/api_node.c.erb"
4015 argv[5] = cast->call_operator_loc.length == 0 ? Qnil : pm_location_new(cast->call_operator_loc.start, cast->call_operator_loc.length, source, freeze);
4016
4017 // opening_loc
4018#line 253 "prism/templates/ext/prism/api_node.c.erb"
4019 argv[6] = pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
4020
4021 // arguments
4022#line 226 "prism/templates/ext/prism/api_node.c.erb"
4023 argv[7] = rb_ary_pop(value_stack);
4024
4025 // closing_loc
4026#line 253 "prism/templates/ext/prism/api_node.c.erb"
4027 argv[8] = pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
4028
4029 // block
4030#line 226 "prism/templates/ext/prism/api_node.c.erb"
4031 argv[9] = rb_ary_pop(value_stack);
4032
4033 // operator_loc
4034#line 253 "prism/templates/ext/prism/api_node.c.erb"
4035 argv[10] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
4036
4037 // value
4038#line 226 "prism/templates/ext/prism/api_node.c.erb"
4039 argv[11] = rb_ary_pop(value_stack);
4040
4041 VALUE value = rb_class_new_instance(12, argv, rb_cPrismIndexOrWriteNode);
4042 if (freeze) rb_obj_freeze(value);
4043
4044 rb_ary_push(value_stack, value);
4045 break;
4046 }
4047#line 203 "prism/templates/ext/prism/api_node.c.erb"
4048 case PM_INDEX_TARGET_NODE: {
4050 VALUE argv[9];
4051
4052 // source
4053 argv[0] = source;
4054
4055 // node_id
4056 argv[1] = ULONG2NUM(node->node_id);
4057
4058 // location
4059 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4060
4061 // flags
4062 argv[3] = ULONG2NUM(node->flags);
4063
4064 // receiver
4065#line 226 "prism/templates/ext/prism/api_node.c.erb"
4066 argv[4] = rb_ary_pop(value_stack);
4067
4068 // opening_loc
4069#line 253 "prism/templates/ext/prism/api_node.c.erb"
4070 argv[5] = pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
4071
4072 // arguments
4073#line 226 "prism/templates/ext/prism/api_node.c.erb"
4074 argv[6] = rb_ary_pop(value_stack);
4075
4076 // closing_loc
4077#line 253 "prism/templates/ext/prism/api_node.c.erb"
4078 argv[7] = pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
4079
4080 // block
4081#line 226 "prism/templates/ext/prism/api_node.c.erb"
4082 argv[8] = rb_ary_pop(value_stack);
4083
4084 VALUE value = rb_class_new_instance(9, argv, rb_cPrismIndexTargetNode);
4085 if (freeze) rb_obj_freeze(value);
4086
4087 rb_ary_push(value_stack, value);
4088 break;
4089 }
4090#line 203 "prism/templates/ext/prism/api_node.c.erb"
4091 case PM_INSTANCE_VARIABLE_AND_WRITE_NODE: {
4093 VALUE argv[8];
4094
4095 // source
4096 argv[0] = source;
4097
4098 // node_id
4099 argv[1] = ULONG2NUM(node->node_id);
4100
4101 // location
4102 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4103
4104 // flags
4105 argv[3] = ULONG2NUM(node->flags);
4106
4107 // name
4108#line 239 "prism/templates/ext/prism/api_node.c.erb"
4109 assert(cast->name != 0);
4110 argv[4] = RARRAY_AREF(constants, cast->name - 1);
4111
4112 // name_loc
4113#line 253 "prism/templates/ext/prism/api_node.c.erb"
4114 argv[5] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
4115
4116 // operator_loc
4117#line 253 "prism/templates/ext/prism/api_node.c.erb"
4118 argv[6] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
4119
4120 // value
4121#line 226 "prism/templates/ext/prism/api_node.c.erb"
4122 argv[7] = rb_ary_pop(value_stack);
4123
4124 VALUE value = rb_class_new_instance(8, argv, rb_cPrismInstanceVariableAndWriteNode);
4125 if (freeze) rb_obj_freeze(value);
4126
4127 rb_ary_push(value_stack, value);
4128 break;
4129 }
4130#line 203 "prism/templates/ext/prism/api_node.c.erb"
4131 case PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
4133 VALUE argv[9];
4134
4135 // source
4136 argv[0] = source;
4137
4138 // node_id
4139 argv[1] = ULONG2NUM(node->node_id);
4140
4141 // location
4142 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4143
4144 // flags
4145 argv[3] = ULONG2NUM(node->flags);
4146
4147 // name
4148#line 239 "prism/templates/ext/prism/api_node.c.erb"
4149 assert(cast->name != 0);
4150 argv[4] = RARRAY_AREF(constants, cast->name - 1);
4151
4152 // name_loc
4153#line 253 "prism/templates/ext/prism/api_node.c.erb"
4154 argv[5] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
4155
4156 // binary_operator_loc
4157#line 253 "prism/templates/ext/prism/api_node.c.erb"
4158 argv[6] = pm_location_new(cast->binary_operator_loc.start, cast->binary_operator_loc.length, source, freeze);
4159
4160 // value
4161#line 226 "prism/templates/ext/prism/api_node.c.erb"
4162 argv[7] = rb_ary_pop(value_stack);
4163
4164 // binary_operator
4165#line 239 "prism/templates/ext/prism/api_node.c.erb"
4166 assert(cast->binary_operator != 0);
4167 argv[8] = RARRAY_AREF(constants, cast->binary_operator - 1);
4168
4169 VALUE value = rb_class_new_instance(9, argv, rb_cPrismInstanceVariableOperatorWriteNode);
4170 if (freeze) rb_obj_freeze(value);
4171
4172 rb_ary_push(value_stack, value);
4173 break;
4174 }
4175#line 203 "prism/templates/ext/prism/api_node.c.erb"
4176 case PM_INSTANCE_VARIABLE_OR_WRITE_NODE: {
4178 VALUE argv[8];
4179
4180 // source
4181 argv[0] = source;
4182
4183 // node_id
4184 argv[1] = ULONG2NUM(node->node_id);
4185
4186 // location
4187 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4188
4189 // flags
4190 argv[3] = ULONG2NUM(node->flags);
4191
4192 // name
4193#line 239 "prism/templates/ext/prism/api_node.c.erb"
4194 assert(cast->name != 0);
4195 argv[4] = RARRAY_AREF(constants, cast->name - 1);
4196
4197 // name_loc
4198#line 253 "prism/templates/ext/prism/api_node.c.erb"
4199 argv[5] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
4200
4201 // operator_loc
4202#line 253 "prism/templates/ext/prism/api_node.c.erb"
4203 argv[6] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
4204
4205 // value
4206#line 226 "prism/templates/ext/prism/api_node.c.erb"
4207 argv[7] = rb_ary_pop(value_stack);
4208
4209 VALUE value = rb_class_new_instance(8, argv, rb_cPrismInstanceVariableOrWriteNode);
4210 if (freeze) rb_obj_freeze(value);
4211
4212 rb_ary_push(value_stack, value);
4213 break;
4214 }
4215#line 203 "prism/templates/ext/prism/api_node.c.erb"
4216 case PM_INSTANCE_VARIABLE_READ_NODE: {
4218 VALUE argv[5];
4219
4220 // source
4221 argv[0] = source;
4222
4223 // node_id
4224 argv[1] = ULONG2NUM(node->node_id);
4225
4226 // location
4227 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4228
4229 // flags
4230 argv[3] = ULONG2NUM(node->flags);
4231
4232 // name
4233#line 239 "prism/templates/ext/prism/api_node.c.erb"
4234 assert(cast->name != 0);
4235 argv[4] = RARRAY_AREF(constants, cast->name - 1);
4236
4237 VALUE value = rb_class_new_instance(5, argv, rb_cPrismInstanceVariableReadNode);
4238 if (freeze) rb_obj_freeze(value);
4239
4240 rb_ary_push(value_stack, value);
4241 break;
4242 }
4243#line 203 "prism/templates/ext/prism/api_node.c.erb"
4244 case PM_INSTANCE_VARIABLE_TARGET_NODE: {
4246 VALUE argv[5];
4247
4248 // source
4249 argv[0] = source;
4250
4251 // node_id
4252 argv[1] = ULONG2NUM(node->node_id);
4253
4254 // location
4255 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4256
4257 // flags
4258 argv[3] = ULONG2NUM(node->flags);
4259
4260 // name
4261#line 239 "prism/templates/ext/prism/api_node.c.erb"
4262 assert(cast->name != 0);
4263 argv[4] = RARRAY_AREF(constants, cast->name - 1);
4264
4265 VALUE value = rb_class_new_instance(5, argv, rb_cPrismInstanceVariableTargetNode);
4266 if (freeze) rb_obj_freeze(value);
4267
4268 rb_ary_push(value_stack, value);
4269 break;
4270 }
4271#line 203 "prism/templates/ext/prism/api_node.c.erb"
4272 case PM_INSTANCE_VARIABLE_WRITE_NODE: {
4274 VALUE argv[8];
4275
4276 // source
4277 argv[0] = source;
4278
4279 // node_id
4280 argv[1] = ULONG2NUM(node->node_id);
4281
4282 // location
4283 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4284
4285 // flags
4286 argv[3] = ULONG2NUM(node->flags);
4287
4288 // name
4289#line 239 "prism/templates/ext/prism/api_node.c.erb"
4290 assert(cast->name != 0);
4291 argv[4] = RARRAY_AREF(constants, cast->name - 1);
4292
4293 // name_loc
4294#line 253 "prism/templates/ext/prism/api_node.c.erb"
4295 argv[5] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
4296
4297 // value
4298#line 226 "prism/templates/ext/prism/api_node.c.erb"
4299 argv[6] = rb_ary_pop(value_stack);
4300
4301 // operator_loc
4302#line 253 "prism/templates/ext/prism/api_node.c.erb"
4303 argv[7] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
4304
4305 VALUE value = rb_class_new_instance(8, argv, rb_cPrismInstanceVariableWriteNode);
4306 if (freeze) rb_obj_freeze(value);
4307
4308 rb_ary_push(value_stack, value);
4309 break;
4310 }
4311#line 203 "prism/templates/ext/prism/api_node.c.erb"
4312 case PM_INTEGER_NODE: {
4313 pm_integer_node_t *cast = (pm_integer_node_t *) node;
4314 VALUE argv[5];
4315
4316 // source
4317 argv[0] = source;
4318
4319 // node_id
4320 argv[1] = ULONG2NUM(node->node_id);
4321
4322 // location
4323 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4324
4325 // flags
4326 argv[3] = ULONG2NUM(node->flags);
4327
4328 // value
4329#line 265 "prism/templates/ext/prism/api_node.c.erb"
4330 argv[4] = pm_integer_new(&cast->value);
4331
4332 VALUE value = rb_class_new_instance(5, argv, rb_cPrismIntegerNode);
4333 if (freeze) rb_obj_freeze(value);
4334
4335 rb_ary_push(value_stack, value);
4336 break;
4337 }
4338#line 203 "prism/templates/ext/prism/api_node.c.erb"
4339 case PM_INTERPOLATED_MATCH_LAST_LINE_NODE: {
4341 VALUE argv[7];
4342
4343 // source
4344 argv[0] = source;
4345
4346 // node_id
4347 argv[1] = ULONG2NUM(node->node_id);
4348
4349 // location
4350 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4351
4352 // flags
4353 argv[3] = ULONG2NUM(node->flags);
4354
4355 // opening_loc
4356#line 253 "prism/templates/ext/prism/api_node.c.erb"
4357 argv[4] = pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
4358
4359 // parts
4360#line 229 "prism/templates/ext/prism/api_node.c.erb"
4361 argv[5] = rb_ary_new_capa(cast->parts.size);
4362 for (size_t index = 0; index < cast->parts.size; index++) {
4363 rb_ary_push(argv[5], rb_ary_pop(value_stack));
4364 }
4365 if (freeze) rb_obj_freeze(argv[5]);
4366
4367 // closing_loc
4368#line 253 "prism/templates/ext/prism/api_node.c.erb"
4369 argv[6] = pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
4370
4371 VALUE value = rb_class_new_instance(7, argv, rb_cPrismInterpolatedMatchLastLineNode);
4372 if (freeze) rb_obj_freeze(value);
4373
4374 rb_ary_push(value_stack, value);
4375 break;
4376 }
4377#line 203 "prism/templates/ext/prism/api_node.c.erb"
4378 case PM_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
4380 VALUE argv[7];
4381
4382 // source
4383 argv[0] = source;
4384
4385 // node_id
4386 argv[1] = ULONG2NUM(node->node_id);
4387
4388 // location
4389 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4390
4391 // flags
4392 argv[3] = ULONG2NUM(node->flags);
4393
4394 // opening_loc
4395#line 253 "prism/templates/ext/prism/api_node.c.erb"
4396 argv[4] = pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
4397
4398 // parts
4399#line 229 "prism/templates/ext/prism/api_node.c.erb"
4400 argv[5] = rb_ary_new_capa(cast->parts.size);
4401 for (size_t index = 0; index < cast->parts.size; index++) {
4402 rb_ary_push(argv[5], rb_ary_pop(value_stack));
4403 }
4404 if (freeze) rb_obj_freeze(argv[5]);
4405
4406 // closing_loc
4407#line 253 "prism/templates/ext/prism/api_node.c.erb"
4408 argv[6] = pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
4409
4410 VALUE value = rb_class_new_instance(7, argv, rb_cPrismInterpolatedRegularExpressionNode);
4411 if (freeze) rb_obj_freeze(value);
4412
4413 rb_ary_push(value_stack, value);
4414 break;
4415 }
4416#line 203 "prism/templates/ext/prism/api_node.c.erb"
4417 case PM_INTERPOLATED_STRING_NODE: {
4419 VALUE argv[7];
4420
4421 // source
4422 argv[0] = source;
4423
4424 // node_id
4425 argv[1] = ULONG2NUM(node->node_id);
4426
4427 // location
4428 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4429
4430 // flags
4431 argv[3] = ULONG2NUM(node->flags);
4432
4433 // opening_loc
4434#line 256 "prism/templates/ext/prism/api_node.c.erb"
4435 argv[4] = cast->opening_loc.length == 0 ? Qnil : pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
4436
4437 // parts
4438#line 229 "prism/templates/ext/prism/api_node.c.erb"
4439 argv[5] = rb_ary_new_capa(cast->parts.size);
4440 for (size_t index = 0; index < cast->parts.size; index++) {
4441 rb_ary_push(argv[5], rb_ary_pop(value_stack));
4442 }
4443 if (freeze) rb_obj_freeze(argv[5]);
4444
4445 // closing_loc
4446#line 256 "prism/templates/ext/prism/api_node.c.erb"
4447 argv[6] = cast->closing_loc.length == 0 ? Qnil : pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
4448
4449 VALUE value = rb_class_new_instance(7, argv, rb_cPrismInterpolatedStringNode);
4450 if (freeze) rb_obj_freeze(value);
4451
4452 rb_ary_push(value_stack, value);
4453 break;
4454 }
4455#line 203 "prism/templates/ext/prism/api_node.c.erb"
4456 case PM_INTERPOLATED_SYMBOL_NODE: {
4458 VALUE argv[7];
4459
4460 // source
4461 argv[0] = source;
4462
4463 // node_id
4464 argv[1] = ULONG2NUM(node->node_id);
4465
4466 // location
4467 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4468
4469 // flags
4470 argv[3] = ULONG2NUM(node->flags);
4471
4472 // opening_loc
4473#line 256 "prism/templates/ext/prism/api_node.c.erb"
4474 argv[4] = cast->opening_loc.length == 0 ? Qnil : pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
4475
4476 // parts
4477#line 229 "prism/templates/ext/prism/api_node.c.erb"
4478 argv[5] = rb_ary_new_capa(cast->parts.size);
4479 for (size_t index = 0; index < cast->parts.size; index++) {
4480 rb_ary_push(argv[5], rb_ary_pop(value_stack));
4481 }
4482 if (freeze) rb_obj_freeze(argv[5]);
4483
4484 // closing_loc
4485#line 256 "prism/templates/ext/prism/api_node.c.erb"
4486 argv[6] = cast->closing_loc.length == 0 ? Qnil : pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
4487
4488 VALUE value = rb_class_new_instance(7, argv, rb_cPrismInterpolatedSymbolNode);
4489 if (freeze) rb_obj_freeze(value);
4490
4491 rb_ary_push(value_stack, value);
4492 break;
4493 }
4494#line 203 "prism/templates/ext/prism/api_node.c.erb"
4495 case PM_INTERPOLATED_X_STRING_NODE: {
4497 VALUE argv[7];
4498
4499 // source
4500 argv[0] = source;
4501
4502 // node_id
4503 argv[1] = ULONG2NUM(node->node_id);
4504
4505 // location
4506 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4507
4508 // flags
4509 argv[3] = ULONG2NUM(node->flags);
4510
4511 // opening_loc
4512#line 253 "prism/templates/ext/prism/api_node.c.erb"
4513 argv[4] = pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
4514
4515 // parts
4516#line 229 "prism/templates/ext/prism/api_node.c.erb"
4517 argv[5] = rb_ary_new_capa(cast->parts.size);
4518 for (size_t index = 0; index < cast->parts.size; index++) {
4519 rb_ary_push(argv[5], rb_ary_pop(value_stack));
4520 }
4521 if (freeze) rb_obj_freeze(argv[5]);
4522
4523 // closing_loc
4524#line 253 "prism/templates/ext/prism/api_node.c.erb"
4525 argv[6] = pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
4526
4527 VALUE value = rb_class_new_instance(7, argv, rb_cPrismInterpolatedXStringNode);
4528 if (freeze) rb_obj_freeze(value);
4529
4530 rb_ary_push(value_stack, value);
4531 break;
4532 }
4533#line 203 "prism/templates/ext/prism/api_node.c.erb"
4534 case PM_IT_LOCAL_VARIABLE_READ_NODE: {
4535 VALUE argv[4];
4536
4537 // source
4538 argv[0] = source;
4539
4540 // node_id
4541 argv[1] = ULONG2NUM(node->node_id);
4542
4543 // location
4544 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4545
4546 // flags
4547 argv[3] = ULONG2NUM(node->flags);
4548
4549 VALUE value = rb_class_new_instance(4, argv, rb_cPrismItLocalVariableReadNode);
4550 if (freeze) rb_obj_freeze(value);
4551
4552 rb_ary_push(value_stack, value);
4553 break;
4554 }
4555#line 203 "prism/templates/ext/prism/api_node.c.erb"
4556 case PM_IT_PARAMETERS_NODE: {
4557 VALUE argv[4];
4558
4559 // source
4560 argv[0] = source;
4561
4562 // node_id
4563 argv[1] = ULONG2NUM(node->node_id);
4564
4565 // location
4566 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4567
4568 // flags
4569 argv[3] = ULONG2NUM(node->flags);
4570
4571 VALUE value = rb_class_new_instance(4, argv, rb_cPrismItParametersNode);
4572 if (freeze) rb_obj_freeze(value);
4573
4574 rb_ary_push(value_stack, value);
4575 break;
4576 }
4577#line 203 "prism/templates/ext/prism/api_node.c.erb"
4578 case PM_KEYWORD_HASH_NODE: {
4580 VALUE argv[5];
4581
4582 // source
4583 argv[0] = source;
4584
4585 // node_id
4586 argv[1] = ULONG2NUM(node->node_id);
4587
4588 // location
4589 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4590
4591 // flags
4592 argv[3] = ULONG2NUM(node->flags);
4593
4594 // elements
4595#line 229 "prism/templates/ext/prism/api_node.c.erb"
4596 argv[4] = rb_ary_new_capa(cast->elements.size);
4597 for (size_t index = 0; index < cast->elements.size; index++) {
4598 rb_ary_push(argv[4], rb_ary_pop(value_stack));
4599 }
4600 if (freeze) rb_obj_freeze(argv[4]);
4601
4602 VALUE value = rb_class_new_instance(5, argv, rb_cPrismKeywordHashNode);
4603 if (freeze) rb_obj_freeze(value);
4604
4605 rb_ary_push(value_stack, value);
4606 break;
4607 }
4608#line 203 "prism/templates/ext/prism/api_node.c.erb"
4609 case PM_KEYWORD_REST_PARAMETER_NODE: {
4611 VALUE argv[7];
4612
4613 // source
4614 argv[0] = source;
4615
4616 // node_id
4617 argv[1] = ULONG2NUM(node->node_id);
4618
4619 // location
4620 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4621
4622 // flags
4623 argv[3] = ULONG2NUM(node->flags);
4624
4625 // name
4626 argv[4] = cast->name == 0 ? Qnil : RARRAY_AREF(constants, cast->name - 1);
4627
4628 // name_loc
4629#line 256 "prism/templates/ext/prism/api_node.c.erb"
4630 argv[5] = cast->name_loc.length == 0 ? Qnil : pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
4631
4632 // operator_loc
4633#line 253 "prism/templates/ext/prism/api_node.c.erb"
4634 argv[6] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
4635
4636 VALUE value = rb_class_new_instance(7, argv, rb_cPrismKeywordRestParameterNode);
4637 if (freeze) rb_obj_freeze(value);
4638
4639 rb_ary_push(value_stack, value);
4640 break;
4641 }
4642#line 203 "prism/templates/ext/prism/api_node.c.erb"
4643 case PM_LAMBDA_NODE: {
4644 pm_lambda_node_t *cast = (pm_lambda_node_t *) node;
4645 VALUE argv[10];
4646
4647 // source
4648 argv[0] = source;
4649
4650 // node_id
4651 argv[1] = ULONG2NUM(node->node_id);
4652
4653 // location
4654 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4655
4656 // flags
4657 argv[3] = ULONG2NUM(node->flags);
4658
4659 // locals
4660#line 245 "prism/templates/ext/prism/api_node.c.erb"
4661 argv[4] = rb_ary_new_capa(cast->locals.size);
4662 for (size_t index = 0; index < cast->locals.size; index++) {
4663 assert(cast->locals.ids[index] != 0);
4664 rb_ary_push(argv[4], RARRAY_AREF(constants, cast->locals.ids[index] - 1));
4665 }
4666 if (freeze) rb_obj_freeze(argv[4]);
4667
4668 // operator_loc
4669#line 253 "prism/templates/ext/prism/api_node.c.erb"
4670 argv[5] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
4671
4672 // opening_loc
4673#line 253 "prism/templates/ext/prism/api_node.c.erb"
4674 argv[6] = pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
4675
4676 // closing_loc
4677#line 253 "prism/templates/ext/prism/api_node.c.erb"
4678 argv[7] = pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
4679
4680 // parameters
4681#line 226 "prism/templates/ext/prism/api_node.c.erb"
4682 argv[8] = rb_ary_pop(value_stack);
4683
4684 // body
4685#line 226 "prism/templates/ext/prism/api_node.c.erb"
4686 argv[9] = rb_ary_pop(value_stack);
4687
4688 VALUE value = rb_class_new_instance(10, argv, rb_cPrismLambdaNode);
4689 if (freeze) rb_obj_freeze(value);
4690
4691 rb_ary_push(value_stack, value);
4692 break;
4693 }
4694#line 203 "prism/templates/ext/prism/api_node.c.erb"
4695 case PM_LOCAL_VARIABLE_AND_WRITE_NODE: {
4697 VALUE argv[9];
4698
4699 // source
4700 argv[0] = source;
4701
4702 // node_id
4703 argv[1] = ULONG2NUM(node->node_id);
4704
4705 // location
4706 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4707
4708 // flags
4709 argv[3] = ULONG2NUM(node->flags);
4710
4711 // name_loc
4712#line 253 "prism/templates/ext/prism/api_node.c.erb"
4713 argv[4] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
4714
4715 // operator_loc
4716#line 253 "prism/templates/ext/prism/api_node.c.erb"
4717 argv[5] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
4718
4719 // value
4720#line 226 "prism/templates/ext/prism/api_node.c.erb"
4721 argv[6] = rb_ary_pop(value_stack);
4722
4723 // name
4724#line 239 "prism/templates/ext/prism/api_node.c.erb"
4725 assert(cast->name != 0);
4726 argv[7] = RARRAY_AREF(constants, cast->name - 1);
4727
4728 // depth
4729#line 262 "prism/templates/ext/prism/api_node.c.erb"
4730 argv[8] = ULONG2NUM(cast->depth);
4731
4732 VALUE value = rb_class_new_instance(9, argv, rb_cPrismLocalVariableAndWriteNode);
4733 if (freeze) rb_obj_freeze(value);
4734
4735 rb_ary_push(value_stack, value);
4736 break;
4737 }
4738#line 203 "prism/templates/ext/prism/api_node.c.erb"
4739 case PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
4741 VALUE argv[10];
4742
4743 // source
4744 argv[0] = source;
4745
4746 // node_id
4747 argv[1] = ULONG2NUM(node->node_id);
4748
4749 // location
4750 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4751
4752 // flags
4753 argv[3] = ULONG2NUM(node->flags);
4754
4755 // name_loc
4756#line 253 "prism/templates/ext/prism/api_node.c.erb"
4757 argv[4] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
4758
4759 // binary_operator_loc
4760#line 253 "prism/templates/ext/prism/api_node.c.erb"
4761 argv[5] = pm_location_new(cast->binary_operator_loc.start, cast->binary_operator_loc.length, source, freeze);
4762
4763 // value
4764#line 226 "prism/templates/ext/prism/api_node.c.erb"
4765 argv[6] = rb_ary_pop(value_stack);
4766
4767 // name
4768#line 239 "prism/templates/ext/prism/api_node.c.erb"
4769 assert(cast->name != 0);
4770 argv[7] = RARRAY_AREF(constants, cast->name - 1);
4771
4772 // binary_operator
4773#line 239 "prism/templates/ext/prism/api_node.c.erb"
4774 assert(cast->binary_operator != 0);
4775 argv[8] = RARRAY_AREF(constants, cast->binary_operator - 1);
4776
4777 // depth
4778#line 262 "prism/templates/ext/prism/api_node.c.erb"
4779 argv[9] = ULONG2NUM(cast->depth);
4780
4781 VALUE value = rb_class_new_instance(10, argv, rb_cPrismLocalVariableOperatorWriteNode);
4782 if (freeze) rb_obj_freeze(value);
4783
4784 rb_ary_push(value_stack, value);
4785 break;
4786 }
4787#line 203 "prism/templates/ext/prism/api_node.c.erb"
4788 case PM_LOCAL_VARIABLE_OR_WRITE_NODE: {
4790 VALUE argv[9];
4791
4792 // source
4793 argv[0] = source;
4794
4795 // node_id
4796 argv[1] = ULONG2NUM(node->node_id);
4797
4798 // location
4799 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4800
4801 // flags
4802 argv[3] = ULONG2NUM(node->flags);
4803
4804 // name_loc
4805#line 253 "prism/templates/ext/prism/api_node.c.erb"
4806 argv[4] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
4807
4808 // operator_loc
4809#line 253 "prism/templates/ext/prism/api_node.c.erb"
4810 argv[5] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
4811
4812 // value
4813#line 226 "prism/templates/ext/prism/api_node.c.erb"
4814 argv[6] = rb_ary_pop(value_stack);
4815
4816 // name
4817#line 239 "prism/templates/ext/prism/api_node.c.erb"
4818 assert(cast->name != 0);
4819 argv[7] = RARRAY_AREF(constants, cast->name - 1);
4820
4821 // depth
4822#line 262 "prism/templates/ext/prism/api_node.c.erb"
4823 argv[8] = ULONG2NUM(cast->depth);
4824
4825 VALUE value = rb_class_new_instance(9, argv, rb_cPrismLocalVariableOrWriteNode);
4826 if (freeze) rb_obj_freeze(value);
4827
4828 rb_ary_push(value_stack, value);
4829 break;
4830 }
4831#line 203 "prism/templates/ext/prism/api_node.c.erb"
4832 case PM_LOCAL_VARIABLE_READ_NODE: {
4834 VALUE argv[6];
4835
4836 // source
4837 argv[0] = source;
4838
4839 // node_id
4840 argv[1] = ULONG2NUM(node->node_id);
4841
4842 // location
4843 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4844
4845 // flags
4846 argv[3] = ULONG2NUM(node->flags);
4847
4848 // name
4849#line 239 "prism/templates/ext/prism/api_node.c.erb"
4850 assert(cast->name != 0);
4851 argv[4] = RARRAY_AREF(constants, cast->name - 1);
4852
4853 // depth
4854#line 262 "prism/templates/ext/prism/api_node.c.erb"
4855 argv[5] = ULONG2NUM(cast->depth);
4856
4857 VALUE value = rb_class_new_instance(6, argv, rb_cPrismLocalVariableReadNode);
4858 if (freeze) rb_obj_freeze(value);
4859
4860 rb_ary_push(value_stack, value);
4861 break;
4862 }
4863#line 203 "prism/templates/ext/prism/api_node.c.erb"
4864 case PM_LOCAL_VARIABLE_TARGET_NODE: {
4866 VALUE argv[6];
4867
4868 // source
4869 argv[0] = source;
4870
4871 // node_id
4872 argv[1] = ULONG2NUM(node->node_id);
4873
4874 // location
4875 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4876
4877 // flags
4878 argv[3] = ULONG2NUM(node->flags);
4879
4880 // name
4881#line 239 "prism/templates/ext/prism/api_node.c.erb"
4882 assert(cast->name != 0);
4883 argv[4] = RARRAY_AREF(constants, cast->name - 1);
4884
4885 // depth
4886#line 262 "prism/templates/ext/prism/api_node.c.erb"
4887 argv[5] = ULONG2NUM(cast->depth);
4888
4889 VALUE value = rb_class_new_instance(6, argv, rb_cPrismLocalVariableTargetNode);
4890 if (freeze) rb_obj_freeze(value);
4891
4892 rb_ary_push(value_stack, value);
4893 break;
4894 }
4895#line 203 "prism/templates/ext/prism/api_node.c.erb"
4896 case PM_LOCAL_VARIABLE_WRITE_NODE: {
4898 VALUE argv[9];
4899
4900 // source
4901 argv[0] = source;
4902
4903 // node_id
4904 argv[1] = ULONG2NUM(node->node_id);
4905
4906 // location
4907 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4908
4909 // flags
4910 argv[3] = ULONG2NUM(node->flags);
4911
4912 // name
4913#line 239 "prism/templates/ext/prism/api_node.c.erb"
4914 assert(cast->name != 0);
4915 argv[4] = RARRAY_AREF(constants, cast->name - 1);
4916
4917 // depth
4918#line 262 "prism/templates/ext/prism/api_node.c.erb"
4919 argv[5] = ULONG2NUM(cast->depth);
4920
4921 // name_loc
4922#line 253 "prism/templates/ext/prism/api_node.c.erb"
4923 argv[6] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
4924
4925 // value
4926#line 226 "prism/templates/ext/prism/api_node.c.erb"
4927 argv[7] = rb_ary_pop(value_stack);
4928
4929 // operator_loc
4930#line 253 "prism/templates/ext/prism/api_node.c.erb"
4931 argv[8] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
4932
4933 VALUE value = rb_class_new_instance(9, argv, rb_cPrismLocalVariableWriteNode);
4934 if (freeze) rb_obj_freeze(value);
4935
4936 rb_ary_push(value_stack, value);
4937 break;
4938 }
4939#line 203 "prism/templates/ext/prism/api_node.c.erb"
4940 case PM_MATCH_LAST_LINE_NODE: {
4942 VALUE argv[8];
4943
4944 // source
4945 argv[0] = source;
4946
4947 // node_id
4948 argv[1] = ULONG2NUM(node->node_id);
4949
4950 // location
4951 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4952
4953 // flags
4954 argv[3] = ULONG2NUM(node->flags);
4955
4956 // opening_loc
4957#line 253 "prism/templates/ext/prism/api_node.c.erb"
4958 argv[4] = pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
4959
4960 // content_loc
4961#line 253 "prism/templates/ext/prism/api_node.c.erb"
4962 argv[5] = pm_location_new(cast->content_loc.start, cast->content_loc.length, source, freeze);
4963
4964 // closing_loc
4965#line 253 "prism/templates/ext/prism/api_node.c.erb"
4966 argv[6] = pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
4967
4968 // unescaped
4969#line 236 "prism/templates/ext/prism/api_node.c.erb"
4970 argv[7] = pm_string_new(&cast->unescaped, encoding);
4971
4972 VALUE value = rb_class_new_instance(8, argv, rb_cPrismMatchLastLineNode);
4973 if (freeze) rb_obj_freeze(value);
4974
4975 rb_ary_push(value_stack, value);
4976 break;
4977 }
4978#line 203 "prism/templates/ext/prism/api_node.c.erb"
4979 case PM_MATCH_PREDICATE_NODE: {
4981 VALUE argv[7];
4982
4983 // source
4984 argv[0] = source;
4985
4986 // node_id
4987 argv[1] = ULONG2NUM(node->node_id);
4988
4989 // location
4990 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
4991
4992 // flags
4993 argv[3] = ULONG2NUM(node->flags);
4994
4995 // value
4996#line 226 "prism/templates/ext/prism/api_node.c.erb"
4997 argv[4] = rb_ary_pop(value_stack);
4998
4999 // pattern
5000#line 226 "prism/templates/ext/prism/api_node.c.erb"
5001 argv[5] = rb_ary_pop(value_stack);
5002
5003 // keyword_loc
5004#line 253 "prism/templates/ext/prism/api_node.c.erb"
5005 argv[6] = pm_location_new(cast->keyword_loc.start, cast->keyword_loc.length, source, freeze);
5006
5007 VALUE value = rb_class_new_instance(7, argv, rb_cPrismMatchPredicateNode);
5008 if (freeze) rb_obj_freeze(value);
5009
5010 rb_ary_push(value_stack, value);
5011 break;
5012 }
5013#line 203 "prism/templates/ext/prism/api_node.c.erb"
5014 case PM_MATCH_REQUIRED_NODE: {
5016 VALUE argv[7];
5017
5018 // source
5019 argv[0] = source;
5020
5021 // node_id
5022 argv[1] = ULONG2NUM(node->node_id);
5023
5024 // location
5025 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5026
5027 // flags
5028 argv[3] = ULONG2NUM(node->flags);
5029
5030 // value
5031#line 226 "prism/templates/ext/prism/api_node.c.erb"
5032 argv[4] = rb_ary_pop(value_stack);
5033
5034 // pattern
5035#line 226 "prism/templates/ext/prism/api_node.c.erb"
5036 argv[5] = rb_ary_pop(value_stack);
5037
5038 // operator_loc
5039#line 253 "prism/templates/ext/prism/api_node.c.erb"
5040 argv[6] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
5041
5042 VALUE value = rb_class_new_instance(7, argv, rb_cPrismMatchRequiredNode);
5043 if (freeze) rb_obj_freeze(value);
5044
5045 rb_ary_push(value_stack, value);
5046 break;
5047 }
5048#line 203 "prism/templates/ext/prism/api_node.c.erb"
5049 case PM_MATCH_WRITE_NODE: {
5051 VALUE argv[6];
5052
5053 // source
5054 argv[0] = source;
5055
5056 // node_id
5057 argv[1] = ULONG2NUM(node->node_id);
5058
5059 // location
5060 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5061
5062 // flags
5063 argv[3] = ULONG2NUM(node->flags);
5064
5065 // call
5066#line 226 "prism/templates/ext/prism/api_node.c.erb"
5067 argv[4] = rb_ary_pop(value_stack);
5068
5069 // targets
5070#line 229 "prism/templates/ext/prism/api_node.c.erb"
5071 argv[5] = rb_ary_new_capa(cast->targets.size);
5072 for (size_t index = 0; index < cast->targets.size; index++) {
5073 rb_ary_push(argv[5], rb_ary_pop(value_stack));
5074 }
5075 if (freeze) rb_obj_freeze(argv[5]);
5076
5077 VALUE value = rb_class_new_instance(6, argv, rb_cPrismMatchWriteNode);
5078 if (freeze) rb_obj_freeze(value);
5079
5080 rb_ary_push(value_stack, value);
5081 break;
5082 }
5083#line 203 "prism/templates/ext/prism/api_node.c.erb"
5084 case PM_MODULE_NODE: {
5085 pm_module_node_t *cast = (pm_module_node_t *) node;
5086 VALUE argv[10];
5087
5088 // source
5089 argv[0] = source;
5090
5091 // node_id
5092 argv[1] = ULONG2NUM(node->node_id);
5093
5094 // location
5095 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5096
5097 // flags
5098 argv[3] = ULONG2NUM(node->flags);
5099
5100 // locals
5101#line 245 "prism/templates/ext/prism/api_node.c.erb"
5102 argv[4] = rb_ary_new_capa(cast->locals.size);
5103 for (size_t index = 0; index < cast->locals.size; index++) {
5104 assert(cast->locals.ids[index] != 0);
5105 rb_ary_push(argv[4], RARRAY_AREF(constants, cast->locals.ids[index] - 1));
5106 }
5107 if (freeze) rb_obj_freeze(argv[4]);
5108
5109 // module_keyword_loc
5110#line 253 "prism/templates/ext/prism/api_node.c.erb"
5111 argv[5] = pm_location_new(cast->module_keyword_loc.start, cast->module_keyword_loc.length, source, freeze);
5112
5113 // constant_path
5114#line 226 "prism/templates/ext/prism/api_node.c.erb"
5115 argv[6] = rb_ary_pop(value_stack);
5116
5117 // body
5118#line 226 "prism/templates/ext/prism/api_node.c.erb"
5119 argv[7] = rb_ary_pop(value_stack);
5120
5121 // end_keyword_loc
5122#line 253 "prism/templates/ext/prism/api_node.c.erb"
5123 argv[8] = pm_location_new(cast->end_keyword_loc.start, cast->end_keyword_loc.length, source, freeze);
5124
5125 // name
5126#line 239 "prism/templates/ext/prism/api_node.c.erb"
5127 assert(cast->name != 0);
5128 argv[9] = RARRAY_AREF(constants, cast->name - 1);
5129
5130 VALUE value = rb_class_new_instance(10, argv, rb_cPrismModuleNode);
5131 if (freeze) rb_obj_freeze(value);
5132
5133 rb_ary_push(value_stack, value);
5134 break;
5135 }
5136#line 203 "prism/templates/ext/prism/api_node.c.erb"
5137 case PM_MULTI_TARGET_NODE: {
5139 VALUE argv[9];
5140
5141 // source
5142 argv[0] = source;
5143
5144 // node_id
5145 argv[1] = ULONG2NUM(node->node_id);
5146
5147 // location
5148 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5149
5150 // flags
5151 argv[3] = ULONG2NUM(node->flags);
5152
5153 // lefts
5154#line 229 "prism/templates/ext/prism/api_node.c.erb"
5155 argv[4] = rb_ary_new_capa(cast->lefts.size);
5156 for (size_t index = 0; index < cast->lefts.size; index++) {
5157 rb_ary_push(argv[4], rb_ary_pop(value_stack));
5158 }
5159 if (freeze) rb_obj_freeze(argv[4]);
5160
5161 // rest
5162#line 226 "prism/templates/ext/prism/api_node.c.erb"
5163 argv[5] = rb_ary_pop(value_stack);
5164
5165 // rights
5166#line 229 "prism/templates/ext/prism/api_node.c.erb"
5167 argv[6] = rb_ary_new_capa(cast->rights.size);
5168 for (size_t index = 0; index < cast->rights.size; index++) {
5169 rb_ary_push(argv[6], rb_ary_pop(value_stack));
5170 }
5171 if (freeze) rb_obj_freeze(argv[6]);
5172
5173 // lparen_loc
5174#line 256 "prism/templates/ext/prism/api_node.c.erb"
5175 argv[7] = cast->lparen_loc.length == 0 ? Qnil : pm_location_new(cast->lparen_loc.start, cast->lparen_loc.length, source, freeze);
5176
5177 // rparen_loc
5178#line 256 "prism/templates/ext/prism/api_node.c.erb"
5179 argv[8] = cast->rparen_loc.length == 0 ? Qnil : pm_location_new(cast->rparen_loc.start, cast->rparen_loc.length, source, freeze);
5180
5181 VALUE value = rb_class_new_instance(9, argv, rb_cPrismMultiTargetNode);
5182 if (freeze) rb_obj_freeze(value);
5183
5184 rb_ary_push(value_stack, value);
5185 break;
5186 }
5187#line 203 "prism/templates/ext/prism/api_node.c.erb"
5188 case PM_MULTI_WRITE_NODE: {
5190 VALUE argv[11];
5191
5192 // source
5193 argv[0] = source;
5194
5195 // node_id
5196 argv[1] = ULONG2NUM(node->node_id);
5197
5198 // location
5199 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5200
5201 // flags
5202 argv[3] = ULONG2NUM(node->flags);
5203
5204 // lefts
5205#line 229 "prism/templates/ext/prism/api_node.c.erb"
5206 argv[4] = rb_ary_new_capa(cast->lefts.size);
5207 for (size_t index = 0; index < cast->lefts.size; index++) {
5208 rb_ary_push(argv[4], rb_ary_pop(value_stack));
5209 }
5210 if (freeze) rb_obj_freeze(argv[4]);
5211
5212 // rest
5213#line 226 "prism/templates/ext/prism/api_node.c.erb"
5214 argv[5] = rb_ary_pop(value_stack);
5215
5216 // rights
5217#line 229 "prism/templates/ext/prism/api_node.c.erb"
5218 argv[6] = rb_ary_new_capa(cast->rights.size);
5219 for (size_t index = 0; index < cast->rights.size; index++) {
5220 rb_ary_push(argv[6], rb_ary_pop(value_stack));
5221 }
5222 if (freeze) rb_obj_freeze(argv[6]);
5223
5224 // lparen_loc
5225#line 256 "prism/templates/ext/prism/api_node.c.erb"
5226 argv[7] = cast->lparen_loc.length == 0 ? Qnil : pm_location_new(cast->lparen_loc.start, cast->lparen_loc.length, source, freeze);
5227
5228 // rparen_loc
5229#line 256 "prism/templates/ext/prism/api_node.c.erb"
5230 argv[8] = cast->rparen_loc.length == 0 ? Qnil : pm_location_new(cast->rparen_loc.start, cast->rparen_loc.length, source, freeze);
5231
5232 // operator_loc
5233#line 253 "prism/templates/ext/prism/api_node.c.erb"
5234 argv[9] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
5235
5236 // value
5237#line 226 "prism/templates/ext/prism/api_node.c.erb"
5238 argv[10] = rb_ary_pop(value_stack);
5239
5240 VALUE value = rb_class_new_instance(11, argv, rb_cPrismMultiWriteNode);
5241 if (freeze) rb_obj_freeze(value);
5242
5243 rb_ary_push(value_stack, value);
5244 break;
5245 }
5246#line 203 "prism/templates/ext/prism/api_node.c.erb"
5247 case PM_NEXT_NODE: {
5248 pm_next_node_t *cast = (pm_next_node_t *) node;
5249 VALUE argv[6];
5250
5251 // source
5252 argv[0] = source;
5253
5254 // node_id
5255 argv[1] = ULONG2NUM(node->node_id);
5256
5257 // location
5258 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5259
5260 // flags
5261 argv[3] = ULONG2NUM(node->flags);
5262
5263 // arguments
5264#line 226 "prism/templates/ext/prism/api_node.c.erb"
5265 argv[4] = rb_ary_pop(value_stack);
5266
5267 // keyword_loc
5268#line 253 "prism/templates/ext/prism/api_node.c.erb"
5269 argv[5] = pm_location_new(cast->keyword_loc.start, cast->keyword_loc.length, source, freeze);
5270
5271 VALUE value = rb_class_new_instance(6, argv, rb_cPrismNextNode);
5272 if (freeze) rb_obj_freeze(value);
5273
5274 rb_ary_push(value_stack, value);
5275 break;
5276 }
5277#line 203 "prism/templates/ext/prism/api_node.c.erb"
5278 case PM_NIL_NODE: {
5279 VALUE argv[4];
5280
5281 // source
5282 argv[0] = source;
5283
5284 // node_id
5285 argv[1] = ULONG2NUM(node->node_id);
5286
5287 // location
5288 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5289
5290 // flags
5291 argv[3] = ULONG2NUM(node->flags);
5292
5293 VALUE value = rb_class_new_instance(4, argv, rb_cPrismNilNode);
5294 if (freeze) rb_obj_freeze(value);
5295
5296 rb_ary_push(value_stack, value);
5297 break;
5298 }
5299#line 203 "prism/templates/ext/prism/api_node.c.erb"
5300 case PM_NO_BLOCK_PARAMETER_NODE: {
5302 VALUE argv[6];
5303
5304 // source
5305 argv[0] = source;
5306
5307 // node_id
5308 argv[1] = ULONG2NUM(node->node_id);
5309
5310 // location
5311 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5312
5313 // flags
5314 argv[3] = ULONG2NUM(node->flags);
5315
5316 // operator_loc
5317#line 253 "prism/templates/ext/prism/api_node.c.erb"
5318 argv[4] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
5319
5320 // keyword_loc
5321#line 253 "prism/templates/ext/prism/api_node.c.erb"
5322 argv[5] = pm_location_new(cast->keyword_loc.start, cast->keyword_loc.length, source, freeze);
5323
5324 VALUE value = rb_class_new_instance(6, argv, rb_cPrismNoBlockParameterNode);
5325 if (freeze) rb_obj_freeze(value);
5326
5327 rb_ary_push(value_stack, value);
5328 break;
5329 }
5330#line 203 "prism/templates/ext/prism/api_node.c.erb"
5331 case PM_NO_KEYWORDS_PARAMETER_NODE: {
5333 VALUE argv[6];
5334
5335 // source
5336 argv[0] = source;
5337
5338 // node_id
5339 argv[1] = ULONG2NUM(node->node_id);
5340
5341 // location
5342 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5343
5344 // flags
5345 argv[3] = ULONG2NUM(node->flags);
5346
5347 // operator_loc
5348#line 253 "prism/templates/ext/prism/api_node.c.erb"
5349 argv[4] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
5350
5351 // keyword_loc
5352#line 253 "prism/templates/ext/prism/api_node.c.erb"
5353 argv[5] = pm_location_new(cast->keyword_loc.start, cast->keyword_loc.length, source, freeze);
5354
5355 VALUE value = rb_class_new_instance(6, argv, rb_cPrismNoKeywordsParameterNode);
5356 if (freeze) rb_obj_freeze(value);
5357
5358 rb_ary_push(value_stack, value);
5359 break;
5360 }
5361#line 203 "prism/templates/ext/prism/api_node.c.erb"
5362 case PM_NUMBERED_PARAMETERS_NODE: {
5364 VALUE argv[5];
5365
5366 // source
5367 argv[0] = source;
5368
5369 // node_id
5370 argv[1] = ULONG2NUM(node->node_id);
5371
5372 // location
5373 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5374
5375 // flags
5376 argv[3] = ULONG2NUM(node->flags);
5377
5378 // maximum
5379#line 259 "prism/templates/ext/prism/api_node.c.erb"
5380 argv[4] = UINT2NUM(cast->maximum);
5381
5382 VALUE value = rb_class_new_instance(5, argv, rb_cPrismNumberedParametersNode);
5383 if (freeze) rb_obj_freeze(value);
5384
5385 rb_ary_push(value_stack, value);
5386 break;
5387 }
5388#line 203 "prism/templates/ext/prism/api_node.c.erb"
5389 case PM_NUMBERED_REFERENCE_READ_NODE: {
5391 VALUE argv[5];
5392
5393 // source
5394 argv[0] = source;
5395
5396 // node_id
5397 argv[1] = ULONG2NUM(node->node_id);
5398
5399 // location
5400 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5401
5402 // flags
5403 argv[3] = ULONG2NUM(node->flags);
5404
5405 // number
5406#line 262 "prism/templates/ext/prism/api_node.c.erb"
5407 argv[4] = ULONG2NUM(cast->number);
5408
5409 VALUE value = rb_class_new_instance(5, argv, rb_cPrismNumberedReferenceReadNode);
5410 if (freeze) rb_obj_freeze(value);
5411
5412 rb_ary_push(value_stack, value);
5413 break;
5414 }
5415#line 203 "prism/templates/ext/prism/api_node.c.erb"
5416 case PM_OPTIONAL_KEYWORD_PARAMETER_NODE: {
5418 VALUE argv[7];
5419
5420 // source
5421 argv[0] = source;
5422
5423 // node_id
5424 argv[1] = ULONG2NUM(node->node_id);
5425
5426 // location
5427 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5428
5429 // flags
5430 argv[3] = ULONG2NUM(node->flags);
5431
5432 // name
5433#line 239 "prism/templates/ext/prism/api_node.c.erb"
5434 assert(cast->name != 0);
5435 argv[4] = RARRAY_AREF(constants, cast->name - 1);
5436
5437 // name_loc
5438#line 253 "prism/templates/ext/prism/api_node.c.erb"
5439 argv[5] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
5440
5441 // value
5442#line 226 "prism/templates/ext/prism/api_node.c.erb"
5443 argv[6] = rb_ary_pop(value_stack);
5444
5445 VALUE value = rb_class_new_instance(7, argv, rb_cPrismOptionalKeywordParameterNode);
5446 if (freeze) rb_obj_freeze(value);
5447
5448 rb_ary_push(value_stack, value);
5449 break;
5450 }
5451#line 203 "prism/templates/ext/prism/api_node.c.erb"
5452 case PM_OPTIONAL_PARAMETER_NODE: {
5454 VALUE argv[8];
5455
5456 // source
5457 argv[0] = source;
5458
5459 // node_id
5460 argv[1] = ULONG2NUM(node->node_id);
5461
5462 // location
5463 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5464
5465 // flags
5466 argv[3] = ULONG2NUM(node->flags);
5467
5468 // name
5469#line 239 "prism/templates/ext/prism/api_node.c.erb"
5470 assert(cast->name != 0);
5471 argv[4] = RARRAY_AREF(constants, cast->name - 1);
5472
5473 // name_loc
5474#line 253 "prism/templates/ext/prism/api_node.c.erb"
5475 argv[5] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
5476
5477 // operator_loc
5478#line 253 "prism/templates/ext/prism/api_node.c.erb"
5479 argv[6] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
5480
5481 // value
5482#line 226 "prism/templates/ext/prism/api_node.c.erb"
5483 argv[7] = rb_ary_pop(value_stack);
5484
5485 VALUE value = rb_class_new_instance(8, argv, rb_cPrismOptionalParameterNode);
5486 if (freeze) rb_obj_freeze(value);
5487
5488 rb_ary_push(value_stack, value);
5489 break;
5490 }
5491#line 203 "prism/templates/ext/prism/api_node.c.erb"
5492 case PM_OR_NODE: {
5493 pm_or_node_t *cast = (pm_or_node_t *) node;
5494 VALUE argv[7];
5495
5496 // source
5497 argv[0] = source;
5498
5499 // node_id
5500 argv[1] = ULONG2NUM(node->node_id);
5501
5502 // location
5503 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5504
5505 // flags
5506 argv[3] = ULONG2NUM(node->flags);
5507
5508 // left
5509#line 226 "prism/templates/ext/prism/api_node.c.erb"
5510 argv[4] = rb_ary_pop(value_stack);
5511
5512 // right
5513#line 226 "prism/templates/ext/prism/api_node.c.erb"
5514 argv[5] = rb_ary_pop(value_stack);
5515
5516 // operator_loc
5517#line 253 "prism/templates/ext/prism/api_node.c.erb"
5518 argv[6] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
5519
5520 VALUE value = rb_class_new_instance(7, argv, rb_cPrismOrNode);
5521 if (freeze) rb_obj_freeze(value);
5522
5523 rb_ary_push(value_stack, value);
5524 break;
5525 }
5526#line 203 "prism/templates/ext/prism/api_node.c.erb"
5527 case PM_PARAMETERS_NODE: {
5529 VALUE argv[11];
5530
5531 // source
5532 argv[0] = source;
5533
5534 // node_id
5535 argv[1] = ULONG2NUM(node->node_id);
5536
5537 // location
5538 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5539
5540 // flags
5541 argv[3] = ULONG2NUM(node->flags);
5542
5543 // requireds
5544#line 229 "prism/templates/ext/prism/api_node.c.erb"
5545 argv[4] = rb_ary_new_capa(cast->requireds.size);
5546 for (size_t index = 0; index < cast->requireds.size; index++) {
5547 rb_ary_push(argv[4], rb_ary_pop(value_stack));
5548 }
5549 if (freeze) rb_obj_freeze(argv[4]);
5550
5551 // optionals
5552#line 229 "prism/templates/ext/prism/api_node.c.erb"
5553 argv[5] = rb_ary_new_capa(cast->optionals.size);
5554 for (size_t index = 0; index < cast->optionals.size; index++) {
5555 rb_ary_push(argv[5], rb_ary_pop(value_stack));
5556 }
5557 if (freeze) rb_obj_freeze(argv[5]);
5558
5559 // rest
5560#line 226 "prism/templates/ext/prism/api_node.c.erb"
5561 argv[6] = rb_ary_pop(value_stack);
5562
5563 // posts
5564#line 229 "prism/templates/ext/prism/api_node.c.erb"
5565 argv[7] = rb_ary_new_capa(cast->posts.size);
5566 for (size_t index = 0; index < cast->posts.size; index++) {
5567 rb_ary_push(argv[7], rb_ary_pop(value_stack));
5568 }
5569 if (freeze) rb_obj_freeze(argv[7]);
5570
5571 // keywords
5572#line 229 "prism/templates/ext/prism/api_node.c.erb"
5573 argv[8] = rb_ary_new_capa(cast->keywords.size);
5574 for (size_t index = 0; index < cast->keywords.size; index++) {
5575 rb_ary_push(argv[8], rb_ary_pop(value_stack));
5576 }
5577 if (freeze) rb_obj_freeze(argv[8]);
5578
5579 // keyword_rest
5580#line 226 "prism/templates/ext/prism/api_node.c.erb"
5581 argv[9] = rb_ary_pop(value_stack);
5582
5583 // block
5584#line 226 "prism/templates/ext/prism/api_node.c.erb"
5585 argv[10] = rb_ary_pop(value_stack);
5586
5587 VALUE value = rb_class_new_instance(11, argv, rb_cPrismParametersNode);
5588 if (freeze) rb_obj_freeze(value);
5589
5590 rb_ary_push(value_stack, value);
5591 break;
5592 }
5593#line 203 "prism/templates/ext/prism/api_node.c.erb"
5594 case PM_PARENTHESES_NODE: {
5596 VALUE argv[7];
5597
5598 // source
5599 argv[0] = source;
5600
5601 // node_id
5602 argv[1] = ULONG2NUM(node->node_id);
5603
5604 // location
5605 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5606
5607 // flags
5608 argv[3] = ULONG2NUM(node->flags);
5609
5610 // body
5611#line 226 "prism/templates/ext/prism/api_node.c.erb"
5612 argv[4] = rb_ary_pop(value_stack);
5613
5614 // opening_loc
5615#line 253 "prism/templates/ext/prism/api_node.c.erb"
5616 argv[5] = pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
5617
5618 // closing_loc
5619#line 253 "prism/templates/ext/prism/api_node.c.erb"
5620 argv[6] = pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
5621
5622 VALUE value = rb_class_new_instance(7, argv, rb_cPrismParenthesesNode);
5623 if (freeze) rb_obj_freeze(value);
5624
5625 rb_ary_push(value_stack, value);
5626 break;
5627 }
5628#line 203 "prism/templates/ext/prism/api_node.c.erb"
5629 case PM_PINNED_EXPRESSION_NODE: {
5631 VALUE argv[8];
5632
5633 // source
5634 argv[0] = source;
5635
5636 // node_id
5637 argv[1] = ULONG2NUM(node->node_id);
5638
5639 // location
5640 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5641
5642 // flags
5643 argv[3] = ULONG2NUM(node->flags);
5644
5645 // expression
5646#line 226 "prism/templates/ext/prism/api_node.c.erb"
5647 argv[4] = rb_ary_pop(value_stack);
5648
5649 // operator_loc
5650#line 253 "prism/templates/ext/prism/api_node.c.erb"
5651 argv[5] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
5652
5653 // lparen_loc
5654#line 253 "prism/templates/ext/prism/api_node.c.erb"
5655 argv[6] = pm_location_new(cast->lparen_loc.start, cast->lparen_loc.length, source, freeze);
5656
5657 // rparen_loc
5658#line 253 "prism/templates/ext/prism/api_node.c.erb"
5659 argv[7] = pm_location_new(cast->rparen_loc.start, cast->rparen_loc.length, source, freeze);
5660
5661 VALUE value = rb_class_new_instance(8, argv, rb_cPrismPinnedExpressionNode);
5662 if (freeze) rb_obj_freeze(value);
5663
5664 rb_ary_push(value_stack, value);
5665 break;
5666 }
5667#line 203 "prism/templates/ext/prism/api_node.c.erb"
5668 case PM_PINNED_VARIABLE_NODE: {
5670 VALUE argv[6];
5671
5672 // source
5673 argv[0] = source;
5674
5675 // node_id
5676 argv[1] = ULONG2NUM(node->node_id);
5677
5678 // location
5679 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5680
5681 // flags
5682 argv[3] = ULONG2NUM(node->flags);
5683
5684 // variable
5685#line 226 "prism/templates/ext/prism/api_node.c.erb"
5686 argv[4] = rb_ary_pop(value_stack);
5687
5688 // operator_loc
5689#line 253 "prism/templates/ext/prism/api_node.c.erb"
5690 argv[5] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
5691
5692 VALUE value = rb_class_new_instance(6, argv, rb_cPrismPinnedVariableNode);
5693 if (freeze) rb_obj_freeze(value);
5694
5695 rb_ary_push(value_stack, value);
5696 break;
5697 }
5698#line 203 "prism/templates/ext/prism/api_node.c.erb"
5699 case PM_POST_EXECUTION_NODE: {
5701 VALUE argv[8];
5702
5703 // source
5704 argv[0] = source;
5705
5706 // node_id
5707 argv[1] = ULONG2NUM(node->node_id);
5708
5709 // location
5710 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5711
5712 // flags
5713 argv[3] = ULONG2NUM(node->flags);
5714
5715 // statements
5716#line 226 "prism/templates/ext/prism/api_node.c.erb"
5717 argv[4] = rb_ary_pop(value_stack);
5718
5719 // keyword_loc
5720#line 253 "prism/templates/ext/prism/api_node.c.erb"
5721 argv[5] = pm_location_new(cast->keyword_loc.start, cast->keyword_loc.length, source, freeze);
5722
5723 // opening_loc
5724#line 253 "prism/templates/ext/prism/api_node.c.erb"
5725 argv[6] = pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
5726
5727 // closing_loc
5728#line 253 "prism/templates/ext/prism/api_node.c.erb"
5729 argv[7] = pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
5730
5731 VALUE value = rb_class_new_instance(8, argv, rb_cPrismPostExecutionNode);
5732 if (freeze) rb_obj_freeze(value);
5733
5734 rb_ary_push(value_stack, value);
5735 break;
5736 }
5737#line 203 "prism/templates/ext/prism/api_node.c.erb"
5738 case PM_PRE_EXECUTION_NODE: {
5740 VALUE argv[8];
5741
5742 // source
5743 argv[0] = source;
5744
5745 // node_id
5746 argv[1] = ULONG2NUM(node->node_id);
5747
5748 // location
5749 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5750
5751 // flags
5752 argv[3] = ULONG2NUM(node->flags);
5753
5754 // statements
5755#line 226 "prism/templates/ext/prism/api_node.c.erb"
5756 argv[4] = rb_ary_pop(value_stack);
5757
5758 // keyword_loc
5759#line 253 "prism/templates/ext/prism/api_node.c.erb"
5760 argv[5] = pm_location_new(cast->keyword_loc.start, cast->keyword_loc.length, source, freeze);
5761
5762 // opening_loc
5763#line 253 "prism/templates/ext/prism/api_node.c.erb"
5764 argv[6] = pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
5765
5766 // closing_loc
5767#line 253 "prism/templates/ext/prism/api_node.c.erb"
5768 argv[7] = pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
5769
5770 VALUE value = rb_class_new_instance(8, argv, rb_cPrismPreExecutionNode);
5771 if (freeze) rb_obj_freeze(value);
5772
5773 rb_ary_push(value_stack, value);
5774 break;
5775 }
5776#line 203 "prism/templates/ext/prism/api_node.c.erb"
5777 case PM_PROGRAM_NODE: {
5778 pm_program_node_t *cast = (pm_program_node_t *) node;
5779 VALUE argv[6];
5780
5781 // source
5782 argv[0] = source;
5783
5784 // node_id
5785 argv[1] = ULONG2NUM(node->node_id);
5786
5787 // location
5788 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5789
5790 // flags
5791 argv[3] = ULONG2NUM(node->flags);
5792
5793 // locals
5794#line 245 "prism/templates/ext/prism/api_node.c.erb"
5795 argv[4] = rb_ary_new_capa(cast->locals.size);
5796 for (size_t index = 0; index < cast->locals.size; index++) {
5797 assert(cast->locals.ids[index] != 0);
5798 rb_ary_push(argv[4], RARRAY_AREF(constants, cast->locals.ids[index] - 1));
5799 }
5800 if (freeze) rb_obj_freeze(argv[4]);
5801
5802 // statements
5803#line 226 "prism/templates/ext/prism/api_node.c.erb"
5804 argv[5] = rb_ary_pop(value_stack);
5805
5806 VALUE value = rb_class_new_instance(6, argv, rb_cPrismProgramNode);
5807 if (freeze) rb_obj_freeze(value);
5808
5809 rb_ary_push(value_stack, value);
5810 break;
5811 }
5812#line 203 "prism/templates/ext/prism/api_node.c.erb"
5813 case PM_RANGE_NODE: {
5814 pm_range_node_t *cast = (pm_range_node_t *) node;
5815 VALUE argv[7];
5816
5817 // source
5818 argv[0] = source;
5819
5820 // node_id
5821 argv[1] = ULONG2NUM(node->node_id);
5822
5823 // location
5824 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5825
5826 // flags
5827 argv[3] = ULONG2NUM(node->flags);
5828
5829 // left
5830#line 226 "prism/templates/ext/prism/api_node.c.erb"
5831 argv[4] = rb_ary_pop(value_stack);
5832
5833 // right
5834#line 226 "prism/templates/ext/prism/api_node.c.erb"
5835 argv[5] = rb_ary_pop(value_stack);
5836
5837 // operator_loc
5838#line 253 "prism/templates/ext/prism/api_node.c.erb"
5839 argv[6] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
5840
5841 VALUE value = rb_class_new_instance(7, argv, rb_cPrismRangeNode);
5842 if (freeze) rb_obj_freeze(value);
5843
5844 rb_ary_push(value_stack, value);
5845 break;
5846 }
5847#line 203 "prism/templates/ext/prism/api_node.c.erb"
5848 case PM_RATIONAL_NODE: {
5849 pm_rational_node_t *cast = (pm_rational_node_t *) node;
5850 VALUE argv[6];
5851
5852 // source
5853 argv[0] = source;
5854
5855 // node_id
5856 argv[1] = ULONG2NUM(node->node_id);
5857
5858 // location
5859 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5860
5861 // flags
5862 argv[3] = ULONG2NUM(node->flags);
5863
5864 // numerator
5865#line 265 "prism/templates/ext/prism/api_node.c.erb"
5866 argv[4] = pm_integer_new(&cast->numerator);
5867
5868 // denominator
5869#line 265 "prism/templates/ext/prism/api_node.c.erb"
5870 argv[5] = pm_integer_new(&cast->denominator);
5871
5872 VALUE value = rb_class_new_instance(6, argv, rb_cPrismRationalNode);
5873 if (freeze) rb_obj_freeze(value);
5874
5875 rb_ary_push(value_stack, value);
5876 break;
5877 }
5878#line 203 "prism/templates/ext/prism/api_node.c.erb"
5879 case PM_REDO_NODE: {
5880 VALUE argv[4];
5881
5882 // source
5883 argv[0] = source;
5884
5885 // node_id
5886 argv[1] = ULONG2NUM(node->node_id);
5887
5888 // location
5889 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5890
5891 // flags
5892 argv[3] = ULONG2NUM(node->flags);
5893
5894 VALUE value = rb_class_new_instance(4, argv, rb_cPrismRedoNode);
5895 if (freeze) rb_obj_freeze(value);
5896
5897 rb_ary_push(value_stack, value);
5898 break;
5899 }
5900#line 203 "prism/templates/ext/prism/api_node.c.erb"
5901 case PM_REGULAR_EXPRESSION_NODE: {
5903 VALUE argv[8];
5904
5905 // source
5906 argv[0] = source;
5907
5908 // node_id
5909 argv[1] = ULONG2NUM(node->node_id);
5910
5911 // location
5912 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5913
5914 // flags
5915 argv[3] = ULONG2NUM(node->flags);
5916
5917 // opening_loc
5918#line 253 "prism/templates/ext/prism/api_node.c.erb"
5919 argv[4] = pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
5920
5921 // content_loc
5922#line 253 "prism/templates/ext/prism/api_node.c.erb"
5923 argv[5] = pm_location_new(cast->content_loc.start, cast->content_loc.length, source, freeze);
5924
5925 // closing_loc
5926#line 253 "prism/templates/ext/prism/api_node.c.erb"
5927 argv[6] = pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
5928
5929 // unescaped
5930#line 236 "prism/templates/ext/prism/api_node.c.erb"
5931 argv[7] = pm_string_new(&cast->unescaped, encoding);
5932
5933 VALUE value = rb_class_new_instance(8, argv, rb_cPrismRegularExpressionNode);
5934 if (freeze) rb_obj_freeze(value);
5935
5936 rb_ary_push(value_stack, value);
5937 break;
5938 }
5939#line 203 "prism/templates/ext/prism/api_node.c.erb"
5940 case PM_REQUIRED_KEYWORD_PARAMETER_NODE: {
5942 VALUE argv[6];
5943
5944 // source
5945 argv[0] = source;
5946
5947 // node_id
5948 argv[1] = ULONG2NUM(node->node_id);
5949
5950 // location
5951 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5952
5953 // flags
5954 argv[3] = ULONG2NUM(node->flags);
5955
5956 // name
5957#line 239 "prism/templates/ext/prism/api_node.c.erb"
5958 assert(cast->name != 0);
5959 argv[4] = RARRAY_AREF(constants, cast->name - 1);
5960
5961 // name_loc
5962#line 253 "prism/templates/ext/prism/api_node.c.erb"
5963 argv[5] = pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
5964
5965 VALUE value = rb_class_new_instance(6, argv, rb_cPrismRequiredKeywordParameterNode);
5966 if (freeze) rb_obj_freeze(value);
5967
5968 rb_ary_push(value_stack, value);
5969 break;
5970 }
5971#line 203 "prism/templates/ext/prism/api_node.c.erb"
5972 case PM_REQUIRED_PARAMETER_NODE: {
5974 VALUE argv[5];
5975
5976 // source
5977 argv[0] = source;
5978
5979 // node_id
5980 argv[1] = ULONG2NUM(node->node_id);
5981
5982 // location
5983 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
5984
5985 // flags
5986 argv[3] = ULONG2NUM(node->flags);
5987
5988 // name
5989#line 239 "prism/templates/ext/prism/api_node.c.erb"
5990 assert(cast->name != 0);
5991 argv[4] = RARRAY_AREF(constants, cast->name - 1);
5992
5993 VALUE value = rb_class_new_instance(5, argv, rb_cPrismRequiredParameterNode);
5994 if (freeze) rb_obj_freeze(value);
5995
5996 rb_ary_push(value_stack, value);
5997 break;
5998 }
5999#line 203 "prism/templates/ext/prism/api_node.c.erb"
6000 case PM_RESCUE_MODIFIER_NODE: {
6002 VALUE argv[7];
6003
6004 // source
6005 argv[0] = source;
6006
6007 // node_id
6008 argv[1] = ULONG2NUM(node->node_id);
6009
6010 // location
6011 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6012
6013 // flags
6014 argv[3] = ULONG2NUM(node->flags);
6015
6016 // expression
6017#line 226 "prism/templates/ext/prism/api_node.c.erb"
6018 argv[4] = rb_ary_pop(value_stack);
6019
6020 // keyword_loc
6021#line 253 "prism/templates/ext/prism/api_node.c.erb"
6022 argv[5] = pm_location_new(cast->keyword_loc.start, cast->keyword_loc.length, source, freeze);
6023
6024 // rescue_expression
6025#line 226 "prism/templates/ext/prism/api_node.c.erb"
6026 argv[6] = rb_ary_pop(value_stack);
6027
6028 VALUE value = rb_class_new_instance(7, argv, rb_cPrismRescueModifierNode);
6029 if (freeze) rb_obj_freeze(value);
6030
6031 rb_ary_push(value_stack, value);
6032 break;
6033 }
6034#line 203 "prism/templates/ext/prism/api_node.c.erb"
6035 case PM_RESCUE_NODE: {
6036 pm_rescue_node_t *cast = (pm_rescue_node_t *) node;
6037 VALUE argv[11];
6038
6039 // source
6040 argv[0] = source;
6041
6042 // node_id
6043 argv[1] = ULONG2NUM(node->node_id);
6044
6045 // location
6046 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6047
6048 // flags
6049 argv[3] = ULONG2NUM(node->flags);
6050
6051 // keyword_loc
6052#line 253 "prism/templates/ext/prism/api_node.c.erb"
6053 argv[4] = pm_location_new(cast->keyword_loc.start, cast->keyword_loc.length, source, freeze);
6054
6055 // exceptions
6056#line 229 "prism/templates/ext/prism/api_node.c.erb"
6057 argv[5] = rb_ary_new_capa(cast->exceptions.size);
6058 for (size_t index = 0; index < cast->exceptions.size; index++) {
6059 rb_ary_push(argv[5], rb_ary_pop(value_stack));
6060 }
6061 if (freeze) rb_obj_freeze(argv[5]);
6062
6063 // operator_loc
6064#line 256 "prism/templates/ext/prism/api_node.c.erb"
6065 argv[6] = cast->operator_loc.length == 0 ? Qnil : pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
6066
6067 // reference
6068#line 226 "prism/templates/ext/prism/api_node.c.erb"
6069 argv[7] = rb_ary_pop(value_stack);
6070
6071 // then_keyword_loc
6072#line 256 "prism/templates/ext/prism/api_node.c.erb"
6073 argv[8] = cast->then_keyword_loc.length == 0 ? Qnil : pm_location_new(cast->then_keyword_loc.start, cast->then_keyword_loc.length, source, freeze);
6074
6075 // statements
6076#line 226 "prism/templates/ext/prism/api_node.c.erb"
6077 argv[9] = rb_ary_pop(value_stack);
6078
6079 // subsequent
6080#line 226 "prism/templates/ext/prism/api_node.c.erb"
6081 argv[10] = rb_ary_pop(value_stack);
6082
6083 VALUE value = rb_class_new_instance(11, argv, rb_cPrismRescueNode);
6084 if (freeze) rb_obj_freeze(value);
6085
6086 rb_ary_push(value_stack, value);
6087 break;
6088 }
6089#line 203 "prism/templates/ext/prism/api_node.c.erb"
6090 case PM_REST_PARAMETER_NODE: {
6092 VALUE argv[7];
6093
6094 // source
6095 argv[0] = source;
6096
6097 // node_id
6098 argv[1] = ULONG2NUM(node->node_id);
6099
6100 // location
6101 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6102
6103 // flags
6104 argv[3] = ULONG2NUM(node->flags);
6105
6106 // name
6107 argv[4] = cast->name == 0 ? Qnil : RARRAY_AREF(constants, cast->name - 1);
6108
6109 // name_loc
6110#line 256 "prism/templates/ext/prism/api_node.c.erb"
6111 argv[5] = cast->name_loc.length == 0 ? Qnil : pm_location_new(cast->name_loc.start, cast->name_loc.length, source, freeze);
6112
6113 // operator_loc
6114#line 253 "prism/templates/ext/prism/api_node.c.erb"
6115 argv[6] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
6116
6117 VALUE value = rb_class_new_instance(7, argv, rb_cPrismRestParameterNode);
6118 if (freeze) rb_obj_freeze(value);
6119
6120 rb_ary_push(value_stack, value);
6121 break;
6122 }
6123#line 203 "prism/templates/ext/prism/api_node.c.erb"
6124 case PM_RETRY_NODE: {
6125 VALUE argv[4];
6126
6127 // source
6128 argv[0] = source;
6129
6130 // node_id
6131 argv[1] = ULONG2NUM(node->node_id);
6132
6133 // location
6134 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6135
6136 // flags
6137 argv[3] = ULONG2NUM(node->flags);
6138
6139 VALUE value = rb_class_new_instance(4, argv, rb_cPrismRetryNode);
6140 if (freeze) rb_obj_freeze(value);
6141
6142 rb_ary_push(value_stack, value);
6143 break;
6144 }
6145#line 203 "prism/templates/ext/prism/api_node.c.erb"
6146 case PM_RETURN_NODE: {
6147 pm_return_node_t *cast = (pm_return_node_t *) node;
6148 VALUE argv[6];
6149
6150 // source
6151 argv[0] = source;
6152
6153 // node_id
6154 argv[1] = ULONG2NUM(node->node_id);
6155
6156 // location
6157 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6158
6159 // flags
6160 argv[3] = ULONG2NUM(node->flags);
6161
6162 // keyword_loc
6163#line 253 "prism/templates/ext/prism/api_node.c.erb"
6164 argv[4] = pm_location_new(cast->keyword_loc.start, cast->keyword_loc.length, source, freeze);
6165
6166 // arguments
6167#line 226 "prism/templates/ext/prism/api_node.c.erb"
6168 argv[5] = rb_ary_pop(value_stack);
6169
6170 VALUE value = rb_class_new_instance(6, argv, rb_cPrismReturnNode);
6171 if (freeze) rb_obj_freeze(value);
6172
6173 rb_ary_push(value_stack, value);
6174 break;
6175 }
6176#line 203 "prism/templates/ext/prism/api_node.c.erb"
6177 case PM_SELF_NODE: {
6178 VALUE argv[4];
6179
6180 // source
6181 argv[0] = source;
6182
6183 // node_id
6184 argv[1] = ULONG2NUM(node->node_id);
6185
6186 // location
6187 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6188
6189 // flags
6190 argv[3] = ULONG2NUM(node->flags);
6191
6192 VALUE value = rb_class_new_instance(4, argv, rb_cPrismSelfNode);
6193 if (freeze) rb_obj_freeze(value);
6194
6195 rb_ary_push(value_stack, value);
6196 break;
6197 }
6198#line 203 "prism/templates/ext/prism/api_node.c.erb"
6199 case PM_SHAREABLE_CONSTANT_NODE: {
6200 VALUE argv[5];
6201
6202 // source
6203 argv[0] = source;
6204
6205 // node_id
6206 argv[1] = ULONG2NUM(node->node_id);
6207
6208 // location
6209 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6210
6211 // flags
6212 argv[3] = ULONG2NUM(node->flags);
6213
6214 // write
6215#line 226 "prism/templates/ext/prism/api_node.c.erb"
6216 argv[4] = rb_ary_pop(value_stack);
6217
6218 VALUE value = rb_class_new_instance(5, argv, rb_cPrismShareableConstantNode);
6219 if (freeze) rb_obj_freeze(value);
6220
6221 rb_ary_push(value_stack, value);
6222 break;
6223 }
6224#line 203 "prism/templates/ext/prism/api_node.c.erb"
6225 case PM_SINGLETON_CLASS_NODE: {
6227 VALUE argv[10];
6228
6229 // source
6230 argv[0] = source;
6231
6232 // node_id
6233 argv[1] = ULONG2NUM(node->node_id);
6234
6235 // location
6236 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6237
6238 // flags
6239 argv[3] = ULONG2NUM(node->flags);
6240
6241 // locals
6242#line 245 "prism/templates/ext/prism/api_node.c.erb"
6243 argv[4] = rb_ary_new_capa(cast->locals.size);
6244 for (size_t index = 0; index < cast->locals.size; index++) {
6245 assert(cast->locals.ids[index] != 0);
6246 rb_ary_push(argv[4], RARRAY_AREF(constants, cast->locals.ids[index] - 1));
6247 }
6248 if (freeze) rb_obj_freeze(argv[4]);
6249
6250 // class_keyword_loc
6251#line 253 "prism/templates/ext/prism/api_node.c.erb"
6252 argv[5] = pm_location_new(cast->class_keyword_loc.start, cast->class_keyword_loc.length, source, freeze);
6253
6254 // operator_loc
6255#line 253 "prism/templates/ext/prism/api_node.c.erb"
6256 argv[6] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
6257
6258 // expression
6259#line 226 "prism/templates/ext/prism/api_node.c.erb"
6260 argv[7] = rb_ary_pop(value_stack);
6261
6262 // body
6263#line 226 "prism/templates/ext/prism/api_node.c.erb"
6264 argv[8] = rb_ary_pop(value_stack);
6265
6266 // end_keyword_loc
6267#line 253 "prism/templates/ext/prism/api_node.c.erb"
6268 argv[9] = pm_location_new(cast->end_keyword_loc.start, cast->end_keyword_loc.length, source, freeze);
6269
6270 VALUE value = rb_class_new_instance(10, argv, rb_cPrismSingletonClassNode);
6271 if (freeze) rb_obj_freeze(value);
6272
6273 rb_ary_push(value_stack, value);
6274 break;
6275 }
6276#line 203 "prism/templates/ext/prism/api_node.c.erb"
6277 case PM_SOURCE_ENCODING_NODE: {
6278 VALUE argv[4];
6279
6280 // source
6281 argv[0] = source;
6282
6283 // node_id
6284 argv[1] = ULONG2NUM(node->node_id);
6285
6286 // location
6287 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6288
6289 // flags
6290 argv[3] = ULONG2NUM(node->flags);
6291
6292 VALUE value = rb_class_new_instance(4, argv, rb_cPrismSourceEncodingNode);
6293 if (freeze) rb_obj_freeze(value);
6294
6295 rb_ary_push(value_stack, value);
6296 break;
6297 }
6298#line 203 "prism/templates/ext/prism/api_node.c.erb"
6299 case PM_SOURCE_FILE_NODE: {
6301 VALUE argv[5];
6302
6303 // source
6304 argv[0] = source;
6305
6306 // node_id
6307 argv[1] = ULONG2NUM(node->node_id);
6308
6309 // location
6310 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6311
6312 // flags
6313 argv[3] = ULONG2NUM(node->flags);
6314
6315 // filepath
6316#line 236 "prism/templates/ext/prism/api_node.c.erb"
6317 argv[4] = pm_string_new(&cast->filepath, encoding);
6318
6319 VALUE value = rb_class_new_instance(5, argv, rb_cPrismSourceFileNode);
6320 if (freeze) rb_obj_freeze(value);
6321
6322 rb_ary_push(value_stack, value);
6323 break;
6324 }
6325#line 203 "prism/templates/ext/prism/api_node.c.erb"
6326 case PM_SOURCE_LINE_NODE: {
6327 VALUE argv[4];
6328
6329 // source
6330 argv[0] = source;
6331
6332 // node_id
6333 argv[1] = ULONG2NUM(node->node_id);
6334
6335 // location
6336 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6337
6338 // flags
6339 argv[3] = ULONG2NUM(node->flags);
6340
6341 VALUE value = rb_class_new_instance(4, argv, rb_cPrismSourceLineNode);
6342 if (freeze) rb_obj_freeze(value);
6343
6344 rb_ary_push(value_stack, value);
6345 break;
6346 }
6347#line 203 "prism/templates/ext/prism/api_node.c.erb"
6348 case PM_SPLAT_NODE: {
6349 pm_splat_node_t *cast = (pm_splat_node_t *) node;
6350 VALUE argv[6];
6351
6352 // source
6353 argv[0] = source;
6354
6355 // node_id
6356 argv[1] = ULONG2NUM(node->node_id);
6357
6358 // location
6359 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6360
6361 // flags
6362 argv[3] = ULONG2NUM(node->flags);
6363
6364 // operator_loc
6365#line 253 "prism/templates/ext/prism/api_node.c.erb"
6366 argv[4] = pm_location_new(cast->operator_loc.start, cast->operator_loc.length, source, freeze);
6367
6368 // expression
6369#line 226 "prism/templates/ext/prism/api_node.c.erb"
6370 argv[5] = rb_ary_pop(value_stack);
6371
6372 VALUE value = rb_class_new_instance(6, argv, rb_cPrismSplatNode);
6373 if (freeze) rb_obj_freeze(value);
6374
6375 rb_ary_push(value_stack, value);
6376 break;
6377 }
6378#line 203 "prism/templates/ext/prism/api_node.c.erb"
6379 case PM_STATEMENTS_NODE: {
6381 VALUE argv[5];
6382
6383 // source
6384 argv[0] = source;
6385
6386 // node_id
6387 argv[1] = ULONG2NUM(node->node_id);
6388
6389 // location
6390 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6391
6392 // flags
6393 argv[3] = ULONG2NUM(node->flags);
6394
6395 // body
6396#line 229 "prism/templates/ext/prism/api_node.c.erb"
6397 argv[4] = rb_ary_new_capa(cast->body.size);
6398 for (size_t index = 0; index < cast->body.size; index++) {
6399 rb_ary_push(argv[4], rb_ary_pop(value_stack));
6400 }
6401 if (freeze) rb_obj_freeze(argv[4]);
6402
6403 VALUE value = rb_class_new_instance(5, argv, rb_cPrismStatementsNode);
6404 if (freeze) rb_obj_freeze(value);
6405
6406 rb_ary_push(value_stack, value);
6407 break;
6408 }
6409#line 203 "prism/templates/ext/prism/api_node.c.erb"
6410 case PM_STRING_NODE: {
6411 pm_string_node_t *cast = (pm_string_node_t *) node;
6412 VALUE argv[8];
6413
6414 // source
6415 argv[0] = source;
6416
6417 // node_id
6418 argv[1] = ULONG2NUM(node->node_id);
6419
6420 // location
6421 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6422
6423 // flags
6424 argv[3] = ULONG2NUM(node->flags);
6425
6426 // opening_loc
6427#line 256 "prism/templates/ext/prism/api_node.c.erb"
6428 argv[4] = cast->opening_loc.length == 0 ? Qnil : pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
6429
6430 // content_loc
6431#line 253 "prism/templates/ext/prism/api_node.c.erb"
6432 argv[5] = pm_location_new(cast->content_loc.start, cast->content_loc.length, source, freeze);
6433
6434 // closing_loc
6435#line 256 "prism/templates/ext/prism/api_node.c.erb"
6436 argv[6] = cast->closing_loc.length == 0 ? Qnil : pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
6437
6438 // unescaped
6439#line 236 "prism/templates/ext/prism/api_node.c.erb"
6440 argv[7] = pm_string_new(&cast->unescaped, encoding);
6441
6442 VALUE value = rb_class_new_instance(8, argv, rb_cPrismStringNode);
6443 if (freeze) rb_obj_freeze(value);
6444
6445 rb_ary_push(value_stack, value);
6446 break;
6447 }
6448#line 203 "prism/templates/ext/prism/api_node.c.erb"
6449 case PM_SUPER_NODE: {
6450 pm_super_node_t *cast = (pm_super_node_t *) node;
6451 VALUE argv[9];
6452
6453 // source
6454 argv[0] = source;
6455
6456 // node_id
6457 argv[1] = ULONG2NUM(node->node_id);
6458
6459 // location
6460 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6461
6462 // flags
6463 argv[3] = ULONG2NUM(node->flags);
6464
6465 // keyword_loc
6466#line 253 "prism/templates/ext/prism/api_node.c.erb"
6467 argv[4] = pm_location_new(cast->keyword_loc.start, cast->keyword_loc.length, source, freeze);
6468
6469 // lparen_loc
6470#line 256 "prism/templates/ext/prism/api_node.c.erb"
6471 argv[5] = cast->lparen_loc.length == 0 ? Qnil : pm_location_new(cast->lparen_loc.start, cast->lparen_loc.length, source, freeze);
6472
6473 // arguments
6474#line 226 "prism/templates/ext/prism/api_node.c.erb"
6475 argv[6] = rb_ary_pop(value_stack);
6476
6477 // rparen_loc
6478#line 256 "prism/templates/ext/prism/api_node.c.erb"
6479 argv[7] = cast->rparen_loc.length == 0 ? Qnil : pm_location_new(cast->rparen_loc.start, cast->rparen_loc.length, source, freeze);
6480
6481 // block
6482#line 226 "prism/templates/ext/prism/api_node.c.erb"
6483 argv[8] = rb_ary_pop(value_stack);
6484
6485 VALUE value = rb_class_new_instance(9, argv, rb_cPrismSuperNode);
6486 if (freeze) rb_obj_freeze(value);
6487
6488 rb_ary_push(value_stack, value);
6489 break;
6490 }
6491#line 203 "prism/templates/ext/prism/api_node.c.erb"
6492 case PM_SYMBOL_NODE: {
6493 pm_symbol_node_t *cast = (pm_symbol_node_t *) node;
6494 VALUE argv[8];
6495
6496 // source
6497 argv[0] = source;
6498
6499 // node_id
6500 argv[1] = ULONG2NUM(node->node_id);
6501
6502 // location
6503 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6504
6505 // flags
6506 argv[3] = ULONG2NUM(node->flags);
6507
6508 // opening_loc
6509#line 256 "prism/templates/ext/prism/api_node.c.erb"
6510 argv[4] = cast->opening_loc.length == 0 ? Qnil : pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
6511
6512 // value_loc
6513#line 256 "prism/templates/ext/prism/api_node.c.erb"
6514 argv[5] = cast->value_loc.length == 0 ? Qnil : pm_location_new(cast->value_loc.start, cast->value_loc.length, source, freeze);
6515
6516 // closing_loc
6517#line 256 "prism/templates/ext/prism/api_node.c.erb"
6518 argv[6] = cast->closing_loc.length == 0 ? Qnil : pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
6519
6520 // unescaped
6521#line 236 "prism/templates/ext/prism/api_node.c.erb"
6522 argv[7] = pm_string_new(&cast->unescaped, encoding);
6523
6524 VALUE value = rb_class_new_instance(8, argv, rb_cPrismSymbolNode);
6525 if (freeze) rb_obj_freeze(value);
6526
6527 rb_ary_push(value_stack, value);
6528 break;
6529 }
6530#line 203 "prism/templates/ext/prism/api_node.c.erb"
6531 case PM_TRUE_NODE: {
6532 VALUE argv[4];
6533
6534 // source
6535 argv[0] = source;
6536
6537 // node_id
6538 argv[1] = ULONG2NUM(node->node_id);
6539
6540 // location
6541 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6542
6543 // flags
6544 argv[3] = ULONG2NUM(node->flags);
6545
6546 VALUE value = rb_class_new_instance(4, argv, rb_cPrismTrueNode);
6547 if (freeze) rb_obj_freeze(value);
6548
6549 rb_ary_push(value_stack, value);
6550 break;
6551 }
6552#line 203 "prism/templates/ext/prism/api_node.c.erb"
6553 case PM_UNDEF_NODE: {
6554 pm_undef_node_t *cast = (pm_undef_node_t *) node;
6555 VALUE argv[6];
6556
6557 // source
6558 argv[0] = source;
6559
6560 // node_id
6561 argv[1] = ULONG2NUM(node->node_id);
6562
6563 // location
6564 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6565
6566 // flags
6567 argv[3] = ULONG2NUM(node->flags);
6568
6569 // names
6570#line 229 "prism/templates/ext/prism/api_node.c.erb"
6571 argv[4] = rb_ary_new_capa(cast->names.size);
6572 for (size_t index = 0; index < cast->names.size; index++) {
6573 rb_ary_push(argv[4], rb_ary_pop(value_stack));
6574 }
6575 if (freeze) rb_obj_freeze(argv[4]);
6576
6577 // keyword_loc
6578#line 253 "prism/templates/ext/prism/api_node.c.erb"
6579 argv[5] = pm_location_new(cast->keyword_loc.start, cast->keyword_loc.length, source, freeze);
6580
6581 VALUE value = rb_class_new_instance(6, argv, rb_cPrismUndefNode);
6582 if (freeze) rb_obj_freeze(value);
6583
6584 rb_ary_push(value_stack, value);
6585 break;
6586 }
6587#line 203 "prism/templates/ext/prism/api_node.c.erb"
6588 case PM_UNLESS_NODE: {
6589 pm_unless_node_t *cast = (pm_unless_node_t *) node;
6590 VALUE argv[10];
6591
6592 // source
6593 argv[0] = source;
6594
6595 // node_id
6596 argv[1] = ULONG2NUM(node->node_id);
6597
6598 // location
6599 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6600
6601 // flags
6602 argv[3] = ULONG2NUM(node->flags);
6603
6604 // unless_keyword_loc
6605#line 253 "prism/templates/ext/prism/api_node.c.erb"
6606 argv[4] = pm_location_new(cast->unless_keyword_loc.start, cast->unless_keyword_loc.length, source, freeze);
6607
6608 // predicate
6609#line 226 "prism/templates/ext/prism/api_node.c.erb"
6610 argv[5] = rb_ary_pop(value_stack);
6611
6612 // then_keyword_loc
6613#line 256 "prism/templates/ext/prism/api_node.c.erb"
6614 argv[6] = cast->then_keyword_loc.length == 0 ? Qnil : pm_location_new(cast->then_keyword_loc.start, cast->then_keyword_loc.length, source, freeze);
6615
6616 // statements
6617#line 226 "prism/templates/ext/prism/api_node.c.erb"
6618 argv[7] = rb_ary_pop(value_stack);
6619
6620 // else_clause
6621#line 226 "prism/templates/ext/prism/api_node.c.erb"
6622 argv[8] = rb_ary_pop(value_stack);
6623
6624 // end_keyword_loc
6625#line 256 "prism/templates/ext/prism/api_node.c.erb"
6626 argv[9] = cast->end_keyword_loc.length == 0 ? Qnil : pm_location_new(cast->end_keyword_loc.start, cast->end_keyword_loc.length, source, freeze);
6627
6628 VALUE value = rb_class_new_instance(10, argv, rb_cPrismUnlessNode);
6629 if (freeze) rb_obj_freeze(value);
6630
6631 rb_ary_push(value_stack, value);
6632 break;
6633 }
6634#line 203 "prism/templates/ext/prism/api_node.c.erb"
6635 case PM_UNTIL_NODE: {
6636 pm_until_node_t *cast = (pm_until_node_t *) node;
6637 VALUE argv[9];
6638
6639 // source
6640 argv[0] = source;
6641
6642 // node_id
6643 argv[1] = ULONG2NUM(node->node_id);
6644
6645 // location
6646 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6647
6648 // flags
6649 argv[3] = ULONG2NUM(node->flags);
6650
6651 // until_keyword_loc
6652#line 253 "prism/templates/ext/prism/api_node.c.erb"
6653 argv[4] = pm_location_new(cast->until_keyword_loc.start, cast->until_keyword_loc.length, source, freeze);
6654
6655 // do_keyword_loc
6656#line 256 "prism/templates/ext/prism/api_node.c.erb"
6657 argv[5] = cast->do_keyword_loc.length == 0 ? Qnil : pm_location_new(cast->do_keyword_loc.start, cast->do_keyword_loc.length, source, freeze);
6658
6659 // end_keyword_loc
6660#line 256 "prism/templates/ext/prism/api_node.c.erb"
6661 argv[6] = cast->end_keyword_loc.length == 0 ? Qnil : pm_location_new(cast->end_keyword_loc.start, cast->end_keyword_loc.length, source, freeze);
6662
6663 // predicate
6664#line 226 "prism/templates/ext/prism/api_node.c.erb"
6665 argv[7] = rb_ary_pop(value_stack);
6666
6667 // statements
6668#line 226 "prism/templates/ext/prism/api_node.c.erb"
6669 argv[8] = rb_ary_pop(value_stack);
6670
6671 VALUE value = rb_class_new_instance(9, argv, rb_cPrismUntilNode);
6672 if (freeze) rb_obj_freeze(value);
6673
6674 rb_ary_push(value_stack, value);
6675 break;
6676 }
6677#line 203 "prism/templates/ext/prism/api_node.c.erb"
6678 case PM_WHEN_NODE: {
6679 pm_when_node_t *cast = (pm_when_node_t *) node;
6680 VALUE argv[8];
6681
6682 // source
6683 argv[0] = source;
6684
6685 // node_id
6686 argv[1] = ULONG2NUM(node->node_id);
6687
6688 // location
6689 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6690
6691 // flags
6692 argv[3] = ULONG2NUM(node->flags);
6693
6694 // when_keyword_loc
6695#line 253 "prism/templates/ext/prism/api_node.c.erb"
6696 argv[4] = pm_location_new(cast->when_keyword_loc.start, cast->when_keyword_loc.length, source, freeze);
6697
6698 // conditions
6699#line 229 "prism/templates/ext/prism/api_node.c.erb"
6700 argv[5] = rb_ary_new_capa(cast->conditions.size);
6701 for (size_t index = 0; index < cast->conditions.size; index++) {
6702 rb_ary_push(argv[5], rb_ary_pop(value_stack));
6703 }
6704 if (freeze) rb_obj_freeze(argv[5]);
6705
6706 // then_keyword_loc
6707#line 256 "prism/templates/ext/prism/api_node.c.erb"
6708 argv[6] = cast->then_keyword_loc.length == 0 ? Qnil : pm_location_new(cast->then_keyword_loc.start, cast->then_keyword_loc.length, source, freeze);
6709
6710 // statements
6711#line 226 "prism/templates/ext/prism/api_node.c.erb"
6712 argv[7] = rb_ary_pop(value_stack);
6713
6714 VALUE value = rb_class_new_instance(8, argv, rb_cPrismWhenNode);
6715 if (freeze) rb_obj_freeze(value);
6716
6717 rb_ary_push(value_stack, value);
6718 break;
6719 }
6720#line 203 "prism/templates/ext/prism/api_node.c.erb"
6721 case PM_WHILE_NODE: {
6722 pm_while_node_t *cast = (pm_while_node_t *) node;
6723 VALUE argv[9];
6724
6725 // source
6726 argv[0] = source;
6727
6728 // node_id
6729 argv[1] = ULONG2NUM(node->node_id);
6730
6731 // location
6732 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6733
6734 // flags
6735 argv[3] = ULONG2NUM(node->flags);
6736
6737 // while_keyword_loc
6738#line 253 "prism/templates/ext/prism/api_node.c.erb"
6739 argv[4] = pm_location_new(cast->while_keyword_loc.start, cast->while_keyword_loc.length, source, freeze);
6740
6741 // do_keyword_loc
6742#line 256 "prism/templates/ext/prism/api_node.c.erb"
6743 argv[5] = cast->do_keyword_loc.length == 0 ? Qnil : pm_location_new(cast->do_keyword_loc.start, cast->do_keyword_loc.length, source, freeze);
6744
6745 // end_keyword_loc
6746#line 256 "prism/templates/ext/prism/api_node.c.erb"
6747 argv[6] = cast->end_keyword_loc.length == 0 ? Qnil : pm_location_new(cast->end_keyword_loc.start, cast->end_keyword_loc.length, source, freeze);
6748
6749 // predicate
6750#line 226 "prism/templates/ext/prism/api_node.c.erb"
6751 argv[7] = rb_ary_pop(value_stack);
6752
6753 // statements
6754#line 226 "prism/templates/ext/prism/api_node.c.erb"
6755 argv[8] = rb_ary_pop(value_stack);
6756
6757 VALUE value = rb_class_new_instance(9, argv, rb_cPrismWhileNode);
6758 if (freeze) rb_obj_freeze(value);
6759
6760 rb_ary_push(value_stack, value);
6761 break;
6762 }
6763#line 203 "prism/templates/ext/prism/api_node.c.erb"
6764 case PM_X_STRING_NODE: {
6765 pm_x_string_node_t *cast = (pm_x_string_node_t *) node;
6766 VALUE argv[8];
6767
6768 // source
6769 argv[0] = source;
6770
6771 // node_id
6772 argv[1] = ULONG2NUM(node->node_id);
6773
6774 // location
6775 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6776
6777 // flags
6778 argv[3] = ULONG2NUM(node->flags);
6779
6780 // opening_loc
6781#line 253 "prism/templates/ext/prism/api_node.c.erb"
6782 argv[4] = pm_location_new(cast->opening_loc.start, cast->opening_loc.length, source, freeze);
6783
6784 // content_loc
6785#line 253 "prism/templates/ext/prism/api_node.c.erb"
6786 argv[5] = pm_location_new(cast->content_loc.start, cast->content_loc.length, source, freeze);
6787
6788 // closing_loc
6789#line 253 "prism/templates/ext/prism/api_node.c.erb"
6790 argv[6] = pm_location_new(cast->closing_loc.start, cast->closing_loc.length, source, freeze);
6791
6792 // unescaped
6793#line 236 "prism/templates/ext/prism/api_node.c.erb"
6794 argv[7] = pm_string_new(&cast->unescaped, encoding);
6795
6796 VALUE value = rb_class_new_instance(8, argv, rb_cPrismXStringNode);
6797 if (freeze) rb_obj_freeze(value);
6798
6799 rb_ary_push(value_stack, value);
6800 break;
6801 }
6802#line 203 "prism/templates/ext/prism/api_node.c.erb"
6803 case PM_YIELD_NODE: {
6804 pm_yield_node_t *cast = (pm_yield_node_t *) node;
6805 VALUE argv[8];
6806
6807 // source
6808 argv[0] = source;
6809
6810 // node_id
6811 argv[1] = ULONG2NUM(node->node_id);
6812
6813 // location
6814 argv[2] = pm_location_new(node->location.start, node->location.length, source, freeze);
6815
6816 // flags
6817 argv[3] = ULONG2NUM(node->flags);
6818
6819 // keyword_loc
6820#line 253 "prism/templates/ext/prism/api_node.c.erb"
6821 argv[4] = pm_location_new(cast->keyword_loc.start, cast->keyword_loc.length, source, freeze);
6822
6823 // lparen_loc
6824#line 256 "prism/templates/ext/prism/api_node.c.erb"
6825 argv[5] = cast->lparen_loc.length == 0 ? Qnil : pm_location_new(cast->lparen_loc.start, cast->lparen_loc.length, source, freeze);
6826
6827 // arguments
6828#line 226 "prism/templates/ext/prism/api_node.c.erb"
6829 argv[6] = rb_ary_pop(value_stack);
6830
6831 // rparen_loc
6832#line 256 "prism/templates/ext/prism/api_node.c.erb"
6833 argv[7] = cast->rparen_loc.length == 0 ? Qnil : pm_location_new(cast->rparen_loc.start, cast->rparen_loc.length, source, freeze);
6834
6835 VALUE value = rb_class_new_instance(8, argv, rb_cPrismYieldNode);
6836 if (freeze) rb_obj_freeze(value);
6837
6838 rb_ary_push(value_stack, value);
6839 break;
6840 }
6841 default:
6842 rb_raise(rb_eRuntimeError, "unknown node type: %d", PM_NODE_TYPE(node));
6843 }
6844 }
6845 }
6846
6847 pm_arena_free(node_arena);
6848 return rb_ary_pop(value_stack);
6849}
6850
6851void
6852Init_prism_api_node(void) {
6853 rb_cPrismAliasGlobalVariableNode = rb_define_class_under(rb_cPrism, "AliasGlobalVariableNode", rb_cPrismNode);
6854 rb_cPrismAliasMethodNode = rb_define_class_under(rb_cPrism, "AliasMethodNode", rb_cPrismNode);
6855 rb_cPrismAlternationPatternNode = rb_define_class_under(rb_cPrism, "AlternationPatternNode", rb_cPrismNode);
6856 rb_cPrismAndNode = rb_define_class_under(rb_cPrism, "AndNode", rb_cPrismNode);
6857 rb_cPrismArgumentsNode = rb_define_class_under(rb_cPrism, "ArgumentsNode", rb_cPrismNode);
6858 rb_cPrismArrayNode = rb_define_class_under(rb_cPrism, "ArrayNode", rb_cPrismNode);
6859 rb_cPrismArrayPatternNode = rb_define_class_under(rb_cPrism, "ArrayPatternNode", rb_cPrismNode);
6860 rb_cPrismAssocNode = rb_define_class_under(rb_cPrism, "AssocNode", rb_cPrismNode);
6861 rb_cPrismAssocSplatNode = rb_define_class_under(rb_cPrism, "AssocSplatNode", rb_cPrismNode);
6862 rb_cPrismBackReferenceReadNode = rb_define_class_under(rb_cPrism, "BackReferenceReadNode", rb_cPrismNode);
6863 rb_cPrismBeginNode = rb_define_class_under(rb_cPrism, "BeginNode", rb_cPrismNode);
6864 rb_cPrismBlockArgumentNode = rb_define_class_under(rb_cPrism, "BlockArgumentNode", rb_cPrismNode);
6865 rb_cPrismBlockLocalVariableNode = rb_define_class_under(rb_cPrism, "BlockLocalVariableNode", rb_cPrismNode);
6866 rb_cPrismBlockNode = rb_define_class_under(rb_cPrism, "BlockNode", rb_cPrismNode);
6867 rb_cPrismBlockParameterNode = rb_define_class_under(rb_cPrism, "BlockParameterNode", rb_cPrismNode);
6868 rb_cPrismBlockParametersNode = rb_define_class_under(rb_cPrism, "BlockParametersNode", rb_cPrismNode);
6869 rb_cPrismBreakNode = rb_define_class_under(rb_cPrism, "BreakNode", rb_cPrismNode);
6870 rb_cPrismCallAndWriteNode = rb_define_class_under(rb_cPrism, "CallAndWriteNode", rb_cPrismNode);
6871 rb_cPrismCallNode = rb_define_class_under(rb_cPrism, "CallNode", rb_cPrismNode);
6872 rb_cPrismCallOperatorWriteNode = rb_define_class_under(rb_cPrism, "CallOperatorWriteNode", rb_cPrismNode);
6873 rb_cPrismCallOrWriteNode = rb_define_class_under(rb_cPrism, "CallOrWriteNode", rb_cPrismNode);
6874 rb_cPrismCallTargetNode = rb_define_class_under(rb_cPrism, "CallTargetNode", rb_cPrismNode);
6875 rb_cPrismCapturePatternNode = rb_define_class_under(rb_cPrism, "CapturePatternNode", rb_cPrismNode);
6876 rb_cPrismCaseMatchNode = rb_define_class_under(rb_cPrism, "CaseMatchNode", rb_cPrismNode);
6877 rb_cPrismCaseNode = rb_define_class_under(rb_cPrism, "CaseNode", rb_cPrismNode);
6878 rb_cPrismClassNode = rb_define_class_under(rb_cPrism, "ClassNode", rb_cPrismNode);
6879 rb_cPrismClassVariableAndWriteNode = rb_define_class_under(rb_cPrism, "ClassVariableAndWriteNode", rb_cPrismNode);
6880 rb_cPrismClassVariableOperatorWriteNode = rb_define_class_under(rb_cPrism, "ClassVariableOperatorWriteNode", rb_cPrismNode);
6881 rb_cPrismClassVariableOrWriteNode = rb_define_class_under(rb_cPrism, "ClassVariableOrWriteNode", rb_cPrismNode);
6882 rb_cPrismClassVariableReadNode = rb_define_class_under(rb_cPrism, "ClassVariableReadNode", rb_cPrismNode);
6883 rb_cPrismClassVariableTargetNode = rb_define_class_under(rb_cPrism, "ClassVariableTargetNode", rb_cPrismNode);
6884 rb_cPrismClassVariableWriteNode = rb_define_class_under(rb_cPrism, "ClassVariableWriteNode", rb_cPrismNode);
6885 rb_cPrismConstantAndWriteNode = rb_define_class_under(rb_cPrism, "ConstantAndWriteNode", rb_cPrismNode);
6886 rb_cPrismConstantOperatorWriteNode = rb_define_class_under(rb_cPrism, "ConstantOperatorWriteNode", rb_cPrismNode);
6887 rb_cPrismConstantOrWriteNode = rb_define_class_under(rb_cPrism, "ConstantOrWriteNode", rb_cPrismNode);
6888 rb_cPrismConstantPathAndWriteNode = rb_define_class_under(rb_cPrism, "ConstantPathAndWriteNode", rb_cPrismNode);
6889 rb_cPrismConstantPathNode = rb_define_class_under(rb_cPrism, "ConstantPathNode", rb_cPrismNode);
6890 rb_cPrismConstantPathOperatorWriteNode = rb_define_class_under(rb_cPrism, "ConstantPathOperatorWriteNode", rb_cPrismNode);
6891 rb_cPrismConstantPathOrWriteNode = rb_define_class_under(rb_cPrism, "ConstantPathOrWriteNode", rb_cPrismNode);
6892 rb_cPrismConstantPathTargetNode = rb_define_class_under(rb_cPrism, "ConstantPathTargetNode", rb_cPrismNode);
6893 rb_cPrismConstantPathWriteNode = rb_define_class_under(rb_cPrism, "ConstantPathWriteNode", rb_cPrismNode);
6894 rb_cPrismConstantReadNode = rb_define_class_under(rb_cPrism, "ConstantReadNode", rb_cPrismNode);
6895 rb_cPrismConstantTargetNode = rb_define_class_under(rb_cPrism, "ConstantTargetNode", rb_cPrismNode);
6896 rb_cPrismConstantWriteNode = rb_define_class_under(rb_cPrism, "ConstantWriteNode", rb_cPrismNode);
6897 rb_cPrismDefNode = rb_define_class_under(rb_cPrism, "DefNode", rb_cPrismNode);
6898 rb_cPrismDefinedNode = rb_define_class_under(rb_cPrism, "DefinedNode", rb_cPrismNode);
6899 rb_cPrismElseNode = rb_define_class_under(rb_cPrism, "ElseNode", rb_cPrismNode);
6900 rb_cPrismEmbeddedStatementsNode = rb_define_class_under(rb_cPrism, "EmbeddedStatementsNode", rb_cPrismNode);
6901 rb_cPrismEmbeddedVariableNode = rb_define_class_under(rb_cPrism, "EmbeddedVariableNode", rb_cPrismNode);
6902 rb_cPrismEnsureNode = rb_define_class_under(rb_cPrism, "EnsureNode", rb_cPrismNode);
6903 rb_cPrismErrorRecoveryNode = rb_define_class_under(rb_cPrism, "ErrorRecoveryNode", rb_cPrismNode);
6904 rb_cPrismFalseNode = rb_define_class_under(rb_cPrism, "FalseNode", rb_cPrismNode);
6905 rb_cPrismFindPatternNode = rb_define_class_under(rb_cPrism, "FindPatternNode", rb_cPrismNode);
6906 rb_cPrismFlipFlopNode = rb_define_class_under(rb_cPrism, "FlipFlopNode", rb_cPrismNode);
6907 rb_cPrismFloatNode = rb_define_class_under(rb_cPrism, "FloatNode", rb_cPrismNode);
6908 rb_cPrismForNode = rb_define_class_under(rb_cPrism, "ForNode", rb_cPrismNode);
6909 rb_cPrismForwardingArgumentsNode = rb_define_class_under(rb_cPrism, "ForwardingArgumentsNode", rb_cPrismNode);
6910 rb_cPrismForwardingParameterNode = rb_define_class_under(rb_cPrism, "ForwardingParameterNode", rb_cPrismNode);
6911 rb_cPrismForwardingSuperNode = rb_define_class_under(rb_cPrism, "ForwardingSuperNode", rb_cPrismNode);
6912 rb_cPrismGlobalVariableAndWriteNode = rb_define_class_under(rb_cPrism, "GlobalVariableAndWriteNode", rb_cPrismNode);
6913 rb_cPrismGlobalVariableOperatorWriteNode = rb_define_class_under(rb_cPrism, "GlobalVariableOperatorWriteNode", rb_cPrismNode);
6914 rb_cPrismGlobalVariableOrWriteNode = rb_define_class_under(rb_cPrism, "GlobalVariableOrWriteNode", rb_cPrismNode);
6915 rb_cPrismGlobalVariableReadNode = rb_define_class_under(rb_cPrism, "GlobalVariableReadNode", rb_cPrismNode);
6916 rb_cPrismGlobalVariableTargetNode = rb_define_class_under(rb_cPrism, "GlobalVariableTargetNode", rb_cPrismNode);
6917 rb_cPrismGlobalVariableWriteNode = rb_define_class_under(rb_cPrism, "GlobalVariableWriteNode", rb_cPrismNode);
6918 rb_cPrismHashNode = rb_define_class_under(rb_cPrism, "HashNode", rb_cPrismNode);
6919 rb_cPrismHashPatternNode = rb_define_class_under(rb_cPrism, "HashPatternNode", rb_cPrismNode);
6920 rb_cPrismIfNode = rb_define_class_under(rb_cPrism, "IfNode", rb_cPrismNode);
6921 rb_cPrismImaginaryNode = rb_define_class_under(rb_cPrism, "ImaginaryNode", rb_cPrismNode);
6922 rb_cPrismImplicitNode = rb_define_class_under(rb_cPrism, "ImplicitNode", rb_cPrismNode);
6923 rb_cPrismImplicitRestNode = rb_define_class_under(rb_cPrism, "ImplicitRestNode", rb_cPrismNode);
6924 rb_cPrismInNode = rb_define_class_under(rb_cPrism, "InNode", rb_cPrismNode);
6925 rb_cPrismIndexAndWriteNode = rb_define_class_under(rb_cPrism, "IndexAndWriteNode", rb_cPrismNode);
6926 rb_cPrismIndexOperatorWriteNode = rb_define_class_under(rb_cPrism, "IndexOperatorWriteNode", rb_cPrismNode);
6927 rb_cPrismIndexOrWriteNode = rb_define_class_under(rb_cPrism, "IndexOrWriteNode", rb_cPrismNode);
6928 rb_cPrismIndexTargetNode = rb_define_class_under(rb_cPrism, "IndexTargetNode", rb_cPrismNode);
6929 rb_cPrismInstanceVariableAndWriteNode = rb_define_class_under(rb_cPrism, "InstanceVariableAndWriteNode", rb_cPrismNode);
6930 rb_cPrismInstanceVariableOperatorWriteNode = rb_define_class_under(rb_cPrism, "InstanceVariableOperatorWriteNode", rb_cPrismNode);
6931 rb_cPrismInstanceVariableOrWriteNode = rb_define_class_under(rb_cPrism, "InstanceVariableOrWriteNode", rb_cPrismNode);
6932 rb_cPrismInstanceVariableReadNode = rb_define_class_under(rb_cPrism, "InstanceVariableReadNode", rb_cPrismNode);
6933 rb_cPrismInstanceVariableTargetNode = rb_define_class_under(rb_cPrism, "InstanceVariableTargetNode", rb_cPrismNode);
6934 rb_cPrismInstanceVariableWriteNode = rb_define_class_under(rb_cPrism, "InstanceVariableWriteNode", rb_cPrismNode);
6935 rb_cPrismIntegerNode = rb_define_class_under(rb_cPrism, "IntegerNode", rb_cPrismNode);
6936 rb_cPrismInterpolatedMatchLastLineNode = rb_define_class_under(rb_cPrism, "InterpolatedMatchLastLineNode", rb_cPrismNode);
6937 rb_cPrismInterpolatedRegularExpressionNode = rb_define_class_under(rb_cPrism, "InterpolatedRegularExpressionNode", rb_cPrismNode);
6938 rb_cPrismInterpolatedStringNode = rb_define_class_under(rb_cPrism, "InterpolatedStringNode", rb_cPrismNode);
6939 rb_cPrismInterpolatedSymbolNode = rb_define_class_under(rb_cPrism, "InterpolatedSymbolNode", rb_cPrismNode);
6940 rb_cPrismInterpolatedXStringNode = rb_define_class_under(rb_cPrism, "InterpolatedXStringNode", rb_cPrismNode);
6941 rb_cPrismItLocalVariableReadNode = rb_define_class_under(rb_cPrism, "ItLocalVariableReadNode", rb_cPrismNode);
6942 rb_cPrismItParametersNode = rb_define_class_under(rb_cPrism, "ItParametersNode", rb_cPrismNode);
6943 rb_cPrismKeywordHashNode = rb_define_class_under(rb_cPrism, "KeywordHashNode", rb_cPrismNode);
6944 rb_cPrismKeywordRestParameterNode = rb_define_class_under(rb_cPrism, "KeywordRestParameterNode", rb_cPrismNode);
6945 rb_cPrismLambdaNode = rb_define_class_under(rb_cPrism, "LambdaNode", rb_cPrismNode);
6946 rb_cPrismLocalVariableAndWriteNode = rb_define_class_under(rb_cPrism, "LocalVariableAndWriteNode", rb_cPrismNode);
6947 rb_cPrismLocalVariableOperatorWriteNode = rb_define_class_under(rb_cPrism, "LocalVariableOperatorWriteNode", rb_cPrismNode);
6948 rb_cPrismLocalVariableOrWriteNode = rb_define_class_under(rb_cPrism, "LocalVariableOrWriteNode", rb_cPrismNode);
6949 rb_cPrismLocalVariableReadNode = rb_define_class_under(rb_cPrism, "LocalVariableReadNode", rb_cPrismNode);
6950 rb_cPrismLocalVariableTargetNode = rb_define_class_under(rb_cPrism, "LocalVariableTargetNode", rb_cPrismNode);
6951 rb_cPrismLocalVariableWriteNode = rb_define_class_under(rb_cPrism, "LocalVariableWriteNode", rb_cPrismNode);
6952 rb_cPrismMatchLastLineNode = rb_define_class_under(rb_cPrism, "MatchLastLineNode", rb_cPrismNode);
6953 rb_cPrismMatchPredicateNode = rb_define_class_under(rb_cPrism, "MatchPredicateNode", rb_cPrismNode);
6954 rb_cPrismMatchRequiredNode = rb_define_class_under(rb_cPrism, "MatchRequiredNode", rb_cPrismNode);
6955 rb_cPrismMatchWriteNode = rb_define_class_under(rb_cPrism, "MatchWriteNode", rb_cPrismNode);
6956 rb_cPrismModuleNode = rb_define_class_under(rb_cPrism, "ModuleNode", rb_cPrismNode);
6957 rb_cPrismMultiTargetNode = rb_define_class_under(rb_cPrism, "MultiTargetNode", rb_cPrismNode);
6958 rb_cPrismMultiWriteNode = rb_define_class_under(rb_cPrism, "MultiWriteNode", rb_cPrismNode);
6959 rb_cPrismNextNode = rb_define_class_under(rb_cPrism, "NextNode", rb_cPrismNode);
6960 rb_cPrismNilNode = rb_define_class_under(rb_cPrism, "NilNode", rb_cPrismNode);
6961 rb_cPrismNoBlockParameterNode = rb_define_class_under(rb_cPrism, "NoBlockParameterNode", rb_cPrismNode);
6962 rb_cPrismNoKeywordsParameterNode = rb_define_class_under(rb_cPrism, "NoKeywordsParameterNode", rb_cPrismNode);
6963 rb_cPrismNumberedParametersNode = rb_define_class_under(rb_cPrism, "NumberedParametersNode", rb_cPrismNode);
6964 rb_cPrismNumberedReferenceReadNode = rb_define_class_under(rb_cPrism, "NumberedReferenceReadNode", rb_cPrismNode);
6965 rb_cPrismOptionalKeywordParameterNode = rb_define_class_under(rb_cPrism, "OptionalKeywordParameterNode", rb_cPrismNode);
6966 rb_cPrismOptionalParameterNode = rb_define_class_under(rb_cPrism, "OptionalParameterNode", rb_cPrismNode);
6967 rb_cPrismOrNode = rb_define_class_under(rb_cPrism, "OrNode", rb_cPrismNode);
6968 rb_cPrismParametersNode = rb_define_class_under(rb_cPrism, "ParametersNode", rb_cPrismNode);
6969 rb_cPrismParenthesesNode = rb_define_class_under(rb_cPrism, "ParenthesesNode", rb_cPrismNode);
6970 rb_cPrismPinnedExpressionNode = rb_define_class_under(rb_cPrism, "PinnedExpressionNode", rb_cPrismNode);
6971 rb_cPrismPinnedVariableNode = rb_define_class_under(rb_cPrism, "PinnedVariableNode", rb_cPrismNode);
6972 rb_cPrismPostExecutionNode = rb_define_class_under(rb_cPrism, "PostExecutionNode", rb_cPrismNode);
6973 rb_cPrismPreExecutionNode = rb_define_class_under(rb_cPrism, "PreExecutionNode", rb_cPrismNode);
6974 rb_cPrismProgramNode = rb_define_class_under(rb_cPrism, "ProgramNode", rb_cPrismNode);
6975 rb_cPrismRangeNode = rb_define_class_under(rb_cPrism, "RangeNode", rb_cPrismNode);
6976 rb_cPrismRationalNode = rb_define_class_under(rb_cPrism, "RationalNode", rb_cPrismNode);
6977 rb_cPrismRedoNode = rb_define_class_under(rb_cPrism, "RedoNode", rb_cPrismNode);
6978 rb_cPrismRegularExpressionNode = rb_define_class_under(rb_cPrism, "RegularExpressionNode", rb_cPrismNode);
6979 rb_cPrismRequiredKeywordParameterNode = rb_define_class_under(rb_cPrism, "RequiredKeywordParameterNode", rb_cPrismNode);
6980 rb_cPrismRequiredParameterNode = rb_define_class_under(rb_cPrism, "RequiredParameterNode", rb_cPrismNode);
6981 rb_cPrismRescueModifierNode = rb_define_class_under(rb_cPrism, "RescueModifierNode", rb_cPrismNode);
6982 rb_cPrismRescueNode = rb_define_class_under(rb_cPrism, "RescueNode", rb_cPrismNode);
6983 rb_cPrismRestParameterNode = rb_define_class_under(rb_cPrism, "RestParameterNode", rb_cPrismNode);
6984 rb_cPrismRetryNode = rb_define_class_under(rb_cPrism, "RetryNode", rb_cPrismNode);
6985 rb_cPrismReturnNode = rb_define_class_under(rb_cPrism, "ReturnNode", rb_cPrismNode);
6986 rb_cPrismSelfNode = rb_define_class_under(rb_cPrism, "SelfNode", rb_cPrismNode);
6987 rb_cPrismShareableConstantNode = rb_define_class_under(rb_cPrism, "ShareableConstantNode", rb_cPrismNode);
6988 rb_cPrismSingletonClassNode = rb_define_class_under(rb_cPrism, "SingletonClassNode", rb_cPrismNode);
6989 rb_cPrismSourceEncodingNode = rb_define_class_under(rb_cPrism, "SourceEncodingNode", rb_cPrismNode);
6990 rb_cPrismSourceFileNode = rb_define_class_under(rb_cPrism, "SourceFileNode", rb_cPrismNode);
6991 rb_cPrismSourceLineNode = rb_define_class_under(rb_cPrism, "SourceLineNode", rb_cPrismNode);
6992 rb_cPrismSplatNode = rb_define_class_under(rb_cPrism, "SplatNode", rb_cPrismNode);
6993 rb_cPrismStatementsNode = rb_define_class_under(rb_cPrism, "StatementsNode", rb_cPrismNode);
6994 rb_cPrismStringNode = rb_define_class_under(rb_cPrism, "StringNode", rb_cPrismNode);
6995 rb_cPrismSuperNode = rb_define_class_under(rb_cPrism, "SuperNode", rb_cPrismNode);
6996 rb_cPrismSymbolNode = rb_define_class_under(rb_cPrism, "SymbolNode", rb_cPrismNode);
6997 rb_cPrismTrueNode = rb_define_class_under(rb_cPrism, "TrueNode", rb_cPrismNode);
6998 rb_cPrismUndefNode = rb_define_class_under(rb_cPrism, "UndefNode", rb_cPrismNode);
6999 rb_cPrismUnlessNode = rb_define_class_under(rb_cPrism, "UnlessNode", rb_cPrismNode);
7000 rb_cPrismUntilNode = rb_define_class_under(rb_cPrism, "UntilNode", rb_cPrismNode);
7001 rb_cPrismWhenNode = rb_define_class_under(rb_cPrism, "WhenNode", rb_cPrismNode);
7002 rb_cPrismWhileNode = rb_define_class_under(rb_cPrism, "WhileNode", rb_cPrismNode);
7003 rb_cPrismXStringNode = rb_define_class_under(rb_cPrism, "XStringNode", rb_cPrismNode);
7004 rb_cPrismYieldNode = rb_define_class_under(rb_cPrism, "YieldNode", rb_cPrismNode);
7005}
#define PRISM_ALIGNOF
Get the alignment requirement of a type.
Definition align.h:15
#define ID2SYM
Old name of RB_ID2SYM.
Definition symbol.h:44
#define ULONG2NUM
Old name of RB_ULONG2NUM.
Definition long.h:60
#define LONG2FIX
Old name of RB_INT2FIX.
Definition long.h:49
#define LONG2NUM
Old name of RB_LONG2NUM.
Definition long.h:50
#define ULL2NUM
Old name of RB_ULL2NUM.
Definition long_long.h:31
#define Qnil
Old name of RUBY_Qnil.
#define DBL2NUM
Old name of rb_float_new.
Definition double.h:29
#define UINT2NUM
Old name of RB_UINT2NUM.
Definition int.h:46
VALUE rb_eRuntimeError
RuntimeError exception.
Definition error.c:1429
VALUE rb_class_new_instance(int argc, const VALUE *argv, VALUE klass)
Allocates, then initialises an instance of the given class.
Definition object.c:2280
VALUE rb_obj_freeze(VALUE obj)
Just calls rb_obj_freeze_inline() inside.
Definition object.c:1297
VALUE rb_funcall(VALUE recv, ID mid, int n,...)
Calls a method.
Definition vm_eval.c:1123
VALUE rb_ary_new(void)
Allocates a new, empty array.
VALUE rb_ary_new_capa(long capa)
Identical to rb_ary_new(), except it additionally specifies how many rooms of objects it should alloc...
VALUE rb_ary_pop(VALUE ary)
Destructively deletes an element from the end of the passed array and returns what was deleted.
VALUE rb_ary_push(VALUE ary, VALUE elem)
Special case of rb_ary_cat() that it adds only one element.
#define rb_str_new(str, len)
Allocates an instance of rb_cString.
Definition string.h:1499
VALUE rb_str_intern(VALUE str)
Identical to rb_to_symbol(), except it assumes the receiver being an instance of RString.
Definition symbol.c:1084
static ID rb_intern_const(const char *str)
This is a "tiny optimisation" over rb_intern().
Definition symbol.h:285
VALUE type(ANYARGS)
ANYARGS-ed function type.
#define RARRAY_AREF(a, i)
Definition rarray.h:402
AliasGlobalVariableNode.
Definition ast.h:1156
PM_NODE_ALIGNAS struct pm_node * new_name
AliasGlobalVariableNode::new_name.
Definition ast.h:1168
pm_location_t keyword_loc
AliasGlobalVariableNode::keyword_loc.
Definition ast.h:1188
PM_NODE_ALIGNAS struct pm_node * old_name
AliasGlobalVariableNode::old_name.
Definition ast.h:1178
AliasMethodNode.
Definition ast.h:1203
PM_NODE_ALIGNAS struct pm_node * old_name
AliasMethodNode::old_name.
Definition ast.h:1237
pm_location_t keyword_loc
AliasMethodNode::keyword_loc.
Definition ast.h:1247
PM_NODE_ALIGNAS struct pm_node * new_name
AliasMethodNode::new_name.
Definition ast.h:1221
AlternationPatternNode.
Definition ast.h:1262
pm_location_t operator_loc
AlternationPatternNode::operator_loc.
Definition ast.h:1294
PM_NODE_ALIGNAS struct pm_node * left
AlternationPatternNode::left.
Definition ast.h:1274
PM_NODE_ALIGNAS struct pm_node * right
AlternationPatternNode::right.
Definition ast.h:1284
AndNode.
Definition ast.h:1309
PM_NODE_ALIGNAS struct pm_node * left
AndNode::left.
Definition ast.h:1324
PM_NODE_ALIGNAS struct pm_node * right
AndNode::right.
Definition ast.h:1337
pm_location_t operator_loc
AndNode::operator_loc.
Definition ast.h:1347
ArgumentsNode.
Definition ast.h:1369
struct pm_node_list arguments
ArgumentsNode::arguments.
Definition ast.h:1381
ArrayNode.
Definition ast.h:1399
pm_location_t closing_loc
ArrayNode::closing_loc.
Definition ast.h:1432
struct pm_node_list elements
ArrayNode::elements.
Definition ast.h:1408
pm_location_t opening_loc
ArrayNode::opening_loc.
Definition ast.h:1420
ArrayPatternNode.
Definition ast.h:1459
struct pm_node_list requireds
ArrayPatternNode::requireds.
Definition ast.h:1487
PM_NODE_ALIGNAS struct pm_node * rest
ArrayPatternNode::rest.
Definition ast.h:1497
PM_NODE_ALIGNAS struct pm_node * constant
ArrayPatternNode::constant.
Definition ast.h:1477
pm_location_t opening_loc
ArrayPatternNode::opening_loc.
Definition ast.h:1517
pm_location_t closing_loc
ArrayPatternNode::closing_loc.
Definition ast.h:1527
struct pm_node_list posts
ArrayPatternNode::posts.
Definition ast.h:1507
AssocNode.
Definition ast.h:1542
PM_NODE_ALIGNAS struct pm_node * value
AssocNode::value.
Definition ast.h:1573
PM_NODE_ALIGNAS struct pm_node * key
AssocNode::key.
Definition ast.h:1560
pm_location_t operator_loc
AssocNode::operator_loc.
Definition ast.h:1583
AssocSplatNode.
Definition ast.h:1598
pm_location_t operator_loc
AssocSplatNode::operator_loc.
Definition ast.h:1620
PM_NODE_ALIGNAS struct pm_node * value
AssocSplatNode::value.
Definition ast.h:1610
BackReferenceReadNode.
Definition ast.h:1635
pm_constant_id_t name
BackReferenceReadNode::name.
Definition ast.h:1648
BeginNode.
Definition ast.h:1665
PM_NODE_ALIGNAS struct pm_else_node * else_clause
BeginNode::else_clause.
Definition ast.h:1707
PM_NODE_ALIGNAS struct pm_ensure_node * ensure_clause
BeginNode::ensure_clause.
Definition ast.h:1717
PM_NODE_ALIGNAS struct pm_statements_node * statements
BeginNode::statements.
Definition ast.h:1687
PM_NODE_ALIGNAS struct pm_rescue_node * rescue_clause
BeginNode::rescue_clause.
Definition ast.h:1697
pm_location_t end_keyword_loc
BeginNode::end_keyword_loc.
Definition ast.h:1727
pm_location_t begin_keyword_loc
BeginNode::begin_keyword_loc.
Definition ast.h:1677
BlockArgumentNode.
Definition ast.h:1742
PM_NODE_ALIGNAS struct pm_node * expression
BlockArgumentNode::expression.
Definition ast.h:1754
pm_location_t operator_loc
BlockArgumentNode::operator_loc.
Definition ast.h:1764
BlockLocalVariableNode.
Definition ast.h:1782
pm_constant_id_t name
BlockLocalVariableNode::name.
Definition ast.h:1794
BlockNode.
Definition ast.h:1809
pm_location_t closing_loc
BlockNode::closing_loc.
Definition ast.h:1865
PM_NODE_ALIGNAS struct pm_node * parameters
BlockNode::parameters.
Definition ast.h:1835
pm_location_t opening_loc
BlockNode::opening_loc.
Definition ast.h:1855
pm_constant_id_list_t locals
BlockNode::locals.
Definition ast.h:1821
PM_NODE_ALIGNAS struct pm_node * body
BlockNode::body.
Definition ast.h:1845
BlockParameterNode.
Definition ast.h:1884
pm_location_t operator_loc
BlockParameterNode::operator_loc.
Definition ast.h:1918
pm_location_t name_loc
BlockParameterNode::name_loc.
Definition ast.h:1907
pm_constant_id_t name
BlockParameterNode::name.
Definition ast.h:1897
BlockParametersNode.
Definition ast.h:1937
struct pm_node_list locals
BlockParametersNode::locals.
Definition ast.h:1967
PM_NODE_ALIGNAS struct pm_parameters_node * parameters
BlockParametersNode::parameters.
Definition ast.h:1953
pm_location_t closing_loc
BlockParametersNode::closing_loc.
Definition ast.h:1995
pm_location_t opening_loc
BlockParametersNode::opening_loc.
Definition ast.h:1981
BreakNode.
Definition ast.h:2010
pm_location_t keyword_loc
BreakNode::keyword_loc.
Definition ast.h:2032
PM_NODE_ALIGNAS struct pm_arguments_node * arguments
BreakNode::arguments.
Definition ast.h:2022
CallAndWriteNode.
Definition ast.h:2053
pm_location_t operator_loc
CallAndWriteNode::operator_loc.
Definition ast.h:2115
PM_NODE_ALIGNAS struct pm_node * receiver
CallAndWriteNode::receiver.
Definition ast.h:2065
PM_NODE_ALIGNAS struct pm_node * value
CallAndWriteNode::value.
Definition ast.h:2125
pm_location_t call_operator_loc
CallAndWriteNode::call_operator_loc.
Definition ast.h:2075
pm_location_t message_loc
CallAndWriteNode::message_loc.
Definition ast.h:2085
pm_constant_id_t read_name
CallAndWriteNode::read_name.
Definition ast.h:2095
pm_constant_id_t write_name
CallAndWriteNode::write_name.
Definition ast.h:2105
CallNode.
Definition ast.h:2161
pm_location_t opening_loc
CallNode::opening_loc.
Definition ast.h:2222
pm_location_t closing_loc
CallNode::closing_loc.
Definition ast.h:2242
pm_constant_id_t name
CallNode::name.
Definition ast.h:2202
PM_NODE_ALIGNAS struct pm_arguments_node * arguments
CallNode::arguments.
Definition ast.h:2232
pm_location_t equal_loc
CallNode::equal_loc.
Definition ast.h:2255
pm_location_t call_operator_loc
CallNode::call_operator_loc.
Definition ast.h:2192
pm_location_t message_loc
CallNode::message_loc.
Definition ast.h:2212
PM_NODE_ALIGNAS struct pm_node * block
CallNode::block.
Definition ast.h:2265
PM_NODE_ALIGNAS struct pm_node * receiver
CallNode::receiver.
Definition ast.h:2179
CallOperatorWriteNode.
Definition ast.h:2286
pm_constant_id_t read_name
CallOperatorWriteNode::read_name.
Definition ast.h:2328
pm_constant_id_t binary_operator
CallOperatorWriteNode::binary_operator.
Definition ast.h:2348
pm_location_t binary_operator_loc
CallOperatorWriteNode::binary_operator_loc.
Definition ast.h:2358
pm_constant_id_t write_name
CallOperatorWriteNode::write_name.
Definition ast.h:2338
pm_location_t message_loc
CallOperatorWriteNode::message_loc.
Definition ast.h:2318
PM_NODE_ALIGNAS struct pm_node * receiver
CallOperatorWriteNode::receiver.
Definition ast.h:2298
PM_NODE_ALIGNAS struct pm_node * value
CallOperatorWriteNode::value.
Definition ast.h:2368
pm_location_t call_operator_loc
CallOperatorWriteNode::call_operator_loc.
Definition ast.h:2308
CallOrWriteNode.
Definition ast.h:2389
pm_location_t operator_loc
CallOrWriteNode::operator_loc.
Definition ast.h:2451
pm_location_t call_operator_loc
CallOrWriteNode::call_operator_loc.
Definition ast.h:2411
PM_NODE_ALIGNAS struct pm_node * receiver
CallOrWriteNode::receiver.
Definition ast.h:2401
PM_NODE_ALIGNAS struct pm_node * value
CallOrWriteNode::value.
Definition ast.h:2461
pm_constant_id_t write_name
CallOrWriteNode::write_name.
Definition ast.h:2441
pm_constant_id_t read_name
CallOrWriteNode::read_name.
Definition ast.h:2431
pm_location_t message_loc
CallOrWriteNode::message_loc.
Definition ast.h:2421
CallTargetNode.
Definition ast.h:2490
pm_constant_id_t name
CallTargetNode::name.
Definition ast.h:2522
PM_NODE_ALIGNAS struct pm_node * receiver
CallTargetNode::receiver.
Definition ast.h:2502
pm_location_t call_operator_loc
CallTargetNode::call_operator_loc.
Definition ast.h:2512
pm_location_t message_loc
CallTargetNode::message_loc.
Definition ast.h:2532
CapturePatternNode.
Definition ast.h:2547
pm_location_t operator_loc
CapturePatternNode::operator_loc.
Definition ast.h:2579
PM_NODE_ALIGNAS struct pm_node * value
CapturePatternNode::value.
Definition ast.h:2559
PM_NODE_ALIGNAS struct pm_local_variable_target_node * target
CapturePatternNode::target.
Definition ast.h:2569
CaseMatchNode.
Definition ast.h:2596
pm_location_t end_keyword_loc
CaseMatchNode::end_keyword_loc.
Definition ast.h:2648
struct pm_node_list conditions
CaseMatchNode::conditions.
Definition ast.h:2618
pm_location_t case_keyword_loc
CaseMatchNode::case_keyword_loc.
Definition ast.h:2638
PM_NODE_ALIGNAS struct pm_node * predicate
CaseMatchNode::predicate.
Definition ast.h:2608
PM_NODE_ALIGNAS struct pm_else_node * else_clause
CaseMatchNode::else_clause.
Definition ast.h:2628
CaseNode.
Definition ast.h:2665
PM_NODE_ALIGNAS struct pm_else_node * else_clause
CaseNode::else_clause.
Definition ast.h:2697
struct pm_node_list conditions
CaseNode::conditions.
Definition ast.h:2687
PM_NODE_ALIGNAS struct pm_node * predicate
CaseNode::predicate.
Definition ast.h:2677
pm_location_t case_keyword_loc
CaseNode::case_keyword_loc.
Definition ast.h:2707
pm_location_t end_keyword_loc
CaseNode::end_keyword_loc.
Definition ast.h:2717
ClassNode.
Definition ast.h:2732
pm_location_t class_keyword_loc
ClassNode::class_keyword_loc.
Definition ast.h:2749
pm_location_t end_keyword_loc
ClassNode::end_keyword_loc.
Definition ast.h:2794
pm_constant_id_list_t locals
ClassNode::locals.
Definition ast.h:2739
PM_NODE_ALIGNAS struct pm_node * superclass
ClassNode::superclass.
Definition ast.h:2774
pm_location_t inheritance_operator_loc
ClassNode::inheritance_operator_loc.
Definition ast.h:2764
pm_constant_id_t name
ClassNode::name.
Definition ast.h:2803
PM_NODE_ALIGNAS struct pm_node * constant_path
ClassNode::constant_path.
Definition ast.h:2754
PM_NODE_ALIGNAS struct pm_node * body
ClassNode::body.
Definition ast.h:2784
ClassVariableAndWriteNode.
Definition ast.h:2818
PM_NODE_ALIGNAS struct pm_node * value
ClassVariableAndWriteNode::value.
Definition ast.h:2860
pm_constant_id_t name
ClassVariableAndWriteNode::name.
Definition ast.h:2830
pm_location_t operator_loc
ClassVariableAndWriteNode::operator_loc.
Definition ast.h:2850
pm_location_t name_loc
ClassVariableAndWriteNode::name_loc.
Definition ast.h:2840
ClassVariableOperatorWriteNode.
Definition ast.h:2875
pm_constant_id_t name
ClassVariableOperatorWriteNode::name.
Definition ast.h:2882
PM_NODE_ALIGNAS struct pm_node * value
ClassVariableOperatorWriteNode::value.
Definition ast.h:2897
pm_location_t name_loc
ClassVariableOperatorWriteNode::name_loc.
Definition ast.h:2887
pm_constant_id_t binary_operator
ClassVariableOperatorWriteNode::binary_operator.
Definition ast.h:2902
pm_location_t binary_operator_loc
ClassVariableOperatorWriteNode::binary_operator_loc.
Definition ast.h:2892
ClassVariableOrWriteNode.
Definition ast.h:2917
PM_NODE_ALIGNAS struct pm_node * value
ClassVariableOrWriteNode::value.
Definition ast.h:2939
pm_location_t name_loc
ClassVariableOrWriteNode::name_loc.
Definition ast.h:2929
pm_location_t operator_loc
ClassVariableOrWriteNode::operator_loc.
Definition ast.h:2934
pm_constant_id_t name
ClassVariableOrWriteNode::name.
Definition ast.h:2924
ClassVariableReadNode.
Definition ast.h:2954
pm_constant_id_t name
ClassVariableReadNode::name.
Definition ast.h:2967
ClassVariableTargetNode.
Definition ast.h:2982
pm_constant_id_t name
ClassVariableTargetNode::name.
Definition ast.h:2989
ClassVariableWriteNode.
Definition ast.h:3004
pm_location_t name_loc
ClassVariableWriteNode::name_loc.
Definition ast.h:3027
PM_NODE_ALIGNAS struct pm_node * value
ClassVariableWriteNode::value.
Definition ast.h:3040
pm_location_t operator_loc
ClassVariableWriteNode::operator_loc.
Definition ast.h:3050
pm_constant_id_t name
ClassVariableWriteNode::name.
Definition ast.h:3017
ConstantAndWriteNode.
Definition ast.h:3065
pm_location_t operator_loc
ConstantAndWriteNode::operator_loc.
Definition ast.h:3082
PM_NODE_ALIGNAS struct pm_node * value
ConstantAndWriteNode::value.
Definition ast.h:3087
pm_location_t name_loc
ConstantAndWriteNode::name_loc.
Definition ast.h:3077
pm_constant_id_t name
ConstantAndWriteNode::name.
Definition ast.h:3072
size_t size
The number of constant ids in the list.
pm_constant_id_t * ids
The constant ids in the list.
ConstantOperatorWriteNode.
Definition ast.h:3102
pm_constant_id_t name
ConstantOperatorWriteNode::name.
Definition ast.h:3109
pm_location_t name_loc
ConstantOperatorWriteNode::name_loc.
Definition ast.h:3114
pm_constant_id_t binary_operator
ConstantOperatorWriteNode::binary_operator.
Definition ast.h:3129
pm_location_t binary_operator_loc
ConstantOperatorWriteNode::binary_operator_loc.
Definition ast.h:3119
PM_NODE_ALIGNAS struct pm_node * value
ConstantOperatorWriteNode::value.
Definition ast.h:3124
ConstantOrWriteNode.
Definition ast.h:3144
pm_location_t operator_loc
ConstantOrWriteNode::operator_loc.
Definition ast.h:3161
PM_NODE_ALIGNAS struct pm_node * value
ConstantOrWriteNode::value.
Definition ast.h:3166
pm_location_t name_loc
ConstantOrWriteNode::name_loc.
Definition ast.h:3156
pm_constant_id_t name
ConstantOrWriteNode::name.
Definition ast.h:3151
ConstantPathAndWriteNode.
Definition ast.h:3181
PM_NODE_ALIGNAS struct pm_constant_path_node * target
ConstantPathAndWriteNode::target.
Definition ast.h:3188
PM_NODE_ALIGNAS struct pm_node * value
ConstantPathAndWriteNode::value.
Definition ast.h:3198
pm_location_t operator_loc
ConstantPathAndWriteNode::operator_loc.
Definition ast.h:3193
ConstantPathNode.
Definition ast.h:3213
pm_location_t delimiter_loc
ConstantPathNode::delimiter_loc.
Definition ast.h:3251
PM_NODE_ALIGNAS struct pm_node * parent
ConstantPathNode::parent.
Definition ast.h:3231
pm_location_t name_loc
ConstantPathNode::name_loc.
Definition ast.h:3264
pm_constant_id_t name
ConstantPathNode::name.
Definition ast.h:3238
ConstantPathOperatorWriteNode.
Definition ast.h:3279
PM_NODE_ALIGNAS struct pm_constant_path_node * target
ConstantPathOperatorWriteNode::target.
Definition ast.h:3286
pm_constant_id_t binary_operator
ConstantPathOperatorWriteNode::binary_operator.
Definition ast.h:3301
pm_location_t binary_operator_loc
ConstantPathOperatorWriteNode::binary_operator_loc.
Definition ast.h:3291
PM_NODE_ALIGNAS struct pm_node * value
ConstantPathOperatorWriteNode::value.
Definition ast.h:3296
ConstantPathOrWriteNode.
Definition ast.h:3316
pm_location_t operator_loc
ConstantPathOrWriteNode::operator_loc.
Definition ast.h:3328
PM_NODE_ALIGNAS struct pm_node * value
ConstantPathOrWriteNode::value.
Definition ast.h:3333
PM_NODE_ALIGNAS struct pm_constant_path_node * target
ConstantPathOrWriteNode::target.
Definition ast.h:3323
ConstantPathTargetNode.
Definition ast.h:3348
pm_location_t delimiter_loc
ConstantPathTargetNode::delimiter_loc.
Definition ast.h:3365
pm_constant_id_t name
ConstantPathTargetNode::name.
Definition ast.h:3360
PM_NODE_ALIGNAS struct pm_node * parent
ConstantPathTargetNode::parent.
Definition ast.h:3355
pm_location_t name_loc
ConstantPathTargetNode::name_loc.
Definition ast.h:3370
ConstantPathWriteNode.
Definition ast.h:3391
PM_NODE_ALIGNAS struct pm_node * value
ConstantPathWriteNode::value.
Definition ast.h:3426
pm_location_t operator_loc
ConstantPathWriteNode::operator_loc.
Definition ast.h:3416
PM_NODE_ALIGNAS struct pm_constant_path_node * target
ConstantPathWriteNode::target.
Definition ast.h:3406
ConstantReadNode.
Definition ast.h:3441
pm_constant_id_t name
ConstantReadNode::name.
Definition ast.h:3454
ConstantTargetNode.
Definition ast.h:3469
pm_constant_id_t name
ConstantTargetNode::name.
Definition ast.h:3476
ConstantWriteNode.
Definition ast.h:3491
PM_NODE_ALIGNAS struct pm_node * value
ConstantWriteNode::value.
Definition ast.h:3527
pm_constant_id_t name
ConstantWriteNode::name.
Definition ast.h:3504
pm_location_t name_loc
ConstantWriteNode::name_loc.
Definition ast.h:3514
pm_location_t operator_loc
ConstantWriteNode::operator_loc.
Definition ast.h:3537
DefNode.
Definition ast.h:3553
pm_location_t end_keyword_loc
DefNode::end_keyword_loc.
Definition ast.h:3615
pm_constant_id_t name
DefNode::name.
Definition ast.h:3560
pm_location_t name_loc
DefNode::name_loc.
Definition ast.h:3565
pm_location_t rparen_loc
DefNode::rparen_loc.
Definition ast.h:3605
PM_NODE_ALIGNAS struct pm_parameters_node * parameters
DefNode::parameters.
Definition ast.h:3575
pm_location_t equal_loc
DefNode::equal_loc.
Definition ast.h:3610
pm_location_t def_keyword_loc
DefNode::def_keyword_loc.
Definition ast.h:3590
pm_location_t lparen_loc
DefNode::lparen_loc.
Definition ast.h:3600
PM_NODE_ALIGNAS struct pm_node * receiver
DefNode::receiver.
Definition ast.h:3570
PM_NODE_ALIGNAS struct pm_node * body
DefNode::body.
Definition ast.h:3580
pm_location_t operator_loc
DefNode::operator_loc.
Definition ast.h:3595
pm_constant_id_list_t locals
DefNode::locals.
Definition ast.h:3585
DefinedNode.
Definition ast.h:3630
PM_NODE_ALIGNAS struct pm_node * value
DefinedNode::value.
Definition ast.h:3642
pm_location_t lparen_loc
DefinedNode::lparen_loc.
Definition ast.h:3637
pm_location_t rparen_loc
DefinedNode::rparen_loc.
Definition ast.h:3647
pm_location_t keyword_loc
DefinedNode::keyword_loc.
Definition ast.h:3652
ElseNode.
Definition ast.h:3667
pm_location_t else_keyword_loc
ElseNode::else_keyword_loc.
Definition ast.h:3674
PM_NODE_ALIGNAS struct pm_statements_node * statements
ElseNode::statements.
Definition ast.h:3679
pm_location_t end_keyword_loc
ElseNode::end_keyword_loc.
Definition ast.h:3684
EmbeddedStatementsNode.
Definition ast.h:3699
PM_NODE_ALIGNAS struct pm_statements_node * statements
EmbeddedStatementsNode::statements.
Definition ast.h:3711
pm_location_t closing_loc
EmbeddedStatementsNode::closing_loc.
Definition ast.h:3716
pm_location_t opening_loc
EmbeddedStatementsNode::opening_loc.
Definition ast.h:3706
EmbeddedVariableNode.
Definition ast.h:3731
PM_NODE_ALIGNAS struct pm_node * variable
EmbeddedVariableNode::variable.
Definition ast.h:3743
pm_location_t operator_loc
EmbeddedVariableNode::operator_loc.
Definition ast.h:3738
EnsureNode.
Definition ast.h:3762
PM_NODE_ALIGNAS struct pm_statements_node * statements
EnsureNode::statements.
Definition ast.h:3774
pm_location_t ensure_keyword_loc
EnsureNode::ensure_keyword_loc.
Definition ast.h:3769
pm_location_t end_keyword_loc
EnsureNode::end_keyword_loc.
Definition ast.h:3779
ErrorRecoveryNode.
Definition ast.h:3791
PM_NODE_ALIGNAS struct pm_node * unexpected
ErrorRecoveryNode::unexpected.
Definition ast.h:3800
FindPatternNode.
Definition ast.h:3841
PM_NODE_ALIGNAS struct pm_splat_node * left
FindPatternNode::left.
Definition ast.h:3866
PM_NODE_ALIGNAS struct pm_splat_node * right
FindPatternNode::right.
Definition ast.h:3892
pm_location_t opening_loc
FindPatternNode::opening_loc.
Definition ast.h:3905
PM_NODE_ALIGNAS struct pm_node * constant
FindPatternNode::constant.
Definition ast.h:3853
struct pm_node_list requireds
FindPatternNode::requireds.
Definition ast.h:3879
pm_location_t closing_loc
FindPatternNode::closing_loc.
Definition ast.h:3918
FlipFlopNode.
Definition ast.h:3936
PM_NODE_ALIGNAS struct pm_node * left
FlipFlopNode::left.
Definition ast.h:3943
pm_location_t operator_loc
FlipFlopNode::operator_loc.
Definition ast.h:3953
PM_NODE_ALIGNAS struct pm_node * right
FlipFlopNode::right.
Definition ast.h:3948
FloatNode.
Definition ast.h:3968
double value
FloatNode::value.
Definition ast.h:3977
ForNode.
Definition ast.h:3992
PM_NODE_ALIGNAS struct pm_node * index
ForNode::index.
Definition ast.h:4004
PM_NODE_ALIGNAS struct pm_node * collection
ForNode::collection.
Definition ast.h:4014
PM_NODE_ALIGNAS struct pm_statements_node * statements
ForNode::statements.
Definition ast.h:4026
pm_location_t end_keyword_loc
ForNode::end_keyword_loc.
Definition ast.h:4066
pm_location_t for_keyword_loc
ForNode::for_keyword_loc.
Definition ast.h:4036
pm_location_t do_keyword_loc
ForNode::do_keyword_loc.
Definition ast.h:4056
pm_location_t in_keyword_loc
ForNode::in_keyword_loc.
Definition ast.h:4046
ForwardingSuperNode.
Definition ast.h:4123
PM_NODE_ALIGNAS struct pm_block_node * block
ForwardingSuperNode::block.
Definition ast.h:4143
pm_location_t keyword_loc
ForwardingSuperNode::keyword_loc.
Definition ast.h:4136
GlobalVariableAndWriteNode.
Definition ast.h:4158
pm_location_t operator_loc
GlobalVariableAndWriteNode::operator_loc.
Definition ast.h:4175
PM_NODE_ALIGNAS struct pm_node * value
GlobalVariableAndWriteNode::value.
Definition ast.h:4180
pm_location_t name_loc
GlobalVariableAndWriteNode::name_loc.
Definition ast.h:4170
pm_constant_id_t name
GlobalVariableAndWriteNode::name.
Definition ast.h:4165
GlobalVariableOperatorWriteNode.
Definition ast.h:4195
PM_NODE_ALIGNAS struct pm_node * value
GlobalVariableOperatorWriteNode::value.
Definition ast.h:4217
pm_constant_id_t name
GlobalVariableOperatorWriteNode::name.
Definition ast.h:4202
pm_constant_id_t binary_operator
GlobalVariableOperatorWriteNode::binary_operator.
Definition ast.h:4222
pm_location_t name_loc
GlobalVariableOperatorWriteNode::name_loc.
Definition ast.h:4207
pm_location_t binary_operator_loc
GlobalVariableOperatorWriteNode::binary_operator_loc.
Definition ast.h:4212
GlobalVariableOrWriteNode.
Definition ast.h:4237
pm_constant_id_t name
GlobalVariableOrWriteNode::name.
Definition ast.h:4244
pm_location_t name_loc
GlobalVariableOrWriteNode::name_loc.
Definition ast.h:4249
pm_location_t operator_loc
GlobalVariableOrWriteNode::operator_loc.
Definition ast.h:4254
PM_NODE_ALIGNAS struct pm_node * value
GlobalVariableOrWriteNode::value.
Definition ast.h:4259
GlobalVariableReadNode.
Definition ast.h:4274
pm_constant_id_t name
GlobalVariableReadNode::name.
Definition ast.h:4287
GlobalVariableTargetNode.
Definition ast.h:4302
pm_constant_id_t name
GlobalVariableTargetNode::name.
Definition ast.h:4309
GlobalVariableWriteNode.
Definition ast.h:4324
pm_location_t name_loc
GlobalVariableWriteNode::name_loc.
Definition ast.h:4347
pm_location_t operator_loc
GlobalVariableWriteNode::operator_loc.
Definition ast.h:4370
pm_constant_id_t name
GlobalVariableWriteNode::name.
Definition ast.h:4337
PM_NODE_ALIGNAS struct pm_node * value
GlobalVariableWriteNode::value.
Definition ast.h:4360
HashNode.
Definition ast.h:4385
struct pm_node_list elements
HashNode::elements.
Definition ast.h:4410
pm_location_t closing_loc
HashNode::closing_loc.
Definition ast.h:4420
pm_location_t opening_loc
HashNode::opening_loc.
Definition ast.h:4397
HashPatternNode.
Definition ast.h:4444
PM_NODE_ALIGNAS struct pm_node * constant
HashPatternNode::constant.
Definition ast.h:4459
struct pm_node_list elements
HashPatternNode::elements.
Definition ast.h:4469
pm_location_t opening_loc
HashPatternNode::opening_loc.
Definition ast.h:4498
pm_location_t closing_loc
HashPatternNode::closing_loc.
Definition ast.h:4511
PM_NODE_ALIGNAS struct pm_node * rest
HashPatternNode::rest.
Definition ast.h:4485
IfNode.
Definition ast.h:4532
PM_NODE_ALIGNAS struct pm_node * predicate
IfNode::predicate.
Definition ast.h:4564
pm_location_t end_keyword_loc
IfNode::end_keyword_loc.
Definition ast.h:4622
pm_location_t if_keyword_loc
IfNode::if_keyword_loc.
Definition ast.h:4546
PM_NODE_ALIGNAS struct pm_statements_node * statements
IfNode::statements.
Definition ast.h:4591
pm_location_t then_keyword_loc
IfNode::then_keyword_loc.
Definition ast.h:4577
PM_NODE_ALIGNAS struct pm_node * subsequent
IfNode::subsequent.
Definition ast.h:4610
ImaginaryNode.
Definition ast.h:4637
PM_NODE_ALIGNAS struct pm_node * numeric
ImaginaryNode::numeric.
Definition ast.h:4644
ImplicitNode.
Definition ast.h:4665
PM_NODE_ALIGNAS struct pm_node * value
ImplicitNode::value.
Definition ast.h:4672
InNode.
Definition ast.h:4713
pm_location_t in_keyword_loc
InNode::in_keyword_loc.
Definition ast.h:4730
PM_NODE_ALIGNAS struct pm_node * pattern
InNode::pattern.
Definition ast.h:4720
PM_NODE_ALIGNAS struct pm_statements_node * statements
InNode::statements.
Definition ast.h:4725
pm_location_t then_keyword_loc
InNode::then_keyword_loc.
Definition ast.h:4735
IndexAndWriteNode.
Definition ast.h:4756
PM_NODE_ALIGNAS struct pm_arguments_node * arguments
IndexAndWriteNode::arguments.
Definition ast.h:4778
pm_location_t operator_loc
IndexAndWriteNode::operator_loc.
Definition ast.h:4793
pm_location_t closing_loc
IndexAndWriteNode::closing_loc.
Definition ast.h:4783
pm_location_t opening_loc
IndexAndWriteNode::opening_loc.
Definition ast.h:4773
pm_location_t call_operator_loc
IndexAndWriteNode::call_operator_loc.
Definition ast.h:4768
PM_NODE_ALIGNAS struct pm_block_argument_node * block
IndexAndWriteNode::block.
Definition ast.h:4788
PM_NODE_ALIGNAS struct pm_node * receiver
IndexAndWriteNode::receiver.
Definition ast.h:4763
PM_NODE_ALIGNAS struct pm_node * value
IndexAndWriteNode::value.
Definition ast.h:4798
IndexOperatorWriteNode.
Definition ast.h:4819
PM_NODE_ALIGNAS struct pm_block_argument_node * block
IndexOperatorWriteNode::block.
Definition ast.h:4851
PM_NODE_ALIGNAS struct pm_node * receiver
IndexOperatorWriteNode::receiver.
Definition ast.h:4826
pm_location_t binary_operator_loc
IndexOperatorWriteNode::binary_operator_loc.
Definition ast.h:4861
PM_NODE_ALIGNAS struct pm_node * value
IndexOperatorWriteNode::value.
Definition ast.h:4866
pm_location_t opening_loc
IndexOperatorWriteNode::opening_loc.
Definition ast.h:4836
PM_NODE_ALIGNAS struct pm_arguments_node * arguments
IndexOperatorWriteNode::arguments.
Definition ast.h:4841
pm_location_t call_operator_loc
IndexOperatorWriteNode::call_operator_loc.
Definition ast.h:4831
pm_location_t closing_loc
IndexOperatorWriteNode::closing_loc.
Definition ast.h:4846
pm_constant_id_t binary_operator
IndexOperatorWriteNode::binary_operator.
Definition ast.h:4856
IndexOrWriteNode.
Definition ast.h:4887
pm_location_t closing_loc
IndexOrWriteNode::closing_loc.
Definition ast.h:4914
pm_location_t call_operator_loc
IndexOrWriteNode::call_operator_loc.
Definition ast.h:4899
pm_location_t operator_loc
IndexOrWriteNode::operator_loc.
Definition ast.h:4924
pm_location_t opening_loc
IndexOrWriteNode::opening_loc.
Definition ast.h:4904
PM_NODE_ALIGNAS struct pm_arguments_node * arguments
IndexOrWriteNode::arguments.
Definition ast.h:4909
PM_NODE_ALIGNAS struct pm_node * value
IndexOrWriteNode::value.
Definition ast.h:4929
PM_NODE_ALIGNAS struct pm_node * receiver
IndexOrWriteNode::receiver.
Definition ast.h:4894
PM_NODE_ALIGNAS struct pm_block_argument_node * block
IndexOrWriteNode::block.
Definition ast.h:4919
IndexTargetNode.
Definition ast.h:4958
PM_NODE_ALIGNAS struct pm_arguments_node * arguments
IndexTargetNode::arguments.
Definition ast.h:4975
pm_location_t closing_loc
IndexTargetNode::closing_loc.
Definition ast.h:4980
PM_NODE_ALIGNAS struct pm_block_argument_node * block
IndexTargetNode::block.
Definition ast.h:4985
pm_location_t opening_loc
IndexTargetNode::opening_loc.
Definition ast.h:4970
PM_NODE_ALIGNAS struct pm_node * receiver
IndexTargetNode::receiver.
Definition ast.h:4965
InstanceVariableAndWriteNode.
Definition ast.h:5000
PM_NODE_ALIGNAS struct pm_node * value
InstanceVariableAndWriteNode::value.
Definition ast.h:5022
pm_location_t operator_loc
InstanceVariableAndWriteNode::operator_loc.
Definition ast.h:5017
pm_location_t name_loc
InstanceVariableAndWriteNode::name_loc.
Definition ast.h:5012
pm_constant_id_t name
InstanceVariableAndWriteNode::name.
Definition ast.h:5007
InstanceVariableOperatorWriteNode.
Definition ast.h:5037
pm_constant_id_t binary_operator
InstanceVariableOperatorWriteNode::binary_operator.
Definition ast.h:5064
PM_NODE_ALIGNAS struct pm_node * value
InstanceVariableOperatorWriteNode::value.
Definition ast.h:5059
pm_location_t binary_operator_loc
InstanceVariableOperatorWriteNode::binary_operator_loc.
Definition ast.h:5054
pm_constant_id_t name
InstanceVariableOperatorWriteNode::name.
Definition ast.h:5044
pm_location_t name_loc
InstanceVariableOperatorWriteNode::name_loc.
Definition ast.h:5049
InstanceVariableOrWriteNode.
Definition ast.h:5079
pm_location_t operator_loc
InstanceVariableOrWriteNode::operator_loc.
Definition ast.h:5096
pm_location_t name_loc
InstanceVariableOrWriteNode::name_loc.
Definition ast.h:5091
pm_constant_id_t name
InstanceVariableOrWriteNode::name.
Definition ast.h:5086
PM_NODE_ALIGNAS struct pm_node * value
InstanceVariableOrWriteNode::value.
Definition ast.h:5101
InstanceVariableReadNode.
Definition ast.h:5116
pm_constant_id_t name
InstanceVariableReadNode::name.
Definition ast.h:5129
InstanceVariableTargetNode.
Definition ast.h:5144
pm_constant_id_t name
InstanceVariableTargetNode::name.
Definition ast.h:5151
InstanceVariableWriteNode.
Definition ast.h:5166
pm_location_t operator_loc
InstanceVariableWriteNode::operator_loc.
Definition ast.h:5212
PM_NODE_ALIGNAS struct pm_node * value
InstanceVariableWriteNode::value.
Definition ast.h:5202
pm_constant_id_t name
InstanceVariableWriteNode::name.
Definition ast.h:5179
pm_location_t name_loc
InstanceVariableWriteNode::name_loc.
Definition ast.h:5189
IntegerNode.
Definition ast.h:5233
pm_integer_t value
IntegerNode::value.
Definition ast.h:5242
A structure represents an arbitrary-sized integer.
Definition integer.h:16
size_t length
The number of allocated values.
Definition integer.h:21
uint32_t value
Embedded value for small integer.
Definition integer.h:32
uint32_t * values
List of 32-bit integers.
Definition integer.h:26
bool negative
Whether or not the integer is negative.
Definition integer.h:38
InterpolatedMatchLastLineNode.
Definition ast.h:5270
pm_location_t closing_loc
InterpolatedMatchLastLineNode::closing_loc.
Definition ast.h:5287
struct pm_node_list parts
InterpolatedMatchLastLineNode::parts.
Definition ast.h:5282
pm_location_t opening_loc
InterpolatedMatchLastLineNode::opening_loc.
Definition ast.h:5277
InterpolatedRegularExpressionNode.
Definition ast.h:5315
pm_location_t opening_loc
InterpolatedRegularExpressionNode::opening_loc.
Definition ast.h:5322
struct pm_node_list parts
InterpolatedRegularExpressionNode::parts.
Definition ast.h:5327
pm_location_t closing_loc
InterpolatedRegularExpressionNode::closing_loc.
Definition ast.h:5332
InterpolatedStringNode.
Definition ast.h:5351
pm_location_t closing_loc
InterpolatedStringNode::closing_loc.
Definition ast.h:5368
pm_location_t opening_loc
InterpolatedStringNode::opening_loc.
Definition ast.h:5358
struct pm_node_list parts
InterpolatedStringNode::parts.
Definition ast.h:5363
InterpolatedSymbolNode.
Definition ast.h:5383
struct pm_node_list parts
InterpolatedSymbolNode::parts.
Definition ast.h:5395
pm_location_t closing_loc
InterpolatedSymbolNode::closing_loc.
Definition ast.h:5400
pm_location_t opening_loc
InterpolatedSymbolNode::opening_loc.
Definition ast.h:5390
InterpolatedXStringNode.
Definition ast.h:5415
pm_location_t opening_loc
InterpolatedXStringNode::opening_loc.
Definition ast.h:5422
pm_location_t closing_loc
InterpolatedXStringNode::closing_loc.
Definition ast.h:5432
struct pm_node_list parts
InterpolatedXStringNode::parts.
Definition ast.h:5427
KeywordHashNode.
Definition ast.h:5484
struct pm_node_list elements
KeywordHashNode::elements.
Definition ast.h:5491
KeywordRestParameterNode.
Definition ast.h:5510
pm_constant_id_t name
KeywordRestParameterNode::name.
Definition ast.h:5517
pm_location_t operator_loc
KeywordRestParameterNode::operator_loc.
Definition ast.h:5527
pm_location_t name_loc
KeywordRestParameterNode::name_loc.
Definition ast.h:5522
LambdaNode.
Definition ast.h:5542
pm_location_t closing_loc
LambdaNode::closing_loc.
Definition ast.h:5564
pm_location_t opening_loc
LambdaNode::opening_loc.
Definition ast.h:5559
pm_location_t operator_loc
LambdaNode::operator_loc.
Definition ast.h:5554
pm_constant_id_list_t locals
LambdaNode::locals.
Definition ast.h:5549
PM_NODE_ALIGNAS struct pm_node * body
LambdaNode::body.
Definition ast.h:5574
PM_NODE_ALIGNAS struct pm_node * parameters
LambdaNode::parameters.
Definition ast.h:5569
A list of offsets of the start of lines in a string.
uint32_t * offsets
The list of offsets.
size_t size
The number of offsets in the list.
LocalVariableAndWriteNode.
Definition ast.h:5589
pm_constant_id_t name
LocalVariableAndWriteNode::name.
Definition ast.h:5611
uint32_t depth
LocalVariableAndWriteNode::depth.
Definition ast.h:5616
pm_location_t operator_loc
LocalVariableAndWriteNode::operator_loc.
Definition ast.h:5601
PM_NODE_ALIGNAS struct pm_node * value
LocalVariableAndWriteNode::value.
Definition ast.h:5606
pm_location_t name_loc
LocalVariableAndWriteNode::name_loc.
Definition ast.h:5596
LocalVariableOperatorWriteNode.
Definition ast.h:5631
uint32_t depth
LocalVariableOperatorWriteNode::depth.
Definition ast.h:5663
pm_constant_id_t binary_operator
LocalVariableOperatorWriteNode::binary_operator.
Definition ast.h:5658
pm_location_t name_loc
LocalVariableOperatorWriteNode::name_loc.
Definition ast.h:5638
pm_location_t binary_operator_loc
LocalVariableOperatorWriteNode::binary_operator_loc.
Definition ast.h:5643
PM_NODE_ALIGNAS struct pm_node * value
LocalVariableOperatorWriteNode::value.
Definition ast.h:5648
pm_constant_id_t name
LocalVariableOperatorWriteNode::name.
Definition ast.h:5653
LocalVariableOrWriteNode.
Definition ast.h:5678
PM_NODE_ALIGNAS struct pm_node * value
LocalVariableOrWriteNode::value.
Definition ast.h:5695
uint32_t depth
LocalVariableOrWriteNode::depth.
Definition ast.h:5705
pm_location_t operator_loc
LocalVariableOrWriteNode::operator_loc.
Definition ast.h:5690
pm_constant_id_t name
LocalVariableOrWriteNode::name.
Definition ast.h:5700
pm_location_t name_loc
LocalVariableOrWriteNode::name_loc.
Definition ast.h:5685
LocalVariableReadNode.
Definition ast.h:5720
uint32_t depth
LocalVariableReadNode::depth.
Definition ast.h:5750
pm_constant_id_t name
LocalVariableReadNode::name.
Definition ast.h:5737
LocalVariableTargetNode.
Definition ast.h:5768
uint32_t depth
LocalVariableTargetNode::depth.
Definition ast.h:5780
pm_constant_id_t name
LocalVariableTargetNode::name.
Definition ast.h:5775
LocalVariableWriteNode.
Definition ast.h:5795
PM_NODE_ALIGNAS struct pm_node * value
LocalVariableWriteNode::value.
Definition ast.h:5848
pm_location_t operator_loc
LocalVariableWriteNode::operator_loc.
Definition ast.h:5858
pm_location_t name_loc
LocalVariableWriteNode::name_loc.
Definition ast.h:5831
uint32_t depth
LocalVariableWriteNode::depth.
Definition ast.h:5821
pm_constant_id_t name
LocalVariableWriteNode::name.
Definition ast.h:5808
uint32_t start
The offset of the location from the start of the source.
Definition ast.h:574
uint32_t length
The length of the location.
Definition ast.h:577
MatchLastLineNode.
Definition ast.h:5886
pm_location_t content_loc
MatchLastLineNode::content_loc.
Definition ast.h:5898
pm_location_t opening_loc
MatchLastLineNode::opening_loc.
Definition ast.h:5893
pm_location_t closing_loc
MatchLastLineNode::closing_loc.
Definition ast.h:5903
pm_string_t unescaped
MatchLastLineNode::unescaped.
Definition ast.h:5908
MatchPredicateNode.
Definition ast.h:5923
pm_location_t keyword_loc
MatchPredicateNode::keyword_loc.
Definition ast.h:5940
PM_NODE_ALIGNAS struct pm_node * pattern
MatchPredicateNode::pattern.
Definition ast.h:5935
PM_NODE_ALIGNAS struct pm_node * value
MatchPredicateNode::value.
Definition ast.h:5930
MatchRequiredNode.
Definition ast.h:5955
pm_location_t operator_loc
MatchRequiredNode::operator_loc.
Definition ast.h:6026
PM_NODE_ALIGNAS struct pm_node * pattern
MatchRequiredNode::pattern.
Definition ast.h:6016
PM_NODE_ALIGNAS struct pm_node * value
MatchRequiredNode::value.
Definition ast.h:5967
MatchWriteNode.
Definition ast.h:6041
PM_NODE_ALIGNAS struct pm_call_node * call
MatchWriteNode::call.
Definition ast.h:6048
struct pm_node_list targets
MatchWriteNode::targets.
Definition ast.h:6053
ModuleNode.
Definition ast.h:6068
pm_location_t end_keyword_loc
ModuleNode::end_keyword_loc.
Definition ast.h:6095
PM_NODE_ALIGNAS struct pm_node * constant_path
ModuleNode::constant_path.
Definition ast.h:6085
PM_NODE_ALIGNAS struct pm_node * body
ModuleNode::body.
Definition ast.h:6090
pm_constant_id_list_t locals
ModuleNode::locals.
Definition ast.h:6075
pm_location_t module_keyword_loc
ModuleNode::module_keyword_loc.
Definition ast.h:6080
pm_constant_id_t name
ModuleNode::name.
Definition ast.h:6100
MultiTargetNode.
Definition ast.h:6120
PM_NODE_ALIGNAS struct pm_node * rest
MultiTargetNode::rest.
Definition ast.h:6157
pm_location_t lparen_loc
MultiTargetNode::lparen_loc.
Definition ast.h:6177
struct pm_node_list lefts
MultiTargetNode::lefts.
Definition ast.h:6137
pm_location_t rparen_loc
MultiTargetNode::rparen_loc.
Definition ast.h:6187
struct pm_node_list rights
MultiTargetNode::rights.
Definition ast.h:6167
MultiWriteNode.
Definition ast.h:6202
pm_location_t rparen_loc
MultiWriteNode::rparen_loc.
Definition ast.h:6269
PM_NODE_ALIGNAS struct pm_node * rest
MultiWriteNode::rest.
Definition ast.h:6239
struct pm_node_list rights
MultiWriteNode::rights.
Definition ast.h:6249
pm_location_t operator_loc
MultiWriteNode::operator_loc.
Definition ast.h:6279
PM_NODE_ALIGNAS struct pm_node * value
MultiWriteNode::value.
Definition ast.h:6289
pm_location_t lparen_loc
MultiWriteNode::lparen_loc.
Definition ast.h:6259
struct pm_node_list lefts
MultiWriteNode::lefts.
Definition ast.h:6219
NextNode.
Definition ast.h:6304
PM_NODE_ALIGNAS struct pm_arguments_node * arguments
NextNode::arguments.
Definition ast.h:6311
pm_location_t keyword_loc
NextNode::keyword_loc.
Definition ast.h:6316
NoBlockParameterNode.
Definition ast.h:6349
pm_location_t keyword_loc
NoBlockParameterNode::keyword_loc.
Definition ast.h:6361
pm_location_t operator_loc
NoBlockParameterNode::operator_loc.
Definition ast.h:6356
NoKeywordsParameterNode.
Definition ast.h:6377
pm_location_t keyword_loc
NoKeywordsParameterNode::keyword_loc.
Definition ast.h:6389
pm_location_t operator_loc
NoKeywordsParameterNode::operator_loc.
Definition ast.h:6384
size_t size
The number of nodes in the list.
Definition ast.h:587
struct pm_node ** nodes
The nodes in the list.
Definition ast.h:593
This is the base structure that represents a node in the syntax tree.
Definition ast.h:1083
uint32_t node_id
The unique identifier for this node, which is deterministic based on the source.
Definition ast.h:1100
pm_node_flags_t flags
This represents any flags on the node.
Definition ast.h:1094
pm_location_t location
This is the location of the node in the source.
Definition ast.h:1106
NumberedParametersNode.
Definition ast.h:6404
uint8_t maximum
NumberedParametersNode::maximum.
Definition ast.h:6411
NumberedReferenceReadNode.
Definition ast.h:6426
uint32_t number
NumberedReferenceReadNode::number.
Definition ast.h:6441
OptionalKeywordParameterNode.
Definition ast.h:6460
pm_constant_id_t name
OptionalKeywordParameterNode::name.
Definition ast.h:6467
PM_NODE_ALIGNAS struct pm_node * value
OptionalKeywordParameterNode::value.
Definition ast.h:6477
pm_location_t name_loc
OptionalKeywordParameterNode::name_loc.
Definition ast.h:6472
OptionalParameterNode.
Definition ast.h:6496
pm_location_t name_loc
OptionalParameterNode::name_loc.
Definition ast.h:6508
pm_constant_id_t name
OptionalParameterNode::name.
Definition ast.h:6503
pm_location_t operator_loc
OptionalParameterNode::operator_loc.
Definition ast.h:6513
PM_NODE_ALIGNAS struct pm_node * value
OptionalParameterNode::value.
Definition ast.h:6518
OrNode.
Definition ast.h:6533
PM_NODE_ALIGNAS struct pm_node * right
OrNode::right.
Definition ast.h:6561
PM_NODE_ALIGNAS struct pm_node * left
OrNode::left.
Definition ast.h:6548
pm_location_t operator_loc
OrNode::operator_loc.
Definition ast.h:6571
ParametersNode.
Definition ast.h:6587
PM_NODE_ALIGNAS struct pm_node * block
ParametersNode::block.
Definition ast.h:6624
struct pm_node_list requireds
ParametersNode::requireds.
Definition ast.h:6594
struct pm_node_list optionals
ParametersNode::optionals.
Definition ast.h:6599
struct pm_node_list posts
ParametersNode::posts.
Definition ast.h:6609
PM_NODE_ALIGNAS struct pm_node * rest
ParametersNode::rest.
Definition ast.h:6604
struct pm_node_list keywords
ParametersNode::keywords.
Definition ast.h:6614
PM_NODE_ALIGNAS struct pm_node * keyword_rest
ParametersNode::keyword_rest.
Definition ast.h:6619
ParenthesesNode.
Definition ast.h:6642
pm_location_t closing_loc
ParenthesesNode::closing_loc.
Definition ast.h:6659
pm_location_t opening_loc
ParenthesesNode::opening_loc.
Definition ast.h:6654
PM_NODE_ALIGNAS struct pm_node * body
ParenthesesNode::body.
Definition ast.h:6649
PinnedExpressionNode.
Definition ast.h:6674
pm_location_t rparen_loc
PinnedExpressionNode::rparen_loc.
Definition ast.h:6716
pm_location_t lparen_loc
PinnedExpressionNode::lparen_loc.
Definition ast.h:6706
PM_NODE_ALIGNAS struct pm_node * expression
PinnedExpressionNode::expression.
Definition ast.h:6686
pm_location_t operator_loc
PinnedExpressionNode::operator_loc.
Definition ast.h:6696
PinnedVariableNode.
Definition ast.h:6731
PM_NODE_ALIGNAS struct pm_node * variable
PinnedVariableNode::variable.
Definition ast.h:6743
pm_location_t operator_loc
PinnedVariableNode::operator_loc.
Definition ast.h:6753
PostExecutionNode.
Definition ast.h:6768
pm_location_t closing_loc
PostExecutionNode::closing_loc.
Definition ast.h:6790
pm_location_t opening_loc
PostExecutionNode::opening_loc.
Definition ast.h:6785
pm_location_t keyword_loc
PostExecutionNode::keyword_loc.
Definition ast.h:6780
PM_NODE_ALIGNAS struct pm_statements_node * statements
PostExecutionNode::statements.
Definition ast.h:6775
PreExecutionNode.
Definition ast.h:6805
pm_location_t closing_loc
PreExecutionNode::closing_loc.
Definition ast.h:6827
pm_location_t opening_loc
PreExecutionNode::opening_loc.
Definition ast.h:6822
PM_NODE_ALIGNAS struct pm_statements_node * statements
PreExecutionNode::statements.
Definition ast.h:6812
pm_location_t keyword_loc
PreExecutionNode::keyword_loc.
Definition ast.h:6817
ProgramNode.
Definition ast.h:6839
PM_NODE_ALIGNAS struct pm_statements_node * statements
ProgramNode::statements.
Definition ast.h:6851
pm_constant_id_list_t locals
ProgramNode::locals.
Definition ast.h:6846
RangeNode.
Definition ast.h:6872
pm_location_t operator_loc
RangeNode::operator_loc.
Definition ast.h:6908
PM_NODE_ALIGNAS struct pm_node * right
RangeNode::right.
Definition ast.h:6901
PM_NODE_ALIGNAS struct pm_node * left
RangeNode::left.
Definition ast.h:6887
RationalNode.
Definition ast.h:6929
pm_integer_t denominator
RationalNode::denominator.
Definition ast.h:6949
pm_integer_t numerator
RationalNode::numerator.
Definition ast.h:6940
RegularExpressionNode.
Definition ast.h:6994
pm_location_t closing_loc
RegularExpressionNode::closing_loc.
Definition ast.h:7011
pm_string_t unescaped
RegularExpressionNode::unescaped.
Definition ast.h:7016
pm_location_t opening_loc
RegularExpressionNode::opening_loc.
Definition ast.h:7001
pm_location_t content_loc
RegularExpressionNode::content_loc.
Definition ast.h:7006
RequiredKeywordParameterNode.
Definition ast.h:7035
pm_location_t name_loc
RequiredKeywordParameterNode::name_loc.
Definition ast.h:7047
pm_constant_id_t name
RequiredKeywordParameterNode::name.
Definition ast.h:7042
RequiredParameterNode.
Definition ast.h:7066
pm_constant_id_t name
RequiredParameterNode::name.
Definition ast.h:7073
RescueModifierNode.
Definition ast.h:7088
PM_NODE_ALIGNAS struct pm_node * expression
RescueModifierNode::expression.
Definition ast.h:7095
pm_location_t keyword_loc
RescueModifierNode::keyword_loc.
Definition ast.h:7100
PM_NODE_ALIGNAS struct pm_node * rescue_expression
RescueModifierNode::rescue_expression.
Definition ast.h:7105
RescueNode.
Definition ast.h:7125
PM_NODE_ALIGNAS struct pm_statements_node * statements
RescueNode::statements.
Definition ast.h:7157
PM_NODE_ALIGNAS struct pm_rescue_node * subsequent
RescueNode::subsequent.
Definition ast.h:7162
pm_location_t keyword_loc
RescueNode::keyword_loc.
Definition ast.h:7132
PM_NODE_ALIGNAS struct pm_node * reference
RescueNode::reference.
Definition ast.h:7147
pm_location_t then_keyword_loc
RescueNode::then_keyword_loc.
Definition ast.h:7152
pm_location_t operator_loc
RescueNode::operator_loc.
Definition ast.h:7142
struct pm_node_list exceptions
RescueNode::exceptions.
Definition ast.h:7137
RestParameterNode.
Definition ast.h:7181
pm_constant_id_t name
RestParameterNode::name.
Definition ast.h:7188
pm_location_t name_loc
RestParameterNode::name_loc.
Definition ast.h:7193
pm_location_t operator_loc
RestParameterNode::operator_loc.
Definition ast.h:7198
ReturnNode.
Definition ast.h:7230
PM_NODE_ALIGNAS struct pm_arguments_node * arguments
ReturnNode::arguments.
Definition ast.h:7242
pm_location_t keyword_loc
ReturnNode::keyword_loc.
Definition ast.h:7237
ShareableConstantNode.
Definition ast.h:7280
PM_NODE_ALIGNAS struct pm_node * write
ShareableConstantNode::write.
Definition ast.h:7289
SingletonClassNode.
Definition ast.h:7304
PM_NODE_ALIGNAS struct pm_node * body
SingletonClassNode::body.
Definition ast.h:7331
pm_constant_id_list_t locals
SingletonClassNode::locals.
Definition ast.h:7311
pm_location_t operator_loc
SingletonClassNode::operator_loc.
Definition ast.h:7321
PM_NODE_ALIGNAS struct pm_node * expression
SingletonClassNode::expression.
Definition ast.h:7326
pm_location_t end_keyword_loc
SingletonClassNode::end_keyword_loc.
Definition ast.h:7336
pm_location_t class_keyword_loc
SingletonClassNode::class_keyword_loc.
Definition ast.h:7316
SourceFileNode.
Definition ast.h:7374
pm_string_t filepath
SourceFileNode::filepath.
Definition ast.h:7383
SplatNode.
Definition ast.h:7415
PM_NODE_ALIGNAS struct pm_node * expression
SplatNode::expression.
Definition ast.h:7427
pm_location_t operator_loc
SplatNode::operator_loc.
Definition ast.h:7422
StatementsNode.
Definition ast.h:7442
struct pm_node_list body
StatementsNode::body.
Definition ast.h:7449
StringNode.
Definition ast.h:7476
pm_string_t unescaped
StringNode::unescaped.
Definition ast.h:7498
pm_location_t content_loc
StringNode::content_loc.
Definition ast.h:7488
pm_location_t closing_loc
StringNode::closing_loc.
Definition ast.h:7493
pm_location_t opening_loc
StringNode::opening_loc.
Definition ast.h:7483
A generic string type that can have various ownership semantics.
Definition stringy.h:18
SuperNode.
Definition ast.h:7518
PM_NODE_ALIGNAS struct pm_arguments_node * arguments
SuperNode::arguments.
Definition ast.h:7537
pm_location_t lparen_loc
SuperNode::lparen_loc.
Definition ast.h:7530
pm_location_t keyword_loc
SuperNode::keyword_loc.
Definition ast.h:7525
pm_location_t rparen_loc
SuperNode::rparen_loc.
Definition ast.h:7542
PM_NODE_ALIGNAS struct pm_node * block
SuperNode::block.
Definition ast.h:7547
SymbolNode.
Definition ast.h:7570
pm_location_t opening_loc
SymbolNode::opening_loc.
Definition ast.h:7577
pm_location_t value_loc
SymbolNode::value_loc.
Definition ast.h:7582
pm_location_t closing_loc
SymbolNode::closing_loc.
Definition ast.h:7587
pm_string_t unescaped
SymbolNode::unescaped.
Definition ast.h:7592
This struct represents a token in the Ruby source.
Definition ast.h:544
UndefNode.
Definition ast.h:7624
pm_location_t keyword_loc
UndefNode::keyword_loc.
Definition ast.h:7636
struct pm_node_list names
UndefNode::names.
Definition ast.h:7631
UnlessNode.
Definition ast.h:7654
pm_location_t then_keyword_loc
UnlessNode::then_keyword_loc.
Definition ast.h:7692
PM_NODE_ALIGNAS struct pm_node * predicate
UnlessNode::predicate.
Definition ast.h:7682
PM_NODE_ALIGNAS struct pm_statements_node * statements
UnlessNode::statements.
Definition ast.h:7703
pm_location_t end_keyword_loc
UnlessNode::end_keyword_loc.
Definition ast.h:7723
PM_NODE_ALIGNAS struct pm_else_node * else_clause
UnlessNode::else_clause.
Definition ast.h:7713
pm_location_t unless_keyword_loc
UnlessNode::unless_keyword_loc.
Definition ast.h:7669
UntilNode.
Definition ast.h:7744
pm_location_t end_keyword_loc
UntilNode::end_keyword_loc.
Definition ast.h:7761
pm_location_t until_keyword_loc
UntilNode::until_keyword_loc.
Definition ast.h:7751
PM_NODE_ALIGNAS struct pm_statements_node * statements
UntilNode::statements.
Definition ast.h:7771
pm_location_t do_keyword_loc
UntilNode::do_keyword_loc.
Definition ast.h:7756
PM_NODE_ALIGNAS struct pm_node * predicate
UntilNode::predicate.
Definition ast.h:7766
WhenNode.
Definition ast.h:7788
pm_location_t when_keyword_loc
WhenNode::when_keyword_loc.
Definition ast.h:7795
pm_location_t then_keyword_loc
WhenNode::then_keyword_loc.
Definition ast.h:7805
PM_NODE_ALIGNAS struct pm_statements_node * statements
WhenNode::statements.
Definition ast.h:7810
struct pm_node_list conditions
WhenNode::conditions.
Definition ast.h:7800
WhileNode.
Definition ast.h:7831
PM_NODE_ALIGNAS struct pm_statements_node * statements
WhileNode::statements.
Definition ast.h:7858
pm_location_t while_keyword_loc
WhileNode::while_keyword_loc.
Definition ast.h:7838
pm_location_t end_keyword_loc
WhileNode::end_keyword_loc.
Definition ast.h:7848
pm_location_t do_keyword_loc
WhileNode::do_keyword_loc.
Definition ast.h:7843
PM_NODE_ALIGNAS struct pm_node * predicate
WhileNode::predicate.
Definition ast.h:7853
XStringNode.
Definition ast.h:7877
pm_location_t closing_loc
XStringNode::closing_loc.
Definition ast.h:7894
pm_location_t opening_loc
XStringNode::opening_loc.
Definition ast.h:7884
pm_location_t content_loc
XStringNode::content_loc.
Definition ast.h:7889
pm_string_t unescaped
XStringNode::unescaped.
Definition ast.h:7899
YieldNode.
Definition ast.h:7914
pm_location_t keyword_loc
YieldNode::keyword_loc.
Definition ast.h:7921
pm_location_t lparen_loc
YieldNode::lparen_loc.
Definition ast.h:7926
pm_location_t rparen_loc
YieldNode::rparen_loc.
Definition ast.h:7936
PM_NODE_ALIGNAS struct pm_arguments_node * arguments
YieldNode::arguments.
Definition ast.h:7931
uintptr_t ID
Type that represents a Ruby identifier such as a variable name.
Definition value.h:52
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40