Ruby 4.1.0dev (2026-03-26 revision 2ca2865aa194cf832b205f530b4fb440166aea68)
node.c
1/*----------------------------------------------------------------------------*/
2/* This file is generated by the templates/template.rb script and should not */
3/* be modified manually. See */
4/* templates/src/node.c.erb */
5/* if you are looking to modify the */
6/* template */
7/*----------------------------------------------------------------------------*/
8
9#line 2 "prism/templates/src/node.c.erb"
10#include "prism/internal/node.h"
11
12#include "prism/internal/arena.h"
13
14#include <stdlib.h>
15
22static void
23pm_node_list_grow(pm_arena_t *arena, pm_node_list_t *list, size_t size) {
24 size_t requested_size = list->size + size;
25
26 // Guard against overflow on the addition.
27 if (requested_size < list->size) abort();
28
29 // If the requested size is within the existing capacity, return.
30 if (requested_size <= list->capacity) return;
31
32 // Otherwise, compute the next capacity by doubling.
33 size_t next_capacity = list->capacity == 0 ? 4 : list->capacity * 2;
34
35 // Guard against overflow on the doubling.
36 while (requested_size > next_capacity) {
37 if (next_capacity == 0) abort();
38 next_capacity *= 2;
39 }
40
41 // Allocate a new array from the arena (old array is abandoned).
42 pm_node_t **nodes = (pm_node_t **) pm_arena_alloc(arena, sizeof(pm_node_t *) * next_capacity, PRISM_ALIGNOF(pm_node_t *));
43
44 // Copy old data into the new array.
45 if (list->size > 0) {
46 memcpy(nodes, list->nodes, list->size * sizeof(pm_node_t *));
47 }
48
49 list->nodes = nodes;
50 list->capacity = next_capacity;
51}
52
57void
58pm_node_list_append_slow(pm_arena_t *arena, pm_node_list_t *list, pm_node_t *node) {
59 pm_node_list_grow(arena, list, 1);
60 list->nodes[list->size++] = node;
61}
62
66void
67pm_node_list_prepend(pm_arena_t *arena, pm_node_list_t *list, pm_node_t *node) {
68 pm_node_list_grow(arena, list, 1);
69 memmove(list->nodes + 1, list->nodes, list->size * sizeof(pm_node_t *));
70 list->nodes[0] = node;
71 list->size++;
72}
73
77void
78pm_node_list_concat(pm_arena_t *arena, pm_node_list_t *list, pm_node_list_t *other) {
79 if (other->size > 0) {
80 pm_node_list_grow(arena, list, other->size);
81 memcpy(list->nodes + list->size, other->nodes, other->size * sizeof(pm_node_t *));
82 list->size += other->size;
83 }
84}
85
89const char *
90pm_node_type(pm_node_type_t node_type)
91{
92 switch (node_type) {
93 case PM_ALIAS_GLOBAL_VARIABLE_NODE:
94 return "PM_ALIAS_GLOBAL_VARIABLE_NODE";
95 case PM_ALIAS_METHOD_NODE:
96 return "PM_ALIAS_METHOD_NODE";
97 case PM_ALTERNATION_PATTERN_NODE:
98 return "PM_ALTERNATION_PATTERN_NODE";
99 case PM_AND_NODE:
100 return "PM_AND_NODE";
101 case PM_ARGUMENTS_NODE:
102 return "PM_ARGUMENTS_NODE";
103 case PM_ARRAY_NODE:
104 return "PM_ARRAY_NODE";
105 case PM_ARRAY_PATTERN_NODE:
106 return "PM_ARRAY_PATTERN_NODE";
107 case PM_ASSOC_NODE:
108 return "PM_ASSOC_NODE";
109 case PM_ASSOC_SPLAT_NODE:
110 return "PM_ASSOC_SPLAT_NODE";
111 case PM_BACK_REFERENCE_READ_NODE:
112 return "PM_BACK_REFERENCE_READ_NODE";
113 case PM_BEGIN_NODE:
114 return "PM_BEGIN_NODE";
115 case PM_BLOCK_ARGUMENT_NODE:
116 return "PM_BLOCK_ARGUMENT_NODE";
117 case PM_BLOCK_LOCAL_VARIABLE_NODE:
118 return "PM_BLOCK_LOCAL_VARIABLE_NODE";
119 case PM_BLOCK_NODE:
120 return "PM_BLOCK_NODE";
121 case PM_BLOCK_PARAMETER_NODE:
122 return "PM_BLOCK_PARAMETER_NODE";
123 case PM_BLOCK_PARAMETERS_NODE:
124 return "PM_BLOCK_PARAMETERS_NODE";
125 case PM_BREAK_NODE:
126 return "PM_BREAK_NODE";
127 case PM_CALL_AND_WRITE_NODE:
128 return "PM_CALL_AND_WRITE_NODE";
129 case PM_CALL_NODE:
130 return "PM_CALL_NODE";
131 case PM_CALL_OPERATOR_WRITE_NODE:
132 return "PM_CALL_OPERATOR_WRITE_NODE";
133 case PM_CALL_OR_WRITE_NODE:
134 return "PM_CALL_OR_WRITE_NODE";
135 case PM_CALL_TARGET_NODE:
136 return "PM_CALL_TARGET_NODE";
137 case PM_CAPTURE_PATTERN_NODE:
138 return "PM_CAPTURE_PATTERN_NODE";
139 case PM_CASE_MATCH_NODE:
140 return "PM_CASE_MATCH_NODE";
141 case PM_CASE_NODE:
142 return "PM_CASE_NODE";
143 case PM_CLASS_NODE:
144 return "PM_CLASS_NODE";
145 case PM_CLASS_VARIABLE_AND_WRITE_NODE:
146 return "PM_CLASS_VARIABLE_AND_WRITE_NODE";
147 case PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE:
148 return "PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE";
149 case PM_CLASS_VARIABLE_OR_WRITE_NODE:
150 return "PM_CLASS_VARIABLE_OR_WRITE_NODE";
151 case PM_CLASS_VARIABLE_READ_NODE:
152 return "PM_CLASS_VARIABLE_READ_NODE";
153 case PM_CLASS_VARIABLE_TARGET_NODE:
154 return "PM_CLASS_VARIABLE_TARGET_NODE";
155 case PM_CLASS_VARIABLE_WRITE_NODE:
156 return "PM_CLASS_VARIABLE_WRITE_NODE";
157 case PM_CONSTANT_AND_WRITE_NODE:
158 return "PM_CONSTANT_AND_WRITE_NODE";
159 case PM_CONSTANT_OPERATOR_WRITE_NODE:
160 return "PM_CONSTANT_OPERATOR_WRITE_NODE";
161 case PM_CONSTANT_OR_WRITE_NODE:
162 return "PM_CONSTANT_OR_WRITE_NODE";
163 case PM_CONSTANT_PATH_AND_WRITE_NODE:
164 return "PM_CONSTANT_PATH_AND_WRITE_NODE";
165 case PM_CONSTANT_PATH_NODE:
166 return "PM_CONSTANT_PATH_NODE";
167 case PM_CONSTANT_PATH_OPERATOR_WRITE_NODE:
168 return "PM_CONSTANT_PATH_OPERATOR_WRITE_NODE";
169 case PM_CONSTANT_PATH_OR_WRITE_NODE:
170 return "PM_CONSTANT_PATH_OR_WRITE_NODE";
171 case PM_CONSTANT_PATH_TARGET_NODE:
172 return "PM_CONSTANT_PATH_TARGET_NODE";
173 case PM_CONSTANT_PATH_WRITE_NODE:
174 return "PM_CONSTANT_PATH_WRITE_NODE";
175 case PM_CONSTANT_READ_NODE:
176 return "PM_CONSTANT_READ_NODE";
177 case PM_CONSTANT_TARGET_NODE:
178 return "PM_CONSTANT_TARGET_NODE";
179 case PM_CONSTANT_WRITE_NODE:
180 return "PM_CONSTANT_WRITE_NODE";
181 case PM_DEF_NODE:
182 return "PM_DEF_NODE";
183 case PM_DEFINED_NODE:
184 return "PM_DEFINED_NODE";
185 case PM_ELSE_NODE:
186 return "PM_ELSE_NODE";
187 case PM_EMBEDDED_STATEMENTS_NODE:
188 return "PM_EMBEDDED_STATEMENTS_NODE";
189 case PM_EMBEDDED_VARIABLE_NODE:
190 return "PM_EMBEDDED_VARIABLE_NODE";
191 case PM_ENSURE_NODE:
192 return "PM_ENSURE_NODE";
193 case PM_ERROR_RECOVERY_NODE:
194 return "PM_ERROR_RECOVERY_NODE";
195 case PM_FALSE_NODE:
196 return "PM_FALSE_NODE";
197 case PM_FIND_PATTERN_NODE:
198 return "PM_FIND_PATTERN_NODE";
199 case PM_FLIP_FLOP_NODE:
200 return "PM_FLIP_FLOP_NODE";
201 case PM_FLOAT_NODE:
202 return "PM_FLOAT_NODE";
203 case PM_FOR_NODE:
204 return "PM_FOR_NODE";
205 case PM_FORWARDING_ARGUMENTS_NODE:
206 return "PM_FORWARDING_ARGUMENTS_NODE";
207 case PM_FORWARDING_PARAMETER_NODE:
208 return "PM_FORWARDING_PARAMETER_NODE";
209 case PM_FORWARDING_SUPER_NODE:
210 return "PM_FORWARDING_SUPER_NODE";
211 case PM_GLOBAL_VARIABLE_AND_WRITE_NODE:
212 return "PM_GLOBAL_VARIABLE_AND_WRITE_NODE";
213 case PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE:
214 return "PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE";
215 case PM_GLOBAL_VARIABLE_OR_WRITE_NODE:
216 return "PM_GLOBAL_VARIABLE_OR_WRITE_NODE";
217 case PM_GLOBAL_VARIABLE_READ_NODE:
218 return "PM_GLOBAL_VARIABLE_READ_NODE";
219 case PM_GLOBAL_VARIABLE_TARGET_NODE:
220 return "PM_GLOBAL_VARIABLE_TARGET_NODE";
221 case PM_GLOBAL_VARIABLE_WRITE_NODE:
222 return "PM_GLOBAL_VARIABLE_WRITE_NODE";
223 case PM_HASH_NODE:
224 return "PM_HASH_NODE";
225 case PM_HASH_PATTERN_NODE:
226 return "PM_HASH_PATTERN_NODE";
227 case PM_IF_NODE:
228 return "PM_IF_NODE";
229 case PM_IMAGINARY_NODE:
230 return "PM_IMAGINARY_NODE";
231 case PM_IMPLICIT_NODE:
232 return "PM_IMPLICIT_NODE";
233 case PM_IMPLICIT_REST_NODE:
234 return "PM_IMPLICIT_REST_NODE";
235 case PM_IN_NODE:
236 return "PM_IN_NODE";
237 case PM_INDEX_AND_WRITE_NODE:
238 return "PM_INDEX_AND_WRITE_NODE";
239 case PM_INDEX_OPERATOR_WRITE_NODE:
240 return "PM_INDEX_OPERATOR_WRITE_NODE";
241 case PM_INDEX_OR_WRITE_NODE:
242 return "PM_INDEX_OR_WRITE_NODE";
243 case PM_INDEX_TARGET_NODE:
244 return "PM_INDEX_TARGET_NODE";
245 case PM_INSTANCE_VARIABLE_AND_WRITE_NODE:
246 return "PM_INSTANCE_VARIABLE_AND_WRITE_NODE";
247 case PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE:
248 return "PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE";
249 case PM_INSTANCE_VARIABLE_OR_WRITE_NODE:
250 return "PM_INSTANCE_VARIABLE_OR_WRITE_NODE";
251 case PM_INSTANCE_VARIABLE_READ_NODE:
252 return "PM_INSTANCE_VARIABLE_READ_NODE";
253 case PM_INSTANCE_VARIABLE_TARGET_NODE:
254 return "PM_INSTANCE_VARIABLE_TARGET_NODE";
255 case PM_INSTANCE_VARIABLE_WRITE_NODE:
256 return "PM_INSTANCE_VARIABLE_WRITE_NODE";
257 case PM_INTEGER_NODE:
258 return "PM_INTEGER_NODE";
259 case PM_INTERPOLATED_MATCH_LAST_LINE_NODE:
260 return "PM_INTERPOLATED_MATCH_LAST_LINE_NODE";
261 case PM_INTERPOLATED_REGULAR_EXPRESSION_NODE:
262 return "PM_INTERPOLATED_REGULAR_EXPRESSION_NODE";
263 case PM_INTERPOLATED_STRING_NODE:
264 return "PM_INTERPOLATED_STRING_NODE";
265 case PM_INTERPOLATED_SYMBOL_NODE:
266 return "PM_INTERPOLATED_SYMBOL_NODE";
267 case PM_INTERPOLATED_X_STRING_NODE:
268 return "PM_INTERPOLATED_X_STRING_NODE";
269 case PM_IT_LOCAL_VARIABLE_READ_NODE:
270 return "PM_IT_LOCAL_VARIABLE_READ_NODE";
271 case PM_IT_PARAMETERS_NODE:
272 return "PM_IT_PARAMETERS_NODE";
273 case PM_KEYWORD_HASH_NODE:
274 return "PM_KEYWORD_HASH_NODE";
275 case PM_KEYWORD_REST_PARAMETER_NODE:
276 return "PM_KEYWORD_REST_PARAMETER_NODE";
277 case PM_LAMBDA_NODE:
278 return "PM_LAMBDA_NODE";
279 case PM_LOCAL_VARIABLE_AND_WRITE_NODE:
280 return "PM_LOCAL_VARIABLE_AND_WRITE_NODE";
281 case PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE:
282 return "PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE";
283 case PM_LOCAL_VARIABLE_OR_WRITE_NODE:
284 return "PM_LOCAL_VARIABLE_OR_WRITE_NODE";
285 case PM_LOCAL_VARIABLE_READ_NODE:
286 return "PM_LOCAL_VARIABLE_READ_NODE";
287 case PM_LOCAL_VARIABLE_TARGET_NODE:
288 return "PM_LOCAL_VARIABLE_TARGET_NODE";
289 case PM_LOCAL_VARIABLE_WRITE_NODE:
290 return "PM_LOCAL_VARIABLE_WRITE_NODE";
291 case PM_MATCH_LAST_LINE_NODE:
292 return "PM_MATCH_LAST_LINE_NODE";
293 case PM_MATCH_PREDICATE_NODE:
294 return "PM_MATCH_PREDICATE_NODE";
295 case PM_MATCH_REQUIRED_NODE:
296 return "PM_MATCH_REQUIRED_NODE";
297 case PM_MATCH_WRITE_NODE:
298 return "PM_MATCH_WRITE_NODE";
299 case PM_MODULE_NODE:
300 return "PM_MODULE_NODE";
301 case PM_MULTI_TARGET_NODE:
302 return "PM_MULTI_TARGET_NODE";
303 case PM_MULTI_WRITE_NODE:
304 return "PM_MULTI_WRITE_NODE";
305 case PM_NEXT_NODE:
306 return "PM_NEXT_NODE";
307 case PM_NIL_NODE:
308 return "PM_NIL_NODE";
309 case PM_NO_BLOCK_PARAMETER_NODE:
310 return "PM_NO_BLOCK_PARAMETER_NODE";
311 case PM_NO_KEYWORDS_PARAMETER_NODE:
312 return "PM_NO_KEYWORDS_PARAMETER_NODE";
313 case PM_NUMBERED_PARAMETERS_NODE:
314 return "PM_NUMBERED_PARAMETERS_NODE";
315 case PM_NUMBERED_REFERENCE_READ_NODE:
316 return "PM_NUMBERED_REFERENCE_READ_NODE";
317 case PM_OPTIONAL_KEYWORD_PARAMETER_NODE:
318 return "PM_OPTIONAL_KEYWORD_PARAMETER_NODE";
319 case PM_OPTIONAL_PARAMETER_NODE:
320 return "PM_OPTIONAL_PARAMETER_NODE";
321 case PM_OR_NODE:
322 return "PM_OR_NODE";
323 case PM_PARAMETERS_NODE:
324 return "PM_PARAMETERS_NODE";
325 case PM_PARENTHESES_NODE:
326 return "PM_PARENTHESES_NODE";
327 case PM_PINNED_EXPRESSION_NODE:
328 return "PM_PINNED_EXPRESSION_NODE";
329 case PM_PINNED_VARIABLE_NODE:
330 return "PM_PINNED_VARIABLE_NODE";
331 case PM_POST_EXECUTION_NODE:
332 return "PM_POST_EXECUTION_NODE";
333 case PM_PRE_EXECUTION_NODE:
334 return "PM_PRE_EXECUTION_NODE";
335 case PM_PROGRAM_NODE:
336 return "PM_PROGRAM_NODE";
337 case PM_RANGE_NODE:
338 return "PM_RANGE_NODE";
339 case PM_RATIONAL_NODE:
340 return "PM_RATIONAL_NODE";
341 case PM_REDO_NODE:
342 return "PM_REDO_NODE";
343 case PM_REGULAR_EXPRESSION_NODE:
344 return "PM_REGULAR_EXPRESSION_NODE";
345 case PM_REQUIRED_KEYWORD_PARAMETER_NODE:
346 return "PM_REQUIRED_KEYWORD_PARAMETER_NODE";
347 case PM_REQUIRED_PARAMETER_NODE:
348 return "PM_REQUIRED_PARAMETER_NODE";
349 case PM_RESCUE_MODIFIER_NODE:
350 return "PM_RESCUE_MODIFIER_NODE";
351 case PM_RESCUE_NODE:
352 return "PM_RESCUE_NODE";
353 case PM_REST_PARAMETER_NODE:
354 return "PM_REST_PARAMETER_NODE";
355 case PM_RETRY_NODE:
356 return "PM_RETRY_NODE";
357 case PM_RETURN_NODE:
358 return "PM_RETURN_NODE";
359 case PM_SELF_NODE:
360 return "PM_SELF_NODE";
361 case PM_SHAREABLE_CONSTANT_NODE:
362 return "PM_SHAREABLE_CONSTANT_NODE";
363 case PM_SINGLETON_CLASS_NODE:
364 return "PM_SINGLETON_CLASS_NODE";
365 case PM_SOURCE_ENCODING_NODE:
366 return "PM_SOURCE_ENCODING_NODE";
367 case PM_SOURCE_FILE_NODE:
368 return "PM_SOURCE_FILE_NODE";
369 case PM_SOURCE_LINE_NODE:
370 return "PM_SOURCE_LINE_NODE";
371 case PM_SPLAT_NODE:
372 return "PM_SPLAT_NODE";
373 case PM_STATEMENTS_NODE:
374 return "PM_STATEMENTS_NODE";
375 case PM_STRING_NODE:
376 return "PM_STRING_NODE";
377 case PM_SUPER_NODE:
378 return "PM_SUPER_NODE";
379 case PM_SYMBOL_NODE:
380 return "PM_SYMBOL_NODE";
381 case PM_TRUE_NODE:
382 return "PM_TRUE_NODE";
383 case PM_UNDEF_NODE:
384 return "PM_UNDEF_NODE";
385 case PM_UNLESS_NODE:
386 return "PM_UNLESS_NODE";
387 case PM_UNTIL_NODE:
388 return "PM_UNTIL_NODE";
389 case PM_WHEN_NODE:
390 return "PM_WHEN_NODE";
391 case PM_WHILE_NODE:
392 return "PM_WHILE_NODE";
393 case PM_X_STRING_NODE:
394 return "PM_X_STRING_NODE";
395 case PM_YIELD_NODE:
396 return "PM_YIELD_NODE";
397 }
398 return "";
399}
400
409void
410pm_visit_node(const pm_node_t *node, bool (*visitor)(const pm_node_t *node, void *data), void *data) {
411 if (visitor(node, data)) pm_visit_child_nodes(node, visitor, data);
412}
413
419void
420pm_visit_child_nodes(const pm_node_t *node, bool (*visitor)(const pm_node_t *node, void *data), void *data) {
421 switch (PM_NODE_TYPE(node)) {
422 case PM_ALIAS_GLOBAL_VARIABLE_NODE: {
424
425 // Visit the new_name field
426 pm_visit_node((const pm_node_t *) cast->new_name, visitor, data);
427
428 // Visit the old_name field
429 pm_visit_node((const pm_node_t *) cast->old_name, visitor, data);
430
431 break;
432 }
433 case PM_ALIAS_METHOD_NODE: {
434 const pm_alias_method_node_t *cast = (const pm_alias_method_node_t *) node;
435
436 // Visit the new_name field
437 pm_visit_node((const pm_node_t *) cast->new_name, visitor, data);
438
439 // Visit the old_name field
440 pm_visit_node((const pm_node_t *) cast->old_name, visitor, data);
441
442 break;
443 }
444 case PM_ALTERNATION_PATTERN_NODE: {
446
447 // Visit the left field
448 pm_visit_node((const pm_node_t *) cast->left, visitor, data);
449
450 // Visit the right field
451 pm_visit_node((const pm_node_t *) cast->right, visitor, data);
452
453 break;
454 }
455 case PM_AND_NODE: {
456 const pm_and_node_t *cast = (const pm_and_node_t *) node;
457
458 // Visit the left field
459 pm_visit_node((const pm_node_t *) cast->left, visitor, data);
460
461 // Visit the right field
462 pm_visit_node((const pm_node_t *) cast->right, visitor, data);
463
464 break;
465 }
466 case PM_ARGUMENTS_NODE: {
467 const pm_arguments_node_t *cast = (const pm_arguments_node_t *) node;
468
469 // Visit the arguments field
470 const pm_node_list_t *arguments = &cast->arguments;
471 for (size_t index = 0; index < arguments->size; index++) {
472 pm_visit_node(arguments->nodes[index], visitor, data);
473 }
474
475 break;
476 }
477 case PM_ARRAY_NODE: {
478 const pm_array_node_t *cast = (const pm_array_node_t *) node;
479
480 // Visit the elements field
481 const pm_node_list_t *elements = &cast->elements;
482 for (size_t index = 0; index < elements->size; index++) {
483 pm_visit_node(elements->nodes[index], visitor, data);
484 }
485
486 break;
487 }
488 case PM_ARRAY_PATTERN_NODE: {
489 const pm_array_pattern_node_t *cast = (const pm_array_pattern_node_t *) node;
490
491 // Visit the constant field
492 if (cast->constant != NULL) {
493 pm_visit_node((const pm_node_t *) cast->constant, visitor, data);
494 }
495
496 // Visit the requireds field
497 const pm_node_list_t *requireds = &cast->requireds;
498 for (size_t index = 0; index < requireds->size; index++) {
499 pm_visit_node(requireds->nodes[index], visitor, data);
500 }
501
502 // Visit the rest field
503 if (cast->rest != NULL) {
504 pm_visit_node((const pm_node_t *) cast->rest, visitor, data);
505 }
506
507 // Visit the posts field
508 const pm_node_list_t *posts = &cast->posts;
509 for (size_t index = 0; index < posts->size; index++) {
510 pm_visit_node(posts->nodes[index], visitor, data);
511 }
512
513 break;
514 }
515 case PM_ASSOC_NODE: {
516 const pm_assoc_node_t *cast = (const pm_assoc_node_t *) node;
517
518 // Visit the key field
519 pm_visit_node((const pm_node_t *) cast->key, visitor, data);
520
521 // Visit the value field
522 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
523
524 break;
525 }
526 case PM_ASSOC_SPLAT_NODE: {
527 const pm_assoc_splat_node_t *cast = (const pm_assoc_splat_node_t *) node;
528
529 // Visit the value field
530 if (cast->value != NULL) {
531 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
532 }
533
534 break;
535 }
536 case PM_BACK_REFERENCE_READ_NODE:
537 break;
538 case PM_BEGIN_NODE: {
539 const pm_begin_node_t *cast = (const pm_begin_node_t *) node;
540
541 // Visit the statements field
542 if (cast->statements != NULL) {
543 pm_visit_node((const pm_node_t *) cast->statements, visitor, data);
544 }
545
546 // Visit the rescue_clause field
547 if (cast->rescue_clause != NULL) {
548 pm_visit_node((const pm_node_t *) cast->rescue_clause, visitor, data);
549 }
550
551 // Visit the else_clause field
552 if (cast->else_clause != NULL) {
553 pm_visit_node((const pm_node_t *) cast->else_clause, visitor, data);
554 }
555
556 // Visit the ensure_clause field
557 if (cast->ensure_clause != NULL) {
558 pm_visit_node((const pm_node_t *) cast->ensure_clause, visitor, data);
559 }
560
561 break;
562 }
563 case PM_BLOCK_ARGUMENT_NODE: {
564 const pm_block_argument_node_t *cast = (const pm_block_argument_node_t *) node;
565
566 // Visit the expression field
567 if (cast->expression != NULL) {
568 pm_visit_node((const pm_node_t *) cast->expression, visitor, data);
569 }
570
571 break;
572 }
573 case PM_BLOCK_LOCAL_VARIABLE_NODE:
574 break;
575 case PM_BLOCK_NODE: {
576 const pm_block_node_t *cast = (const pm_block_node_t *) node;
577
578 // Visit the parameters field
579 if (cast->parameters != NULL) {
580 pm_visit_node((const pm_node_t *) cast->parameters, visitor, data);
581 }
582
583 // Visit the body field
584 if (cast->body != NULL) {
585 pm_visit_node((const pm_node_t *) cast->body, visitor, data);
586 }
587
588 break;
589 }
590 case PM_BLOCK_PARAMETER_NODE:
591 break;
592 case PM_BLOCK_PARAMETERS_NODE: {
593 const pm_block_parameters_node_t *cast = (const pm_block_parameters_node_t *) node;
594
595 // Visit the parameters field
596 if (cast->parameters != NULL) {
597 pm_visit_node((const pm_node_t *) cast->parameters, visitor, data);
598 }
599
600 // Visit the locals field
601 const pm_node_list_t *locals = &cast->locals;
602 for (size_t index = 0; index < locals->size; index++) {
603 pm_visit_node(locals->nodes[index], visitor, data);
604 }
605
606 break;
607 }
608 case PM_BREAK_NODE: {
609 const pm_break_node_t *cast = (const pm_break_node_t *) node;
610
611 // Visit the arguments field
612 if (cast->arguments != NULL) {
613 pm_visit_node((const pm_node_t *) cast->arguments, visitor, data);
614 }
615
616 break;
617 }
618 case PM_CALL_AND_WRITE_NODE: {
619 const pm_call_and_write_node_t *cast = (const pm_call_and_write_node_t *) node;
620
621 // Visit the receiver field
622 if (cast->receiver != NULL) {
623 pm_visit_node((const pm_node_t *) cast->receiver, visitor, data);
624 }
625
626 // Visit the value field
627 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
628
629 break;
630 }
631 case PM_CALL_NODE: {
632 const pm_call_node_t *cast = (const pm_call_node_t *) node;
633
634 // Visit the receiver field
635 if (cast->receiver != NULL) {
636 pm_visit_node((const pm_node_t *) cast->receiver, visitor, data);
637 }
638
639 // Visit the arguments field
640 if (cast->arguments != NULL) {
641 pm_visit_node((const pm_node_t *) cast->arguments, visitor, data);
642 }
643
644 // Visit the block field
645 if (cast->block != NULL) {
646 pm_visit_node((const pm_node_t *) cast->block, visitor, data);
647 }
648
649 break;
650 }
651 case PM_CALL_OPERATOR_WRITE_NODE: {
653
654 // Visit the receiver field
655 if (cast->receiver != NULL) {
656 pm_visit_node((const pm_node_t *) cast->receiver, visitor, data);
657 }
658
659 // Visit the value field
660 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
661
662 break;
663 }
664 case PM_CALL_OR_WRITE_NODE: {
665 const pm_call_or_write_node_t *cast = (const pm_call_or_write_node_t *) node;
666
667 // Visit the receiver field
668 if (cast->receiver != NULL) {
669 pm_visit_node((const pm_node_t *) cast->receiver, visitor, data);
670 }
671
672 // Visit the value field
673 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
674
675 break;
676 }
677 case PM_CALL_TARGET_NODE: {
678 const pm_call_target_node_t *cast = (const pm_call_target_node_t *) node;
679
680 // Visit the receiver field
681 pm_visit_node((const pm_node_t *) cast->receiver, visitor, data);
682
683 break;
684 }
685 case PM_CAPTURE_PATTERN_NODE: {
686 const pm_capture_pattern_node_t *cast = (const pm_capture_pattern_node_t *) node;
687
688 // Visit the value field
689 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
690
691 // Visit the target field
692 pm_visit_node((const pm_node_t *) cast->target, visitor, data);
693
694 break;
695 }
696 case PM_CASE_MATCH_NODE: {
697 const pm_case_match_node_t *cast = (const pm_case_match_node_t *) node;
698
699 // Visit the predicate field
700 if (cast->predicate != NULL) {
701 pm_visit_node((const pm_node_t *) cast->predicate, visitor, data);
702 }
703
704 // Visit the conditions field
705 const pm_node_list_t *conditions = &cast->conditions;
706 for (size_t index = 0; index < conditions->size; index++) {
707 pm_visit_node(conditions->nodes[index], visitor, data);
708 }
709
710 // Visit the else_clause field
711 if (cast->else_clause != NULL) {
712 pm_visit_node((const pm_node_t *) cast->else_clause, visitor, data);
713 }
714
715 break;
716 }
717 case PM_CASE_NODE: {
718 const pm_case_node_t *cast = (const pm_case_node_t *) node;
719
720 // Visit the predicate field
721 if (cast->predicate != NULL) {
722 pm_visit_node((const pm_node_t *) cast->predicate, visitor, data);
723 }
724
725 // Visit the conditions field
726 const pm_node_list_t *conditions = &cast->conditions;
727 for (size_t index = 0; index < conditions->size; index++) {
728 pm_visit_node(conditions->nodes[index], visitor, data);
729 }
730
731 // Visit the else_clause field
732 if (cast->else_clause != NULL) {
733 pm_visit_node((const pm_node_t *) cast->else_clause, visitor, data);
734 }
735
736 break;
737 }
738 case PM_CLASS_NODE: {
739 const pm_class_node_t *cast = (const pm_class_node_t *) node;
740
741 // Visit the constant_path field
742 pm_visit_node((const pm_node_t *) cast->constant_path, visitor, data);
743
744 // Visit the superclass field
745 if (cast->superclass != NULL) {
746 pm_visit_node((const pm_node_t *) cast->superclass, visitor, data);
747 }
748
749 // Visit the body field
750 if (cast->body != NULL) {
751 pm_visit_node((const pm_node_t *) cast->body, visitor, data);
752 }
753
754 break;
755 }
756 case PM_CLASS_VARIABLE_AND_WRITE_NODE: {
758
759 // Visit the value field
760 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
761
762 break;
763 }
764 case PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
766
767 // Visit the value field
768 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
769
770 break;
771 }
772 case PM_CLASS_VARIABLE_OR_WRITE_NODE: {
774
775 // Visit the value field
776 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
777
778 break;
779 }
780 case PM_CLASS_VARIABLE_READ_NODE:
781 break;
782 case PM_CLASS_VARIABLE_TARGET_NODE:
783 break;
784 case PM_CLASS_VARIABLE_WRITE_NODE: {
786
787 // Visit the value field
788 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
789
790 break;
791 }
792 case PM_CONSTANT_AND_WRITE_NODE: {
794
795 // Visit the value field
796 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
797
798 break;
799 }
800 case PM_CONSTANT_OPERATOR_WRITE_NODE: {
802
803 // Visit the value field
804 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
805
806 break;
807 }
808 case PM_CONSTANT_OR_WRITE_NODE: {
809 const pm_constant_or_write_node_t *cast = (const pm_constant_or_write_node_t *) node;
810
811 // Visit the value field
812 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
813
814 break;
815 }
816 case PM_CONSTANT_PATH_AND_WRITE_NODE: {
818
819 // Visit the target field
820 pm_visit_node((const pm_node_t *) cast->target, visitor, data);
821
822 // Visit the value field
823 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
824
825 break;
826 }
827 case PM_CONSTANT_PATH_NODE: {
828 const pm_constant_path_node_t *cast = (const pm_constant_path_node_t *) node;
829
830 // Visit the parent field
831 if (cast->parent != NULL) {
832 pm_visit_node((const pm_node_t *) cast->parent, visitor, data);
833 }
834
835 break;
836 }
837 case PM_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
839
840 // Visit the target field
841 pm_visit_node((const pm_node_t *) cast->target, visitor, data);
842
843 // Visit the value field
844 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
845
846 break;
847 }
848 case PM_CONSTANT_PATH_OR_WRITE_NODE: {
850
851 // Visit the target field
852 pm_visit_node((const pm_node_t *) cast->target, visitor, data);
853
854 // Visit the value field
855 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
856
857 break;
858 }
859 case PM_CONSTANT_PATH_TARGET_NODE: {
861
862 // Visit the parent field
863 if (cast->parent != NULL) {
864 pm_visit_node((const pm_node_t *) cast->parent, visitor, data);
865 }
866
867 break;
868 }
869 case PM_CONSTANT_PATH_WRITE_NODE: {
871
872 // Visit the target field
873 pm_visit_node((const pm_node_t *) cast->target, visitor, data);
874
875 // Visit the value field
876 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
877
878 break;
879 }
880 case PM_CONSTANT_READ_NODE:
881 break;
882 case PM_CONSTANT_TARGET_NODE:
883 break;
884 case PM_CONSTANT_WRITE_NODE: {
885 const pm_constant_write_node_t *cast = (const pm_constant_write_node_t *) node;
886
887 // Visit the value field
888 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
889
890 break;
891 }
892 case PM_DEF_NODE: {
893 const pm_def_node_t *cast = (const pm_def_node_t *) node;
894
895 // Visit the receiver field
896 if (cast->receiver != NULL) {
897 pm_visit_node((const pm_node_t *) cast->receiver, visitor, data);
898 }
899
900 // Visit the parameters field
901 if (cast->parameters != NULL) {
902 pm_visit_node((const pm_node_t *) cast->parameters, visitor, data);
903 }
904
905 // Visit the body field
906 if (cast->body != NULL) {
907 pm_visit_node((const pm_node_t *) cast->body, visitor, data);
908 }
909
910 break;
911 }
912 case PM_DEFINED_NODE: {
913 const pm_defined_node_t *cast = (const pm_defined_node_t *) node;
914
915 // Visit the value field
916 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
917
918 break;
919 }
920 case PM_ELSE_NODE: {
921 const pm_else_node_t *cast = (const pm_else_node_t *) node;
922
923 // Visit the statements field
924 if (cast->statements != NULL) {
925 pm_visit_node((const pm_node_t *) cast->statements, visitor, data);
926 }
927
928 break;
929 }
930 case PM_EMBEDDED_STATEMENTS_NODE: {
932
933 // Visit the statements field
934 if (cast->statements != NULL) {
935 pm_visit_node((const pm_node_t *) cast->statements, visitor, data);
936 }
937
938 break;
939 }
940 case PM_EMBEDDED_VARIABLE_NODE: {
941 const pm_embedded_variable_node_t *cast = (const pm_embedded_variable_node_t *) node;
942
943 // Visit the variable field
944 pm_visit_node((const pm_node_t *) cast->variable, visitor, data);
945
946 break;
947 }
948 case PM_ENSURE_NODE: {
949 const pm_ensure_node_t *cast = (const pm_ensure_node_t *) node;
950
951 // Visit the statements field
952 if (cast->statements != NULL) {
953 pm_visit_node((const pm_node_t *) cast->statements, visitor, data);
954 }
955
956 break;
957 }
958 case PM_ERROR_RECOVERY_NODE: {
959 const pm_error_recovery_node_t *cast = (const pm_error_recovery_node_t *) node;
960
961 // Visit the unexpected field
962 if (cast->unexpected != NULL) {
963 pm_visit_node((const pm_node_t *) cast->unexpected, visitor, data);
964 }
965
966 break;
967 }
968 case PM_FALSE_NODE:
969 break;
970 case PM_FIND_PATTERN_NODE: {
971 const pm_find_pattern_node_t *cast = (const pm_find_pattern_node_t *) node;
972
973 // Visit the constant field
974 if (cast->constant != NULL) {
975 pm_visit_node((const pm_node_t *) cast->constant, visitor, data);
976 }
977
978 // Visit the left field
979 pm_visit_node((const pm_node_t *) cast->left, visitor, data);
980
981 // Visit the requireds field
982 const pm_node_list_t *requireds = &cast->requireds;
983 for (size_t index = 0; index < requireds->size; index++) {
984 pm_visit_node(requireds->nodes[index], visitor, data);
985 }
986
987 // Visit the right field
988 pm_visit_node((const pm_node_t *) cast->right, visitor, data);
989
990 break;
991 }
992 case PM_FLIP_FLOP_NODE: {
993 const pm_flip_flop_node_t *cast = (const pm_flip_flop_node_t *) node;
994
995 // Visit the left field
996 if (cast->left != NULL) {
997 pm_visit_node((const pm_node_t *) cast->left, visitor, data);
998 }
999
1000 // Visit the right field
1001 if (cast->right != NULL) {
1002 pm_visit_node((const pm_node_t *) cast->right, visitor, data);
1003 }
1004
1005 break;
1006 }
1007 case PM_FLOAT_NODE:
1008 break;
1009 case PM_FOR_NODE: {
1010 const pm_for_node_t *cast = (const pm_for_node_t *) node;
1011
1012 // Visit the index field
1013 pm_visit_node((const pm_node_t *) cast->index, visitor, data);
1014
1015 // Visit the collection field
1016 pm_visit_node((const pm_node_t *) cast->collection, visitor, data);
1017
1018 // Visit the statements field
1019 if (cast->statements != NULL) {
1020 pm_visit_node((const pm_node_t *) cast->statements, visitor, data);
1021 }
1022
1023 break;
1024 }
1025 case PM_FORWARDING_ARGUMENTS_NODE:
1026 break;
1027 case PM_FORWARDING_PARAMETER_NODE:
1028 break;
1029 case PM_FORWARDING_SUPER_NODE: {
1030 const pm_forwarding_super_node_t *cast = (const pm_forwarding_super_node_t *) node;
1031
1032 // Visit the block field
1033 if (cast->block != NULL) {
1034 pm_visit_node((const pm_node_t *) cast->block, visitor, data);
1035 }
1036
1037 break;
1038 }
1039 case PM_GLOBAL_VARIABLE_AND_WRITE_NODE: {
1041
1042 // Visit the value field
1043 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
1044
1045 break;
1046 }
1047 case PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
1049
1050 // Visit the value field
1051 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
1052
1053 break;
1054 }
1055 case PM_GLOBAL_VARIABLE_OR_WRITE_NODE: {
1057
1058 // Visit the value field
1059 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
1060
1061 break;
1062 }
1063 case PM_GLOBAL_VARIABLE_READ_NODE:
1064 break;
1065 case PM_GLOBAL_VARIABLE_TARGET_NODE:
1066 break;
1067 case PM_GLOBAL_VARIABLE_WRITE_NODE: {
1069
1070 // Visit the value field
1071 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
1072
1073 break;
1074 }
1075 case PM_HASH_NODE: {
1076 const pm_hash_node_t *cast = (const pm_hash_node_t *) node;
1077
1078 // Visit the elements field
1079 const pm_node_list_t *elements = &cast->elements;
1080 for (size_t index = 0; index < elements->size; index++) {
1081 pm_visit_node(elements->nodes[index], visitor, data);
1082 }
1083
1084 break;
1085 }
1086 case PM_HASH_PATTERN_NODE: {
1087 const pm_hash_pattern_node_t *cast = (const pm_hash_pattern_node_t *) node;
1088
1089 // Visit the constant field
1090 if (cast->constant != NULL) {
1091 pm_visit_node((const pm_node_t *) cast->constant, visitor, data);
1092 }
1093
1094 // Visit the elements field
1095 const pm_node_list_t *elements = &cast->elements;
1096 for (size_t index = 0; index < elements->size; index++) {
1097 pm_visit_node(elements->nodes[index], visitor, data);
1098 }
1099
1100 // Visit the rest field
1101 if (cast->rest != NULL) {
1102 pm_visit_node((const pm_node_t *) cast->rest, visitor, data);
1103 }
1104
1105 break;
1106 }
1107 case PM_IF_NODE: {
1108 const pm_if_node_t *cast = (const pm_if_node_t *) node;
1109
1110 // Visit the predicate field
1111 pm_visit_node((const pm_node_t *) cast->predicate, visitor, data);
1112
1113 // Visit the statements field
1114 if (cast->statements != NULL) {
1115 pm_visit_node((const pm_node_t *) cast->statements, visitor, data);
1116 }
1117
1118 // Visit the subsequent field
1119 if (cast->subsequent != NULL) {
1120 pm_visit_node((const pm_node_t *) cast->subsequent, visitor, data);
1121 }
1122
1123 break;
1124 }
1125 case PM_IMAGINARY_NODE: {
1126 const pm_imaginary_node_t *cast = (const pm_imaginary_node_t *) node;
1127
1128 // Visit the numeric field
1129 pm_visit_node((const pm_node_t *) cast->numeric, visitor, data);
1130
1131 break;
1132 }
1133 case PM_IMPLICIT_NODE: {
1134 const pm_implicit_node_t *cast = (const pm_implicit_node_t *) node;
1135
1136 // Visit the value field
1137 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
1138
1139 break;
1140 }
1141 case PM_IMPLICIT_REST_NODE:
1142 break;
1143 case PM_IN_NODE: {
1144 const pm_in_node_t *cast = (const pm_in_node_t *) node;
1145
1146 // Visit the pattern field
1147 pm_visit_node((const pm_node_t *) cast->pattern, visitor, data);
1148
1149 // Visit the statements field
1150 if (cast->statements != NULL) {
1151 pm_visit_node((const pm_node_t *) cast->statements, visitor, data);
1152 }
1153
1154 break;
1155 }
1156 case PM_INDEX_AND_WRITE_NODE: {
1157 const pm_index_and_write_node_t *cast = (const pm_index_and_write_node_t *) node;
1158
1159 // Visit the receiver field
1160 if (cast->receiver != NULL) {
1161 pm_visit_node((const pm_node_t *) cast->receiver, visitor, data);
1162 }
1163
1164 // Visit the arguments field
1165 if (cast->arguments != NULL) {
1166 pm_visit_node((const pm_node_t *) cast->arguments, visitor, data);
1167 }
1168
1169 // Visit the block field
1170 if (cast->block != NULL) {
1171 pm_visit_node((const pm_node_t *) cast->block, visitor, data);
1172 }
1173
1174 // Visit the value field
1175 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
1176
1177 break;
1178 }
1179 case PM_INDEX_OPERATOR_WRITE_NODE: {
1181
1182 // Visit the receiver field
1183 if (cast->receiver != NULL) {
1184 pm_visit_node((const pm_node_t *) cast->receiver, visitor, data);
1185 }
1186
1187 // Visit the arguments field
1188 if (cast->arguments != NULL) {
1189 pm_visit_node((const pm_node_t *) cast->arguments, visitor, data);
1190 }
1191
1192 // Visit the block field
1193 if (cast->block != NULL) {
1194 pm_visit_node((const pm_node_t *) cast->block, visitor, data);
1195 }
1196
1197 // Visit the value field
1198 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
1199
1200 break;
1201 }
1202 case PM_INDEX_OR_WRITE_NODE: {
1203 const pm_index_or_write_node_t *cast = (const pm_index_or_write_node_t *) node;
1204
1205 // Visit the receiver field
1206 if (cast->receiver != NULL) {
1207 pm_visit_node((const pm_node_t *) cast->receiver, visitor, data);
1208 }
1209
1210 // Visit the arguments field
1211 if (cast->arguments != NULL) {
1212 pm_visit_node((const pm_node_t *) cast->arguments, visitor, data);
1213 }
1214
1215 // Visit the block field
1216 if (cast->block != NULL) {
1217 pm_visit_node((const pm_node_t *) cast->block, visitor, data);
1218 }
1219
1220 // Visit the value field
1221 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
1222
1223 break;
1224 }
1225 case PM_INDEX_TARGET_NODE: {
1226 const pm_index_target_node_t *cast = (const pm_index_target_node_t *) node;
1227
1228 // Visit the receiver field
1229 pm_visit_node((const pm_node_t *) cast->receiver, visitor, data);
1230
1231 // Visit the arguments field
1232 if (cast->arguments != NULL) {
1233 pm_visit_node((const pm_node_t *) cast->arguments, visitor, data);
1234 }
1235
1236 // Visit the block field
1237 if (cast->block != NULL) {
1238 pm_visit_node((const pm_node_t *) cast->block, visitor, data);
1239 }
1240
1241 break;
1242 }
1243 case PM_INSTANCE_VARIABLE_AND_WRITE_NODE: {
1245
1246 // Visit the value field
1247 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
1248
1249 break;
1250 }
1251 case PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
1253
1254 // Visit the value field
1255 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
1256
1257 break;
1258 }
1259 case PM_INSTANCE_VARIABLE_OR_WRITE_NODE: {
1261
1262 // Visit the value field
1263 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
1264
1265 break;
1266 }
1267 case PM_INSTANCE_VARIABLE_READ_NODE:
1268 break;
1269 case PM_INSTANCE_VARIABLE_TARGET_NODE:
1270 break;
1271 case PM_INSTANCE_VARIABLE_WRITE_NODE: {
1273
1274 // Visit the value field
1275 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
1276
1277 break;
1278 }
1279 case PM_INTEGER_NODE:
1280 break;
1281 case PM_INTERPOLATED_MATCH_LAST_LINE_NODE: {
1283
1284 // Visit the parts field
1285 const pm_node_list_t *parts = &cast->parts;
1286 for (size_t index = 0; index < parts->size; index++) {
1287 pm_visit_node(parts->nodes[index], visitor, data);
1288 }
1289
1290 break;
1291 }
1292 case PM_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
1294
1295 // Visit the parts field
1296 const pm_node_list_t *parts = &cast->parts;
1297 for (size_t index = 0; index < parts->size; index++) {
1298 pm_visit_node(parts->nodes[index], visitor, data);
1299 }
1300
1301 break;
1302 }
1303 case PM_INTERPOLATED_STRING_NODE: {
1305
1306 // Visit the parts field
1307 const pm_node_list_t *parts = &cast->parts;
1308 for (size_t index = 0; index < parts->size; index++) {
1309 pm_visit_node(parts->nodes[index], visitor, data);
1310 }
1311
1312 break;
1313 }
1314 case PM_INTERPOLATED_SYMBOL_NODE: {
1316
1317 // Visit the parts field
1318 const pm_node_list_t *parts = &cast->parts;
1319 for (size_t index = 0; index < parts->size; index++) {
1320 pm_visit_node(parts->nodes[index], visitor, data);
1321 }
1322
1323 break;
1324 }
1325 case PM_INTERPOLATED_X_STRING_NODE: {
1327
1328 // Visit the parts field
1329 const pm_node_list_t *parts = &cast->parts;
1330 for (size_t index = 0; index < parts->size; index++) {
1331 pm_visit_node(parts->nodes[index], visitor, data);
1332 }
1333
1334 break;
1335 }
1336 case PM_IT_LOCAL_VARIABLE_READ_NODE:
1337 break;
1338 case PM_IT_PARAMETERS_NODE:
1339 break;
1340 case PM_KEYWORD_HASH_NODE: {
1341 const pm_keyword_hash_node_t *cast = (const pm_keyword_hash_node_t *) node;
1342
1343 // Visit the elements field
1344 const pm_node_list_t *elements = &cast->elements;
1345 for (size_t index = 0; index < elements->size; index++) {
1346 pm_visit_node(elements->nodes[index], visitor, data);
1347 }
1348
1349 break;
1350 }
1351 case PM_KEYWORD_REST_PARAMETER_NODE:
1352 break;
1353 case PM_LAMBDA_NODE: {
1354 const pm_lambda_node_t *cast = (const pm_lambda_node_t *) node;
1355
1356 // Visit the parameters field
1357 if (cast->parameters != NULL) {
1358 pm_visit_node((const pm_node_t *) cast->parameters, visitor, data);
1359 }
1360
1361 // Visit the body field
1362 if (cast->body != NULL) {
1363 pm_visit_node((const pm_node_t *) cast->body, visitor, data);
1364 }
1365
1366 break;
1367 }
1368 case PM_LOCAL_VARIABLE_AND_WRITE_NODE: {
1370
1371 // Visit the value field
1372 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
1373
1374 break;
1375 }
1376 case PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
1378
1379 // Visit the value field
1380 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
1381
1382 break;
1383 }
1384 case PM_LOCAL_VARIABLE_OR_WRITE_NODE: {
1386
1387 // Visit the value field
1388 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
1389
1390 break;
1391 }
1392 case PM_LOCAL_VARIABLE_READ_NODE:
1393 break;
1394 case PM_LOCAL_VARIABLE_TARGET_NODE:
1395 break;
1396 case PM_LOCAL_VARIABLE_WRITE_NODE: {
1398
1399 // Visit the value field
1400 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
1401
1402 break;
1403 }
1404 case PM_MATCH_LAST_LINE_NODE:
1405 break;
1406 case PM_MATCH_PREDICATE_NODE: {
1407 const pm_match_predicate_node_t *cast = (const pm_match_predicate_node_t *) node;
1408
1409 // Visit the value field
1410 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
1411
1412 // Visit the pattern field
1413 pm_visit_node((const pm_node_t *) cast->pattern, visitor, data);
1414
1415 break;
1416 }
1417 case PM_MATCH_REQUIRED_NODE: {
1418 const pm_match_required_node_t *cast = (const pm_match_required_node_t *) node;
1419
1420 // Visit the value field
1421 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
1422
1423 // Visit the pattern field
1424 pm_visit_node((const pm_node_t *) cast->pattern, visitor, data);
1425
1426 break;
1427 }
1428 case PM_MATCH_WRITE_NODE: {
1429 const pm_match_write_node_t *cast = (const pm_match_write_node_t *) node;
1430
1431 // Visit the call field
1432 pm_visit_node((const pm_node_t *) cast->call, visitor, data);
1433
1434 // Visit the targets field
1435 const pm_node_list_t *targets = &cast->targets;
1436 for (size_t index = 0; index < targets->size; index++) {
1437 pm_visit_node(targets->nodes[index], visitor, data);
1438 }
1439
1440 break;
1441 }
1442 case PM_MODULE_NODE: {
1443 const pm_module_node_t *cast = (const pm_module_node_t *) node;
1444
1445 // Visit the constant_path field
1446 pm_visit_node((const pm_node_t *) cast->constant_path, visitor, data);
1447
1448 // Visit the body field
1449 if (cast->body != NULL) {
1450 pm_visit_node((const pm_node_t *) cast->body, visitor, data);
1451 }
1452
1453 break;
1454 }
1455 case PM_MULTI_TARGET_NODE: {
1456 const pm_multi_target_node_t *cast = (const pm_multi_target_node_t *) node;
1457
1458 // Visit the lefts field
1459 const pm_node_list_t *lefts = &cast->lefts;
1460 for (size_t index = 0; index < lefts->size; index++) {
1461 pm_visit_node(lefts->nodes[index], visitor, data);
1462 }
1463
1464 // Visit the rest field
1465 if (cast->rest != NULL) {
1466 pm_visit_node((const pm_node_t *) cast->rest, visitor, data);
1467 }
1468
1469 // Visit the rights field
1470 const pm_node_list_t *rights = &cast->rights;
1471 for (size_t index = 0; index < rights->size; index++) {
1472 pm_visit_node(rights->nodes[index], visitor, data);
1473 }
1474
1475 break;
1476 }
1477 case PM_MULTI_WRITE_NODE: {
1478 const pm_multi_write_node_t *cast = (const pm_multi_write_node_t *) node;
1479
1480 // Visit the lefts field
1481 const pm_node_list_t *lefts = &cast->lefts;
1482 for (size_t index = 0; index < lefts->size; index++) {
1483 pm_visit_node(lefts->nodes[index], visitor, data);
1484 }
1485
1486 // Visit the rest field
1487 if (cast->rest != NULL) {
1488 pm_visit_node((const pm_node_t *) cast->rest, visitor, data);
1489 }
1490
1491 // Visit the rights field
1492 const pm_node_list_t *rights = &cast->rights;
1493 for (size_t index = 0; index < rights->size; index++) {
1494 pm_visit_node(rights->nodes[index], visitor, data);
1495 }
1496
1497 // Visit the value field
1498 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
1499
1500 break;
1501 }
1502 case PM_NEXT_NODE: {
1503 const pm_next_node_t *cast = (const pm_next_node_t *) node;
1504
1505 // Visit the arguments field
1506 if (cast->arguments != NULL) {
1507 pm_visit_node((const pm_node_t *) cast->arguments, visitor, data);
1508 }
1509
1510 break;
1511 }
1512 case PM_NIL_NODE:
1513 break;
1514 case PM_NO_BLOCK_PARAMETER_NODE:
1515 break;
1516 case PM_NO_KEYWORDS_PARAMETER_NODE:
1517 break;
1518 case PM_NUMBERED_PARAMETERS_NODE:
1519 break;
1520 case PM_NUMBERED_REFERENCE_READ_NODE:
1521 break;
1522 case PM_OPTIONAL_KEYWORD_PARAMETER_NODE: {
1524
1525 // Visit the value field
1526 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
1527
1528 break;
1529 }
1530 case PM_OPTIONAL_PARAMETER_NODE: {
1532
1533 // Visit the value field
1534 pm_visit_node((const pm_node_t *) cast->value, visitor, data);
1535
1536 break;
1537 }
1538 case PM_OR_NODE: {
1539 const pm_or_node_t *cast = (const pm_or_node_t *) node;
1540
1541 // Visit the left field
1542 pm_visit_node((const pm_node_t *) cast->left, visitor, data);
1543
1544 // Visit the right field
1545 pm_visit_node((const pm_node_t *) cast->right, visitor, data);
1546
1547 break;
1548 }
1549 case PM_PARAMETERS_NODE: {
1550 const pm_parameters_node_t *cast = (const pm_parameters_node_t *) node;
1551
1552 // Visit the requireds field
1553 const pm_node_list_t *requireds = &cast->requireds;
1554 for (size_t index = 0; index < requireds->size; index++) {
1555 pm_visit_node(requireds->nodes[index], visitor, data);
1556 }
1557
1558 // Visit the optionals field
1559 const pm_node_list_t *optionals = &cast->optionals;
1560 for (size_t index = 0; index < optionals->size; index++) {
1561 pm_visit_node(optionals->nodes[index], visitor, data);
1562 }
1563
1564 // Visit the rest field
1565 if (cast->rest != NULL) {
1566 pm_visit_node((const pm_node_t *) cast->rest, visitor, data);
1567 }
1568
1569 // Visit the posts field
1570 const pm_node_list_t *posts = &cast->posts;
1571 for (size_t index = 0; index < posts->size; index++) {
1572 pm_visit_node(posts->nodes[index], visitor, data);
1573 }
1574
1575 // Visit the keywords field
1576 const pm_node_list_t *keywords = &cast->keywords;
1577 for (size_t index = 0; index < keywords->size; index++) {
1578 pm_visit_node(keywords->nodes[index], visitor, data);
1579 }
1580
1581 // Visit the keyword_rest field
1582 if (cast->keyword_rest != NULL) {
1583 pm_visit_node((const pm_node_t *) cast->keyword_rest, visitor, data);
1584 }
1585
1586 // Visit the block field
1587 if (cast->block != NULL) {
1588 pm_visit_node((const pm_node_t *) cast->block, visitor, data);
1589 }
1590
1591 break;
1592 }
1593 case PM_PARENTHESES_NODE: {
1594 const pm_parentheses_node_t *cast = (const pm_parentheses_node_t *) node;
1595
1596 // Visit the body field
1597 if (cast->body != NULL) {
1598 pm_visit_node((const pm_node_t *) cast->body, visitor, data);
1599 }
1600
1601 break;
1602 }
1603 case PM_PINNED_EXPRESSION_NODE: {
1604 const pm_pinned_expression_node_t *cast = (const pm_pinned_expression_node_t *) node;
1605
1606 // Visit the expression field
1607 pm_visit_node((const pm_node_t *) cast->expression, visitor, data);
1608
1609 break;
1610 }
1611 case PM_PINNED_VARIABLE_NODE: {
1612 const pm_pinned_variable_node_t *cast = (const pm_pinned_variable_node_t *) node;
1613
1614 // Visit the variable field
1615 pm_visit_node((const pm_node_t *) cast->variable, visitor, data);
1616
1617 break;
1618 }
1619 case PM_POST_EXECUTION_NODE: {
1620 const pm_post_execution_node_t *cast = (const pm_post_execution_node_t *) node;
1621
1622 // Visit the statements field
1623 if (cast->statements != NULL) {
1624 pm_visit_node((const pm_node_t *) cast->statements, visitor, data);
1625 }
1626
1627 break;
1628 }
1629 case PM_PRE_EXECUTION_NODE: {
1630 const pm_pre_execution_node_t *cast = (const pm_pre_execution_node_t *) node;
1631
1632 // Visit the statements field
1633 if (cast->statements != NULL) {
1634 pm_visit_node((const pm_node_t *) cast->statements, visitor, data);
1635 }
1636
1637 break;
1638 }
1639 case PM_PROGRAM_NODE: {
1640 const pm_program_node_t *cast = (const pm_program_node_t *) node;
1641
1642 // Visit the statements field
1643 pm_visit_node((const pm_node_t *) cast->statements, visitor, data);
1644
1645 break;
1646 }
1647 case PM_RANGE_NODE: {
1648 const pm_range_node_t *cast = (const pm_range_node_t *) node;
1649
1650 // Visit the left field
1651 if (cast->left != NULL) {
1652 pm_visit_node((const pm_node_t *) cast->left, visitor, data);
1653 }
1654
1655 // Visit the right field
1656 if (cast->right != NULL) {
1657 pm_visit_node((const pm_node_t *) cast->right, visitor, data);
1658 }
1659
1660 break;
1661 }
1662 case PM_RATIONAL_NODE:
1663 break;
1664 case PM_REDO_NODE:
1665 break;
1666 case PM_REGULAR_EXPRESSION_NODE:
1667 break;
1668 case PM_REQUIRED_KEYWORD_PARAMETER_NODE:
1669 break;
1670 case PM_REQUIRED_PARAMETER_NODE:
1671 break;
1672 case PM_RESCUE_MODIFIER_NODE: {
1673 const pm_rescue_modifier_node_t *cast = (const pm_rescue_modifier_node_t *) node;
1674
1675 // Visit the expression field
1676 pm_visit_node((const pm_node_t *) cast->expression, visitor, data);
1677
1678 // Visit the rescue_expression field
1679 pm_visit_node((const pm_node_t *) cast->rescue_expression, visitor, data);
1680
1681 break;
1682 }
1683 case PM_RESCUE_NODE: {
1684 const pm_rescue_node_t *cast = (const pm_rescue_node_t *) node;
1685
1686 // Visit the exceptions field
1687 const pm_node_list_t *exceptions = &cast->exceptions;
1688 for (size_t index = 0; index < exceptions->size; index++) {
1689 pm_visit_node(exceptions->nodes[index], visitor, data);
1690 }
1691
1692 // Visit the reference field
1693 if (cast->reference != NULL) {
1694 pm_visit_node((const pm_node_t *) cast->reference, visitor, data);
1695 }
1696
1697 // Visit the statements field
1698 if (cast->statements != NULL) {
1699 pm_visit_node((const pm_node_t *) cast->statements, visitor, data);
1700 }
1701
1702 // Visit the subsequent field
1703 if (cast->subsequent != NULL) {
1704 pm_visit_node((const pm_node_t *) cast->subsequent, visitor, data);
1705 }
1706
1707 break;
1708 }
1709 case PM_REST_PARAMETER_NODE:
1710 break;
1711 case PM_RETRY_NODE:
1712 break;
1713 case PM_RETURN_NODE: {
1714 const pm_return_node_t *cast = (const pm_return_node_t *) node;
1715
1716 // Visit the arguments field
1717 if (cast->arguments != NULL) {
1718 pm_visit_node((const pm_node_t *) cast->arguments, visitor, data);
1719 }
1720
1721 break;
1722 }
1723 case PM_SELF_NODE:
1724 break;
1725 case PM_SHAREABLE_CONSTANT_NODE: {
1727
1728 // Visit the write field
1729 pm_visit_node((const pm_node_t *) cast->write, visitor, data);
1730
1731 break;
1732 }
1733 case PM_SINGLETON_CLASS_NODE: {
1734 const pm_singleton_class_node_t *cast = (const pm_singleton_class_node_t *) node;
1735
1736 // Visit the expression field
1737 pm_visit_node((const pm_node_t *) cast->expression, visitor, data);
1738
1739 // Visit the body field
1740 if (cast->body != NULL) {
1741 pm_visit_node((const pm_node_t *) cast->body, visitor, data);
1742 }
1743
1744 break;
1745 }
1746 case PM_SOURCE_ENCODING_NODE:
1747 break;
1748 case PM_SOURCE_FILE_NODE:
1749 break;
1750 case PM_SOURCE_LINE_NODE:
1751 break;
1752 case PM_SPLAT_NODE: {
1753 const pm_splat_node_t *cast = (const pm_splat_node_t *) node;
1754
1755 // Visit the expression field
1756 if (cast->expression != NULL) {
1757 pm_visit_node((const pm_node_t *) cast->expression, visitor, data);
1758 }
1759
1760 break;
1761 }
1762 case PM_STATEMENTS_NODE: {
1763 const pm_statements_node_t *cast = (const pm_statements_node_t *) node;
1764
1765 // Visit the body field
1766 const pm_node_list_t *body = &cast->body;
1767 for (size_t index = 0; index < body->size; index++) {
1768 pm_visit_node(body->nodes[index], visitor, data);
1769 }
1770
1771 break;
1772 }
1773 case PM_STRING_NODE:
1774 break;
1775 case PM_SUPER_NODE: {
1776 const pm_super_node_t *cast = (const pm_super_node_t *) node;
1777
1778 // Visit the arguments field
1779 if (cast->arguments != NULL) {
1780 pm_visit_node((const pm_node_t *) cast->arguments, visitor, data);
1781 }
1782
1783 // Visit the block field
1784 if (cast->block != NULL) {
1785 pm_visit_node((const pm_node_t *) cast->block, visitor, data);
1786 }
1787
1788 break;
1789 }
1790 case PM_SYMBOL_NODE:
1791 break;
1792 case PM_TRUE_NODE:
1793 break;
1794 case PM_UNDEF_NODE: {
1795 const pm_undef_node_t *cast = (const pm_undef_node_t *) node;
1796
1797 // Visit the names field
1798 const pm_node_list_t *names = &cast->names;
1799 for (size_t index = 0; index < names->size; index++) {
1800 pm_visit_node(names->nodes[index], visitor, data);
1801 }
1802
1803 break;
1804 }
1805 case PM_UNLESS_NODE: {
1806 const pm_unless_node_t *cast = (const pm_unless_node_t *) node;
1807
1808 // Visit the predicate field
1809 pm_visit_node((const pm_node_t *) cast->predicate, visitor, data);
1810
1811 // Visit the statements field
1812 if (cast->statements != NULL) {
1813 pm_visit_node((const pm_node_t *) cast->statements, visitor, data);
1814 }
1815
1816 // Visit the else_clause field
1817 if (cast->else_clause != NULL) {
1818 pm_visit_node((const pm_node_t *) cast->else_clause, visitor, data);
1819 }
1820
1821 break;
1822 }
1823 case PM_UNTIL_NODE: {
1824 const pm_until_node_t *cast = (const pm_until_node_t *) node;
1825
1826 // Visit the predicate field
1827 pm_visit_node((const pm_node_t *) cast->predicate, visitor, data);
1828
1829 // Visit the statements field
1830 if (cast->statements != NULL) {
1831 pm_visit_node((const pm_node_t *) cast->statements, visitor, data);
1832 }
1833
1834 break;
1835 }
1836 case PM_WHEN_NODE: {
1837 const pm_when_node_t *cast = (const pm_when_node_t *) node;
1838
1839 // Visit the conditions field
1840 const pm_node_list_t *conditions = &cast->conditions;
1841 for (size_t index = 0; index < conditions->size; index++) {
1842 pm_visit_node(conditions->nodes[index], visitor, data);
1843 }
1844
1845 // Visit the statements field
1846 if (cast->statements != NULL) {
1847 pm_visit_node((const pm_node_t *) cast->statements, visitor, data);
1848 }
1849
1850 break;
1851 }
1852 case PM_WHILE_NODE: {
1853 const pm_while_node_t *cast = (const pm_while_node_t *) node;
1854
1855 // Visit the predicate field
1856 pm_visit_node((const pm_node_t *) cast->predicate, visitor, data);
1857
1858 // Visit the statements field
1859 if (cast->statements != NULL) {
1860 pm_visit_node((const pm_node_t *) cast->statements, visitor, data);
1861 }
1862
1863 break;
1864 }
1865 case PM_X_STRING_NODE:
1866 break;
1867 case PM_YIELD_NODE: {
1868 const pm_yield_node_t *cast = (const pm_yield_node_t *) node;
1869
1870 // Visit the arguments field
1871 if (cast->arguments != NULL) {
1872 pm_visit_node((const pm_node_t *) cast->arguments, visitor, data);
1873 }
1874
1875 break;
1876 }
1877 case PM_SCOPE_NODE:
1878 break;
1879 }
1880}
1881
1886pm_alias_global_variable_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *new_name, struct pm_node *old_name, pm_location_t keyword_loc) {
1888
1890 .base = { .type = PM_ALIAS_GLOBAL_VARIABLE_NODE, .flags = flags, .node_id = node_id, .location = location },
1891 .new_name = new_name,
1892 .old_name = old_name,
1893 .keyword_loc = keyword_loc
1894 };
1895
1896 return node;
1897}
1898
1903pm_alias_method_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *new_name, struct pm_node *old_name, pm_location_t keyword_loc) {
1905
1906 *node = (pm_alias_method_node_t) {
1907 .base = { .type = PM_ALIAS_METHOD_NODE, .flags = flags, .node_id = node_id, .location = location },
1908 .new_name = new_name,
1909 .old_name = old_name,
1910 .keyword_loc = keyword_loc
1911 };
1912
1913 return node;
1914}
1915
1920pm_alternation_pattern_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *left, struct pm_node *right, pm_location_t operator_loc) {
1922
1924 .base = { .type = PM_ALTERNATION_PATTERN_NODE, .flags = flags, .node_id = node_id, .location = location },
1925 .left = left,
1926 .right = right,
1927 .operator_loc = operator_loc
1928 };
1929
1930 return node;
1931}
1932
1937pm_and_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *left, struct pm_node *right, pm_location_t operator_loc) {
1938 pm_and_node_t *node = (pm_and_node_t *) pm_arena_alloc(arena, sizeof(pm_and_node_t), PRISM_ALIGNOF(pm_and_node_t));
1939
1940 *node = (pm_and_node_t) {
1941 .base = { .type = PM_AND_NODE, .flags = flags, .node_id = node_id, .location = location },
1942 .left = left,
1943 .right = right,
1944 .operator_loc = operator_loc
1945 };
1946
1947 return node;
1948}
1949
1954pm_arguments_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_node_list_t arguments) {
1956
1957 *node = (pm_arguments_node_t) {
1958 .base = { .type = PM_ARGUMENTS_NODE, .flags = flags, .node_id = node_id, .location = location },
1959 .arguments = arguments
1960 };
1961
1962 return node;
1963}
1964
1969pm_array_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_node_list_t elements, pm_location_t opening_loc, pm_location_t closing_loc) {
1970 pm_array_node_t *node = (pm_array_node_t *) pm_arena_alloc(arena, sizeof(pm_array_node_t), PRISM_ALIGNOF(pm_array_node_t));
1971
1972 *node = (pm_array_node_t) {
1973 .base = { .type = PM_ARRAY_NODE, .flags = flags, .node_id = node_id, .location = location },
1974 .elements = elements,
1975 .opening_loc = opening_loc,
1976 .closing_loc = closing_loc
1977 };
1978
1979 return node;
1980}
1981
1986pm_array_pattern_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *constant, pm_node_list_t requireds, struct pm_node *rest, pm_node_list_t posts, pm_location_t opening_loc, pm_location_t closing_loc) {
1988
1989 *node = (pm_array_pattern_node_t) {
1990 .base = { .type = PM_ARRAY_PATTERN_NODE, .flags = flags, .node_id = node_id, .location = location },
1991 .constant = constant,
1992 .requireds = requireds,
1993 .rest = rest,
1994 .posts = posts,
1995 .opening_loc = opening_loc,
1996 .closing_loc = closing_loc
1997 };
1998
1999 return node;
2000}
2001
2006pm_assoc_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *key, struct pm_node *value, pm_location_t operator_loc) {
2007 pm_assoc_node_t *node = (pm_assoc_node_t *) pm_arena_alloc(arena, sizeof(pm_assoc_node_t), PRISM_ALIGNOF(pm_assoc_node_t));
2008
2009 *node = (pm_assoc_node_t) {
2010 .base = { .type = PM_ASSOC_NODE, .flags = flags, .node_id = node_id, .location = location },
2011 .key = key,
2012 .value = value,
2013 .operator_loc = operator_loc
2014 };
2015
2016 return node;
2017}
2018
2023pm_assoc_splat_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *value, pm_location_t operator_loc) {
2025
2026 *node = (pm_assoc_splat_node_t) {
2027 .base = { .type = PM_ASSOC_SPLAT_NODE, .flags = flags, .node_id = node_id, .location = location },
2028 .value = value,
2029 .operator_loc = operator_loc
2030 };
2031
2032 return node;
2033}
2034
2039pm_back_reference_read_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name) {
2041
2043 .base = { .type = PM_BACK_REFERENCE_READ_NODE, .flags = flags, .node_id = node_id, .location = location },
2044 .name = name
2045 };
2046
2047 return node;
2048}
2049
2054pm_begin_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t begin_keyword_loc, struct pm_statements_node *statements, struct pm_rescue_node *rescue_clause, struct pm_else_node *else_clause, struct pm_ensure_node *ensure_clause, pm_location_t end_keyword_loc) {
2055 pm_begin_node_t *node = (pm_begin_node_t *) pm_arena_alloc(arena, sizeof(pm_begin_node_t), PRISM_ALIGNOF(pm_begin_node_t));
2056
2057 *node = (pm_begin_node_t) {
2058 .base = { .type = PM_BEGIN_NODE, .flags = flags, .node_id = node_id, .location = location },
2059 .begin_keyword_loc = begin_keyword_loc,
2060 .statements = statements,
2061 .rescue_clause = rescue_clause,
2062 .else_clause = else_clause,
2063 .ensure_clause = ensure_clause,
2064 .end_keyword_loc = end_keyword_loc
2065 };
2066
2067 return node;
2068}
2069
2074pm_block_argument_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *expression, pm_location_t operator_loc) {
2076
2077 *node = (pm_block_argument_node_t) {
2078 .base = { .type = PM_BLOCK_ARGUMENT_NODE, .flags = flags, .node_id = node_id, .location = location },
2079 .expression = expression,
2080 .operator_loc = operator_loc
2081 };
2082
2083 return node;
2084}
2085
2090pm_block_local_variable_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name) {
2092
2094 .base = { .type = PM_BLOCK_LOCAL_VARIABLE_NODE, .flags = flags, .node_id = node_id, .location = location },
2095 .name = name
2096 };
2097
2098 return node;
2099}
2100
2105pm_block_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_list_t locals, struct pm_node *parameters, struct pm_node *body, pm_location_t opening_loc, pm_location_t closing_loc) {
2106 pm_block_node_t *node = (pm_block_node_t *) pm_arena_alloc(arena, sizeof(pm_block_node_t), PRISM_ALIGNOF(pm_block_node_t));
2107
2108 *node = (pm_block_node_t) {
2109 .base = { .type = PM_BLOCK_NODE, .flags = flags, .node_id = node_id, .location = location },
2110 .locals = locals,
2111 .parameters = parameters,
2112 .body = body,
2113 .opening_loc = opening_loc,
2114 .closing_loc = closing_loc
2115 };
2116
2117 return node;
2118}
2119
2124pm_block_parameter_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, pm_location_t name_loc, pm_location_t operator_loc) {
2126
2127 *node = (pm_block_parameter_node_t) {
2128 .base = { .type = PM_BLOCK_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
2129 .name = name,
2130 .name_loc = name_loc,
2131 .operator_loc = operator_loc
2132 };
2133
2134 return node;
2135}
2136
2141pm_block_parameters_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_parameters_node *parameters, pm_node_list_t locals, pm_location_t opening_loc, pm_location_t closing_loc) {
2143
2144 *node = (pm_block_parameters_node_t) {
2145 .base = { .type = PM_BLOCK_PARAMETERS_NODE, .flags = flags, .node_id = node_id, .location = location },
2146 .parameters = parameters,
2147 .locals = locals,
2148 .opening_loc = opening_loc,
2149 .closing_loc = closing_loc
2150 };
2151
2152 return node;
2153}
2154
2159pm_break_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_arguments_node *arguments, pm_location_t keyword_loc) {
2160 pm_break_node_t *node = (pm_break_node_t *) pm_arena_alloc(arena, sizeof(pm_break_node_t), PRISM_ALIGNOF(pm_break_node_t));
2161
2162 *node = (pm_break_node_t) {
2163 .base = { .type = PM_BREAK_NODE, .flags = flags, .node_id = node_id, .location = location },
2164 .arguments = arguments,
2165 .keyword_loc = keyword_loc
2166 };
2167
2168 return node;
2169}
2170
2175pm_call_and_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *receiver, pm_location_t call_operator_loc, pm_location_t message_loc, pm_constant_id_t read_name, pm_constant_id_t write_name, pm_location_t operator_loc, struct pm_node *value) {
2177
2178 *node = (pm_call_and_write_node_t) {
2179 .base = { .type = PM_CALL_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2180 .receiver = receiver,
2181 .call_operator_loc = call_operator_loc,
2182 .message_loc = message_loc,
2183 .read_name = read_name,
2184 .write_name = write_name,
2185 .operator_loc = operator_loc,
2186 .value = value
2187 };
2188
2189 return node;
2190}
2191
2196pm_call_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *receiver, pm_location_t call_operator_loc, pm_constant_id_t name, pm_location_t message_loc, pm_location_t opening_loc, struct pm_arguments_node *arguments, pm_location_t closing_loc, pm_location_t equal_loc, struct pm_node *block) {
2197 pm_call_node_t *node = (pm_call_node_t *) pm_arena_alloc(arena, sizeof(pm_call_node_t), PRISM_ALIGNOF(pm_call_node_t));
2198
2199 *node = (pm_call_node_t) {
2200 .base = { .type = PM_CALL_NODE, .flags = flags, .node_id = node_id, .location = location },
2201 .receiver = receiver,
2202 .call_operator_loc = call_operator_loc,
2203 .name = name,
2204 .message_loc = message_loc,
2205 .opening_loc = opening_loc,
2206 .arguments = arguments,
2207 .closing_loc = closing_loc,
2208 .equal_loc = equal_loc,
2209 .block = block
2210 };
2211
2212 return node;
2213}
2214
2219pm_call_operator_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *receiver, pm_location_t call_operator_loc, pm_location_t message_loc, pm_constant_id_t read_name, pm_constant_id_t write_name, pm_constant_id_t binary_operator, pm_location_t binary_operator_loc, struct pm_node *value) {
2221
2223 .base = { .type = PM_CALL_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2224 .receiver = receiver,
2225 .call_operator_loc = call_operator_loc,
2226 .message_loc = message_loc,
2227 .read_name = read_name,
2228 .write_name = write_name,
2229 .binary_operator = binary_operator,
2230 .binary_operator_loc = binary_operator_loc,
2231 .value = value
2232 };
2233
2234 return node;
2235}
2236
2241pm_call_or_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *receiver, pm_location_t call_operator_loc, pm_location_t message_loc, pm_constant_id_t read_name, pm_constant_id_t write_name, pm_location_t operator_loc, struct pm_node *value) {
2243
2244 *node = (pm_call_or_write_node_t) {
2245 .base = { .type = PM_CALL_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2246 .receiver = receiver,
2247 .call_operator_loc = call_operator_loc,
2248 .message_loc = message_loc,
2249 .read_name = read_name,
2250 .write_name = write_name,
2251 .operator_loc = operator_loc,
2252 .value = value
2253 };
2254
2255 return node;
2256}
2257
2262pm_call_target_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *receiver, pm_location_t call_operator_loc, pm_constant_id_t name, pm_location_t message_loc) {
2264
2265 *node = (pm_call_target_node_t) {
2266 .base = { .type = PM_CALL_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
2267 .receiver = receiver,
2268 .call_operator_loc = call_operator_loc,
2269 .name = name,
2270 .message_loc = message_loc
2271 };
2272
2273 return node;
2274}
2275
2280pm_capture_pattern_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *value, struct pm_local_variable_target_node *target, pm_location_t operator_loc) {
2282
2283 *node = (pm_capture_pattern_node_t) {
2284 .base = { .type = PM_CAPTURE_PATTERN_NODE, .flags = flags, .node_id = node_id, .location = location },
2285 .value = value,
2286 .target = target,
2287 .operator_loc = operator_loc
2288 };
2289
2290 return node;
2291}
2292
2297pm_case_match_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *predicate, pm_node_list_t conditions, struct pm_else_node *else_clause, pm_location_t case_keyword_loc, pm_location_t end_keyword_loc) {
2299
2300 *node = (pm_case_match_node_t) {
2301 .base = { .type = PM_CASE_MATCH_NODE, .flags = flags, .node_id = node_id, .location = location },
2302 .predicate = predicate,
2303 .conditions = conditions,
2304 .else_clause = else_clause,
2305 .case_keyword_loc = case_keyword_loc,
2306 .end_keyword_loc = end_keyword_loc
2307 };
2308
2309 return node;
2310}
2311
2316pm_case_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *predicate, pm_node_list_t conditions, struct pm_else_node *else_clause, pm_location_t case_keyword_loc, pm_location_t end_keyword_loc) {
2317 pm_case_node_t *node = (pm_case_node_t *) pm_arena_alloc(arena, sizeof(pm_case_node_t), PRISM_ALIGNOF(pm_case_node_t));
2318
2319 *node = (pm_case_node_t) {
2320 .base = { .type = PM_CASE_NODE, .flags = flags, .node_id = node_id, .location = location },
2321 .predicate = predicate,
2322 .conditions = conditions,
2323 .else_clause = else_clause,
2324 .case_keyword_loc = case_keyword_loc,
2325 .end_keyword_loc = end_keyword_loc
2326 };
2327
2328 return node;
2329}
2330
2335pm_class_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_list_t locals, pm_location_t class_keyword_loc, struct pm_node *constant_path, pm_location_t inheritance_operator_loc, struct pm_node *superclass, struct pm_node *body, pm_location_t end_keyword_loc, pm_constant_id_t name) {
2336 pm_class_node_t *node = (pm_class_node_t *) pm_arena_alloc(arena, sizeof(pm_class_node_t), PRISM_ALIGNOF(pm_class_node_t));
2337
2338 *node = (pm_class_node_t) {
2339 .base = { .type = PM_CLASS_NODE, .flags = flags, .node_id = node_id, .location = location },
2340 .locals = locals,
2341 .class_keyword_loc = class_keyword_loc,
2342 .constant_path = constant_path,
2343 .inheritance_operator_loc = inheritance_operator_loc,
2344 .superclass = superclass,
2345 .body = body,
2346 .end_keyword_loc = end_keyword_loc,
2347 .name = name
2348 };
2349
2350 return node;
2351}
2352
2357pm_class_variable_and_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, pm_location_t name_loc, pm_location_t operator_loc, struct pm_node *value) {
2359
2361 .base = { .type = PM_CLASS_VARIABLE_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2362 .name = name,
2363 .name_loc = name_loc,
2364 .operator_loc = operator_loc,
2365 .value = value
2366 };
2367
2368 return node;
2369}
2370
2375pm_class_variable_operator_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, pm_location_t name_loc, pm_location_t binary_operator_loc, struct pm_node *value, pm_constant_id_t binary_operator) {
2377
2379 .base = { .type = PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2380 .name = name,
2381 .name_loc = name_loc,
2382 .binary_operator_loc = binary_operator_loc,
2383 .value = value,
2384 .binary_operator = binary_operator
2385 };
2386
2387 return node;
2388}
2389
2394pm_class_variable_or_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, pm_location_t name_loc, pm_location_t operator_loc, struct pm_node *value) {
2396
2398 .base = { .type = PM_CLASS_VARIABLE_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2399 .name = name,
2400 .name_loc = name_loc,
2401 .operator_loc = operator_loc,
2402 .value = value
2403 };
2404
2405 return node;
2406}
2407
2412pm_class_variable_read_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name) {
2414
2416 .base = { .type = PM_CLASS_VARIABLE_READ_NODE, .flags = flags, .node_id = node_id, .location = location },
2417 .name = name
2418 };
2419
2420 return node;
2421}
2422
2427pm_class_variable_target_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name) {
2429
2431 .base = { .type = PM_CLASS_VARIABLE_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
2432 .name = name
2433 };
2434
2435 return node;
2436}
2437
2442pm_class_variable_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, pm_location_t name_loc, struct pm_node *value, pm_location_t operator_loc) {
2444
2446 .base = { .type = PM_CLASS_VARIABLE_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2447 .name = name,
2448 .name_loc = name_loc,
2449 .value = value,
2450 .operator_loc = operator_loc
2451 };
2452
2453 return node;
2454}
2455
2460pm_constant_and_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, pm_location_t name_loc, pm_location_t operator_loc, struct pm_node *value) {
2462
2464 .base = { .type = PM_CONSTANT_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2465 .name = name,
2466 .name_loc = name_loc,
2467 .operator_loc = operator_loc,
2468 .value = value
2469 };
2470
2471 return node;
2472}
2473
2478pm_constant_operator_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, pm_location_t name_loc, pm_location_t binary_operator_loc, struct pm_node *value, pm_constant_id_t binary_operator) {
2480
2482 .base = { .type = PM_CONSTANT_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2483 .name = name,
2484 .name_loc = name_loc,
2485 .binary_operator_loc = binary_operator_loc,
2486 .value = value,
2487 .binary_operator = binary_operator
2488 };
2489
2490 return node;
2491}
2492
2497pm_constant_or_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, pm_location_t name_loc, pm_location_t operator_loc, struct pm_node *value) {
2499
2500 *node = (pm_constant_or_write_node_t) {
2501 .base = { .type = PM_CONSTANT_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2502 .name = name,
2503 .name_loc = name_loc,
2504 .operator_loc = operator_loc,
2505 .value = value
2506 };
2507
2508 return node;
2509}
2510
2515pm_constant_path_and_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_constant_path_node *target, pm_location_t operator_loc, struct pm_node *value) {
2517
2519 .base = { .type = PM_CONSTANT_PATH_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2520 .target = target,
2521 .operator_loc = operator_loc,
2522 .value = value
2523 };
2524
2525 return node;
2526}
2527
2532pm_constant_path_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *parent, pm_constant_id_t name, pm_location_t delimiter_loc, pm_location_t name_loc) {
2534
2535 *node = (pm_constant_path_node_t) {
2536 .base = { .type = PM_CONSTANT_PATH_NODE, .flags = flags, .node_id = node_id, .location = location },
2537 .parent = parent,
2538 .name = name,
2539 .delimiter_loc = delimiter_loc,
2540 .name_loc = name_loc
2541 };
2542
2543 return node;
2544}
2545
2550pm_constant_path_operator_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_constant_path_node *target, pm_location_t binary_operator_loc, struct pm_node *value, pm_constant_id_t binary_operator) {
2552
2554 .base = { .type = PM_CONSTANT_PATH_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2555 .target = target,
2556 .binary_operator_loc = binary_operator_loc,
2557 .value = value,
2558 .binary_operator = binary_operator
2559 };
2560
2561 return node;
2562}
2563
2568pm_constant_path_or_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_constant_path_node *target, pm_location_t operator_loc, struct pm_node *value) {
2570
2572 .base = { .type = PM_CONSTANT_PATH_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2573 .target = target,
2574 .operator_loc = operator_loc,
2575 .value = value
2576 };
2577
2578 return node;
2579}
2580
2585pm_constant_path_target_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *parent, pm_constant_id_t name, pm_location_t delimiter_loc, pm_location_t name_loc) {
2587
2589 .base = { .type = PM_CONSTANT_PATH_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
2590 .parent = parent,
2591 .name = name,
2592 .delimiter_loc = delimiter_loc,
2593 .name_loc = name_loc
2594 };
2595
2596 return node;
2597}
2598
2603pm_constant_path_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_constant_path_node *target, pm_location_t operator_loc, struct pm_node *value) {
2605
2607 .base = { .type = PM_CONSTANT_PATH_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2608 .target = target,
2609 .operator_loc = operator_loc,
2610 .value = value
2611 };
2612
2613 return node;
2614}
2615
2620pm_constant_read_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name) {
2622
2623 *node = (pm_constant_read_node_t) {
2624 .base = { .type = PM_CONSTANT_READ_NODE, .flags = flags, .node_id = node_id, .location = location },
2625 .name = name
2626 };
2627
2628 return node;
2629}
2630
2635pm_constant_target_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name) {
2637
2638 *node = (pm_constant_target_node_t) {
2639 .base = { .type = PM_CONSTANT_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
2640 .name = name
2641 };
2642
2643 return node;
2644}
2645
2650pm_constant_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, pm_location_t name_loc, struct pm_node *value, pm_location_t operator_loc) {
2652
2653 *node = (pm_constant_write_node_t) {
2654 .base = { .type = PM_CONSTANT_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2655 .name = name,
2656 .name_loc = name_loc,
2657 .value = value,
2658 .operator_loc = operator_loc
2659 };
2660
2661 return node;
2662}
2663
2668pm_def_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, pm_location_t name_loc, struct pm_node *receiver, struct pm_parameters_node *parameters, struct pm_node *body, pm_constant_id_list_t locals, pm_location_t def_keyword_loc, pm_location_t operator_loc, pm_location_t lparen_loc, pm_location_t rparen_loc, pm_location_t equal_loc, pm_location_t end_keyword_loc) {
2669 pm_def_node_t *node = (pm_def_node_t *) pm_arena_alloc(arena, sizeof(pm_def_node_t), PRISM_ALIGNOF(pm_def_node_t));
2670
2671 *node = (pm_def_node_t) {
2672 .base = { .type = PM_DEF_NODE, .flags = flags, .node_id = node_id, .location = location },
2673 .name = name,
2674 .name_loc = name_loc,
2675 .receiver = receiver,
2676 .parameters = parameters,
2677 .body = body,
2678 .locals = locals,
2679 .def_keyword_loc = def_keyword_loc,
2680 .operator_loc = operator_loc,
2681 .lparen_loc = lparen_loc,
2682 .rparen_loc = rparen_loc,
2683 .equal_loc = equal_loc,
2684 .end_keyword_loc = end_keyword_loc
2685 };
2686
2687 return node;
2688}
2689
2694pm_defined_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t lparen_loc, struct pm_node *value, pm_location_t rparen_loc, pm_location_t keyword_loc) {
2695 pm_defined_node_t *node = (pm_defined_node_t *) pm_arena_alloc(arena, sizeof(pm_defined_node_t), PRISM_ALIGNOF(pm_defined_node_t));
2696
2697 *node = (pm_defined_node_t) {
2698 .base = { .type = PM_DEFINED_NODE, .flags = flags, .node_id = node_id, .location = location },
2699 .lparen_loc = lparen_loc,
2700 .value = value,
2701 .rparen_loc = rparen_loc,
2702 .keyword_loc = keyword_loc
2703 };
2704
2705 return node;
2706}
2707
2712pm_else_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t else_keyword_loc, struct pm_statements_node *statements, pm_location_t end_keyword_loc) {
2713 pm_else_node_t *node = (pm_else_node_t *) pm_arena_alloc(arena, sizeof(pm_else_node_t), PRISM_ALIGNOF(pm_else_node_t));
2714
2715 *node = (pm_else_node_t) {
2716 .base = { .type = PM_ELSE_NODE, .flags = flags, .node_id = node_id, .location = location },
2717 .else_keyword_loc = else_keyword_loc,
2718 .statements = statements,
2719 .end_keyword_loc = end_keyword_loc
2720 };
2721
2722 return node;
2723}
2724
2729pm_embedded_statements_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t opening_loc, struct pm_statements_node *statements, pm_location_t closing_loc) {
2731
2733 .base = { .type = PM_EMBEDDED_STATEMENTS_NODE, .flags = flags, .node_id = node_id, .location = location },
2734 .opening_loc = opening_loc,
2735 .statements = statements,
2736 .closing_loc = closing_loc
2737 };
2738
2739 return node;
2740}
2741
2746pm_embedded_variable_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t operator_loc, struct pm_node *variable) {
2748
2749 *node = (pm_embedded_variable_node_t) {
2750 .base = { .type = PM_EMBEDDED_VARIABLE_NODE, .flags = flags, .node_id = node_id, .location = location },
2751 .operator_loc = operator_loc,
2752 .variable = variable
2753 };
2754
2755 return node;
2756}
2757
2762pm_ensure_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t ensure_keyword_loc, struct pm_statements_node *statements, pm_location_t end_keyword_loc) {
2763 pm_ensure_node_t *node = (pm_ensure_node_t *) pm_arena_alloc(arena, sizeof(pm_ensure_node_t), PRISM_ALIGNOF(pm_ensure_node_t));
2764
2765 *node = (pm_ensure_node_t) {
2766 .base = { .type = PM_ENSURE_NODE, .flags = flags, .node_id = node_id, .location = location },
2767 .ensure_keyword_loc = ensure_keyword_loc,
2768 .statements = statements,
2769 .end_keyword_loc = end_keyword_loc
2770 };
2771
2772 return node;
2773}
2774
2779pm_error_recovery_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *unexpected) {
2781
2782 *node = (pm_error_recovery_node_t) {
2783 .base = { .type = PM_ERROR_RECOVERY_NODE, .flags = flags, .node_id = node_id, .location = location },
2784 .unexpected = unexpected
2785 };
2786
2787 return node;
2788}
2789
2794pm_false_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
2795 pm_false_node_t *node = (pm_false_node_t *) pm_arena_alloc(arena, sizeof(pm_false_node_t), PRISM_ALIGNOF(pm_false_node_t));
2796
2797 *node = (pm_false_node_t) {
2798 .base = { .type = PM_FALSE_NODE, .flags = flags, .node_id = node_id, .location = location }
2799 };
2800
2801 return node;
2802}
2803
2808pm_find_pattern_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *constant, struct pm_splat_node *left, pm_node_list_t requireds, struct pm_splat_node *right, pm_location_t opening_loc, pm_location_t closing_loc) {
2810
2811 *node = (pm_find_pattern_node_t) {
2812 .base = { .type = PM_FIND_PATTERN_NODE, .flags = flags, .node_id = node_id, .location = location },
2813 .constant = constant,
2814 .left = left,
2815 .requireds = requireds,
2816 .right = right,
2817 .opening_loc = opening_loc,
2818 .closing_loc = closing_loc
2819 };
2820
2821 return node;
2822}
2823
2828pm_flip_flop_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *left, struct pm_node *right, pm_location_t operator_loc) {
2830
2831 *node = (pm_flip_flop_node_t) {
2832 .base = { .type = PM_FLIP_FLOP_NODE, .flags = flags, .node_id = node_id, .location = location },
2833 .left = left,
2834 .right = right,
2835 .operator_loc = operator_loc
2836 };
2837
2838 return node;
2839}
2840
2845pm_float_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, double value) {
2846 pm_float_node_t *node = (pm_float_node_t *) pm_arena_alloc(arena, sizeof(pm_float_node_t), PRISM_ALIGNOF(pm_float_node_t));
2847
2848 *node = (pm_float_node_t) {
2849 .base = { .type = PM_FLOAT_NODE, .flags = flags, .node_id = node_id, .location = location },
2850 .value = value
2851 };
2852
2853 return node;
2854}
2855
2860pm_for_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *index, struct pm_node *collection, struct pm_statements_node *statements, pm_location_t for_keyword_loc, pm_location_t in_keyword_loc, pm_location_t do_keyword_loc, pm_location_t end_keyword_loc) {
2861 pm_for_node_t *node = (pm_for_node_t *) pm_arena_alloc(arena, sizeof(pm_for_node_t), PRISM_ALIGNOF(pm_for_node_t));
2862
2863 *node = (pm_for_node_t) {
2864 .base = { .type = PM_FOR_NODE, .flags = flags, .node_id = node_id, .location = location },
2865 .index = index,
2866 .collection = collection,
2867 .statements = statements,
2868 .for_keyword_loc = for_keyword_loc,
2869 .in_keyword_loc = in_keyword_loc,
2870 .do_keyword_loc = do_keyword_loc,
2871 .end_keyword_loc = end_keyword_loc
2872 };
2873
2874 return node;
2875}
2876
2881pm_forwarding_arguments_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
2883
2885 .base = { .type = PM_FORWARDING_ARGUMENTS_NODE, .flags = flags, .node_id = node_id, .location = location }
2886 };
2887
2888 return node;
2889}
2890
2895pm_forwarding_parameter_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
2897
2899 .base = { .type = PM_FORWARDING_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location }
2900 };
2901
2902 return node;
2903}
2904
2909pm_forwarding_super_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t keyword_loc, struct pm_block_node *block) {
2911
2912 *node = (pm_forwarding_super_node_t) {
2913 .base = { .type = PM_FORWARDING_SUPER_NODE, .flags = flags, .node_id = node_id, .location = location },
2914 .keyword_loc = keyword_loc,
2915 .block = block
2916 };
2917
2918 return node;
2919}
2920
2925pm_global_variable_and_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, pm_location_t name_loc, pm_location_t operator_loc, struct pm_node *value) {
2927
2929 .base = { .type = PM_GLOBAL_VARIABLE_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2930 .name = name,
2931 .name_loc = name_loc,
2932 .operator_loc = operator_loc,
2933 .value = value
2934 };
2935
2936 return node;
2937}
2938
2943pm_global_variable_operator_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, pm_location_t name_loc, pm_location_t binary_operator_loc, struct pm_node *value, pm_constant_id_t binary_operator) {
2945
2947 .base = { .type = PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2948 .name = name,
2949 .name_loc = name_loc,
2950 .binary_operator_loc = binary_operator_loc,
2951 .value = value,
2952 .binary_operator = binary_operator
2953 };
2954
2955 return node;
2956}
2957
2962pm_global_variable_or_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, pm_location_t name_loc, pm_location_t operator_loc, struct pm_node *value) {
2964
2966 .base = { .type = PM_GLOBAL_VARIABLE_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2967 .name = name,
2968 .name_loc = name_loc,
2969 .operator_loc = operator_loc,
2970 .value = value
2971 };
2972
2973 return node;
2974}
2975
2980pm_global_variable_read_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name) {
2982
2984 .base = { .type = PM_GLOBAL_VARIABLE_READ_NODE, .flags = flags, .node_id = node_id, .location = location },
2985 .name = name
2986 };
2987
2988 return node;
2989}
2990
2995pm_global_variable_target_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name) {
2997
2999 .base = { .type = PM_GLOBAL_VARIABLE_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
3000 .name = name
3001 };
3002
3003 return node;
3004}
3005
3010pm_global_variable_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, pm_location_t name_loc, struct pm_node *value, pm_location_t operator_loc) {
3012
3014 .base = { .type = PM_GLOBAL_VARIABLE_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3015 .name = name,
3016 .name_loc = name_loc,
3017 .value = value,
3018 .operator_loc = operator_loc
3019 };
3020
3021 return node;
3022}
3023
3028pm_hash_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t opening_loc, pm_node_list_t elements, pm_location_t closing_loc) {
3029 pm_hash_node_t *node = (pm_hash_node_t *) pm_arena_alloc(arena, sizeof(pm_hash_node_t), PRISM_ALIGNOF(pm_hash_node_t));
3030
3031 *node = (pm_hash_node_t) {
3032 .base = { .type = PM_HASH_NODE, .flags = flags, .node_id = node_id, .location = location },
3033 .opening_loc = opening_loc,
3034 .elements = elements,
3035 .closing_loc = closing_loc
3036 };
3037
3038 return node;
3039}
3040
3045pm_hash_pattern_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *constant, pm_node_list_t elements, struct pm_node *rest, pm_location_t opening_loc, pm_location_t closing_loc) {
3047
3048 *node = (pm_hash_pattern_node_t) {
3049 .base = { .type = PM_HASH_PATTERN_NODE, .flags = flags, .node_id = node_id, .location = location },
3050 .constant = constant,
3051 .elements = elements,
3052 .rest = rest,
3053 .opening_loc = opening_loc,
3054 .closing_loc = closing_loc
3055 };
3056
3057 return node;
3058}
3059
3064pm_if_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t if_keyword_loc, struct pm_node *predicate, pm_location_t then_keyword_loc, struct pm_statements_node *statements, struct pm_node *subsequent, pm_location_t end_keyword_loc) {
3065 pm_if_node_t *node = (pm_if_node_t *) pm_arena_alloc(arena, sizeof(pm_if_node_t), PRISM_ALIGNOF(pm_if_node_t));
3066
3067 *node = (pm_if_node_t) {
3068 .base = { .type = PM_IF_NODE, .flags = flags, .node_id = node_id, .location = location },
3069 .if_keyword_loc = if_keyword_loc,
3070 .predicate = predicate,
3071 .then_keyword_loc = then_keyword_loc,
3072 .statements = statements,
3073 .subsequent = subsequent,
3074 .end_keyword_loc = end_keyword_loc
3075 };
3076
3077 return node;
3078}
3079
3084pm_imaginary_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *numeric) {
3086
3087 *node = (pm_imaginary_node_t) {
3088 .base = { .type = PM_IMAGINARY_NODE, .flags = flags, .node_id = node_id, .location = location },
3089 .numeric = numeric
3090 };
3091
3092 return node;
3093}
3094
3099pm_implicit_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *value) {
3101
3102 *node = (pm_implicit_node_t) {
3103 .base = { .type = PM_IMPLICIT_NODE, .flags = flags, .node_id = node_id, .location = location },
3104 .value = value
3105 };
3106
3107 return node;
3108}
3109
3114pm_implicit_rest_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
3116
3117 *node = (pm_implicit_rest_node_t) {
3118 .base = { .type = PM_IMPLICIT_REST_NODE, .flags = flags, .node_id = node_id, .location = location }
3119 };
3120
3121 return node;
3122}
3123
3128pm_in_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *pattern, struct pm_statements_node *statements, pm_location_t in_loc, pm_location_t then_loc) {
3129 pm_in_node_t *node = (pm_in_node_t *) pm_arena_alloc(arena, sizeof(pm_in_node_t), PRISM_ALIGNOF(pm_in_node_t));
3130
3131 *node = (pm_in_node_t) {
3132 .base = { .type = PM_IN_NODE, .flags = flags, .node_id = node_id, .location = location },
3133 .pattern = pattern,
3134 .statements = statements,
3135 .in_loc = in_loc,
3136 .then_loc = then_loc
3137 };
3138
3139 return node;
3140}
3141
3146pm_index_and_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *receiver, pm_location_t call_operator_loc, pm_location_t opening_loc, struct pm_arguments_node *arguments, pm_location_t closing_loc, struct pm_block_argument_node *block, pm_location_t operator_loc, struct pm_node *value) {
3148
3149 *node = (pm_index_and_write_node_t) {
3150 .base = { .type = PM_INDEX_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3151 .receiver = receiver,
3152 .call_operator_loc = call_operator_loc,
3153 .opening_loc = opening_loc,
3154 .arguments = arguments,
3155 .closing_loc = closing_loc,
3156 .block = block,
3157 .operator_loc = operator_loc,
3158 .value = value
3159 };
3160
3161 return node;
3162}
3163
3168pm_index_operator_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *receiver, pm_location_t call_operator_loc, pm_location_t opening_loc, struct pm_arguments_node *arguments, pm_location_t closing_loc, struct pm_block_argument_node *block, pm_constant_id_t binary_operator, pm_location_t binary_operator_loc, struct pm_node *value) {
3170
3172 .base = { .type = PM_INDEX_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3173 .receiver = receiver,
3174 .call_operator_loc = call_operator_loc,
3175 .opening_loc = opening_loc,
3176 .arguments = arguments,
3177 .closing_loc = closing_loc,
3178 .block = block,
3179 .binary_operator = binary_operator,
3180 .binary_operator_loc = binary_operator_loc,
3181 .value = value
3182 };
3183
3184 return node;
3185}
3186
3191pm_index_or_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *receiver, pm_location_t call_operator_loc, pm_location_t opening_loc, struct pm_arguments_node *arguments, pm_location_t closing_loc, struct pm_block_argument_node *block, pm_location_t operator_loc, struct pm_node *value) {
3193
3194 *node = (pm_index_or_write_node_t) {
3195 .base = { .type = PM_INDEX_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3196 .receiver = receiver,
3197 .call_operator_loc = call_operator_loc,
3198 .opening_loc = opening_loc,
3199 .arguments = arguments,
3200 .closing_loc = closing_loc,
3201 .block = block,
3202 .operator_loc = operator_loc,
3203 .value = value
3204 };
3205
3206 return node;
3207}
3208
3213pm_index_target_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *receiver, pm_location_t opening_loc, struct pm_arguments_node *arguments, pm_location_t closing_loc, struct pm_block_argument_node *block) {
3215
3216 *node = (pm_index_target_node_t) {
3217 .base = { .type = PM_INDEX_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
3218 .receiver = receiver,
3219 .opening_loc = opening_loc,
3220 .arguments = arguments,
3221 .closing_loc = closing_loc,
3222 .block = block
3223 };
3224
3225 return node;
3226}
3227
3232pm_instance_variable_and_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, pm_location_t name_loc, pm_location_t operator_loc, struct pm_node *value) {
3234
3236 .base = { .type = PM_INSTANCE_VARIABLE_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3237 .name = name,
3238 .name_loc = name_loc,
3239 .operator_loc = operator_loc,
3240 .value = value
3241 };
3242
3243 return node;
3244}
3245
3250pm_instance_variable_operator_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, pm_location_t name_loc, pm_location_t binary_operator_loc, struct pm_node *value, pm_constant_id_t binary_operator) {
3252
3254 .base = { .type = PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3255 .name = name,
3256 .name_loc = name_loc,
3257 .binary_operator_loc = binary_operator_loc,
3258 .value = value,
3259 .binary_operator = binary_operator
3260 };
3261
3262 return node;
3263}
3264
3269pm_instance_variable_or_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, pm_location_t name_loc, pm_location_t operator_loc, struct pm_node *value) {
3271
3273 .base = { .type = PM_INSTANCE_VARIABLE_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3274 .name = name,
3275 .name_loc = name_loc,
3276 .operator_loc = operator_loc,
3277 .value = value
3278 };
3279
3280 return node;
3281}
3282
3287pm_instance_variable_read_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name) {
3289
3291 .base = { .type = PM_INSTANCE_VARIABLE_READ_NODE, .flags = flags, .node_id = node_id, .location = location },
3292 .name = name
3293 };
3294
3295 return node;
3296}
3297
3302pm_instance_variable_target_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name) {
3304
3306 .base = { .type = PM_INSTANCE_VARIABLE_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
3307 .name = name
3308 };
3309
3310 return node;
3311}
3312
3317pm_instance_variable_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, pm_location_t name_loc, struct pm_node *value, pm_location_t operator_loc) {
3319
3321 .base = { .type = PM_INSTANCE_VARIABLE_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3322 .name = name,
3323 .name_loc = name_loc,
3324 .value = value,
3325 .operator_loc = operator_loc
3326 };
3327
3328 return node;
3329}
3330
3335pm_integer_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_integer_t value) {
3336 pm_integer_node_t *node = (pm_integer_node_t *) pm_arena_alloc(arena, sizeof(pm_integer_node_t), PRISM_ALIGNOF(pm_integer_node_t));
3337
3338 *node = (pm_integer_node_t) {
3339 .base = { .type = PM_INTEGER_NODE, .flags = flags, .node_id = node_id, .location = location },
3340 .value = value
3341 };
3342
3343 return node;
3344}
3345
3350pm_interpolated_match_last_line_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t opening_loc, pm_node_list_t parts, pm_location_t closing_loc) {
3352
3354 .base = { .type = PM_INTERPOLATED_MATCH_LAST_LINE_NODE, .flags = flags, .node_id = node_id, .location = location },
3355 .opening_loc = opening_loc,
3356 .parts = parts,
3357 .closing_loc = closing_loc
3358 };
3359
3360 return node;
3361}
3362
3367pm_interpolated_regular_expression_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t opening_loc, pm_node_list_t parts, pm_location_t closing_loc) {
3369
3371 .base = { .type = PM_INTERPOLATED_REGULAR_EXPRESSION_NODE, .flags = flags, .node_id = node_id, .location = location },
3372 .opening_loc = opening_loc,
3373 .parts = parts,
3374 .closing_loc = closing_loc
3375 };
3376
3377 return node;
3378}
3379
3384pm_interpolated_string_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t opening_loc, pm_node_list_t parts, pm_location_t closing_loc) {
3386
3388 .base = { .type = PM_INTERPOLATED_STRING_NODE, .flags = flags, .node_id = node_id, .location = location },
3389 .opening_loc = opening_loc,
3390 .parts = parts,
3391 .closing_loc = closing_loc
3392 };
3393
3394 return node;
3395}
3396
3401pm_interpolated_symbol_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t opening_loc, pm_node_list_t parts, pm_location_t closing_loc) {
3403
3405 .base = { .type = PM_INTERPOLATED_SYMBOL_NODE, .flags = flags, .node_id = node_id, .location = location },
3406 .opening_loc = opening_loc,
3407 .parts = parts,
3408 .closing_loc = closing_loc
3409 };
3410
3411 return node;
3412}
3413
3418pm_interpolated_x_string_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t opening_loc, pm_node_list_t parts, pm_location_t closing_loc) {
3420
3422 .base = { .type = PM_INTERPOLATED_X_STRING_NODE, .flags = flags, .node_id = node_id, .location = location },
3423 .opening_loc = opening_loc,
3424 .parts = parts,
3425 .closing_loc = closing_loc
3426 };
3427
3428 return node;
3429}
3430
3435pm_it_local_variable_read_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
3437
3439 .base = { .type = PM_IT_LOCAL_VARIABLE_READ_NODE, .flags = flags, .node_id = node_id, .location = location }
3440 };
3441
3442 return node;
3443}
3444
3449pm_it_parameters_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
3451
3452 *node = (pm_it_parameters_node_t) {
3453 .base = { .type = PM_IT_PARAMETERS_NODE, .flags = flags, .node_id = node_id, .location = location }
3454 };
3455
3456 return node;
3457}
3458
3463pm_keyword_hash_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_node_list_t elements) {
3465
3466 *node = (pm_keyword_hash_node_t) {
3467 .base = { .type = PM_KEYWORD_HASH_NODE, .flags = flags, .node_id = node_id, .location = location },
3468 .elements = elements
3469 };
3470
3471 return node;
3472}
3473
3478pm_keyword_rest_parameter_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, pm_location_t name_loc, pm_location_t operator_loc) {
3480
3482 .base = { .type = PM_KEYWORD_REST_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
3483 .name = name,
3484 .name_loc = name_loc,
3485 .operator_loc = operator_loc
3486 };
3487
3488 return node;
3489}
3490
3495pm_lambda_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_list_t locals, pm_location_t operator_loc, pm_location_t opening_loc, pm_location_t closing_loc, struct pm_node *parameters, struct pm_node *body) {
3496 pm_lambda_node_t *node = (pm_lambda_node_t *) pm_arena_alloc(arena, sizeof(pm_lambda_node_t), PRISM_ALIGNOF(pm_lambda_node_t));
3497
3498 *node = (pm_lambda_node_t) {
3499 .base = { .type = PM_LAMBDA_NODE, .flags = flags, .node_id = node_id, .location = location },
3500 .locals = locals,
3501 .operator_loc = operator_loc,
3502 .opening_loc = opening_loc,
3503 .closing_loc = closing_loc,
3504 .parameters = parameters,
3505 .body = body
3506 };
3507
3508 return node;
3509}
3510
3515pm_local_variable_and_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t name_loc, pm_location_t operator_loc, struct pm_node *value, pm_constant_id_t name, uint32_t depth) {
3517
3519 .base = { .type = PM_LOCAL_VARIABLE_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3520 .name_loc = name_loc,
3521 .operator_loc = operator_loc,
3522 .value = value,
3523 .name = name,
3524 .depth = depth
3525 };
3526
3527 return node;
3528}
3529
3534pm_local_variable_operator_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t name_loc, pm_location_t binary_operator_loc, struct pm_node *value, pm_constant_id_t name, pm_constant_id_t binary_operator, uint32_t depth) {
3536
3538 .base = { .type = PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3539 .name_loc = name_loc,
3540 .binary_operator_loc = binary_operator_loc,
3541 .value = value,
3542 .name = name,
3543 .binary_operator = binary_operator,
3544 .depth = depth
3545 };
3546
3547 return node;
3548}
3549
3554pm_local_variable_or_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t name_loc, pm_location_t operator_loc, struct pm_node *value, pm_constant_id_t name, uint32_t depth) {
3556
3558 .base = { .type = PM_LOCAL_VARIABLE_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3559 .name_loc = name_loc,
3560 .operator_loc = operator_loc,
3561 .value = value,
3562 .name = name,
3563 .depth = depth
3564 };
3565
3566 return node;
3567}
3568
3573pm_local_variable_read_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, uint32_t depth) {
3575
3577 .base = { .type = PM_LOCAL_VARIABLE_READ_NODE, .flags = flags, .node_id = node_id, .location = location },
3578 .name = name,
3579 .depth = depth
3580 };
3581
3582 return node;
3583}
3584
3589pm_local_variable_target_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, uint32_t depth) {
3591
3593 .base = { .type = PM_LOCAL_VARIABLE_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
3594 .name = name,
3595 .depth = depth
3596 };
3597
3598 return node;
3599}
3600
3605pm_local_variable_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, uint32_t depth, pm_location_t name_loc, struct pm_node *value, pm_location_t operator_loc) {
3607
3609 .base = { .type = PM_LOCAL_VARIABLE_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3610 .name = name,
3611 .depth = depth,
3612 .name_loc = name_loc,
3613 .value = value,
3614 .operator_loc = operator_loc
3615 };
3616
3617 return node;
3618}
3619
3624pm_match_last_line_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t opening_loc, pm_location_t content_loc, pm_location_t closing_loc, pm_string_t unescaped) {
3626
3627 *node = (pm_match_last_line_node_t) {
3628 .base = { .type = PM_MATCH_LAST_LINE_NODE, .flags = flags, .node_id = node_id, .location = location },
3629 .opening_loc = opening_loc,
3630 .content_loc = content_loc,
3631 .closing_loc = closing_loc,
3632 .unescaped = unescaped
3633 };
3634
3635 return node;
3636}
3637
3642pm_match_predicate_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *value, struct pm_node *pattern, pm_location_t operator_loc) {
3644
3645 *node = (pm_match_predicate_node_t) {
3646 .base = { .type = PM_MATCH_PREDICATE_NODE, .flags = flags, .node_id = node_id, .location = location },
3647 .value = value,
3648 .pattern = pattern,
3649 .operator_loc = operator_loc
3650 };
3651
3652 return node;
3653}
3654
3659pm_match_required_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *value, struct pm_node *pattern, pm_location_t operator_loc) {
3661
3662 *node = (pm_match_required_node_t) {
3663 .base = { .type = PM_MATCH_REQUIRED_NODE, .flags = flags, .node_id = node_id, .location = location },
3664 .value = value,
3665 .pattern = pattern,
3666 .operator_loc = operator_loc
3667 };
3668
3669 return node;
3670}
3671
3676pm_match_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_call_node *call, pm_node_list_t targets) {
3678
3679 *node = (pm_match_write_node_t) {
3680 .base = { .type = PM_MATCH_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3681 .call = call,
3682 .targets = targets
3683 };
3684
3685 return node;
3686}
3687
3692pm_module_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_list_t locals, pm_location_t module_keyword_loc, struct pm_node *constant_path, struct pm_node *body, pm_location_t end_keyword_loc, pm_constant_id_t name) {
3693 pm_module_node_t *node = (pm_module_node_t *) pm_arena_alloc(arena, sizeof(pm_module_node_t), PRISM_ALIGNOF(pm_module_node_t));
3694
3695 *node = (pm_module_node_t) {
3696 .base = { .type = PM_MODULE_NODE, .flags = flags, .node_id = node_id, .location = location },
3697 .locals = locals,
3698 .module_keyword_loc = module_keyword_loc,
3699 .constant_path = constant_path,
3700 .body = body,
3701 .end_keyword_loc = end_keyword_loc,
3702 .name = name
3703 };
3704
3705 return node;
3706}
3707
3712pm_multi_target_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_node_list_t lefts, struct pm_node *rest, pm_node_list_t rights, pm_location_t lparen_loc, pm_location_t rparen_loc) {
3714
3715 *node = (pm_multi_target_node_t) {
3716 .base = { .type = PM_MULTI_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
3717 .lefts = lefts,
3718 .rest = rest,
3719 .rights = rights,
3720 .lparen_loc = lparen_loc,
3721 .rparen_loc = rparen_loc
3722 };
3723
3724 return node;
3725}
3726
3731pm_multi_write_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_node_list_t lefts, struct pm_node *rest, pm_node_list_t rights, pm_location_t lparen_loc, pm_location_t rparen_loc, pm_location_t operator_loc, struct pm_node *value) {
3733
3734 *node = (pm_multi_write_node_t) {
3735 .base = { .type = PM_MULTI_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3736 .lefts = lefts,
3737 .rest = rest,
3738 .rights = rights,
3739 .lparen_loc = lparen_loc,
3740 .rparen_loc = rparen_loc,
3741 .operator_loc = operator_loc,
3742 .value = value
3743 };
3744
3745 return node;
3746}
3747
3752pm_next_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_arguments_node *arguments, pm_location_t keyword_loc) {
3753 pm_next_node_t *node = (pm_next_node_t *) pm_arena_alloc(arena, sizeof(pm_next_node_t), PRISM_ALIGNOF(pm_next_node_t));
3754
3755 *node = (pm_next_node_t) {
3756 .base = { .type = PM_NEXT_NODE, .flags = flags, .node_id = node_id, .location = location },
3757 .arguments = arguments,
3758 .keyword_loc = keyword_loc
3759 };
3760
3761 return node;
3762}
3763
3768pm_nil_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
3769 pm_nil_node_t *node = (pm_nil_node_t *) pm_arena_alloc(arena, sizeof(pm_nil_node_t), PRISM_ALIGNOF(pm_nil_node_t));
3770
3771 *node = (pm_nil_node_t) {
3772 .base = { .type = PM_NIL_NODE, .flags = flags, .node_id = node_id, .location = location }
3773 };
3774
3775 return node;
3776}
3777
3782pm_no_block_parameter_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t operator_loc, pm_location_t keyword_loc) {
3784
3786 .base = { .type = PM_NO_BLOCK_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
3787 .operator_loc = operator_loc,
3788 .keyword_loc = keyword_loc
3789 };
3790
3791 return node;
3792}
3793
3798pm_no_keywords_parameter_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t operator_loc, pm_location_t keyword_loc) {
3800
3802 .base = { .type = PM_NO_KEYWORDS_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
3803 .operator_loc = operator_loc,
3804 .keyword_loc = keyword_loc
3805 };
3806
3807 return node;
3808}
3809
3814pm_numbered_parameters_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, uint8_t maximum) {
3816
3818 .base = { .type = PM_NUMBERED_PARAMETERS_NODE, .flags = flags, .node_id = node_id, .location = location },
3819 .maximum = maximum
3820 };
3821
3822 return node;
3823}
3824
3829pm_numbered_reference_read_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, uint32_t number) {
3831
3833 .base = { .type = PM_NUMBERED_REFERENCE_READ_NODE, .flags = flags, .node_id = node_id, .location = location },
3834 .number = number
3835 };
3836
3837 return node;
3838}
3839
3844pm_optional_keyword_parameter_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, pm_location_t name_loc, struct pm_node *value) {
3846
3848 .base = { .type = PM_OPTIONAL_KEYWORD_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
3849 .name = name,
3850 .name_loc = name_loc,
3851 .value = value
3852 };
3853
3854 return node;
3855}
3856
3861pm_optional_parameter_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, pm_location_t name_loc, pm_location_t operator_loc, struct pm_node *value) {
3863
3865 .base = { .type = PM_OPTIONAL_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
3866 .name = name,
3867 .name_loc = name_loc,
3868 .operator_loc = operator_loc,
3869 .value = value
3870 };
3871
3872 return node;
3873}
3874
3879pm_or_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *left, struct pm_node *right, pm_location_t operator_loc) {
3880 pm_or_node_t *node = (pm_or_node_t *) pm_arena_alloc(arena, sizeof(pm_or_node_t), PRISM_ALIGNOF(pm_or_node_t));
3881
3882 *node = (pm_or_node_t) {
3883 .base = { .type = PM_OR_NODE, .flags = flags, .node_id = node_id, .location = location },
3884 .left = left,
3885 .right = right,
3886 .operator_loc = operator_loc
3887 };
3888
3889 return node;
3890}
3891
3896pm_parameters_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_node_list_t requireds, pm_node_list_t optionals, struct pm_node *rest, pm_node_list_t posts, pm_node_list_t keywords, struct pm_node *keyword_rest, struct pm_node *block) {
3898
3899 *node = (pm_parameters_node_t) {
3900 .base = { .type = PM_PARAMETERS_NODE, .flags = flags, .node_id = node_id, .location = location },
3901 .requireds = requireds,
3902 .optionals = optionals,
3903 .rest = rest,
3904 .posts = posts,
3905 .keywords = keywords,
3906 .keyword_rest = keyword_rest,
3907 .block = block
3908 };
3909
3910 return node;
3911}
3912
3917pm_parentheses_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *body, pm_location_t opening_loc, pm_location_t closing_loc) {
3919
3920 *node = (pm_parentheses_node_t) {
3921 .base = { .type = PM_PARENTHESES_NODE, .flags = flags, .node_id = node_id, .location = location },
3922 .body = body,
3923 .opening_loc = opening_loc,
3924 .closing_loc = closing_loc
3925 };
3926
3927 return node;
3928}
3929
3934pm_pinned_expression_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *expression, pm_location_t operator_loc, pm_location_t lparen_loc, pm_location_t rparen_loc) {
3936
3937 *node = (pm_pinned_expression_node_t) {
3938 .base = { .type = PM_PINNED_EXPRESSION_NODE, .flags = flags, .node_id = node_id, .location = location },
3939 .expression = expression,
3940 .operator_loc = operator_loc,
3941 .lparen_loc = lparen_loc,
3942 .rparen_loc = rparen_loc
3943 };
3944
3945 return node;
3946}
3947
3952pm_pinned_variable_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *variable, pm_location_t operator_loc) {
3954
3955 *node = (pm_pinned_variable_node_t) {
3956 .base = { .type = PM_PINNED_VARIABLE_NODE, .flags = flags, .node_id = node_id, .location = location },
3957 .variable = variable,
3958 .operator_loc = operator_loc
3959 };
3960
3961 return node;
3962}
3963
3968pm_post_execution_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_statements_node *statements, pm_location_t keyword_loc, pm_location_t opening_loc, pm_location_t closing_loc) {
3970
3971 *node = (pm_post_execution_node_t) {
3972 .base = { .type = PM_POST_EXECUTION_NODE, .flags = flags, .node_id = node_id, .location = location },
3973 .statements = statements,
3974 .keyword_loc = keyword_loc,
3975 .opening_loc = opening_loc,
3976 .closing_loc = closing_loc
3977 };
3978
3979 return node;
3980}
3981
3986pm_pre_execution_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_statements_node *statements, pm_location_t keyword_loc, pm_location_t opening_loc, pm_location_t closing_loc) {
3988
3989 *node = (pm_pre_execution_node_t) {
3990 .base = { .type = PM_PRE_EXECUTION_NODE, .flags = flags, .node_id = node_id, .location = location },
3991 .statements = statements,
3992 .keyword_loc = keyword_loc,
3993 .opening_loc = opening_loc,
3994 .closing_loc = closing_loc
3995 };
3996
3997 return node;
3998}
3999
4004pm_program_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_list_t locals, struct pm_statements_node *statements) {
4005 pm_program_node_t *node = (pm_program_node_t *) pm_arena_alloc(arena, sizeof(pm_program_node_t), PRISM_ALIGNOF(pm_program_node_t));
4006
4007 *node = (pm_program_node_t) {
4008 .base = { .type = PM_PROGRAM_NODE, .flags = flags, .node_id = node_id, .location = location },
4009 .locals = locals,
4010 .statements = statements
4011 };
4012
4013 return node;
4014}
4015
4020pm_range_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *left, struct pm_node *right, pm_location_t operator_loc) {
4021 pm_range_node_t *node = (pm_range_node_t *) pm_arena_alloc(arena, sizeof(pm_range_node_t), PRISM_ALIGNOF(pm_range_node_t));
4022
4023 *node = (pm_range_node_t) {
4024 .base = { .type = PM_RANGE_NODE, .flags = flags, .node_id = node_id, .location = location },
4025 .left = left,
4026 .right = right,
4027 .operator_loc = operator_loc
4028 };
4029
4030 return node;
4031}
4032
4037pm_rational_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_integer_t numerator, pm_integer_t denominator) {
4039
4040 *node = (pm_rational_node_t) {
4041 .base = { .type = PM_RATIONAL_NODE, .flags = flags, .node_id = node_id, .location = location },
4042 .numerator = numerator,
4043 .denominator = denominator
4044 };
4045
4046 return node;
4047}
4048
4053pm_redo_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
4054 pm_redo_node_t *node = (pm_redo_node_t *) pm_arena_alloc(arena, sizeof(pm_redo_node_t), PRISM_ALIGNOF(pm_redo_node_t));
4055
4056 *node = (pm_redo_node_t) {
4057 .base = { .type = PM_REDO_NODE, .flags = flags, .node_id = node_id, .location = location }
4058 };
4059
4060 return node;
4061}
4062
4067pm_regular_expression_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t opening_loc, pm_location_t content_loc, pm_location_t closing_loc, pm_string_t unescaped) {
4069
4071 .base = { .type = PM_REGULAR_EXPRESSION_NODE, .flags = flags, .node_id = node_id, .location = location },
4072 .opening_loc = opening_loc,
4073 .content_loc = content_loc,
4074 .closing_loc = closing_loc,
4075 .unescaped = unescaped
4076 };
4077
4078 return node;
4079}
4080
4085pm_required_keyword_parameter_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, pm_location_t name_loc) {
4087
4089 .base = { .type = PM_REQUIRED_KEYWORD_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
4090 .name = name,
4091 .name_loc = name_loc
4092 };
4093
4094 return node;
4095}
4096
4101pm_required_parameter_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name) {
4103
4105 .base = { .type = PM_REQUIRED_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
4106 .name = name
4107 };
4108
4109 return node;
4110}
4111
4116pm_rescue_modifier_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *expression, pm_location_t keyword_loc, struct pm_node *rescue_expression) {
4118
4119 *node = (pm_rescue_modifier_node_t) {
4120 .base = { .type = PM_RESCUE_MODIFIER_NODE, .flags = flags, .node_id = node_id, .location = location },
4121 .expression = expression,
4122 .keyword_loc = keyword_loc,
4123 .rescue_expression = rescue_expression
4124 };
4125
4126 return node;
4127}
4128
4133pm_rescue_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t keyword_loc, pm_node_list_t exceptions, pm_location_t operator_loc, struct pm_node *reference, pm_location_t then_keyword_loc, struct pm_statements_node *statements, struct pm_rescue_node *subsequent) {
4134 pm_rescue_node_t *node = (pm_rescue_node_t *) pm_arena_alloc(arena, sizeof(pm_rescue_node_t), PRISM_ALIGNOF(pm_rescue_node_t));
4135
4136 *node = (pm_rescue_node_t) {
4137 .base = { .type = PM_RESCUE_NODE, .flags = flags, .node_id = node_id, .location = location },
4138 .keyword_loc = keyword_loc,
4139 .exceptions = exceptions,
4140 .operator_loc = operator_loc,
4141 .reference = reference,
4142 .then_keyword_loc = then_keyword_loc,
4143 .statements = statements,
4144 .subsequent = subsequent
4145 };
4146
4147 return node;
4148}
4149
4154pm_rest_parameter_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_t name, pm_location_t name_loc, pm_location_t operator_loc) {
4156
4157 *node = (pm_rest_parameter_node_t) {
4158 .base = { .type = PM_REST_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
4159 .name = name,
4160 .name_loc = name_loc,
4161 .operator_loc = operator_loc
4162 };
4163
4164 return node;
4165}
4166
4171pm_retry_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
4172 pm_retry_node_t *node = (pm_retry_node_t *) pm_arena_alloc(arena, sizeof(pm_retry_node_t), PRISM_ALIGNOF(pm_retry_node_t));
4173
4174 *node = (pm_retry_node_t) {
4175 .base = { .type = PM_RETRY_NODE, .flags = flags, .node_id = node_id, .location = location }
4176 };
4177
4178 return node;
4179}
4180
4185pm_return_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t keyword_loc, struct pm_arguments_node *arguments) {
4186 pm_return_node_t *node = (pm_return_node_t *) pm_arena_alloc(arena, sizeof(pm_return_node_t), PRISM_ALIGNOF(pm_return_node_t));
4187
4188 *node = (pm_return_node_t) {
4189 .base = { .type = PM_RETURN_NODE, .flags = flags, .node_id = node_id, .location = location },
4190 .keyword_loc = keyword_loc,
4191 .arguments = arguments
4192 };
4193
4194 return node;
4195}
4196
4201pm_self_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
4202 pm_self_node_t *node = (pm_self_node_t *) pm_arena_alloc(arena, sizeof(pm_self_node_t), PRISM_ALIGNOF(pm_self_node_t));
4203
4204 *node = (pm_self_node_t) {
4205 .base = { .type = PM_SELF_NODE, .flags = flags, .node_id = node_id, .location = location }
4206 };
4207
4208 return node;
4209}
4210
4215pm_shareable_constant_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *write) {
4217
4219 .base = { .type = PM_SHAREABLE_CONSTANT_NODE, .flags = flags, .node_id = node_id, .location = location },
4220 .write = write
4221 };
4222
4223 return node;
4224}
4225
4230pm_singleton_class_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_constant_id_list_t locals, pm_location_t class_keyword_loc, pm_location_t operator_loc, struct pm_node *expression, struct pm_node *body, pm_location_t end_keyword_loc) {
4232
4233 *node = (pm_singleton_class_node_t) {
4234 .base = { .type = PM_SINGLETON_CLASS_NODE, .flags = flags, .node_id = node_id, .location = location },
4235 .locals = locals,
4236 .class_keyword_loc = class_keyword_loc,
4237 .operator_loc = operator_loc,
4238 .expression = expression,
4239 .body = body,
4240 .end_keyword_loc = end_keyword_loc
4241 };
4242
4243 return node;
4244}
4245
4250pm_source_encoding_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
4252
4253 *node = (pm_source_encoding_node_t) {
4254 .base = { .type = PM_SOURCE_ENCODING_NODE, .flags = flags, .node_id = node_id, .location = location }
4255 };
4256
4257 return node;
4258}
4259
4264pm_source_file_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_string_t filepath) {
4266
4267 *node = (pm_source_file_node_t) {
4268 .base = { .type = PM_SOURCE_FILE_NODE, .flags = flags, .node_id = node_id, .location = location },
4269 .filepath = filepath
4270 };
4271
4272 return node;
4273}
4274
4279pm_source_line_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
4281
4282 *node = (pm_source_line_node_t) {
4283 .base = { .type = PM_SOURCE_LINE_NODE, .flags = flags, .node_id = node_id, .location = location }
4284 };
4285
4286 return node;
4287}
4288
4293pm_splat_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t operator_loc, struct pm_node *expression) {
4294 pm_splat_node_t *node = (pm_splat_node_t *) pm_arena_alloc(arena, sizeof(pm_splat_node_t), PRISM_ALIGNOF(pm_splat_node_t));
4295
4296 *node = (pm_splat_node_t) {
4297 .base = { .type = PM_SPLAT_NODE, .flags = flags, .node_id = node_id, .location = location },
4298 .operator_loc = operator_loc,
4299 .expression = expression
4300 };
4301
4302 return node;
4303}
4304
4309pm_statements_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_node_list_t body) {
4311
4312 *node = (pm_statements_node_t) {
4313 .base = { .type = PM_STATEMENTS_NODE, .flags = flags, .node_id = node_id, .location = location },
4314 .body = body
4315 };
4316
4317 return node;
4318}
4319
4324pm_string_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t opening_loc, pm_location_t content_loc, pm_location_t closing_loc, pm_string_t unescaped) {
4325 pm_string_node_t *node = (pm_string_node_t *) pm_arena_alloc(arena, sizeof(pm_string_node_t), PRISM_ALIGNOF(pm_string_node_t));
4326
4327 *node = (pm_string_node_t) {
4328 .base = { .type = PM_STRING_NODE, .flags = flags, .node_id = node_id, .location = location },
4329 .opening_loc = opening_loc,
4330 .content_loc = content_loc,
4331 .closing_loc = closing_loc,
4332 .unescaped = unescaped
4333 };
4334
4335 return node;
4336}
4337
4342pm_super_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t keyword_loc, pm_location_t lparen_loc, struct pm_arguments_node *arguments, pm_location_t rparen_loc, struct pm_node *block) {
4343 pm_super_node_t *node = (pm_super_node_t *) pm_arena_alloc(arena, sizeof(pm_super_node_t), PRISM_ALIGNOF(pm_super_node_t));
4344
4345 *node = (pm_super_node_t) {
4346 .base = { .type = PM_SUPER_NODE, .flags = flags, .node_id = node_id, .location = location },
4347 .keyword_loc = keyword_loc,
4348 .lparen_loc = lparen_loc,
4349 .arguments = arguments,
4350 .rparen_loc = rparen_loc,
4351 .block = block
4352 };
4353
4354 return node;
4355}
4356
4361pm_symbol_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t opening_loc, pm_location_t value_loc, pm_location_t closing_loc, pm_string_t unescaped) {
4362 pm_symbol_node_t *node = (pm_symbol_node_t *) pm_arena_alloc(arena, sizeof(pm_symbol_node_t), PRISM_ALIGNOF(pm_symbol_node_t));
4363
4364 *node = (pm_symbol_node_t) {
4365 .base = { .type = PM_SYMBOL_NODE, .flags = flags, .node_id = node_id, .location = location },
4366 .opening_loc = opening_loc,
4367 .value_loc = value_loc,
4368 .closing_loc = closing_loc,
4369 .unescaped = unescaped
4370 };
4371
4372 return node;
4373}
4374
4379pm_true_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
4380 pm_true_node_t *node = (pm_true_node_t *) pm_arena_alloc(arena, sizeof(pm_true_node_t), PRISM_ALIGNOF(pm_true_node_t));
4381
4382 *node = (pm_true_node_t) {
4383 .base = { .type = PM_TRUE_NODE, .flags = flags, .node_id = node_id, .location = location }
4384 };
4385
4386 return node;
4387}
4388
4393pm_undef_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_node_list_t names, pm_location_t keyword_loc) {
4394 pm_undef_node_t *node = (pm_undef_node_t *) pm_arena_alloc(arena, sizeof(pm_undef_node_t), PRISM_ALIGNOF(pm_undef_node_t));
4395
4396 *node = (pm_undef_node_t) {
4397 .base = { .type = PM_UNDEF_NODE, .flags = flags, .node_id = node_id, .location = location },
4398 .names = names,
4399 .keyword_loc = keyword_loc
4400 };
4401
4402 return node;
4403}
4404
4409pm_unless_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t keyword_loc, struct pm_node *predicate, pm_location_t then_keyword_loc, struct pm_statements_node *statements, struct pm_else_node *else_clause, pm_location_t end_keyword_loc) {
4410 pm_unless_node_t *node = (pm_unless_node_t *) pm_arena_alloc(arena, sizeof(pm_unless_node_t), PRISM_ALIGNOF(pm_unless_node_t));
4411
4412 *node = (pm_unless_node_t) {
4413 .base = { .type = PM_UNLESS_NODE, .flags = flags, .node_id = node_id, .location = location },
4414 .keyword_loc = keyword_loc,
4415 .predicate = predicate,
4416 .then_keyword_loc = then_keyword_loc,
4417 .statements = statements,
4418 .else_clause = else_clause,
4419 .end_keyword_loc = end_keyword_loc
4420 };
4421
4422 return node;
4423}
4424
4429pm_until_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t keyword_loc, pm_location_t do_keyword_loc, pm_location_t closing_loc, struct pm_node *predicate, struct pm_statements_node *statements) {
4430 pm_until_node_t *node = (pm_until_node_t *) pm_arena_alloc(arena, sizeof(pm_until_node_t), PRISM_ALIGNOF(pm_until_node_t));
4431
4432 *node = (pm_until_node_t) {
4433 .base = { .type = PM_UNTIL_NODE, .flags = flags, .node_id = node_id, .location = location },
4434 .keyword_loc = keyword_loc,
4435 .do_keyword_loc = do_keyword_loc,
4436 .closing_loc = closing_loc,
4437 .predicate = predicate,
4438 .statements = statements
4439 };
4440
4441 return node;
4442}
4443
4448pm_when_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t keyword_loc, pm_node_list_t conditions, pm_location_t then_keyword_loc, struct pm_statements_node *statements) {
4449 pm_when_node_t *node = (pm_when_node_t *) pm_arena_alloc(arena, sizeof(pm_when_node_t), PRISM_ALIGNOF(pm_when_node_t));
4450
4451 *node = (pm_when_node_t) {
4452 .base = { .type = PM_WHEN_NODE, .flags = flags, .node_id = node_id, .location = location },
4453 .keyword_loc = keyword_loc,
4454 .conditions = conditions,
4455 .then_keyword_loc = then_keyword_loc,
4456 .statements = statements
4457 };
4458
4459 return node;
4460}
4461
4466pm_while_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t keyword_loc, pm_location_t do_keyword_loc, pm_location_t closing_loc, struct pm_node *predicate, struct pm_statements_node *statements) {
4467 pm_while_node_t *node = (pm_while_node_t *) pm_arena_alloc(arena, sizeof(pm_while_node_t), PRISM_ALIGNOF(pm_while_node_t));
4468
4469 *node = (pm_while_node_t) {
4470 .base = { .type = PM_WHILE_NODE, .flags = flags, .node_id = node_id, .location = location },
4471 .keyword_loc = keyword_loc,
4472 .do_keyword_loc = do_keyword_loc,
4473 .closing_loc = closing_loc,
4474 .predicate = predicate,
4475 .statements = statements
4476 };
4477
4478 return node;
4479}
4480
4485pm_x_string_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t opening_loc, pm_location_t content_loc, pm_location_t closing_loc, pm_string_t unescaped) {
4487
4488 *node = (pm_x_string_node_t) {
4489 .base = { .type = PM_X_STRING_NODE, .flags = flags, .node_id = node_id, .location = location },
4490 .opening_loc = opening_loc,
4491 .content_loc = content_loc,
4492 .closing_loc = closing_loc,
4493 .unescaped = unescaped
4494 };
4495
4496 return node;
4497}
4498
4503pm_yield_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t keyword_loc, pm_location_t lparen_loc, struct pm_arguments_node *arguments, pm_location_t rparen_loc) {
4504 pm_yield_node_t *node = (pm_yield_node_t *) pm_arena_alloc(arena, sizeof(pm_yield_node_t), PRISM_ALIGNOF(pm_yield_node_t));
4505
4506 *node = (pm_yield_node_t) {
4507 .base = { .type = PM_YIELD_NODE, .flags = flags, .node_id = node_id, .location = location },
4508 .keyword_loc = keyword_loc,
4509 .lparen_loc = lparen_loc,
4510 .arguments = arguments,
4511 .rparen_loc = rparen_loc
4512 };
4513
4514 return node;
4515}
#define PRISM_ALIGNOF
Get the alignment requirement of a type.
Definition align.h:15
uint32_t pm_constant_id_t
A constant id is a unique identifier for a constant in the constant pool.
AliasGlobalVariableNode.
Definition ast.h:1138
PM_NODE_ALIGNAS struct pm_node * new_name
AliasGlobalVariableNode::new_name.
Definition ast.h:1150
pm_node_t base
The embedded base node.
Definition ast.h:1140
PM_NODE_ALIGNAS struct pm_node * old_name
AliasGlobalVariableNode::old_name.
Definition ast.h:1160
AliasMethodNode.
Definition ast.h:1185
PM_NODE_ALIGNAS struct pm_node * old_name
AliasMethodNode::old_name.
Definition ast.h:1219
pm_node_t base
The embedded base node.
Definition ast.h:1187
PM_NODE_ALIGNAS struct pm_node * new_name
AliasMethodNode::new_name.
Definition ast.h:1203
AlternationPatternNode.
Definition ast.h:1244
PM_NODE_ALIGNAS struct pm_node * left
AlternationPatternNode::left.
Definition ast.h:1256
pm_node_t base
The embedded base node.
Definition ast.h:1246
PM_NODE_ALIGNAS struct pm_node * right
AlternationPatternNode::right.
Definition ast.h:1266
AndNode.
Definition ast.h:1291
PM_NODE_ALIGNAS struct pm_node * left
AndNode::left.
Definition ast.h:1306
PM_NODE_ALIGNAS struct pm_node * right
AndNode::right.
Definition ast.h:1319
pm_node_t base
The embedded base node.
Definition ast.h:1293
ArgumentsNode.
Definition ast.h:1351
pm_node_t base
The embedded base node.
Definition ast.h:1353
struct pm_node_list arguments
ArgumentsNode::arguments.
Definition ast.h:1363
ArrayNode.
Definition ast.h:1381
pm_node_t base
The embedded base node.
Definition ast.h:1383
struct pm_node_list elements
ArrayNode::elements.
Definition ast.h:1390
ArrayPatternNode.
Definition ast.h:1441
struct pm_node_list requireds
ArrayPatternNode::requireds.
Definition ast.h:1469
PM_NODE_ALIGNAS struct pm_node * rest
ArrayPatternNode::rest.
Definition ast.h:1479
PM_NODE_ALIGNAS struct pm_node * constant
ArrayPatternNode::constant.
Definition ast.h:1459
pm_node_t base
The embedded base node.
Definition ast.h:1443
struct pm_node_list posts
ArrayPatternNode::posts.
Definition ast.h:1489
AssocNode.
Definition ast.h:1524
pm_node_t base
The embedded base node.
Definition ast.h:1526
PM_NODE_ALIGNAS struct pm_node * value
AssocNode::value.
Definition ast.h:1555
PM_NODE_ALIGNAS struct pm_node * key
AssocNode::key.
Definition ast.h:1542
AssocSplatNode.
Definition ast.h:1580
pm_node_t base
The embedded base node.
Definition ast.h:1582
PM_NODE_ALIGNAS struct pm_node * value
AssocSplatNode::value.
Definition ast.h:1592
BackReferenceReadNode.
Definition ast.h:1617
pm_node_t base
The embedded base node.
Definition ast.h:1619
BeginNode.
Definition ast.h:1647
PM_NODE_ALIGNAS struct pm_else_node * else_clause
BeginNode::else_clause.
Definition ast.h:1689
PM_NODE_ALIGNAS struct pm_ensure_node * ensure_clause
BeginNode::ensure_clause.
Definition ast.h:1699
PM_NODE_ALIGNAS struct pm_statements_node * statements
BeginNode::statements.
Definition ast.h:1669
PM_NODE_ALIGNAS struct pm_rescue_node * rescue_clause
BeginNode::rescue_clause.
Definition ast.h:1679
pm_node_t base
The embedded base node.
Definition ast.h:1649
BlockArgumentNode.
Definition ast.h:1724
PM_NODE_ALIGNAS struct pm_node * expression
BlockArgumentNode::expression.
Definition ast.h:1736
pm_node_t base
The embedded base node.
Definition ast.h:1726
pm_location_t operator_loc
BlockArgumentNode::operator_loc.
Definition ast.h:1746
BlockLocalVariableNode.
Definition ast.h:1764
pm_node_t base
The embedded base node.
Definition ast.h:1766
BlockNode.
Definition ast.h:1791
pm_node_t base
The embedded base node.
Definition ast.h:1793
PM_NODE_ALIGNAS struct pm_node * parameters
BlockNode::parameters.
Definition ast.h:1817
PM_NODE_ALIGNAS struct pm_node * body
BlockNode::body.
Definition ast.h:1827
BlockParameterNode.
Definition ast.h:1866
pm_node_t base
The embedded base node.
Definition ast.h:1868
BlockParametersNode.
Definition ast.h:1919
pm_node_t base
The embedded base node.
Definition ast.h:1921
struct pm_node_list locals
BlockParametersNode::locals.
Definition ast.h:1949
PM_NODE_ALIGNAS struct pm_parameters_node * parameters
BlockParametersNode::parameters.
Definition ast.h:1935
BreakNode.
Definition ast.h:1992
pm_node_t base
The embedded base node.
Definition ast.h:1994
PM_NODE_ALIGNAS struct pm_arguments_node * arguments
BreakNode::arguments.
Definition ast.h:2004
CallAndWriteNode.
Definition ast.h:2035
PM_NODE_ALIGNAS struct pm_node * receiver
CallAndWriteNode::receiver.
Definition ast.h:2047
pm_node_t base
The embedded base node.
Definition ast.h:2037
PM_NODE_ALIGNAS struct pm_node * value
CallAndWriteNode::value.
Definition ast.h:2107
CallNode.
Definition ast.h:2143
pm_node_t base
The embedded base node.
Definition ast.h:2145
PM_NODE_ALIGNAS struct pm_arguments_node * arguments
CallNode::arguments.
Definition ast.h:2214
PM_NODE_ALIGNAS struct pm_node * block
CallNode::block.
Definition ast.h:2247
PM_NODE_ALIGNAS struct pm_node * receiver
CallNode::receiver.
Definition ast.h:2161
CallOperatorWriteNode.
Definition ast.h:2268
pm_node_t base
The embedded base node.
Definition ast.h:2270
PM_NODE_ALIGNAS struct pm_node * receiver
CallOperatorWriteNode::receiver.
Definition ast.h:2280
PM_NODE_ALIGNAS struct pm_node * value
CallOperatorWriteNode::value.
Definition ast.h:2350
CallOrWriteNode.
Definition ast.h:2371
PM_NODE_ALIGNAS struct pm_node * receiver
CallOrWriteNode::receiver.
Definition ast.h:2383
pm_node_t base
The embedded base node.
Definition ast.h:2373
PM_NODE_ALIGNAS struct pm_node * value
CallOrWriteNode::value.
Definition ast.h:2443
CallTargetNode.
Definition ast.h:2472
pm_node_t base
The embedded base node.
Definition ast.h:2474
PM_NODE_ALIGNAS struct pm_node * receiver
CallTargetNode::receiver.
Definition ast.h:2484
CapturePatternNode.
Definition ast.h:2529
pm_node_t base
The embedded base node.
Definition ast.h:2531
PM_NODE_ALIGNAS struct pm_node * value
CapturePatternNode::value.
Definition ast.h:2541
PM_NODE_ALIGNAS struct pm_local_variable_target_node * target
CapturePatternNode::target.
Definition ast.h:2551
CaseMatchNode.
Definition ast.h:2578
struct pm_node_list conditions
CaseMatchNode::conditions.
Definition ast.h:2600
pm_node_t base
The embedded base node.
Definition ast.h:2580
PM_NODE_ALIGNAS struct pm_node * predicate
CaseMatchNode::predicate.
Definition ast.h:2590
PM_NODE_ALIGNAS struct pm_else_node * else_clause
CaseMatchNode::else_clause.
Definition ast.h:2610
CaseNode.
Definition ast.h:2647
PM_NODE_ALIGNAS struct pm_else_node * else_clause
CaseNode::else_clause.
Definition ast.h:2679
struct pm_node_list conditions
CaseNode::conditions.
Definition ast.h:2669
PM_NODE_ALIGNAS struct pm_node * predicate
CaseNode::predicate.
Definition ast.h:2659
pm_node_t base
The embedded base node.
Definition ast.h:2649
ClassNode.
Definition ast.h:2714
PM_NODE_ALIGNAS struct pm_node * superclass
ClassNode::superclass.
Definition ast.h:2756
pm_node_t base
The embedded base node.
Definition ast.h:2716
PM_NODE_ALIGNAS struct pm_node * constant_path
ClassNode::constant_path.
Definition ast.h:2736
PM_NODE_ALIGNAS struct pm_node * body
ClassNode::body.
Definition ast.h:2766
ClassVariableAndWriteNode.
Definition ast.h:2800
PM_NODE_ALIGNAS struct pm_node * value
ClassVariableAndWriteNode::value.
Definition ast.h:2842
pm_node_t base
The embedded base node.
Definition ast.h:2802
ClassVariableOperatorWriteNode.
Definition ast.h:2857
pm_node_t base
The embedded base node.
Definition ast.h:2859
PM_NODE_ALIGNAS struct pm_node * value
ClassVariableOperatorWriteNode::value.
Definition ast.h:2879
ClassVariableOrWriteNode.
Definition ast.h:2899
pm_node_t base
The embedded base node.
Definition ast.h:2901
PM_NODE_ALIGNAS struct pm_node * value
ClassVariableOrWriteNode::value.
Definition ast.h:2921
ClassVariableReadNode.
Definition ast.h:2936
pm_node_t base
The embedded base node.
Definition ast.h:2938
ClassVariableTargetNode.
Definition ast.h:2964
pm_node_t base
The embedded base node.
Definition ast.h:2966
ClassVariableWriteNode.
Definition ast.h:2986
PM_NODE_ALIGNAS struct pm_node * value
ClassVariableWriteNode::value.
Definition ast.h:3022
pm_node_t base
The embedded base node.
Definition ast.h:2988
ConstantAndWriteNode.
Definition ast.h:3047
PM_NODE_ALIGNAS struct pm_node * value
ConstantAndWriteNode::value.
Definition ast.h:3069
pm_node_t base
The embedded base node.
Definition ast.h:3049
A list of constant IDs.
ConstantOperatorWriteNode.
Definition ast.h:3084
PM_NODE_ALIGNAS struct pm_node * value
ConstantOperatorWriteNode::value.
Definition ast.h:3106
pm_node_t base
The embedded base node.
Definition ast.h:3086
ConstantOrWriteNode.
Definition ast.h:3126
PM_NODE_ALIGNAS struct pm_node * value
ConstantOrWriteNode::value.
Definition ast.h:3148
pm_node_t base
The embedded base node.
Definition ast.h:3128
ConstantPathAndWriteNode.
Definition ast.h:3163
PM_NODE_ALIGNAS struct pm_constant_path_node * target
ConstantPathAndWriteNode::target.
Definition ast.h:3170
pm_node_t base
The embedded base node.
Definition ast.h:3165
PM_NODE_ALIGNAS struct pm_node * value
ConstantPathAndWriteNode::value.
Definition ast.h:3180
ConstantPathNode.
Definition ast.h:3195
pm_node_t base
The embedded base node.
Definition ast.h:3197
PM_NODE_ALIGNAS struct pm_node * parent
ConstantPathNode::parent.
Definition ast.h:3213
ConstantPathOperatorWriteNode.
Definition ast.h:3261
PM_NODE_ALIGNAS struct pm_constant_path_node * target
ConstantPathOperatorWriteNode::target.
Definition ast.h:3268
pm_node_t base
The embedded base node.
Definition ast.h:3263
PM_NODE_ALIGNAS struct pm_node * value
ConstantPathOperatorWriteNode::value.
Definition ast.h:3278
ConstantPathOrWriteNode.
Definition ast.h:3298
pm_node_t base
The embedded base node.
Definition ast.h:3300
PM_NODE_ALIGNAS struct pm_node * value
ConstantPathOrWriteNode::value.
Definition ast.h:3315
PM_NODE_ALIGNAS struct pm_constant_path_node * target
ConstantPathOrWriteNode::target.
Definition ast.h:3305
ConstantPathTargetNode.
Definition ast.h:3330
pm_node_t base
The embedded base node.
Definition ast.h:3332
PM_NODE_ALIGNAS struct pm_node * parent
ConstantPathTargetNode::parent.
Definition ast.h:3337
ConstantPathWriteNode.
Definition ast.h:3373
PM_NODE_ALIGNAS struct pm_node * value
ConstantPathWriteNode::value.
Definition ast.h:3408
pm_node_t base
The embedded base node.
Definition ast.h:3375
PM_NODE_ALIGNAS struct pm_constant_path_node * target
ConstantPathWriteNode::target.
Definition ast.h:3388
ConstantReadNode.
Definition ast.h:3423
pm_node_t base
The embedded base node.
Definition ast.h:3425
ConstantTargetNode.
Definition ast.h:3451
pm_node_t base
The embedded base node.
Definition ast.h:3453
ConstantWriteNode.
Definition ast.h:3473
pm_node_t base
The embedded base node.
Definition ast.h:3475
PM_NODE_ALIGNAS struct pm_node * value
ConstantWriteNode::value.
Definition ast.h:3509
DefNode.
Definition ast.h:3535
PM_NODE_ALIGNAS struct pm_parameters_node * parameters
DefNode::parameters.
Definition ast.h:3557
pm_node_t base
The embedded base node.
Definition ast.h:3537
PM_NODE_ALIGNAS struct pm_node * receiver
DefNode::receiver.
Definition ast.h:3552
PM_NODE_ALIGNAS struct pm_node * body
DefNode::body.
Definition ast.h:3562
DefinedNode.
Definition ast.h:3612
PM_NODE_ALIGNAS struct pm_node * value
DefinedNode::value.
Definition ast.h:3624
pm_node_t base
The embedded base node.
Definition ast.h:3614
ElseNode.
Definition ast.h:3649
pm_node_t base
The embedded base node.
Definition ast.h:3651
PM_NODE_ALIGNAS struct pm_statements_node * statements
ElseNode::statements.
Definition ast.h:3661
pm_location_t end_keyword_loc
ElseNode::end_keyword_loc.
Definition ast.h:3666
EmbeddedStatementsNode.
Definition ast.h:3681
PM_NODE_ALIGNAS struct pm_statements_node * statements
EmbeddedStatementsNode::statements.
Definition ast.h:3693
pm_node_t base
The embedded base node.
Definition ast.h:3683
EmbeddedVariableNode.
Definition ast.h:3713
PM_NODE_ALIGNAS struct pm_node * variable
EmbeddedVariableNode::variable.
Definition ast.h:3725
pm_node_t base
The embedded base node.
Definition ast.h:3715
EnsureNode.
Definition ast.h:3744
PM_NODE_ALIGNAS struct pm_statements_node * statements
EnsureNode::statements.
Definition ast.h:3756
pm_node_t base
The embedded base node.
Definition ast.h:3746
pm_location_t end_keyword_loc
EnsureNode::end_keyword_loc.
Definition ast.h:3761
ErrorRecoveryNode.
Definition ast.h:3773
PM_NODE_ALIGNAS struct pm_node * unexpected
ErrorRecoveryNode::unexpected.
Definition ast.h:3782
pm_node_t base
The embedded base node.
Definition ast.h:3775
FalseNode.
Definition ast.h:3797
pm_node_t base
The embedded base node.
Definition ast.h:3799
FindPatternNode.
Definition ast.h:3823
PM_NODE_ALIGNAS struct pm_splat_node * left
FindPatternNode::left.
Definition ast.h:3848
PM_NODE_ALIGNAS struct pm_splat_node * right
FindPatternNode::right.
Definition ast.h:3874
pm_node_t base
The embedded base node.
Definition ast.h:3825
PM_NODE_ALIGNAS struct pm_node * constant
FindPatternNode::constant.
Definition ast.h:3835
struct pm_node_list requireds
FindPatternNode::requireds.
Definition ast.h:3861
FlipFlopNode.
Definition ast.h:3918
PM_NODE_ALIGNAS struct pm_node * left
FlipFlopNode::left.
Definition ast.h:3925
pm_node_t base
The embedded base node.
Definition ast.h:3920
PM_NODE_ALIGNAS struct pm_node * right
FlipFlopNode::right.
Definition ast.h:3930
FloatNode.
Definition ast.h:3950
pm_node_t base
The embedded base node.
Definition ast.h:3952
ForNode.
Definition ast.h:3974
PM_NODE_ALIGNAS struct pm_node * index
ForNode::index.
Definition ast.h:3986
PM_NODE_ALIGNAS struct pm_node * collection
ForNode::collection.
Definition ast.h:3996
pm_node_t base
The embedded base node.
Definition ast.h:3976
PM_NODE_ALIGNAS struct pm_statements_node * statements
ForNode::statements.
Definition ast.h:4008
ForwardingArgumentsNode.
Definition ast.h:4065
pm_node_t base
The embedded base node.
Definition ast.h:4067
ForwardingParameterNode.
Definition ast.h:4083
pm_node_t base
The embedded base node.
Definition ast.h:4085
ForwardingSuperNode.
Definition ast.h:4105
pm_node_t base
The embedded base node.
Definition ast.h:4107
PM_NODE_ALIGNAS struct pm_block_node * block
ForwardingSuperNode::block.
Definition ast.h:4125
GlobalVariableAndWriteNode.
Definition ast.h:4140
pm_node_t base
The embedded base node.
Definition ast.h:4142
PM_NODE_ALIGNAS struct pm_node * value
GlobalVariableAndWriteNode::value.
Definition ast.h:4162
GlobalVariableOperatorWriteNode.
Definition ast.h:4177
PM_NODE_ALIGNAS struct pm_node * value
GlobalVariableOperatorWriteNode::value.
Definition ast.h:4199
pm_node_t base
The embedded base node.
Definition ast.h:4179
GlobalVariableOrWriteNode.
Definition ast.h:4219
pm_node_t base
The embedded base node.
Definition ast.h:4221
PM_NODE_ALIGNAS struct pm_node * value
GlobalVariableOrWriteNode::value.
Definition ast.h:4241
GlobalVariableReadNode.
Definition ast.h:4256
pm_node_t base
The embedded base node.
Definition ast.h:4258
GlobalVariableTargetNode.
Definition ast.h:4284
pm_node_t base
The embedded base node.
Definition ast.h:4286
GlobalVariableWriteNode.
Definition ast.h:4306
pm_node_t base
The embedded base node.
Definition ast.h:4308
PM_NODE_ALIGNAS struct pm_node * value
GlobalVariableWriteNode::value.
Definition ast.h:4342
HashNode.
Definition ast.h:4367
struct pm_node_list elements
HashNode::elements.
Definition ast.h:4392
pm_node_t base
The embedded base node.
Definition ast.h:4369
HashPatternNode.
Definition ast.h:4426
PM_NODE_ALIGNAS struct pm_node * constant
HashPatternNode::constant.
Definition ast.h:4441
struct pm_node_list elements
HashPatternNode::elements.
Definition ast.h:4451
pm_node_t base
The embedded base node.
Definition ast.h:4428
PM_NODE_ALIGNAS struct pm_node * rest
HashPatternNode::rest.
Definition ast.h:4467
IfNode.
Definition ast.h:4514
PM_NODE_ALIGNAS struct pm_node * predicate
IfNode::predicate.
Definition ast.h:4546
PM_NODE_ALIGNAS struct pm_statements_node * statements
IfNode::statements.
Definition ast.h:4573
pm_node_t base
The embedded base node.
Definition ast.h:4516
PM_NODE_ALIGNAS struct pm_node * subsequent
IfNode::subsequent.
Definition ast.h:4592
ImaginaryNode.
Definition ast.h:4619
pm_node_t base
The embedded base node.
Definition ast.h:4621
PM_NODE_ALIGNAS struct pm_node * numeric
ImaginaryNode::numeric.
Definition ast.h:4626
ImplicitNode.
Definition ast.h:4647
pm_node_t base
The embedded base node.
Definition ast.h:4649
PM_NODE_ALIGNAS struct pm_node * value
ImplicitNode::value.
Definition ast.h:4654
ImplicitRestNode.
Definition ast.h:4678
pm_node_t base
The embedded base node.
Definition ast.h:4680
InNode.
Definition ast.h:4695
PM_NODE_ALIGNAS struct pm_node * pattern
InNode::pattern.
Definition ast.h:4702
PM_NODE_ALIGNAS struct pm_statements_node * statements
InNode::statements.
Definition ast.h:4707
pm_node_t base
The embedded base node.
Definition ast.h:4697
IndexAndWriteNode.
Definition ast.h:4738
PM_NODE_ALIGNAS struct pm_arguments_node * arguments
IndexAndWriteNode::arguments.
Definition ast.h:4760
pm_node_t base
The embedded base node.
Definition ast.h:4740
PM_NODE_ALIGNAS struct pm_block_argument_node * block
IndexAndWriteNode::block.
Definition ast.h:4770
PM_NODE_ALIGNAS struct pm_node * receiver
IndexAndWriteNode::receiver.
Definition ast.h:4745
PM_NODE_ALIGNAS struct pm_node * value
IndexAndWriteNode::value.
Definition ast.h:4780
IndexOperatorWriteNode.
Definition ast.h:4801
PM_NODE_ALIGNAS struct pm_block_argument_node * block
IndexOperatorWriteNode::block.
Definition ast.h:4833
pm_node_t base
The embedded base node.
Definition ast.h:4803
PM_NODE_ALIGNAS struct pm_node * receiver
IndexOperatorWriteNode::receiver.
Definition ast.h:4808
PM_NODE_ALIGNAS struct pm_node * value
IndexOperatorWriteNode::value.
Definition ast.h:4848
PM_NODE_ALIGNAS struct pm_arguments_node * arguments
IndexOperatorWriteNode::arguments.
Definition ast.h:4823
IndexOrWriteNode.
Definition ast.h:4869
pm_node_t base
The embedded base node.
Definition ast.h:4871
PM_NODE_ALIGNAS struct pm_arguments_node * arguments
IndexOrWriteNode::arguments.
Definition ast.h:4891
PM_NODE_ALIGNAS struct pm_node * value
IndexOrWriteNode::value.
Definition ast.h:4911
PM_NODE_ALIGNAS struct pm_node * receiver
IndexOrWriteNode::receiver.
Definition ast.h:4876
PM_NODE_ALIGNAS struct pm_block_argument_node * block
IndexOrWriteNode::block.
Definition ast.h:4901
IndexTargetNode.
Definition ast.h:4940
pm_node_t base
The embedded base node.
Definition ast.h:4942
PM_NODE_ALIGNAS struct pm_arguments_node * arguments
IndexTargetNode::arguments.
Definition ast.h:4957
PM_NODE_ALIGNAS struct pm_block_argument_node * block
IndexTargetNode::block.
Definition ast.h:4967
PM_NODE_ALIGNAS struct pm_node * receiver
IndexTargetNode::receiver.
Definition ast.h:4947
InstanceVariableAndWriteNode.
Definition ast.h:4982
PM_NODE_ALIGNAS struct pm_node * value
InstanceVariableAndWriteNode::value.
Definition ast.h:5004
pm_node_t base
The embedded base node.
Definition ast.h:4984
InstanceVariableOperatorWriteNode.
Definition ast.h:5019
PM_NODE_ALIGNAS struct pm_node * value
InstanceVariableOperatorWriteNode::value.
Definition ast.h:5041
pm_node_t base
The embedded base node.
Definition ast.h:5021
InstanceVariableOrWriteNode.
Definition ast.h:5061
pm_node_t base
The embedded base node.
Definition ast.h:5063
PM_NODE_ALIGNAS struct pm_node * value
InstanceVariableOrWriteNode::value.
Definition ast.h:5083
InstanceVariableReadNode.
Definition ast.h:5098
pm_node_t base
The embedded base node.
Definition ast.h:5100
InstanceVariableTargetNode.
Definition ast.h:5126
pm_node_t base
The embedded base node.
Definition ast.h:5128
InstanceVariableWriteNode.
Definition ast.h:5148
PM_NODE_ALIGNAS struct pm_node * value
InstanceVariableWriteNode::value.
Definition ast.h:5184
pm_node_t base
The embedded base node.
Definition ast.h:5150
IntegerNode.
Definition ast.h:5215
pm_node_t base
The embedded base node.
Definition ast.h:5217
A structure represents an arbitrary-sized integer.
Definition integer.h:16
InterpolatedMatchLastLineNode.
Definition ast.h:5252
pm_node_t base
The embedded base node.
Definition ast.h:5254
struct pm_node_list parts
InterpolatedMatchLastLineNode::parts.
Definition ast.h:5264
InterpolatedRegularExpressionNode.
Definition ast.h:5297
struct pm_node_list parts
InterpolatedRegularExpressionNode::parts.
Definition ast.h:5309
pm_node_t base
The embedded base node.
Definition ast.h:5299
InterpolatedStringNode.
Definition ast.h:5333
pm_node_t base
The embedded base node.
Definition ast.h:5335
struct pm_node_list parts
InterpolatedStringNode::parts.
Definition ast.h:5345
InterpolatedSymbolNode.
Definition ast.h:5365
struct pm_node_list parts
InterpolatedSymbolNode::parts.
Definition ast.h:5377
pm_node_t base
The embedded base node.
Definition ast.h:5367
InterpolatedXStringNode.
Definition ast.h:5397
pm_node_t base
The embedded base node.
Definition ast.h:5399
struct pm_node_list parts
InterpolatedXStringNode::parts.
Definition ast.h:5409
ItLocalVariableReadNode.
Definition ast.h:5429
pm_node_t base
The embedded base node.
Definition ast.h:5431
ItParametersNode.
Definition ast.h:5446
pm_node_t base
The embedded base node.
Definition ast.h:5448
KeywordHashNode.
Definition ast.h:5466
pm_node_t base
The embedded base node.
Definition ast.h:5468
struct pm_node_list elements
KeywordHashNode::elements.
Definition ast.h:5473
KeywordRestParameterNode.
Definition ast.h:5492
pm_node_t base
The embedded base node.
Definition ast.h:5494
LambdaNode.
Definition ast.h:5524
pm_node_t base
The embedded base node.
Definition ast.h:5526
PM_NODE_ALIGNAS struct pm_node * body
LambdaNode::body.
Definition ast.h:5556
PM_NODE_ALIGNAS struct pm_node * parameters
LambdaNode::parameters.
Definition ast.h:5551
LocalVariableAndWriteNode.
Definition ast.h:5571
pm_node_t base
The embedded base node.
Definition ast.h:5573
PM_NODE_ALIGNAS struct pm_node * value
LocalVariableAndWriteNode::value.
Definition ast.h:5588
LocalVariableOperatorWriteNode.
Definition ast.h:5613
pm_node_t base
The embedded base node.
Definition ast.h:5615
PM_NODE_ALIGNAS struct pm_node * value
LocalVariableOperatorWriteNode::value.
Definition ast.h:5630
LocalVariableOrWriteNode.
Definition ast.h:5660
PM_NODE_ALIGNAS struct pm_node * value
LocalVariableOrWriteNode::value.
Definition ast.h:5677
pm_node_t base
The embedded base node.
Definition ast.h:5662
LocalVariableReadNode.
Definition ast.h:5702
pm_node_t base
The embedded base node.
Definition ast.h:5704
LocalVariableTargetNode.
Definition ast.h:5750
pm_node_t base
The embedded base node.
Definition ast.h:5752
LocalVariableWriteNode.
Definition ast.h:5777
PM_NODE_ALIGNAS struct pm_node * value
LocalVariableWriteNode::value.
Definition ast.h:5830
pm_node_t base
The embedded base node.
Definition ast.h:5779
This struct represents a slice in the source code, defined by an offset and a length.
Definition ast.h:554
MatchLastLineNode.
Definition ast.h:5868
pm_node_t base
The embedded base node.
Definition ast.h:5870
MatchPredicateNode.
Definition ast.h:5905
PM_NODE_ALIGNAS struct pm_node * pattern
MatchPredicateNode::pattern.
Definition ast.h:5917
PM_NODE_ALIGNAS struct pm_node * value
MatchPredicateNode::value.
Definition ast.h:5912
pm_node_t base
The embedded base node.
Definition ast.h:5907
MatchRequiredNode.
Definition ast.h:5937
pm_node_t base
The embedded base node.
Definition ast.h:5939
PM_NODE_ALIGNAS struct pm_node * pattern
MatchRequiredNode::pattern.
Definition ast.h:5998
PM_NODE_ALIGNAS struct pm_node * value
MatchRequiredNode::value.
Definition ast.h:5949
MatchWriteNode.
Definition ast.h:6023
pm_node_t base
The embedded base node.
Definition ast.h:6025
PM_NODE_ALIGNAS struct pm_call_node * call
MatchWriteNode::call.
Definition ast.h:6030
struct pm_node_list targets
MatchWriteNode::targets.
Definition ast.h:6035
ModuleNode.
Definition ast.h:6050
PM_NODE_ALIGNAS struct pm_node * constant_path
ModuleNode::constant_path.
Definition ast.h:6067
PM_NODE_ALIGNAS struct pm_node * body
ModuleNode::body.
Definition ast.h:6072
pm_node_t base
The embedded base node.
Definition ast.h:6052
MultiTargetNode.
Definition ast.h:6102
PM_NODE_ALIGNAS struct pm_node * rest
MultiTargetNode::rest.
Definition ast.h:6139
pm_node_t base
The embedded base node.
Definition ast.h:6104
struct pm_node_list lefts
MultiTargetNode::lefts.
Definition ast.h:6119
struct pm_node_list rights
MultiTargetNode::rights.
Definition ast.h:6149
MultiWriteNode.
Definition ast.h:6184
PM_NODE_ALIGNAS struct pm_node * rest
MultiWriteNode::rest.
Definition ast.h:6221
struct pm_node_list rights
MultiWriteNode::rights.
Definition ast.h:6231
PM_NODE_ALIGNAS struct pm_node * value
MultiWriteNode::value.
Definition ast.h:6271
struct pm_node_list lefts
MultiWriteNode::lefts.
Definition ast.h:6201
pm_node_t base
The embedded base node.
Definition ast.h:6186
NextNode.
Definition ast.h:6286
PM_NODE_ALIGNAS struct pm_arguments_node * arguments
NextNode::arguments.
Definition ast.h:6293
pm_node_t base
The embedded base node.
Definition ast.h:6288
NilNode.
Definition ast.h:6313
pm_node_t base
The embedded base node.
Definition ast.h:6315
NoBlockParameterNode.
Definition ast.h:6331
pm_node_t base
The embedded base node.
Definition ast.h:6333
NoKeywordsParameterNode.
Definition ast.h:6359
pm_node_t base
The embedded base node.
Definition ast.h:6361
A list of nodes in the source, most often used for lists of children.
Definition ast.h:567
size_t size
The number of nodes in the list.
Definition ast.h:569
struct pm_node ** nodes
The nodes in the list.
Definition ast.h:575
size_t capacity
The capacity of the list that has been allocated.
Definition ast.h:572
This is the base structure that represents a node in the syntax tree.
Definition ast.h:1065
pm_node_type_t type
This represents the type of the node.
Definition ast.h:1070
NumberedParametersNode.
Definition ast.h:6386
pm_node_t base
The embedded base node.
Definition ast.h:6388
NumberedReferenceReadNode.
Definition ast.h:6408
pm_node_t base
The embedded base node.
Definition ast.h:6410
OptionalKeywordParameterNode.
Definition ast.h:6442
pm_node_t base
The embedded base node.
Definition ast.h:6444
PM_NODE_ALIGNAS struct pm_node * value
OptionalKeywordParameterNode::value.
Definition ast.h:6459
OptionalParameterNode.
Definition ast.h:6478
pm_node_t base
The embedded base node.
Definition ast.h:6480
PM_NODE_ALIGNAS struct pm_node * value
OptionalParameterNode::value.
Definition ast.h:6500
OrNode.
Definition ast.h:6515
PM_NODE_ALIGNAS struct pm_node * right
OrNode::right.
Definition ast.h:6543
pm_node_t base
The embedded base node.
Definition ast.h:6517
PM_NODE_ALIGNAS struct pm_node * left
OrNode::left.
Definition ast.h:6530
ParametersNode.
Definition ast.h:6569
PM_NODE_ALIGNAS struct pm_node * block
ParametersNode::block.
Definition ast.h:6606
struct pm_node_list requireds
ParametersNode::requireds.
Definition ast.h:6576
struct pm_node_list optionals
ParametersNode::optionals.
Definition ast.h:6581
struct pm_node_list posts
ParametersNode::posts.
Definition ast.h:6591
pm_node_t base
The embedded base node.
Definition ast.h:6571
PM_NODE_ALIGNAS struct pm_node * rest
ParametersNode::rest.
Definition ast.h:6586
struct pm_node_list keywords
ParametersNode::keywords.
Definition ast.h:6596
PM_NODE_ALIGNAS struct pm_node * keyword_rest
ParametersNode::keyword_rest.
Definition ast.h:6601
ParenthesesNode.
Definition ast.h:6624
pm_node_t base
The embedded base node.
Definition ast.h:6626
PM_NODE_ALIGNAS struct pm_node * body
ParenthesesNode::body.
Definition ast.h:6631
PinnedExpressionNode.
Definition ast.h:6656
pm_node_t base
The embedded base node.
Definition ast.h:6658
PM_NODE_ALIGNAS struct pm_node * expression
PinnedExpressionNode::expression.
Definition ast.h:6668
PinnedVariableNode.
Definition ast.h:6713
pm_node_t base
The embedded base node.
Definition ast.h:6715
PM_NODE_ALIGNAS struct pm_node * variable
PinnedVariableNode::variable.
Definition ast.h:6725
PostExecutionNode.
Definition ast.h:6750
pm_node_t base
The embedded base node.
Definition ast.h:6752
PM_NODE_ALIGNAS struct pm_statements_node * statements
PostExecutionNode::statements.
Definition ast.h:6757
PreExecutionNode.
Definition ast.h:6787
PM_NODE_ALIGNAS struct pm_statements_node * statements
PreExecutionNode::statements.
Definition ast.h:6794
pm_node_t base
The embedded base node.
Definition ast.h:6789
ProgramNode.
Definition ast.h:6821
pm_node_t base
The embedded base node.
Definition ast.h:6823
PM_NODE_ALIGNAS struct pm_statements_node * statements
ProgramNode::statements.
Definition ast.h:6833
RangeNode.
Definition ast.h:6854
pm_node_t base
The embedded base node.
Definition ast.h:6856
PM_NODE_ALIGNAS struct pm_node * right
RangeNode::right.
Definition ast.h:6883
PM_NODE_ALIGNAS struct pm_node * left
RangeNode::left.
Definition ast.h:6869
RationalNode.
Definition ast.h:6911
pm_node_t base
The embedded base node.
Definition ast.h:6913
RedoNode.
Definition ast.h:6946
pm_node_t base
The embedded base node.
Definition ast.h:6948
RegularExpressionNode.
Definition ast.h:6976
pm_node_t base
The embedded base node.
Definition ast.h:6978
RequiredKeywordParameterNode.
Definition ast.h:7017
pm_node_t base
The embedded base node.
Definition ast.h:7019
RequiredParameterNode.
Definition ast.h:7048
pm_node_t base
The embedded base node.
Definition ast.h:7050
RescueModifierNode.
Definition ast.h:7070
PM_NODE_ALIGNAS struct pm_node * expression
RescueModifierNode::expression.
Definition ast.h:7077
pm_node_t base
The embedded base node.
Definition ast.h:7072
PM_NODE_ALIGNAS struct pm_node * rescue_expression
RescueModifierNode::rescue_expression.
Definition ast.h:7087
RescueNode.
Definition ast.h:7107
PM_NODE_ALIGNAS struct pm_statements_node * statements
RescueNode::statements.
Definition ast.h:7139
PM_NODE_ALIGNAS struct pm_rescue_node * subsequent
RescueNode::subsequent.
Definition ast.h:7144
PM_NODE_ALIGNAS struct pm_node * reference
RescueNode::reference.
Definition ast.h:7129
struct pm_node_list exceptions
RescueNode::exceptions.
Definition ast.h:7119
pm_node_t base
The embedded base node.
Definition ast.h:7109
RestParameterNode.
Definition ast.h:7163
pm_node_t base
The embedded base node.
Definition ast.h:7165
RetryNode.
Definition ast.h:7195
pm_node_t base
The embedded base node.
Definition ast.h:7197
ReturnNode.
Definition ast.h:7212
PM_NODE_ALIGNAS struct pm_arguments_node * arguments
ReturnNode::arguments.
Definition ast.h:7224
pm_node_t base
The embedded base node.
Definition ast.h:7214
SelfNode.
Definition ast.h:7239
pm_node_t base
The embedded base node.
Definition ast.h:7241
ShareableConstantNode.
Definition ast.h:7262
PM_NODE_ALIGNAS struct pm_node * write
ShareableConstantNode::write.
Definition ast.h:7271
pm_node_t base
The embedded base node.
Definition ast.h:7264
SingletonClassNode.
Definition ast.h:7286
PM_NODE_ALIGNAS struct pm_node * body
SingletonClassNode::body.
Definition ast.h:7313
pm_node_t base
The embedded base node.
Definition ast.h:7288
PM_NODE_ALIGNAS struct pm_node * expression
SingletonClassNode::expression.
Definition ast.h:7308
SourceEncodingNode.
Definition ast.h:7333
pm_node_t base
The embedded base node.
Definition ast.h:7335
SourceFileNode.
Definition ast.h:7356
pm_node_t base
The embedded base node.
Definition ast.h:7358
SourceLineNode.
Definition ast.h:7380
pm_node_t base
The embedded base node.
Definition ast.h:7382
SplatNode.
Definition ast.h:7397
pm_node_t base
The embedded base node.
Definition ast.h:7399
PM_NODE_ALIGNAS struct pm_node * expression
SplatNode::expression.
Definition ast.h:7409
StatementsNode.
Definition ast.h:7424
struct pm_node_list body
StatementsNode::body.
Definition ast.h:7431
pm_node_t base
The embedded base node.
Definition ast.h:7426
StringNode.
Definition ast.h:7458
pm_node_t base
The embedded base node.
Definition ast.h:7460
A generic string type that can have various ownership semantics.
Definition stringy.h:18
SuperNode.
Definition ast.h:7500
PM_NODE_ALIGNAS struct pm_arguments_node * arguments
SuperNode::arguments.
Definition ast.h:7519
pm_node_t base
The embedded base node.
Definition ast.h:7502
PM_NODE_ALIGNAS struct pm_node * block
SuperNode::block.
Definition ast.h:7529
SymbolNode.
Definition ast.h:7552
pm_node_t base
The embedded base node.
Definition ast.h:7554
TrueNode.
Definition ast.h:7589
pm_node_t base
The embedded base node.
Definition ast.h:7591
UndefNode.
Definition ast.h:7606
pm_node_t base
The embedded base node.
Definition ast.h:7608
struct pm_node_list names
UndefNode::names.
Definition ast.h:7613
UnlessNode.
Definition ast.h:7636
PM_NODE_ALIGNAS struct pm_node * predicate
UnlessNode::predicate.
Definition ast.h:7664
PM_NODE_ALIGNAS struct pm_statements_node * statements
UnlessNode::statements.
Definition ast.h:7685
PM_NODE_ALIGNAS struct pm_else_node * else_clause
UnlessNode::else_clause.
Definition ast.h:7695
pm_node_t base
The embedded base node.
Definition ast.h:7638
UntilNode.
Definition ast.h:7726
pm_node_t base
The embedded base node.
Definition ast.h:7728
PM_NODE_ALIGNAS struct pm_statements_node * statements
UntilNode::statements.
Definition ast.h:7753
PM_NODE_ALIGNAS struct pm_node * predicate
UntilNode::predicate.
Definition ast.h:7748
WhenNode.
Definition ast.h:7770
pm_node_t base
The embedded base node.
Definition ast.h:7772
PM_NODE_ALIGNAS struct pm_statements_node * statements
WhenNode::statements.
Definition ast.h:7792
struct pm_node_list conditions
WhenNode::conditions.
Definition ast.h:7782
WhileNode.
Definition ast.h:7813
PM_NODE_ALIGNAS struct pm_statements_node * statements
WhileNode::statements.
Definition ast.h:7840
pm_node_t base
The embedded base node.
Definition ast.h:7815
PM_NODE_ALIGNAS struct pm_node * predicate
WhileNode::predicate.
Definition ast.h:7835
XStringNode.
Definition ast.h:7859
pm_node_t base
The embedded base node.
Definition ast.h:7861
YieldNode.
Definition ast.h:7896
pm_node_t base
The embedded base node.
Definition ast.h:7898
PM_NODE_ALIGNAS struct pm_arguments_node * arguments
YieldNode::arguments.
Definition ast.h:7913