9#line 2 "prism/templates/src/node.c.erb"
10#include "prism/internal/node.h"
12#include "prism/internal/arena.h"
24 size_t requested_size = list->
size + size;
27 if (requested_size < list->size) abort();
30 if (requested_size <= list->capacity)
return;
36 while (requested_size > next_capacity) {
37 if (next_capacity == 0) abort();
59 pm_node_list_grow(arena, list, 1);
68 pm_node_list_append_inline(arena, list, node);
76 pm_node_list_grow(arena, list, 1);
78 list->
nodes[0] = node;
87 if (other->
size > 0) {
88 pm_node_list_grow(arena, list, other->
size);
98pm_node_type(pm_node_type_t node_type)
101 case PM_ALIAS_GLOBAL_VARIABLE_NODE:
102 return "PM_ALIAS_GLOBAL_VARIABLE_NODE";
103 case PM_ALIAS_METHOD_NODE:
104 return "PM_ALIAS_METHOD_NODE";
105 case PM_ALTERNATION_PATTERN_NODE:
106 return "PM_ALTERNATION_PATTERN_NODE";
108 return "PM_AND_NODE";
109 case PM_ARGUMENTS_NODE:
110 return "PM_ARGUMENTS_NODE";
112 return "PM_ARRAY_NODE";
113 case PM_ARRAY_PATTERN_NODE:
114 return "PM_ARRAY_PATTERN_NODE";
116 return "PM_ASSOC_NODE";
117 case PM_ASSOC_SPLAT_NODE:
118 return "PM_ASSOC_SPLAT_NODE";
119 case PM_BACK_REFERENCE_READ_NODE:
120 return "PM_BACK_REFERENCE_READ_NODE";
122 return "PM_BEGIN_NODE";
123 case PM_BLOCK_ARGUMENT_NODE:
124 return "PM_BLOCK_ARGUMENT_NODE";
125 case PM_BLOCK_LOCAL_VARIABLE_NODE:
126 return "PM_BLOCK_LOCAL_VARIABLE_NODE";
128 return "PM_BLOCK_NODE";
129 case PM_BLOCK_PARAMETER_NODE:
130 return "PM_BLOCK_PARAMETER_NODE";
131 case PM_BLOCK_PARAMETERS_NODE:
132 return "PM_BLOCK_PARAMETERS_NODE";
134 return "PM_BREAK_NODE";
135 case PM_CALL_AND_WRITE_NODE:
136 return "PM_CALL_AND_WRITE_NODE";
138 return "PM_CALL_NODE";
139 case PM_CALL_OPERATOR_WRITE_NODE:
140 return "PM_CALL_OPERATOR_WRITE_NODE";
141 case PM_CALL_OR_WRITE_NODE:
142 return "PM_CALL_OR_WRITE_NODE";
143 case PM_CALL_TARGET_NODE:
144 return "PM_CALL_TARGET_NODE";
145 case PM_CAPTURE_PATTERN_NODE:
146 return "PM_CAPTURE_PATTERN_NODE";
147 case PM_CASE_MATCH_NODE:
148 return "PM_CASE_MATCH_NODE";
150 return "PM_CASE_NODE";
152 return "PM_CLASS_NODE";
153 case PM_CLASS_VARIABLE_AND_WRITE_NODE:
154 return "PM_CLASS_VARIABLE_AND_WRITE_NODE";
155 case PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE:
156 return "PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE";
157 case PM_CLASS_VARIABLE_OR_WRITE_NODE:
158 return "PM_CLASS_VARIABLE_OR_WRITE_NODE";
159 case PM_CLASS_VARIABLE_READ_NODE:
160 return "PM_CLASS_VARIABLE_READ_NODE";
161 case PM_CLASS_VARIABLE_TARGET_NODE:
162 return "PM_CLASS_VARIABLE_TARGET_NODE";
163 case PM_CLASS_VARIABLE_WRITE_NODE:
164 return "PM_CLASS_VARIABLE_WRITE_NODE";
165 case PM_CONSTANT_AND_WRITE_NODE:
166 return "PM_CONSTANT_AND_WRITE_NODE";
167 case PM_CONSTANT_OPERATOR_WRITE_NODE:
168 return "PM_CONSTANT_OPERATOR_WRITE_NODE";
169 case PM_CONSTANT_OR_WRITE_NODE:
170 return "PM_CONSTANT_OR_WRITE_NODE";
171 case PM_CONSTANT_PATH_AND_WRITE_NODE:
172 return "PM_CONSTANT_PATH_AND_WRITE_NODE";
173 case PM_CONSTANT_PATH_NODE:
174 return "PM_CONSTANT_PATH_NODE";
175 case PM_CONSTANT_PATH_OPERATOR_WRITE_NODE:
176 return "PM_CONSTANT_PATH_OPERATOR_WRITE_NODE";
177 case PM_CONSTANT_PATH_OR_WRITE_NODE:
178 return "PM_CONSTANT_PATH_OR_WRITE_NODE";
179 case PM_CONSTANT_PATH_TARGET_NODE:
180 return "PM_CONSTANT_PATH_TARGET_NODE";
181 case PM_CONSTANT_PATH_WRITE_NODE:
182 return "PM_CONSTANT_PATH_WRITE_NODE";
183 case PM_CONSTANT_READ_NODE:
184 return "PM_CONSTANT_READ_NODE";
185 case PM_CONSTANT_TARGET_NODE:
186 return "PM_CONSTANT_TARGET_NODE";
187 case PM_CONSTANT_WRITE_NODE:
188 return "PM_CONSTANT_WRITE_NODE";
190 return "PM_DEF_NODE";
191 case PM_DEFINED_NODE:
192 return "PM_DEFINED_NODE";
194 return "PM_ELSE_NODE";
195 case PM_EMBEDDED_STATEMENTS_NODE:
196 return "PM_EMBEDDED_STATEMENTS_NODE";
197 case PM_EMBEDDED_VARIABLE_NODE:
198 return "PM_EMBEDDED_VARIABLE_NODE";
200 return "PM_ENSURE_NODE";
201 case PM_ERROR_RECOVERY_NODE:
202 return "PM_ERROR_RECOVERY_NODE";
204 return "PM_FALSE_NODE";
205 case PM_FIND_PATTERN_NODE:
206 return "PM_FIND_PATTERN_NODE";
207 case PM_FLIP_FLOP_NODE:
208 return "PM_FLIP_FLOP_NODE";
210 return "PM_FLOAT_NODE";
212 return "PM_FOR_NODE";
213 case PM_FORWARDING_ARGUMENTS_NODE:
214 return "PM_FORWARDING_ARGUMENTS_NODE";
215 case PM_FORWARDING_PARAMETER_NODE:
216 return "PM_FORWARDING_PARAMETER_NODE";
217 case PM_FORWARDING_SUPER_NODE:
218 return "PM_FORWARDING_SUPER_NODE";
219 case PM_GLOBAL_VARIABLE_AND_WRITE_NODE:
220 return "PM_GLOBAL_VARIABLE_AND_WRITE_NODE";
221 case PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE:
222 return "PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE";
223 case PM_GLOBAL_VARIABLE_OR_WRITE_NODE:
224 return "PM_GLOBAL_VARIABLE_OR_WRITE_NODE";
225 case PM_GLOBAL_VARIABLE_READ_NODE:
226 return "PM_GLOBAL_VARIABLE_READ_NODE";
227 case PM_GLOBAL_VARIABLE_TARGET_NODE:
228 return "PM_GLOBAL_VARIABLE_TARGET_NODE";
229 case PM_GLOBAL_VARIABLE_WRITE_NODE:
230 return "PM_GLOBAL_VARIABLE_WRITE_NODE";
232 return "PM_HASH_NODE";
233 case PM_HASH_PATTERN_NODE:
234 return "PM_HASH_PATTERN_NODE";
237 case PM_IMAGINARY_NODE:
238 return "PM_IMAGINARY_NODE";
239 case PM_IMPLICIT_NODE:
240 return "PM_IMPLICIT_NODE";
241 case PM_IMPLICIT_REST_NODE:
242 return "PM_IMPLICIT_REST_NODE";
245 case PM_INDEX_AND_WRITE_NODE:
246 return "PM_INDEX_AND_WRITE_NODE";
247 case PM_INDEX_OPERATOR_WRITE_NODE:
248 return "PM_INDEX_OPERATOR_WRITE_NODE";
249 case PM_INDEX_OR_WRITE_NODE:
250 return "PM_INDEX_OR_WRITE_NODE";
251 case PM_INDEX_TARGET_NODE:
252 return "PM_INDEX_TARGET_NODE";
253 case PM_INSTANCE_VARIABLE_AND_WRITE_NODE:
254 return "PM_INSTANCE_VARIABLE_AND_WRITE_NODE";
255 case PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE:
256 return "PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE";
257 case PM_INSTANCE_VARIABLE_OR_WRITE_NODE:
258 return "PM_INSTANCE_VARIABLE_OR_WRITE_NODE";
259 case PM_INSTANCE_VARIABLE_READ_NODE:
260 return "PM_INSTANCE_VARIABLE_READ_NODE";
261 case PM_INSTANCE_VARIABLE_TARGET_NODE:
262 return "PM_INSTANCE_VARIABLE_TARGET_NODE";
263 case PM_INSTANCE_VARIABLE_WRITE_NODE:
264 return "PM_INSTANCE_VARIABLE_WRITE_NODE";
265 case PM_INTEGER_NODE:
266 return "PM_INTEGER_NODE";
267 case PM_INTERPOLATED_MATCH_LAST_LINE_NODE:
268 return "PM_INTERPOLATED_MATCH_LAST_LINE_NODE";
269 case PM_INTERPOLATED_REGULAR_EXPRESSION_NODE:
270 return "PM_INTERPOLATED_REGULAR_EXPRESSION_NODE";
271 case PM_INTERPOLATED_STRING_NODE:
272 return "PM_INTERPOLATED_STRING_NODE";
273 case PM_INTERPOLATED_SYMBOL_NODE:
274 return "PM_INTERPOLATED_SYMBOL_NODE";
275 case PM_INTERPOLATED_X_STRING_NODE:
276 return "PM_INTERPOLATED_X_STRING_NODE";
277 case PM_IT_LOCAL_VARIABLE_READ_NODE:
278 return "PM_IT_LOCAL_VARIABLE_READ_NODE";
279 case PM_IT_PARAMETERS_NODE:
280 return "PM_IT_PARAMETERS_NODE";
281 case PM_KEYWORD_HASH_NODE:
282 return "PM_KEYWORD_HASH_NODE";
283 case PM_KEYWORD_REST_PARAMETER_NODE:
284 return "PM_KEYWORD_REST_PARAMETER_NODE";
286 return "PM_LAMBDA_NODE";
287 case PM_LOCAL_VARIABLE_AND_WRITE_NODE:
288 return "PM_LOCAL_VARIABLE_AND_WRITE_NODE";
289 case PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE:
290 return "PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE";
291 case PM_LOCAL_VARIABLE_OR_WRITE_NODE:
292 return "PM_LOCAL_VARIABLE_OR_WRITE_NODE";
293 case PM_LOCAL_VARIABLE_READ_NODE:
294 return "PM_LOCAL_VARIABLE_READ_NODE";
295 case PM_LOCAL_VARIABLE_TARGET_NODE:
296 return "PM_LOCAL_VARIABLE_TARGET_NODE";
297 case PM_LOCAL_VARIABLE_WRITE_NODE:
298 return "PM_LOCAL_VARIABLE_WRITE_NODE";
299 case PM_MATCH_LAST_LINE_NODE:
300 return "PM_MATCH_LAST_LINE_NODE";
301 case PM_MATCH_PREDICATE_NODE:
302 return "PM_MATCH_PREDICATE_NODE";
303 case PM_MATCH_REQUIRED_NODE:
304 return "PM_MATCH_REQUIRED_NODE";
305 case PM_MATCH_WRITE_NODE:
306 return "PM_MATCH_WRITE_NODE";
308 return "PM_MODULE_NODE";
309 case PM_MULTI_TARGET_NODE:
310 return "PM_MULTI_TARGET_NODE";
311 case PM_MULTI_WRITE_NODE:
312 return "PM_MULTI_WRITE_NODE";
314 return "PM_NEXT_NODE";
316 return "PM_NIL_NODE";
317 case PM_NO_BLOCK_PARAMETER_NODE:
318 return "PM_NO_BLOCK_PARAMETER_NODE";
319 case PM_NO_KEYWORDS_PARAMETER_NODE:
320 return "PM_NO_KEYWORDS_PARAMETER_NODE";
321 case PM_NUMBERED_PARAMETERS_NODE:
322 return "PM_NUMBERED_PARAMETERS_NODE";
323 case PM_NUMBERED_REFERENCE_READ_NODE:
324 return "PM_NUMBERED_REFERENCE_READ_NODE";
325 case PM_OPTIONAL_KEYWORD_PARAMETER_NODE:
326 return "PM_OPTIONAL_KEYWORD_PARAMETER_NODE";
327 case PM_OPTIONAL_PARAMETER_NODE:
328 return "PM_OPTIONAL_PARAMETER_NODE";
331 case PM_PARAMETERS_NODE:
332 return "PM_PARAMETERS_NODE";
333 case PM_PARENTHESES_NODE:
334 return "PM_PARENTHESES_NODE";
335 case PM_PINNED_EXPRESSION_NODE:
336 return "PM_PINNED_EXPRESSION_NODE";
337 case PM_PINNED_VARIABLE_NODE:
338 return "PM_PINNED_VARIABLE_NODE";
339 case PM_POST_EXECUTION_NODE:
340 return "PM_POST_EXECUTION_NODE";
341 case PM_PRE_EXECUTION_NODE:
342 return "PM_PRE_EXECUTION_NODE";
343 case PM_PROGRAM_NODE:
344 return "PM_PROGRAM_NODE";
346 return "PM_RANGE_NODE";
347 case PM_RATIONAL_NODE:
348 return "PM_RATIONAL_NODE";
350 return "PM_REDO_NODE";
351 case PM_REGULAR_EXPRESSION_NODE:
352 return "PM_REGULAR_EXPRESSION_NODE";
353 case PM_REQUIRED_KEYWORD_PARAMETER_NODE:
354 return "PM_REQUIRED_KEYWORD_PARAMETER_NODE";
355 case PM_REQUIRED_PARAMETER_NODE:
356 return "PM_REQUIRED_PARAMETER_NODE";
357 case PM_RESCUE_MODIFIER_NODE:
358 return "PM_RESCUE_MODIFIER_NODE";
360 return "PM_RESCUE_NODE";
361 case PM_REST_PARAMETER_NODE:
362 return "PM_REST_PARAMETER_NODE";
364 return "PM_RETRY_NODE";
366 return "PM_RETURN_NODE";
368 return "PM_SELF_NODE";
369 case PM_SHAREABLE_CONSTANT_NODE:
370 return "PM_SHAREABLE_CONSTANT_NODE";
371 case PM_SINGLETON_CLASS_NODE:
372 return "PM_SINGLETON_CLASS_NODE";
373 case PM_SOURCE_ENCODING_NODE:
374 return "PM_SOURCE_ENCODING_NODE";
375 case PM_SOURCE_FILE_NODE:
376 return "PM_SOURCE_FILE_NODE";
377 case PM_SOURCE_LINE_NODE:
378 return "PM_SOURCE_LINE_NODE";
380 return "PM_SPLAT_NODE";
381 case PM_STATEMENTS_NODE:
382 return "PM_STATEMENTS_NODE";
384 return "PM_STRING_NODE";
386 return "PM_SUPER_NODE";
388 return "PM_SYMBOL_NODE";
390 return "PM_TRUE_NODE";
392 return "PM_UNDEF_NODE";
394 return "PM_UNLESS_NODE";
396 return "PM_UNTIL_NODE";
398 return "PM_WHEN_NODE";
400 return "PM_WHILE_NODE";
401 case PM_X_STRING_NODE:
402 return "PM_X_STRING_NODE";
404 return "PM_YIELD_NODE";
419 if (result ==
PM_VISIT_DESCEND)
return pm_visit_child_nodes(node, visitor, data);
431 switch (PM_NODE_TYPE(node)) {
432 case PM_ALIAS_GLOBAL_VARIABLE_NODE: {
436 if (!pm_visit_node((
const pm_node_t *) cast->new_name, visitor, data))
return false;
439 if (!pm_visit_node((
const pm_node_t *) cast->old_name, visitor, data))
return false;
443 case PM_ALIAS_METHOD_NODE: {
447 if (!pm_visit_node((
const pm_node_t *) cast->new_name, visitor, data))
return false;
450 if (!pm_visit_node((
const pm_node_t *) cast->old_name, visitor, data))
return false;
454 case PM_ALTERNATION_PATTERN_NODE: {
458 if (!pm_visit_node((
const pm_node_t *) cast->left, visitor, data))
return false;
461 if (!pm_visit_node((
const pm_node_t *) cast->right, visitor, data))
return false;
469 if (!pm_visit_node((
const pm_node_t *) cast->left, visitor, data))
return false;
472 if (!pm_visit_node((
const pm_node_t *) cast->right, visitor, data))
return false;
476 case PM_ARGUMENTS_NODE: {
481 for (
size_t index = 0; index < arguments->
size; index++) {
482 if (!pm_visit_node(arguments->
nodes[index], visitor, data))
return false;
487 case PM_ARRAY_NODE: {
492 for (
size_t index = 0; index < elements->
size; index++) {
493 if (!pm_visit_node(elements->
nodes[index], visitor, data))
return false;
498 case PM_ARRAY_PATTERN_NODE: {
502 if (cast->constant != NULL && !pm_visit_node((
const pm_node_t *) cast->constant, visitor, data))
return false;
506 for (
size_t index = 0; index < requireds->
size; index++) {
507 if (!pm_visit_node(requireds->
nodes[index], visitor, data))
return false;
511 if (cast->rest != NULL && !pm_visit_node((
const pm_node_t *) cast->rest, visitor, data))
return false;
515 for (
size_t index = 0; index < posts->
size; index++) {
516 if (!pm_visit_node(posts->
nodes[index], visitor, data))
return false;
521 case PM_ASSOC_NODE: {
525 if (!pm_visit_node((
const pm_node_t *) cast->key, visitor, data))
return false;
528 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
532 case PM_ASSOC_SPLAT_NODE: {
536 if (cast->value != NULL && !pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
540 case PM_BACK_REFERENCE_READ_NODE:
542 case PM_BEGIN_NODE: {
546 if (cast->statements != NULL && !pm_visit_node((
const pm_node_t *) cast->statements, visitor, data))
return false;
549 if (cast->rescue_clause != NULL && !pm_visit_node((
const pm_node_t *) cast->rescue_clause, visitor, data))
return false;
552 if (cast->else_clause != NULL && !pm_visit_node((
const pm_node_t *) cast->else_clause, visitor, data))
return false;
555 if (cast->ensure_clause != NULL && !pm_visit_node((
const pm_node_t *) cast->ensure_clause, visitor, data))
return false;
559 case PM_BLOCK_ARGUMENT_NODE: {
563 if (cast->expression != NULL && !pm_visit_node((
const pm_node_t *) cast->expression, visitor, data))
return false;
567 case PM_BLOCK_LOCAL_VARIABLE_NODE:
569 case PM_BLOCK_NODE: {
573 if (cast->parameters != NULL && !pm_visit_node((
const pm_node_t *) cast->parameters, visitor, data))
return false;
576 if (cast->body != NULL && !pm_visit_node((
const pm_node_t *) cast->body, visitor, data))
return false;
580 case PM_BLOCK_PARAMETER_NODE:
582 case PM_BLOCK_PARAMETERS_NODE: {
586 if (cast->parameters != NULL && !pm_visit_node((
const pm_node_t *) cast->parameters, visitor, data))
return false;
590 for (
size_t index = 0; index < locals->
size; index++) {
591 if (!pm_visit_node(locals->
nodes[index], visitor, data))
return false;
596 case PM_BREAK_NODE: {
600 if (cast->arguments != NULL && !pm_visit_node((
const pm_node_t *) cast->arguments, visitor, data))
return false;
604 case PM_CALL_AND_WRITE_NODE: {
608 if (cast->receiver != NULL && !pm_visit_node((
const pm_node_t *) cast->receiver, visitor, data))
return false;
611 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
619 if (cast->receiver != NULL && !pm_visit_node((
const pm_node_t *) cast->receiver, visitor, data))
return false;
622 if (cast->arguments != NULL && !pm_visit_node((
const pm_node_t *) cast->arguments, visitor, data))
return false;
625 if (cast->block != NULL && !pm_visit_node((
const pm_node_t *) cast->block, visitor, data))
return false;
629 case PM_CALL_OPERATOR_WRITE_NODE: {
633 if (cast->receiver != NULL && !pm_visit_node((
const pm_node_t *) cast->receiver, visitor, data))
return false;
636 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
640 case PM_CALL_OR_WRITE_NODE: {
644 if (cast->receiver != NULL && !pm_visit_node((
const pm_node_t *) cast->receiver, visitor, data))
return false;
647 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
651 case PM_CALL_TARGET_NODE: {
655 if (!pm_visit_node((
const pm_node_t *) cast->receiver, visitor, data))
return false;
659 case PM_CAPTURE_PATTERN_NODE: {
663 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
666 if (!pm_visit_node((
const pm_node_t *) cast->target, visitor, data))
return false;
670 case PM_CASE_MATCH_NODE: {
674 if (cast->predicate != NULL && !pm_visit_node((
const pm_node_t *) cast->predicate, visitor, data))
return false;
678 for (
size_t index = 0; index < conditions->
size; index++) {
679 if (!pm_visit_node(conditions->
nodes[index], visitor, data))
return false;
683 if (cast->else_clause != NULL && !pm_visit_node((
const pm_node_t *) cast->else_clause, visitor, data))
return false;
691 if (cast->predicate != NULL && !pm_visit_node((
const pm_node_t *) cast->predicate, visitor, data))
return false;
695 for (
size_t index = 0; index < conditions->
size; index++) {
696 if (!pm_visit_node(conditions->
nodes[index], visitor, data))
return false;
700 if (cast->else_clause != NULL && !pm_visit_node((
const pm_node_t *) cast->else_clause, visitor, data))
return false;
704 case PM_CLASS_NODE: {
708 if (!pm_visit_node((
const pm_node_t *) cast->constant_path, visitor, data))
return false;
711 if (cast->superclass != NULL && !pm_visit_node((
const pm_node_t *) cast->superclass, visitor, data))
return false;
714 if (cast->body != NULL && !pm_visit_node((
const pm_node_t *) cast->body, visitor, data))
return false;
718 case PM_CLASS_VARIABLE_AND_WRITE_NODE: {
722 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
726 case PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
730 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
734 case PM_CLASS_VARIABLE_OR_WRITE_NODE: {
738 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
742 case PM_CLASS_VARIABLE_READ_NODE:
744 case PM_CLASS_VARIABLE_TARGET_NODE:
746 case PM_CLASS_VARIABLE_WRITE_NODE: {
750 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
754 case PM_CONSTANT_AND_WRITE_NODE: {
758 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
762 case PM_CONSTANT_OPERATOR_WRITE_NODE: {
766 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
770 case PM_CONSTANT_OR_WRITE_NODE: {
774 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
778 case PM_CONSTANT_PATH_AND_WRITE_NODE: {
782 if (!pm_visit_node((
const pm_node_t *) cast->target, visitor, data))
return false;
785 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
789 case PM_CONSTANT_PATH_NODE: {
793 if (cast->parent != NULL && !pm_visit_node((
const pm_node_t *) cast->parent, visitor, data))
return false;
797 case PM_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
801 if (!pm_visit_node((
const pm_node_t *) cast->target, visitor, data))
return false;
804 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
808 case PM_CONSTANT_PATH_OR_WRITE_NODE: {
812 if (!pm_visit_node((
const pm_node_t *) cast->target, visitor, data))
return false;
815 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
819 case PM_CONSTANT_PATH_TARGET_NODE: {
823 if (cast->parent != NULL && !pm_visit_node((
const pm_node_t *) cast->parent, visitor, data))
return false;
827 case PM_CONSTANT_PATH_WRITE_NODE: {
831 if (!pm_visit_node((
const pm_node_t *) cast->target, visitor, data))
return false;
834 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
838 case PM_CONSTANT_READ_NODE:
840 case PM_CONSTANT_TARGET_NODE:
842 case PM_CONSTANT_WRITE_NODE: {
846 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
854 if (cast->receiver != NULL && !pm_visit_node((
const pm_node_t *) cast->receiver, visitor, data))
return false;
857 if (cast->parameters != NULL && !pm_visit_node((
const pm_node_t *) cast->parameters, visitor, data))
return false;
860 if (cast->body != NULL && !pm_visit_node((
const pm_node_t *) cast->body, visitor, data))
return false;
864 case PM_DEFINED_NODE: {
868 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
876 if (cast->statements != NULL && !pm_visit_node((
const pm_node_t *) cast->statements, visitor, data))
return false;
880 case PM_EMBEDDED_STATEMENTS_NODE: {
884 if (cast->statements != NULL && !pm_visit_node((
const pm_node_t *) cast->statements, visitor, data))
return false;
888 case PM_EMBEDDED_VARIABLE_NODE: {
892 if (!pm_visit_node((
const pm_node_t *) cast->variable, visitor, data))
return false;
896 case PM_ENSURE_NODE: {
900 if (cast->statements != NULL && !pm_visit_node((
const pm_node_t *) cast->statements, visitor, data))
return false;
904 case PM_ERROR_RECOVERY_NODE: {
908 if (cast->unexpected != NULL && !pm_visit_node((
const pm_node_t *) cast->unexpected, visitor, data))
return false;
914 case PM_FIND_PATTERN_NODE: {
918 if (cast->constant != NULL && !pm_visit_node((
const pm_node_t *) cast->constant, visitor, data))
return false;
921 if (!pm_visit_node((
const pm_node_t *) cast->left, visitor, data))
return false;
925 for (
size_t index = 0; index < requireds->
size; index++) {
926 if (!pm_visit_node(requireds->
nodes[index], visitor, data))
return false;
930 if (!pm_visit_node((
const pm_node_t *) cast->right, visitor, data))
return false;
934 case PM_FLIP_FLOP_NODE: {
938 if (cast->left != NULL && !pm_visit_node((
const pm_node_t *) cast->left, visitor, data))
return false;
941 if (cast->right != NULL && !pm_visit_node((
const pm_node_t *) cast->right, visitor, data))
return false;
951 if (!pm_visit_node((
const pm_node_t *) cast->index, visitor, data))
return false;
954 if (!pm_visit_node((
const pm_node_t *) cast->collection, visitor, data))
return false;
957 if (cast->statements != NULL && !pm_visit_node((
const pm_node_t *) cast->statements, visitor, data))
return false;
961 case PM_FORWARDING_ARGUMENTS_NODE:
963 case PM_FORWARDING_PARAMETER_NODE:
965 case PM_FORWARDING_SUPER_NODE: {
969 if (cast->block != NULL && !pm_visit_node((
const pm_node_t *) cast->block, visitor, data))
return false;
973 case PM_GLOBAL_VARIABLE_AND_WRITE_NODE: {
977 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
981 case PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
985 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
989 case PM_GLOBAL_VARIABLE_OR_WRITE_NODE: {
993 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
997 case PM_GLOBAL_VARIABLE_READ_NODE:
999 case PM_GLOBAL_VARIABLE_TARGET_NODE:
1001 case PM_GLOBAL_VARIABLE_WRITE_NODE: {
1005 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
1009 case PM_HASH_NODE: {
1014 for (
size_t index = 0; index < elements->
size; index++) {
1015 if (!pm_visit_node(elements->
nodes[index], visitor, data))
return false;
1020 case PM_HASH_PATTERN_NODE: {
1024 if (cast->constant != NULL && !pm_visit_node((
const pm_node_t *) cast->constant, visitor, data))
return false;
1028 for (
size_t index = 0; index < elements->
size; index++) {
1029 if (!pm_visit_node(elements->
nodes[index], visitor, data))
return false;
1033 if (cast->rest != NULL && !pm_visit_node((
const pm_node_t *) cast->rest, visitor, data))
return false;
1041 if (!pm_visit_node((
const pm_node_t *) cast->predicate, visitor, data))
return false;
1044 if (cast->statements != NULL && !pm_visit_node((
const pm_node_t *) cast->statements, visitor, data))
return false;
1047 if (cast->subsequent != NULL && !pm_visit_node((
const pm_node_t *) cast->subsequent, visitor, data))
return false;
1051 case PM_IMAGINARY_NODE: {
1055 if (!pm_visit_node((
const pm_node_t *) cast->numeric, visitor, data))
return false;
1059 case PM_IMPLICIT_NODE: {
1063 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
1067 case PM_IMPLICIT_REST_NODE:
1073 if (!pm_visit_node((
const pm_node_t *) cast->pattern, visitor, data))
return false;
1076 if (cast->statements != NULL && !pm_visit_node((
const pm_node_t *) cast->statements, visitor, data))
return false;
1080 case PM_INDEX_AND_WRITE_NODE: {
1084 if (cast->receiver != NULL && !pm_visit_node((
const pm_node_t *) cast->receiver, visitor, data))
return false;
1087 if (cast->arguments != NULL && !pm_visit_node((
const pm_node_t *) cast->arguments, visitor, data))
return false;
1090 if (cast->block != NULL && !pm_visit_node((
const pm_node_t *) cast->block, visitor, data))
return false;
1093 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
1097 case PM_INDEX_OPERATOR_WRITE_NODE: {
1101 if (cast->receiver != NULL && !pm_visit_node((
const pm_node_t *) cast->receiver, visitor, data))
return false;
1104 if (cast->arguments != NULL && !pm_visit_node((
const pm_node_t *) cast->arguments, visitor, data))
return false;
1107 if (cast->block != NULL && !pm_visit_node((
const pm_node_t *) cast->block, visitor, data))
return false;
1110 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
1114 case PM_INDEX_OR_WRITE_NODE: {
1118 if (cast->receiver != NULL && !pm_visit_node((
const pm_node_t *) cast->receiver, visitor, data))
return false;
1121 if (cast->arguments != NULL && !pm_visit_node((
const pm_node_t *) cast->arguments, visitor, data))
return false;
1124 if (cast->block != NULL && !pm_visit_node((
const pm_node_t *) cast->block, visitor, data))
return false;
1127 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
1131 case PM_INDEX_TARGET_NODE: {
1135 if (!pm_visit_node((
const pm_node_t *) cast->receiver, visitor, data))
return false;
1138 if (cast->arguments != NULL && !pm_visit_node((
const pm_node_t *) cast->arguments, visitor, data))
return false;
1141 if (cast->block != NULL && !pm_visit_node((
const pm_node_t *) cast->block, visitor, data))
return false;
1145 case PM_INSTANCE_VARIABLE_AND_WRITE_NODE: {
1149 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
1153 case PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
1157 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
1161 case PM_INSTANCE_VARIABLE_OR_WRITE_NODE: {
1165 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
1169 case PM_INSTANCE_VARIABLE_READ_NODE:
1171 case PM_INSTANCE_VARIABLE_TARGET_NODE:
1173 case PM_INSTANCE_VARIABLE_WRITE_NODE: {
1177 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
1181 case PM_INTEGER_NODE:
1183 case PM_INTERPOLATED_MATCH_LAST_LINE_NODE: {
1188 for (
size_t index = 0; index < parts->
size; index++) {
1189 if (!pm_visit_node(parts->
nodes[index], visitor, data))
return false;
1194 case PM_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
1199 for (
size_t index = 0; index < parts->
size; index++) {
1200 if (!pm_visit_node(parts->
nodes[index], visitor, data))
return false;
1205 case PM_INTERPOLATED_STRING_NODE: {
1210 for (
size_t index = 0; index < parts->
size; index++) {
1211 if (!pm_visit_node(parts->
nodes[index], visitor, data))
return false;
1216 case PM_INTERPOLATED_SYMBOL_NODE: {
1221 for (
size_t index = 0; index < parts->
size; index++) {
1222 if (!pm_visit_node(parts->
nodes[index], visitor, data))
return false;
1227 case PM_INTERPOLATED_X_STRING_NODE: {
1232 for (
size_t index = 0; index < parts->
size; index++) {
1233 if (!pm_visit_node(parts->
nodes[index], visitor, data))
return false;
1238 case PM_IT_LOCAL_VARIABLE_READ_NODE:
1240 case PM_IT_PARAMETERS_NODE:
1242 case PM_KEYWORD_HASH_NODE: {
1247 for (
size_t index = 0; index < elements->
size; index++) {
1248 if (!pm_visit_node(elements->
nodes[index], visitor, data))
return false;
1253 case PM_KEYWORD_REST_PARAMETER_NODE:
1255 case PM_LAMBDA_NODE: {
1259 if (cast->parameters != NULL && !pm_visit_node((
const pm_node_t *) cast->parameters, visitor, data))
return false;
1262 if (cast->body != NULL && !pm_visit_node((
const pm_node_t *) cast->body, visitor, data))
return false;
1266 case PM_LOCAL_VARIABLE_AND_WRITE_NODE: {
1270 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
1274 case PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
1278 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
1282 case PM_LOCAL_VARIABLE_OR_WRITE_NODE: {
1286 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
1290 case PM_LOCAL_VARIABLE_READ_NODE:
1292 case PM_LOCAL_VARIABLE_TARGET_NODE:
1294 case PM_LOCAL_VARIABLE_WRITE_NODE: {
1298 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
1302 case PM_MATCH_LAST_LINE_NODE:
1304 case PM_MATCH_PREDICATE_NODE: {
1308 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
1311 if (!pm_visit_node((
const pm_node_t *) cast->pattern, visitor, data))
return false;
1315 case PM_MATCH_REQUIRED_NODE: {
1319 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
1322 if (!pm_visit_node((
const pm_node_t *) cast->pattern, visitor, data))
return false;
1326 case PM_MATCH_WRITE_NODE: {
1330 if (!pm_visit_node((
const pm_node_t *) cast->call, visitor, data))
return false;
1334 for (
size_t index = 0; index < targets->
size; index++) {
1335 if (!pm_visit_node(targets->
nodes[index], visitor, data))
return false;
1340 case PM_MODULE_NODE: {
1344 if (!pm_visit_node((
const pm_node_t *) cast->constant_path, visitor, data))
return false;
1347 if (cast->body != NULL && !pm_visit_node((
const pm_node_t *) cast->body, visitor, data))
return false;
1351 case PM_MULTI_TARGET_NODE: {
1356 for (
size_t index = 0; index < lefts->
size; index++) {
1357 if (!pm_visit_node(lefts->
nodes[index], visitor, data))
return false;
1361 if (cast->rest != NULL && !pm_visit_node((
const pm_node_t *) cast->rest, visitor, data))
return false;
1365 for (
size_t index = 0; index < rights->
size; index++) {
1366 if (!pm_visit_node(rights->
nodes[index], visitor, data))
return false;
1371 case PM_MULTI_WRITE_NODE: {
1376 for (
size_t index = 0; index < lefts->
size; index++) {
1377 if (!pm_visit_node(lefts->
nodes[index], visitor, data))
return false;
1381 if (cast->rest != NULL && !pm_visit_node((
const pm_node_t *) cast->rest, visitor, data))
return false;
1385 for (
size_t index = 0; index < rights->
size; index++) {
1386 if (!pm_visit_node(rights->
nodes[index], visitor, data))
return false;
1390 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
1394 case PM_NEXT_NODE: {
1398 if (cast->arguments != NULL && !pm_visit_node((
const pm_node_t *) cast->arguments, visitor, data))
return false;
1404 case PM_NO_BLOCK_PARAMETER_NODE:
1406 case PM_NO_KEYWORDS_PARAMETER_NODE:
1408 case PM_NUMBERED_PARAMETERS_NODE:
1410 case PM_NUMBERED_REFERENCE_READ_NODE:
1412 case PM_OPTIONAL_KEYWORD_PARAMETER_NODE: {
1416 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
1420 case PM_OPTIONAL_PARAMETER_NODE: {
1424 if (!pm_visit_node((
const pm_node_t *) cast->value, visitor, data))
return false;
1432 if (!pm_visit_node((
const pm_node_t *) cast->left, visitor, data))
return false;
1435 if (!pm_visit_node((
const pm_node_t *) cast->right, visitor, data))
return false;
1439 case PM_PARAMETERS_NODE: {
1444 for (
size_t index = 0; index < requireds->
size; index++) {
1445 if (!pm_visit_node(requireds->
nodes[index], visitor, data))
return false;
1450 for (
size_t index = 0; index < optionals->
size; index++) {
1451 if (!pm_visit_node(optionals->
nodes[index], visitor, data))
return false;
1455 if (cast->rest != NULL && !pm_visit_node((
const pm_node_t *) cast->rest, visitor, data))
return false;
1459 for (
size_t index = 0; index < posts->
size; index++) {
1460 if (!pm_visit_node(posts->
nodes[index], visitor, data))
return false;
1465 for (
size_t index = 0; index < keywords->
size; index++) {
1466 if (!pm_visit_node(keywords->
nodes[index], visitor, data))
return false;
1470 if (cast->keyword_rest != NULL && !pm_visit_node((
const pm_node_t *) cast->keyword_rest, visitor, data))
return false;
1473 if (cast->block != NULL && !pm_visit_node((
const pm_node_t *) cast->block, visitor, data))
return false;
1477 case PM_PARENTHESES_NODE: {
1481 if (cast->body != NULL && !pm_visit_node((
const pm_node_t *) cast->body, visitor, data))
return false;
1485 case PM_PINNED_EXPRESSION_NODE: {
1489 if (!pm_visit_node((
const pm_node_t *) cast->expression, visitor, data))
return false;
1493 case PM_PINNED_VARIABLE_NODE: {
1497 if (!pm_visit_node((
const pm_node_t *) cast->variable, visitor, data))
return false;
1501 case PM_POST_EXECUTION_NODE: {
1505 if (cast->statements != NULL && !pm_visit_node((
const pm_node_t *) cast->statements, visitor, data))
return false;
1509 case PM_PRE_EXECUTION_NODE: {
1513 if (cast->statements != NULL && !pm_visit_node((
const pm_node_t *) cast->statements, visitor, data))
return false;
1517 case PM_PROGRAM_NODE: {
1521 if (!pm_visit_node((
const pm_node_t *) cast->statements, visitor, data))
return false;
1525 case PM_RANGE_NODE: {
1529 if (cast->left != NULL && !pm_visit_node((
const pm_node_t *) cast->left, visitor, data))
return false;
1532 if (cast->right != NULL && !pm_visit_node((
const pm_node_t *) cast->right, visitor, data))
return false;
1536 case PM_RATIONAL_NODE:
1540 case PM_REGULAR_EXPRESSION_NODE:
1542 case PM_REQUIRED_KEYWORD_PARAMETER_NODE:
1544 case PM_REQUIRED_PARAMETER_NODE:
1546 case PM_RESCUE_MODIFIER_NODE: {
1550 if (!pm_visit_node((
const pm_node_t *) cast->expression, visitor, data))
return false;
1553 if (!pm_visit_node((
const pm_node_t *) cast->rescue_expression, visitor, data))
return false;
1557 case PM_RESCUE_NODE: {
1562 for (
size_t index = 0; index < exceptions->
size; index++) {
1563 if (!pm_visit_node(exceptions->
nodes[index], visitor, data))
return false;
1567 if (cast->reference != NULL && !pm_visit_node((
const pm_node_t *) cast->reference, visitor, data))
return false;
1570 if (cast->statements != NULL && !pm_visit_node((
const pm_node_t *) cast->statements, visitor, data))
return false;
1573 if (cast->subsequent != NULL && !pm_visit_node((
const pm_node_t *) cast->subsequent, visitor, data))
return false;
1577 case PM_REST_PARAMETER_NODE:
1581 case PM_RETURN_NODE: {
1585 if (cast->arguments != NULL && !pm_visit_node((
const pm_node_t *) cast->arguments, visitor, data))
return false;
1591 case PM_SHAREABLE_CONSTANT_NODE: {
1595 if (!pm_visit_node((
const pm_node_t *) cast->write, visitor, data))
return false;
1599 case PM_SINGLETON_CLASS_NODE: {
1603 if (!pm_visit_node((
const pm_node_t *) cast->expression, visitor, data))
return false;
1606 if (cast->body != NULL && !pm_visit_node((
const pm_node_t *) cast->body, visitor, data))
return false;
1610 case PM_SOURCE_ENCODING_NODE:
1612 case PM_SOURCE_FILE_NODE:
1614 case PM_SOURCE_LINE_NODE:
1616 case PM_SPLAT_NODE: {
1620 if (cast->expression != NULL && !pm_visit_node((
const pm_node_t *) cast->expression, visitor, data))
return false;
1624 case PM_STATEMENTS_NODE: {
1629 for (
size_t index = 0; index < body->
size; index++) {
1630 if (!pm_visit_node(body->
nodes[index], visitor, data))
return false;
1635 case PM_STRING_NODE:
1637 case PM_SUPER_NODE: {
1641 if (cast->arguments != NULL && !pm_visit_node((
const pm_node_t *) cast->arguments, visitor, data))
return false;
1644 if (cast->block != NULL && !pm_visit_node((
const pm_node_t *) cast->block, visitor, data))
return false;
1648 case PM_SYMBOL_NODE:
1652 case PM_UNDEF_NODE: {
1657 for (
size_t index = 0; index < names->
size; index++) {
1658 if (!pm_visit_node(names->
nodes[index], visitor, data))
return false;
1663 case PM_UNLESS_NODE: {
1667 if (!pm_visit_node((
const pm_node_t *) cast->predicate, visitor, data))
return false;
1670 if (cast->statements != NULL && !pm_visit_node((
const pm_node_t *) cast->statements, visitor, data))
return false;
1673 if (cast->else_clause != NULL && !pm_visit_node((
const pm_node_t *) cast->else_clause, visitor, data))
return false;
1677 case PM_UNTIL_NODE: {
1681 if (!pm_visit_node((
const pm_node_t *) cast->predicate, visitor, data))
return false;
1684 if (cast->statements != NULL && !pm_visit_node((
const pm_node_t *) cast->statements, visitor, data))
return false;
1688 case PM_WHEN_NODE: {
1693 for (
size_t index = 0; index < conditions->
size; index++) {
1694 if (!pm_visit_node(conditions->
nodes[index], visitor, data))
return false;
1698 if (cast->statements != NULL && !pm_visit_node((
const pm_node_t *) cast->statements, visitor, data))
return false;
1702 case PM_WHILE_NODE: {
1706 if (!pm_visit_node((
const pm_node_t *) cast->predicate, visitor, data))
return false;
1709 if (cast->statements != NULL && !pm_visit_node((
const pm_node_t *) cast->statements, visitor, data))
return false;
1713 case PM_X_STRING_NODE:
1715 case PM_YIELD_NODE: {
1719 if (cast->arguments != NULL && !pm_visit_node((
const pm_node_t *) cast->arguments, visitor, data))
return false;
1738 .
base = { .
type = PM_ALIAS_GLOBAL_VARIABLE_NODE, .flags = flags, .node_id = node_id, .location = location },
1739 .new_name = new_name,
1740 .old_name = old_name,
1741 .keyword_loc = keyword_loc
1755 .
base = { .
type = PM_ALIAS_METHOD_NODE, .flags = flags, .node_id = node_id, .location = location },
1756 .new_name = new_name,
1757 .old_name = old_name,
1758 .keyword_loc = keyword_loc
1772 .
base = { .
type = PM_ALTERNATION_PATTERN_NODE, .flags = flags, .node_id = node_id, .location = location },
1775 .operator_loc = operator_loc
1789 .
base = { .
type = PM_AND_NODE, .flags = flags, .node_id = node_id, .location = location },
1792 .operator_loc = operator_loc
1806 .
base = { .
type = PM_ARGUMENTS_NODE, .flags = flags, .node_id = node_id, .location = location },
1807 .arguments = arguments
1821 .
base = { .
type = PM_ARRAY_NODE, .flags = flags, .node_id = node_id, .location = location },
1822 .elements = elements,
1823 .opening_loc = opening_loc,
1824 .closing_loc = closing_loc
1838 .
base = { .
type = PM_ARRAY_PATTERN_NODE, .flags = flags, .node_id = node_id, .location = location },
1840 .requireds = requireds,
1843 .opening_loc = opening_loc,
1844 .closing_loc = closing_loc
1858 .
base = { .
type = PM_ASSOC_NODE, .flags = flags, .node_id = node_id, .location = location },
1861 .operator_loc = operator_loc
1875 .
base = { .
type = PM_ASSOC_SPLAT_NODE, .flags = flags, .node_id = node_id, .location = location },
1877 .operator_loc = operator_loc
1891 .
base = { .
type = PM_BACK_REFERENCE_READ_NODE, .flags = flags, .node_id = node_id, .location = location },
1906 .
base = { .
type = PM_BEGIN_NODE, .flags = flags, .node_id = node_id, .location = location },
1907 .begin_keyword_loc = begin_keyword_loc,
1908 .statements = statements,
1909 .rescue_clause = rescue_clause,
1910 .else_clause = else_clause,
1911 .ensure_clause = ensure_clause,
1926 .
base = { .
type = PM_BLOCK_ARGUMENT_NODE, .flags = flags, .node_id = node_id, .location = location },
1927 .expression = expression,
1928 .operator_loc = operator_loc
1942 .
base = { .
type = PM_BLOCK_LOCAL_VARIABLE_NODE, .flags = flags, .node_id = node_id, .location = location },
1957 .
base = { .
type = PM_BLOCK_NODE, .flags = flags, .node_id = node_id, .location = location },
1959 .parameters = parameters,
1961 .opening_loc = opening_loc,
1962 .closing_loc = closing_loc
1976 .
base = { .
type = PM_BLOCK_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
1978 .name_loc = name_loc,
1979 .operator_loc = operator_loc
1993 .
base = { .
type = PM_BLOCK_PARAMETERS_NODE, .flags = flags, .node_id = node_id, .location = location },
1994 .parameters = parameters,
1996 .opening_loc = opening_loc,
1997 .closing_loc = closing_loc
2011 .
base = { .
type = PM_BREAK_NODE, .flags = flags, .node_id = node_id, .location = location },
2012 .arguments = arguments,
2013 .keyword_loc = keyword_loc
2023pm_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) {
2027 .
base = { .
type = PM_CALL_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2028 .receiver = receiver,
2029 .call_operator_loc = call_operator_loc,
2030 .message_loc = message_loc,
2031 .read_name = read_name,
2032 .write_name = write_name,
2033 .operator_loc = operator_loc,
2044pm_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) {
2048 .
base = { .
type = PM_CALL_NODE, .flags = flags, .node_id = node_id, .location = location },
2049 .receiver = receiver,
2050 .call_operator_loc = call_operator_loc,
2052 .message_loc = message_loc,
2053 .opening_loc = opening_loc,
2054 .arguments = arguments,
2055 .closing_loc = closing_loc,
2056 .equal_loc = equal_loc,
2067pm_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) {
2071 .
base = { .
type = PM_CALL_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2072 .receiver = receiver,
2073 .call_operator_loc = call_operator_loc,
2074 .message_loc = message_loc,
2075 .read_name = read_name,
2076 .write_name = write_name,
2077 .binary_operator = binary_operator,
2078 .binary_operator_loc = binary_operator_loc,
2089pm_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) {
2093 .
base = { .
type = PM_CALL_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2094 .receiver = receiver,
2095 .call_operator_loc = call_operator_loc,
2096 .message_loc = message_loc,
2097 .read_name = read_name,
2098 .write_name = write_name,
2099 .operator_loc = operator_loc,
2114 .
base = { .
type = PM_CALL_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
2115 .receiver = receiver,
2116 .call_operator_loc = call_operator_loc,
2118 .message_loc = message_loc
2132 .
base = { .
type = PM_CAPTURE_PATTERN_NODE, .flags = flags, .node_id = node_id, .location = location },
2135 .operator_loc = operator_loc
2149 .
base = { .
type = PM_CASE_MATCH_NODE, .flags = flags, .node_id = node_id, .location = location },
2150 .predicate = predicate,
2151 .conditions = conditions,
2152 .else_clause = else_clause,
2153 .case_keyword_loc = case_keyword_loc,
2154 .end_keyword_loc = end_keyword_loc
2168 .
base = { .
type = PM_CASE_NODE, .flags = flags, .node_id = node_id, .location = location },
2169 .predicate = predicate,
2170 .conditions = conditions,
2171 .else_clause = else_clause,
2172 .case_keyword_loc = case_keyword_loc,
2173 .end_keyword_loc = end_keyword_loc
2183pm_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) {
2187 .
base = { .
type = PM_CLASS_NODE, .flags = flags, .node_id = node_id, .location = location },
2189 .class_keyword_loc = class_keyword_loc,
2190 .constant_path = constant_path,
2191 .inheritance_operator_loc = inheritance_operator_loc,
2192 .superclass = superclass,
2194 .end_keyword_loc = end_keyword_loc,
2209 .
base = { .
type = PM_CLASS_VARIABLE_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2211 .name_loc = name_loc,
2212 .operator_loc = operator_loc,
2227 .
base = { .
type = PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2229 .name_loc = name_loc,
2230 .binary_operator_loc = binary_operator_loc,
2232 .binary_operator = binary_operator
2246 .
base = { .
type = PM_CLASS_VARIABLE_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2248 .name_loc = name_loc,
2249 .operator_loc = operator_loc,
2264 .
base = { .
type = PM_CLASS_VARIABLE_READ_NODE, .flags = flags, .node_id = node_id, .location = location },
2279 .
base = { .
type = PM_CLASS_VARIABLE_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
2294 .
base = { .
type = PM_CLASS_VARIABLE_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2296 .name_loc = name_loc,
2298 .operator_loc = operator_loc
2312 .
base = { .
type = PM_CONSTANT_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2314 .name_loc = name_loc,
2315 .operator_loc = operator_loc,
2330 .
base = { .
type = PM_CONSTANT_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2332 .name_loc = name_loc,
2333 .binary_operator_loc = binary_operator_loc,
2335 .binary_operator = binary_operator
2349 .
base = { .
type = PM_CONSTANT_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2351 .name_loc = name_loc,
2352 .operator_loc = operator_loc,
2367 .
base = { .
type = PM_CONSTANT_PATH_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2369 .operator_loc = operator_loc,
2384 .
base = { .
type = PM_CONSTANT_PATH_NODE, .flags = flags, .node_id = node_id, .location = location },
2387 .delimiter_loc = delimiter_loc,
2388 .name_loc = name_loc
2402 .
base = { .
type = PM_CONSTANT_PATH_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2404 .binary_operator_loc = binary_operator_loc,
2406 .binary_operator = binary_operator
2420 .
base = { .
type = PM_CONSTANT_PATH_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2422 .operator_loc = operator_loc,
2437 .
base = { .
type = PM_CONSTANT_PATH_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
2440 .delimiter_loc = delimiter_loc,
2441 .name_loc = name_loc
2455 .
base = { .
type = PM_CONSTANT_PATH_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2457 .operator_loc = operator_loc,
2472 .
base = { .
type = PM_CONSTANT_READ_NODE, .flags = flags, .node_id = node_id, .location = location },
2487 .
base = { .
type = PM_CONSTANT_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
2502 .
base = { .
type = PM_CONSTANT_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2504 .name_loc = name_loc,
2506 .operator_loc = operator_loc
2516pm_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) {
2520 .
base = { .
type = PM_DEF_NODE, .flags = flags, .node_id = node_id, .location = location },
2522 .name_loc = name_loc,
2523 .receiver = receiver,
2524 .parameters = parameters,
2527 .def_keyword_loc = def_keyword_loc,
2528 .operator_loc = operator_loc,
2529 .lparen_loc = lparen_loc,
2530 .rparen_loc = rparen_loc,
2531 .equal_loc = equal_loc,
2532 .end_keyword_loc = end_keyword_loc
2546 .
base = { .
type = PM_DEFINED_NODE, .flags = flags, .node_id = node_id, .location = location },
2547 .lparen_loc = lparen_loc,
2549 .rparen_loc = rparen_loc,
2550 .keyword_loc = keyword_loc
2564 .
base = { .
type = PM_ELSE_NODE, .flags = flags, .node_id = node_id, .location = location },
2565 .else_keyword_loc = else_keyword_loc,
2566 .statements = statements,
2567 .end_keyword_loc = end_keyword_loc
2581 .
base = { .
type = PM_EMBEDDED_STATEMENTS_NODE, .flags = flags, .node_id = node_id, .location = location },
2582 .opening_loc = opening_loc,
2583 .statements = statements,
2584 .closing_loc = closing_loc
2598 .
base = { .
type = PM_EMBEDDED_VARIABLE_NODE, .flags = flags, .node_id = node_id, .location = location },
2599 .operator_loc = operator_loc,
2600 .variable = variable
2614 .
base = { .
type = PM_ENSURE_NODE, .flags = flags, .node_id = node_id, .location = location },
2615 .ensure_keyword_loc = ensure_keyword_loc,
2616 .statements = statements,
2617 .end_keyword_loc = end_keyword_loc
2631 .
base = { .
type = PM_ERROR_RECOVERY_NODE, .flags = flags, .node_id = node_id, .location = location },
2632 .unexpected = unexpected
2646 .
base = { .
type = PM_FALSE_NODE, .flags = flags, .node_id = node_id, .location = location }
2660 .
base = { .
type = PM_FIND_PATTERN_NODE, .flags = flags, .node_id = node_id, .location = location },
2663 .requireds = requireds,
2665 .opening_loc = opening_loc,
2666 .closing_loc = closing_loc
2680 .
base = { .
type = PM_FLIP_FLOP_NODE, .flags = flags, .node_id = node_id, .location = location },
2683 .operator_loc = operator_loc
2693pm_float_node_new(
pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags,
pm_location_t location,
double value) {
2697 .
base = { .
type = PM_FLOAT_NODE, .flags = flags, .node_id = node_id, .location = location },
2708pm_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) {
2712 .
base = { .
type = PM_FOR_NODE, .flags = flags, .node_id = node_id, .location = location },
2714 .collection = collection,
2715 .statements = statements,
2716 .for_keyword_loc = for_keyword_loc,
2717 .in_keyword_loc = in_keyword_loc,
2718 .do_keyword_loc = do_keyword_loc,
2719 .end_keyword_loc = end_keyword_loc
2729pm_forwarding_arguments_node_new(
pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags,
pm_location_t location) {
2733 .
base = { .
type = PM_FORWARDING_ARGUMENTS_NODE, .flags = flags, .node_id = node_id, .location = location }
2743pm_forwarding_parameter_node_new(
pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags,
pm_location_t location) {
2747 .
base = { .
type = PM_FORWARDING_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location }
2761 .
base = { .
type = PM_FORWARDING_SUPER_NODE, .flags = flags, .node_id = node_id, .location = location },
2762 .keyword_loc = keyword_loc,
2777 .
base = { .
type = PM_GLOBAL_VARIABLE_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2779 .name_loc = name_loc,
2780 .operator_loc = operator_loc,
2795 .
base = { .
type = PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2797 .name_loc = name_loc,
2798 .binary_operator_loc = binary_operator_loc,
2800 .binary_operator = binary_operator
2814 .
base = { .
type = PM_GLOBAL_VARIABLE_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2816 .name_loc = name_loc,
2817 .operator_loc = operator_loc,
2832 .
base = { .
type = PM_GLOBAL_VARIABLE_READ_NODE, .flags = flags, .node_id = node_id, .location = location },
2847 .
base = { .
type = PM_GLOBAL_VARIABLE_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
2862 .
base = { .
type = PM_GLOBAL_VARIABLE_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2864 .name_loc = name_loc,
2866 .operator_loc = operator_loc
2880 .
base = { .
type = PM_HASH_NODE, .flags = flags, .node_id = node_id, .location = location },
2881 .opening_loc = opening_loc,
2882 .elements = elements,
2883 .closing_loc = closing_loc
2897 .
base = { .
type = PM_HASH_PATTERN_NODE, .flags = flags, .node_id = node_id, .location = location },
2899 .elements = elements,
2901 .opening_loc = opening_loc,
2902 .closing_loc = closing_loc
2916 .
base = { .
type = PM_IF_NODE, .flags = flags, .node_id = node_id, .location = location },
2917 .if_keyword_loc = if_keyword_loc,
2918 .predicate = predicate,
2919 .then_keyword_loc = then_keyword_loc,
2920 .statements = statements,
2921 .subsequent = subsequent,
2922 .end_keyword_loc = end_keyword_loc
2936 .
base = { .
type = PM_IMAGINARY_NODE, .flags = flags, .node_id = node_id, .location = location },
2951 .
base = { .
type = PM_IMPLICIT_NODE, .flags = flags, .node_id = node_id, .location = location },
2962pm_implicit_rest_node_new(
pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags,
pm_location_t location) {
2966 .
base = { .
type = PM_IMPLICIT_REST_NODE, .flags = flags, .node_id = node_id, .location = location }
2980 .
base = { .
type = PM_IN_NODE, .flags = flags, .node_id = node_id, .location = location },
2982 .statements = statements,
2983 .in_keyword_loc = in_keyword_loc,
2984 .then_keyword_loc = then_keyword_loc
2994pm_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) {
2998 .
base = { .
type = PM_INDEX_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2999 .receiver = receiver,
3000 .call_operator_loc = call_operator_loc,
3001 .opening_loc = opening_loc,
3002 .arguments = arguments,
3003 .closing_loc = closing_loc,
3016pm_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) {
3020 .
base = { .
type = PM_INDEX_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3021 .receiver = receiver,
3022 .call_operator_loc = call_operator_loc,
3023 .opening_loc = opening_loc,
3024 .arguments = arguments,
3025 .closing_loc = closing_loc,
3027 .binary_operator = binary_operator,
3028 .binary_operator_loc = binary_operator_loc,
3039pm_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) {
3043 .
base = { .
type = PM_INDEX_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3044 .receiver = receiver,
3045 .call_operator_loc = call_operator_loc,
3046 .opening_loc = opening_loc,
3047 .arguments = arguments,
3048 .closing_loc = closing_loc,
3065 .
base = { .
type = PM_INDEX_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
3066 .receiver = receiver,
3067 .opening_loc = opening_loc,
3068 .arguments = arguments,
3069 .closing_loc = closing_loc,
3084 .
base = { .
type = PM_INSTANCE_VARIABLE_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3086 .name_loc = name_loc,
3087 .operator_loc = operator_loc,
3102 .
base = { .
type = PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3104 .name_loc = name_loc,
3105 .binary_operator_loc = binary_operator_loc,
3107 .binary_operator = binary_operator
3121 .
base = { .
type = PM_INSTANCE_VARIABLE_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3123 .name_loc = name_loc,
3124 .operator_loc = operator_loc,
3139 .
base = { .
type = PM_INSTANCE_VARIABLE_READ_NODE, .flags = flags, .node_id = node_id, .location = location },
3154 .
base = { .
type = PM_INSTANCE_VARIABLE_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
3169 .
base = { .
type = PM_INSTANCE_VARIABLE_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3171 .name_loc = name_loc,
3173 .operator_loc = operator_loc
3187 .
base = { .
type = PM_INTEGER_NODE, .flags = flags, .node_id = node_id, .location = location },
3202 .
base = { .
type = PM_INTERPOLATED_MATCH_LAST_LINE_NODE, .flags = flags, .node_id = node_id, .location = location },
3203 .opening_loc = opening_loc,
3205 .closing_loc = closing_loc
3219 .
base = { .
type = PM_INTERPOLATED_REGULAR_EXPRESSION_NODE, .flags = flags, .node_id = node_id, .location = location },
3220 .opening_loc = opening_loc,
3222 .closing_loc = closing_loc
3236 .
base = { .
type = PM_INTERPOLATED_STRING_NODE, .flags = flags, .node_id = node_id, .location = location },
3237 .opening_loc = opening_loc,
3239 .closing_loc = closing_loc
3253 .
base = { .
type = PM_INTERPOLATED_SYMBOL_NODE, .flags = flags, .node_id = node_id, .location = location },
3254 .opening_loc = opening_loc,
3256 .closing_loc = closing_loc
3270 .
base = { .
type = PM_INTERPOLATED_X_STRING_NODE, .flags = flags, .node_id = node_id, .location = location },
3271 .opening_loc = opening_loc,
3273 .closing_loc = closing_loc
3283pm_it_local_variable_read_node_new(
pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags,
pm_location_t location) {
3287 .
base = { .
type = PM_IT_LOCAL_VARIABLE_READ_NODE, .flags = flags, .node_id = node_id, .location = location }
3297pm_it_parameters_node_new(
pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags,
pm_location_t location) {
3301 .
base = { .
type = PM_IT_PARAMETERS_NODE, .flags = flags, .node_id = node_id, .location = location }
3315 .
base = { .
type = PM_KEYWORD_HASH_NODE, .flags = flags, .node_id = node_id, .location = location },
3316 .elements = elements
3330 .
base = { .
type = PM_KEYWORD_REST_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
3332 .name_loc = name_loc,
3333 .operator_loc = operator_loc
3347 .
base = { .
type = PM_LAMBDA_NODE, .flags = flags, .node_id = node_id, .location = location },
3349 .operator_loc = operator_loc,
3350 .opening_loc = opening_loc,
3351 .closing_loc = closing_loc,
3352 .parameters = parameters,
3367 .
base = { .
type = PM_LOCAL_VARIABLE_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3368 .name_loc = name_loc,
3369 .operator_loc = operator_loc,
3386 .
base = { .
type = PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3387 .name_loc = name_loc,
3388 .binary_operator_loc = binary_operator_loc,
3391 .binary_operator = binary_operator,
3406 .
base = { .
type = PM_LOCAL_VARIABLE_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3407 .name_loc = name_loc,
3408 .operator_loc = operator_loc,
3425 .
base = { .
type = PM_LOCAL_VARIABLE_READ_NODE, .flags = flags, .node_id = node_id, .location = location },
3441 .
base = { .
type = PM_LOCAL_VARIABLE_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
3457 .
base = { .
type = PM_LOCAL_VARIABLE_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3460 .name_loc = name_loc,
3462 .operator_loc = operator_loc
3476 .
base = { .
type = PM_MATCH_LAST_LINE_NODE, .flags = flags, .node_id = node_id, .location = location },
3477 .opening_loc = opening_loc,
3478 .content_loc = content_loc,
3479 .closing_loc = closing_loc,
3480 .unescaped = unescaped
3494 .
base = { .
type = PM_MATCH_PREDICATE_NODE, .flags = flags, .node_id = node_id, .location = location },
3497 .keyword_loc = keyword_loc
3511 .
base = { .
type = PM_MATCH_REQUIRED_NODE, .flags = flags, .node_id = node_id, .location = location },
3514 .operator_loc = operator_loc
3528 .
base = { .
type = PM_MATCH_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3544 .
base = { .
type = PM_MODULE_NODE, .flags = flags, .node_id = node_id, .location = location },
3546 .module_keyword_loc = module_keyword_loc,
3547 .constant_path = constant_path,
3549 .end_keyword_loc = end_keyword_loc,
3564 .
base = { .
type = PM_MULTI_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
3568 .lparen_loc = lparen_loc,
3569 .rparen_loc = rparen_loc
3579pm_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) {
3583 .
base = { .
type = PM_MULTI_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3587 .lparen_loc = lparen_loc,
3588 .rparen_loc = rparen_loc,
3589 .operator_loc = operator_loc,
3604 .
base = { .
type = PM_NEXT_NODE, .flags = flags, .node_id = node_id, .location = location },
3605 .arguments = arguments,
3606 .keyword_loc = keyword_loc
3620 .
base = { .
type = PM_NIL_NODE, .flags = flags, .node_id = node_id, .location = location }
3634 .
base = { .
type = PM_NO_BLOCK_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
3635 .operator_loc = operator_loc,
3636 .keyword_loc = keyword_loc
3650 .
base = { .
type = PM_NO_KEYWORDS_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
3651 .operator_loc = operator_loc,
3652 .keyword_loc = keyword_loc
3662pm_numbered_parameters_node_new(
pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags,
pm_location_t location, uint8_t maximum) {
3666 .
base = { .
type = PM_NUMBERED_PARAMETERS_NODE, .flags = flags, .node_id = node_id, .location = location },
3677pm_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) {
3681 .
base = { .
type = PM_NUMBERED_REFERENCE_READ_NODE, .flags = flags, .node_id = node_id, .location = location },
3696 .
base = { .
type = PM_OPTIONAL_KEYWORD_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
3698 .name_loc = name_loc,
3713 .
base = { .
type = PM_OPTIONAL_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
3715 .name_loc = name_loc,
3716 .operator_loc = operator_loc,
3731 .
base = { .
type = PM_OR_NODE, .flags = flags, .node_id = node_id, .location = location },
3734 .operator_loc = operator_loc
3744pm_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) {
3748 .
base = { .
type = PM_PARAMETERS_NODE, .flags = flags, .node_id = node_id, .location = location },
3749 .requireds = requireds,
3750 .optionals = optionals,
3753 .keywords = keywords,
3754 .keyword_rest = keyword_rest,
3769 .
base = { .
type = PM_PARENTHESES_NODE, .flags = flags, .node_id = node_id, .location = location },
3771 .opening_loc = opening_loc,
3772 .closing_loc = closing_loc
3786 .
base = { .
type = PM_PINNED_EXPRESSION_NODE, .flags = flags, .node_id = node_id, .location = location },
3787 .expression = expression,
3788 .operator_loc = operator_loc,
3789 .lparen_loc = lparen_loc,
3790 .rparen_loc = rparen_loc
3804 .
base = { .
type = PM_PINNED_VARIABLE_NODE, .flags = flags, .node_id = node_id, .location = location },
3805 .variable = variable,
3806 .operator_loc = operator_loc
3820 .
base = { .
type = PM_POST_EXECUTION_NODE, .flags = flags, .node_id = node_id, .location = location },
3821 .statements = statements,
3822 .keyword_loc = keyword_loc,
3823 .opening_loc = opening_loc,
3824 .closing_loc = closing_loc
3838 .
base = { .
type = PM_PRE_EXECUTION_NODE, .flags = flags, .node_id = node_id, .location = location },
3839 .statements = statements,
3840 .keyword_loc = keyword_loc,
3841 .opening_loc = opening_loc,
3842 .closing_loc = closing_loc
3856 .
base = { .
type = PM_PROGRAM_NODE, .flags = flags, .node_id = node_id, .location = location },
3858 .statements = statements
3872 .
base = { .
type = PM_RANGE_NODE, .flags = flags, .node_id = node_id, .location = location },
3875 .operator_loc = operator_loc
3889 .
base = { .
type = PM_RATIONAL_NODE, .flags = flags, .node_id = node_id, .location = location },
3890 .numerator = numerator,
3891 .denominator = denominator
3905 .
base = { .
type = PM_REDO_NODE, .flags = flags, .node_id = node_id, .location = location }
3919 .
base = { .
type = PM_REGULAR_EXPRESSION_NODE, .flags = flags, .node_id = node_id, .location = location },
3920 .opening_loc = opening_loc,
3921 .content_loc = content_loc,
3922 .closing_loc = closing_loc,
3923 .unescaped = unescaped
3937 .
base = { .
type = PM_REQUIRED_KEYWORD_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
3939 .name_loc = name_loc
3953 .
base = { .
type = PM_REQUIRED_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
3968 .
base = { .
type = PM_RESCUE_MODIFIER_NODE, .flags = flags, .node_id = node_id, .location = location },
3969 .expression = expression,
3970 .keyword_loc = keyword_loc,
3971 .rescue_expression = rescue_expression
3981pm_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) {
3985 .
base = { .
type = PM_RESCUE_NODE, .flags = flags, .node_id = node_id, .location = location },
3986 .keyword_loc = keyword_loc,
3987 .exceptions = exceptions,
3988 .operator_loc = operator_loc,
3989 .reference = reference,
3990 .then_keyword_loc = then_keyword_loc,
3991 .statements = statements,
3992 .subsequent = subsequent
4006 .
base = { .
type = PM_REST_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
4008 .name_loc = name_loc,
4009 .operator_loc = operator_loc
4023 .
base = { .
type = PM_RETRY_NODE, .flags = flags, .node_id = node_id, .location = location }
4037 .
base = { .
type = PM_RETURN_NODE, .flags = flags, .node_id = node_id, .location = location },
4038 .keyword_loc = keyword_loc,
4039 .arguments = arguments
4053 .
base = { .
type = PM_SELF_NODE, .flags = flags, .node_id = node_id, .location = location }
4067 .
base = { .
type = PM_SHAREABLE_CONSTANT_NODE, .flags = flags, .node_id = node_id, .location = location },
4082 .
base = { .
type = PM_SINGLETON_CLASS_NODE, .flags = flags, .node_id = node_id, .location = location },
4084 .class_keyword_loc = class_keyword_loc,
4085 .operator_loc = operator_loc,
4086 .expression = expression,
4088 .end_keyword_loc = end_keyword_loc
4098pm_source_encoding_node_new(
pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags,
pm_location_t location) {
4102 .
base = { .
type = PM_SOURCE_ENCODING_NODE, .flags = flags, .node_id = node_id, .location = location }
4116 .
base = { .
type = PM_SOURCE_FILE_NODE, .flags = flags, .node_id = node_id, .location = location },
4117 .filepath = filepath
4131 .
base = { .
type = PM_SOURCE_LINE_NODE, .flags = flags, .node_id = node_id, .location = location }
4145 .
base = { .
type = PM_SPLAT_NODE, .flags = flags, .node_id = node_id, .location = location },
4146 .operator_loc = operator_loc,
4147 .expression = expression
4161 .
base = { .
type = PM_STATEMENTS_NODE, .flags = flags, .node_id = node_id, .location = location },
4176 .
base = { .
type = PM_STRING_NODE, .flags = flags, .node_id = node_id, .location = location },
4177 .opening_loc = opening_loc,
4178 .content_loc = content_loc,
4179 .closing_loc = closing_loc,
4180 .unescaped = unescaped
4194 .
base = { .
type = PM_SUPER_NODE, .flags = flags, .node_id = node_id, .location = location },
4195 .keyword_loc = keyword_loc,
4196 .lparen_loc = lparen_loc,
4197 .arguments = arguments,
4198 .rparen_loc = rparen_loc,
4213 .
base = { .
type = PM_SYMBOL_NODE, .flags = flags, .node_id = node_id, .location = location },
4214 .opening_loc = opening_loc,
4215 .content_loc = content_loc,
4216 .closing_loc = closing_loc,
4217 .unescaped = unescaped
4231 .
base = { .
type = PM_TRUE_NODE, .flags = flags, .node_id = node_id, .location = location }
4245 .
base = { .
type = PM_UNDEF_NODE, .flags = flags, .node_id = node_id, .location = location },
4247 .keyword_loc = keyword_loc
4261 .
base = { .
type = PM_UNLESS_NODE, .flags = flags, .node_id = node_id, .location = location },
4262 .unless_keyword_loc = unless_keyword_loc,
4263 .predicate = predicate,
4264 .then_keyword_loc = then_keyword_loc,
4265 .statements = statements,
4266 .else_clause = else_clause,
4281 .
base = { .
type = PM_UNTIL_NODE, .flags = flags, .node_id = node_id, .location = location },
4282 .until_keyword_loc = until_keyword_loc,
4283 .do_keyword_loc = do_keyword_loc,
4284 .end_keyword_loc = end_keyword_loc,
4285 .predicate = predicate,
4286 .statements = statements
4300 .
base = { .
type = PM_WHEN_NODE, .flags = flags, .node_id = node_id, .location = location },
4301 .when_keyword_loc = when_keyword_loc,
4302 .conditions = conditions,
4303 .then_keyword_loc = then_keyword_loc,
4304 .statements = statements
4318 .
base = { .
type = PM_WHILE_NODE, .flags = flags, .node_id = node_id, .location = location },
4319 .while_keyword_loc = while_keyword_loc,
4320 .do_keyword_loc = do_keyword_loc,
4321 .end_keyword_loc = end_keyword_loc,
4322 .predicate = predicate,
4323 .statements = statements
4337 .
base = { .
type = PM_X_STRING_NODE, .flags = flags, .node_id = node_id, .location = location },
4338 .opening_loc = opening_loc,
4339 .content_loc = content_loc,
4340 .closing_loc = closing_loc,
4341 .unescaped = unescaped
4355 .
base = { .
type = PM_YIELD_NODE, .flags = flags, .node_id = node_id, .location = location },
4356 .keyword_loc = keyword_loc,
4357 .lparen_loc = lparen_loc,
4358 .arguments = arguments,
4359 .rparen_loc = rparen_loc
#define PRISM_ALIGNOF
Get the alignment requirement of a type.
uint32_t pm_constant_id_t
A constant id is a unique identifier for a constant in the constant pool.
std::string_view constant(const pm_parser_t *parser PRISM_LIFETIMEBOUND, pm_constant_id_t constant_id) noexcept
The name of the constant with the given id, which must not be zero.
pm_visit_result_t(* pm_visit_callback_t)(const pm_node_t *node, void *data)
A callback that is called for each node visited by pm_visit_node and pm_visit_child_nodes.
pm_visit_result_t
The value returned by a visitor callback, which determines where the walk goes next.
@ PM_VISIT_STOP
End the walk without visiting any more nodes.
@ PM_VISIT_DESCEND
Continue the walk by visiting this node's children.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_location_t operator_loc
BlockArgumentNode::operator_loc.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
ClassVariableAndWriteNode.
pm_node_t base
The embedded base node.
ClassVariableOperatorWriteNode.
pm_node_t base
The embedded base node.
ClassVariableOrWriteNode.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
ConstantOperatorWriteNode.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
ConstantPathAndWriteNode.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
ConstantPathOperatorWriteNode.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_location_t end_keyword_loc
ElseNode::end_keyword_loc.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_location_t end_keyword_loc
EnsureNode::end_keyword_loc.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
GlobalVariableAndWriteNode.
pm_node_t base
The embedded base node.
GlobalVariableOperatorWriteNode.
pm_node_t base
The embedded base node.
GlobalVariableOrWriteNode.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
GlobalVariableTargetNode.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
InstanceVariableAndWriteNode.
pm_node_t base
The embedded base node.
InstanceVariableOperatorWriteNode.
pm_node_t base
The embedded base node.
InstanceVariableOrWriteNode.
pm_node_t base
The embedded base node.
InstanceVariableReadNode.
pm_node_t base
The embedded base node.
InstanceVariableTargetNode.
pm_node_t base
The embedded base node.
InstanceVariableWriteNode.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
A structure represents an arbitrary-sized integer.
InterpolatedMatchLastLineNode.
pm_node_t base
The embedded base node.
InterpolatedRegularExpressionNode.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
KeywordRestParameterNode.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
LocalVariableAndWriteNode.
pm_node_t base
The embedded base node.
LocalVariableOperatorWriteNode.
pm_node_t base
The embedded base node.
LocalVariableOrWriteNode.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
This struct represents a slice in the source code, defined by an offset and a length.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
A list of nodes in the source, most often used for lists of children.
size_t size
The number of nodes in the list.
struct pm_node ** nodes
The nodes in the list.
size_t capacity
The capacity of the list that has been allocated.
This is the base structure that represents a node in the syntax tree.
pm_node_type_t type
This represents the type of the node.
pm_node_t base
The embedded base node.
NumberedReferenceReadNode.
pm_node_t base
The embedded base node.
OptionalKeywordParameterNode.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
RequiredKeywordParameterNode.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
A view of a sequence of bytes.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.
pm_node_t base
The embedded base node.