Coverage Report

Created: 2026-11-10 14:14

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
src/node.c
Line
Count
Source
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
#include "prism/internal/oom.h"
14
15
/**
16
 * Attempts to grow the node list to the next size. If there is already
17
 * capacity in the list, this function does nothing. Otherwise it allocates a
18
 * new array from the arena (abandon-and-copy strategy) and copies the existing
19
 * data into it.
20
 */
21
static void
22
359k
pm_node_list_grow(pm_arena_t *arena, pm_node_list_t *list, size_t size) {
23
359k
    size_t requested_size = list->size + size;
24
25
    // Guard against overflow on the addition.
26
359k
    if (requested_size < list->size) 
PRISM_OOM0
();
  Branch (26:9): [True: 0, False: 359k]
27
28
    // If the requested size is within the existing capacity, return.
29
359k
    if (requested_size <= list->capacity) 
return941
;
  Branch (29:9): [True: 941, False: 358k]
30
31
    // Otherwise, compute the next capacity by doubling.
32
358k
    size_t next_capacity = list->capacity == 0 ? 
4318k
:
list->capacity * 239.6k
;
  Branch (32:28): [True: 318k, False: 39.6k]
33
34
    // Guard against overflow on the doubling.
35
358k
    while (requested_size > next_capacity) {
  Branch (35:12): [True: 341, False: 358k]
36
341
        if (next_capacity == 0) 
PRISM_OOM0
();
  Branch (36:13): [True: 0, False: 341]
37
341
        next_capacity *= 2;
38
341
    }
39
40
    // Allocate a new array from the arena (old array is abandoned).
41
358k
    pm_node_t **nodes = (pm_node_t **) pm_arena_alloc(arena, sizeof(pm_node_t *) * next_capacity, PRISM_ALIGNOF(pm_node_t *));
42
43
    // Copy old data into the new array.
44
358k
    if (list->size > 0) {
  Branch (44:9): [True: 39.6k, False: 318k]
45
39.6k
        memcpy(nodes, list->nodes, list->size * sizeof(pm_node_t *));
46
39.6k
    }
47
48
358k
    list->nodes = nodes;
49
358k
    list->capacity = next_capacity;
50
358k
}
51
52
/**
53
 * Slow path for pm_node_list_append_inline: grow the list and append the node.
54
 * Do not call directly - use pm_node_list_append_inline instead.
55
 */
56
void
57
355k
pm_node_list_append_slow(pm_arena_t *arena, pm_node_list_t *list, pm_node_t *node) {
58
355k
    pm_node_list_grow(arena, list, 1);
59
355k
    list->nodes[list->size++] = node;
60
355k
}
61
62
/**
63
 * Append a new node onto the end of the node list.
64
 */
65
void
66
pm_node_list_append(pm_arena_t *arena, pm_node_list_t *list, pm_node_t *node) {
67
    pm_node_list_append_inline(arena, list, node);
68
}
69
70
/**
71
 * Prepend a new node onto the beginning of the node list.
72
 */
73
void
74
1.05k
pm_node_list_prepend(pm_arena_t *arena, pm_node_list_t *list, pm_node_t *node) {
75
1.05k
    pm_node_list_grow(arena, list, 1);
76
1.05k
    memmove(list->nodes + 1, list->nodes, list->size * sizeof(pm_node_t *));
77
1.05k
    list->nodes[0] = node;
78
1.05k
    list->size++;
79
1.05k
}
80
81
/**
82
 * Concatenate the given node list onto the end of the other node list.
83
 */
84
void
85
49.4k
pm_node_list_concat(pm_arena_t *arena, pm_node_list_t *list, pm_node_list_t *other) {
86
49.4k
    if (other->size > 0) {
  Branch (86:9): [True: 2.38k, False: 47.1k]
87
2.38k
        pm_node_list_grow(arena, list, other->size);
88
2.38k
        memcpy(list->nodes + list->size, other->nodes, other->size * sizeof(pm_node_t *));
89
2.38k
        list->size += other->size;
90
2.38k
    }
91
49.4k
}
92
93
/**
94
 * Returns a string representation of the given node type.
95
 */
96
const char *
97
pm_node_type(pm_node_type_t node_type)
98
{
99
    switch (node_type) {
100
        case PM_ALIAS_GLOBAL_VARIABLE_NODE:
101
            return "PM_ALIAS_GLOBAL_VARIABLE_NODE";
102
        case PM_ALIAS_METHOD_NODE:
103
            return "PM_ALIAS_METHOD_NODE";
104
        case PM_ALTERNATION_PATTERN_NODE:
105
            return "PM_ALTERNATION_PATTERN_NODE";
106
        case PM_AND_NODE:
107
            return "PM_AND_NODE";
108
        case PM_ARGUMENTS_NODE:
109
            return "PM_ARGUMENTS_NODE";
110
        case PM_ARRAY_NODE:
111
            return "PM_ARRAY_NODE";
112
        case PM_ARRAY_PATTERN_NODE:
113
            return "PM_ARRAY_PATTERN_NODE";
114
        case PM_ASSOC_NODE:
115
            return "PM_ASSOC_NODE";
116
        case PM_ASSOC_SPLAT_NODE:
117
            return "PM_ASSOC_SPLAT_NODE";
118
        case PM_BACK_REFERENCE_READ_NODE:
119
            return "PM_BACK_REFERENCE_READ_NODE";
120
        case PM_BEGIN_NODE:
121
            return "PM_BEGIN_NODE";
122
        case PM_BLOCK_ARGUMENT_NODE:
123
            return "PM_BLOCK_ARGUMENT_NODE";
124
        case PM_BLOCK_LOCAL_VARIABLE_NODE:
125
            return "PM_BLOCK_LOCAL_VARIABLE_NODE";
126
        case PM_BLOCK_NODE:
127
            return "PM_BLOCK_NODE";
128
        case PM_BLOCK_PARAMETER_NODE:
129
            return "PM_BLOCK_PARAMETER_NODE";
130
        case PM_BLOCK_PARAMETERS_NODE:
131
            return "PM_BLOCK_PARAMETERS_NODE";
132
        case PM_BREAK_NODE:
133
            return "PM_BREAK_NODE";
134
        case PM_CALL_AND_WRITE_NODE:
135
            return "PM_CALL_AND_WRITE_NODE";
136
        case PM_CALL_NODE:
137
            return "PM_CALL_NODE";
138
        case PM_CALL_OPERATOR_WRITE_NODE:
139
            return "PM_CALL_OPERATOR_WRITE_NODE";
140
        case PM_CALL_OR_WRITE_NODE:
141
            return "PM_CALL_OR_WRITE_NODE";
142
        case PM_CALL_TARGET_NODE:
143
            return "PM_CALL_TARGET_NODE";
144
        case PM_CAPTURE_PATTERN_NODE:
145
            return "PM_CAPTURE_PATTERN_NODE";
146
        case PM_CASE_MATCH_NODE:
147
            return "PM_CASE_MATCH_NODE";
148
        case PM_CASE_NODE:
149
            return "PM_CASE_NODE";
150
        case PM_CLASS_NODE:
151
            return "PM_CLASS_NODE";
152
        case PM_CLASS_VARIABLE_AND_WRITE_NODE:
153
            return "PM_CLASS_VARIABLE_AND_WRITE_NODE";
154
        case PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE:
155
            return "PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE";
156
        case PM_CLASS_VARIABLE_OR_WRITE_NODE:
157
            return "PM_CLASS_VARIABLE_OR_WRITE_NODE";
158
        case PM_CLASS_VARIABLE_READ_NODE:
159
            return "PM_CLASS_VARIABLE_READ_NODE";
160
        case PM_CLASS_VARIABLE_TARGET_NODE:
161
            return "PM_CLASS_VARIABLE_TARGET_NODE";
162
        case PM_CLASS_VARIABLE_WRITE_NODE:
163
            return "PM_CLASS_VARIABLE_WRITE_NODE";
164
        case PM_CONSTANT_AND_WRITE_NODE:
165
            return "PM_CONSTANT_AND_WRITE_NODE";
166
        case PM_CONSTANT_OPERATOR_WRITE_NODE:
167
            return "PM_CONSTANT_OPERATOR_WRITE_NODE";
168
        case PM_CONSTANT_OR_WRITE_NODE:
169
            return "PM_CONSTANT_OR_WRITE_NODE";
170
        case PM_CONSTANT_PATH_AND_WRITE_NODE:
171
            return "PM_CONSTANT_PATH_AND_WRITE_NODE";
172
        case PM_CONSTANT_PATH_NODE:
173
            return "PM_CONSTANT_PATH_NODE";
174
        case PM_CONSTANT_PATH_OPERATOR_WRITE_NODE:
175
            return "PM_CONSTANT_PATH_OPERATOR_WRITE_NODE";
176
        case PM_CONSTANT_PATH_OR_WRITE_NODE:
177
            return "PM_CONSTANT_PATH_OR_WRITE_NODE";
178
        case PM_CONSTANT_PATH_TARGET_NODE:
179
            return "PM_CONSTANT_PATH_TARGET_NODE";
180
        case PM_CONSTANT_PATH_WRITE_NODE:
181
            return "PM_CONSTANT_PATH_WRITE_NODE";
182
        case PM_CONSTANT_READ_NODE:
183
            return "PM_CONSTANT_READ_NODE";
184
        case PM_CONSTANT_TARGET_NODE:
185
            return "PM_CONSTANT_TARGET_NODE";
186
        case PM_CONSTANT_WRITE_NODE:
187
            return "PM_CONSTANT_WRITE_NODE";
188
        case PM_DEF_NODE:
189
            return "PM_DEF_NODE";
190
        case PM_DEFINED_NODE:
191
            return "PM_DEFINED_NODE";
192
        case PM_ELSE_NODE:
193
            return "PM_ELSE_NODE";
194
        case PM_EMBEDDED_STATEMENTS_NODE:
195
            return "PM_EMBEDDED_STATEMENTS_NODE";
196
        case PM_EMBEDDED_VARIABLE_NODE:
197
            return "PM_EMBEDDED_VARIABLE_NODE";
198
        case PM_ENSURE_NODE:
199
            return "PM_ENSURE_NODE";
200
        case PM_ERROR_RECOVERY_NODE:
201
            return "PM_ERROR_RECOVERY_NODE";
202
        case PM_FALSE_NODE:
203
            return "PM_FALSE_NODE";
204
        case PM_FIND_PATTERN_NODE:
205
            return "PM_FIND_PATTERN_NODE";
206
        case PM_FLIP_FLOP_NODE:
207
            return "PM_FLIP_FLOP_NODE";
208
        case PM_FLOAT_NODE:
209
            return "PM_FLOAT_NODE";
210
        case PM_FOR_NODE:
211
            return "PM_FOR_NODE";
212
        case PM_FORWARDING_ARGUMENTS_NODE:
213
            return "PM_FORWARDING_ARGUMENTS_NODE";
214
        case PM_FORWARDING_PARAMETER_NODE:
215
            return "PM_FORWARDING_PARAMETER_NODE";
216
        case PM_FORWARDING_SUPER_NODE:
217
            return "PM_FORWARDING_SUPER_NODE";
218
        case PM_GLOBAL_VARIABLE_AND_WRITE_NODE:
219
            return "PM_GLOBAL_VARIABLE_AND_WRITE_NODE";
220
        case PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE:
221
            return "PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE";
222
        case PM_GLOBAL_VARIABLE_OR_WRITE_NODE:
223
            return "PM_GLOBAL_VARIABLE_OR_WRITE_NODE";
224
        case PM_GLOBAL_VARIABLE_READ_NODE:
225
            return "PM_GLOBAL_VARIABLE_READ_NODE";
226
        case PM_GLOBAL_VARIABLE_TARGET_NODE:
227
            return "PM_GLOBAL_VARIABLE_TARGET_NODE";
228
        case PM_GLOBAL_VARIABLE_WRITE_NODE:
229
            return "PM_GLOBAL_VARIABLE_WRITE_NODE";
230
        case PM_HASH_NODE:
231
            return "PM_HASH_NODE";
232
        case PM_HASH_PATTERN_NODE:
233
            return "PM_HASH_PATTERN_NODE";
234
        case PM_IF_NODE:
235
            return "PM_IF_NODE";
236
        case PM_IMAGINARY_NODE:
237
            return "PM_IMAGINARY_NODE";
238
        case PM_IMPLICIT_NODE:
239
            return "PM_IMPLICIT_NODE";
240
        case PM_IMPLICIT_REST_NODE:
241
            return "PM_IMPLICIT_REST_NODE";
242
        case PM_IN_NODE:
243
            return "PM_IN_NODE";
244
        case PM_INDEX_AND_WRITE_NODE:
245
            return "PM_INDEX_AND_WRITE_NODE";
246
        case PM_INDEX_OPERATOR_WRITE_NODE:
247
            return "PM_INDEX_OPERATOR_WRITE_NODE";
248
        case PM_INDEX_OR_WRITE_NODE:
249
            return "PM_INDEX_OR_WRITE_NODE";
250
        case PM_INDEX_TARGET_NODE:
251
            return "PM_INDEX_TARGET_NODE";
252
        case PM_INSTANCE_VARIABLE_AND_WRITE_NODE:
253
            return "PM_INSTANCE_VARIABLE_AND_WRITE_NODE";
254
        case PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE:
255
            return "PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE";
256
        case PM_INSTANCE_VARIABLE_OR_WRITE_NODE:
257
            return "PM_INSTANCE_VARIABLE_OR_WRITE_NODE";
258
        case PM_INSTANCE_VARIABLE_READ_NODE:
259
            return "PM_INSTANCE_VARIABLE_READ_NODE";
260
        case PM_INSTANCE_VARIABLE_TARGET_NODE:
261
            return "PM_INSTANCE_VARIABLE_TARGET_NODE";
262
        case PM_INSTANCE_VARIABLE_WRITE_NODE:
263
            return "PM_INSTANCE_VARIABLE_WRITE_NODE";
264
        case PM_INTEGER_NODE:
265
            return "PM_INTEGER_NODE";
266
        case PM_INTERPOLATED_MATCH_LAST_LINE_NODE:
267
            return "PM_INTERPOLATED_MATCH_LAST_LINE_NODE";
268
        case PM_INTERPOLATED_REGULAR_EXPRESSION_NODE:
269
            return "PM_INTERPOLATED_REGULAR_EXPRESSION_NODE";
270
        case PM_INTERPOLATED_STRING_NODE:
271
            return "PM_INTERPOLATED_STRING_NODE";
272
        case PM_INTERPOLATED_SYMBOL_NODE:
273
            return "PM_INTERPOLATED_SYMBOL_NODE";
274
        case PM_INTERPOLATED_X_STRING_NODE:
275
            return "PM_INTERPOLATED_X_STRING_NODE";
276
        case PM_IT_LOCAL_VARIABLE_READ_NODE:
277
            return "PM_IT_LOCAL_VARIABLE_READ_NODE";
278
        case PM_IT_PARAMETERS_NODE:
279
            return "PM_IT_PARAMETERS_NODE";
280
        case PM_KEYWORD_HASH_NODE:
281
            return "PM_KEYWORD_HASH_NODE";
282
        case PM_KEYWORD_REST_PARAMETER_NODE:
283
            return "PM_KEYWORD_REST_PARAMETER_NODE";
284
        case PM_LAMBDA_NODE:
285
            return "PM_LAMBDA_NODE";
286
        case PM_LOCAL_VARIABLE_AND_WRITE_NODE:
287
            return "PM_LOCAL_VARIABLE_AND_WRITE_NODE";
288
        case PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE:
289
            return "PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE";
290
        case PM_LOCAL_VARIABLE_OR_WRITE_NODE:
291
            return "PM_LOCAL_VARIABLE_OR_WRITE_NODE";
292
        case PM_LOCAL_VARIABLE_READ_NODE:
293
            return "PM_LOCAL_VARIABLE_READ_NODE";
294
        case PM_LOCAL_VARIABLE_TARGET_NODE:
295
            return "PM_LOCAL_VARIABLE_TARGET_NODE";
296
        case PM_LOCAL_VARIABLE_WRITE_NODE:
297
            return "PM_LOCAL_VARIABLE_WRITE_NODE";
298
        case PM_MATCH_LAST_LINE_NODE:
299
            return "PM_MATCH_LAST_LINE_NODE";
300
        case PM_MATCH_PREDICATE_NODE:
301
            return "PM_MATCH_PREDICATE_NODE";
302
        case PM_MATCH_REQUIRED_NODE:
303
            return "PM_MATCH_REQUIRED_NODE";
304
        case PM_MATCH_WRITE_NODE:
305
            return "PM_MATCH_WRITE_NODE";
306
        case PM_MODULE_NODE:
307
            return "PM_MODULE_NODE";
308
        case PM_MULTI_TARGET_NODE:
309
            return "PM_MULTI_TARGET_NODE";
310
        case PM_MULTI_WRITE_NODE:
311
            return "PM_MULTI_WRITE_NODE";
312
        case PM_NEXT_NODE:
313
            return "PM_NEXT_NODE";
314
        case PM_NIL_NODE:
315
            return "PM_NIL_NODE";
316
        case PM_NO_BLOCK_PARAMETER_NODE:
317
            return "PM_NO_BLOCK_PARAMETER_NODE";
318
        case PM_NO_KEYWORDS_PARAMETER_NODE:
319
            return "PM_NO_KEYWORDS_PARAMETER_NODE";
320
        case PM_NUMBERED_PARAMETERS_NODE:
321
            return "PM_NUMBERED_PARAMETERS_NODE";
322
        case PM_NUMBERED_REFERENCE_READ_NODE:
323
            return "PM_NUMBERED_REFERENCE_READ_NODE";
324
        case PM_OPTIONAL_KEYWORD_PARAMETER_NODE:
325
            return "PM_OPTIONAL_KEYWORD_PARAMETER_NODE";
326
        case PM_OPTIONAL_PARAMETER_NODE:
327
            return "PM_OPTIONAL_PARAMETER_NODE";
328
        case PM_OR_NODE:
329
            return "PM_OR_NODE";
330
        case PM_PARAMETERS_NODE:
331
            return "PM_PARAMETERS_NODE";
332
        case PM_PARENTHESES_NODE:
333
            return "PM_PARENTHESES_NODE";
334
        case PM_PINNED_EXPRESSION_NODE:
335
            return "PM_PINNED_EXPRESSION_NODE";
336
        case PM_PINNED_VARIABLE_NODE:
337
            return "PM_PINNED_VARIABLE_NODE";
338
        case PM_POST_EXECUTION_NODE:
339
            return "PM_POST_EXECUTION_NODE";
340
        case PM_PRE_EXECUTION_NODE:
341
            return "PM_PRE_EXECUTION_NODE";
342
        case PM_PROGRAM_NODE:
343
            return "PM_PROGRAM_NODE";
344
        case PM_RANGE_NODE:
345
            return "PM_RANGE_NODE";
346
        case PM_RATIONAL_NODE:
347
            return "PM_RATIONAL_NODE";
348
        case PM_REDO_NODE:
349
            return "PM_REDO_NODE";
350
        case PM_REGULAR_EXPRESSION_NODE:
351
            return "PM_REGULAR_EXPRESSION_NODE";
352
        case PM_REQUIRED_KEYWORD_PARAMETER_NODE:
353
            return "PM_REQUIRED_KEYWORD_PARAMETER_NODE";
354
        case PM_REQUIRED_PARAMETER_NODE:
355
            return "PM_REQUIRED_PARAMETER_NODE";
356
        case PM_RESCUE_MODIFIER_NODE:
357
            return "PM_RESCUE_MODIFIER_NODE";
358
        case PM_RESCUE_NODE:
359
            return "PM_RESCUE_NODE";
360
        case PM_REST_PARAMETER_NODE:
361
            return "PM_REST_PARAMETER_NODE";
362
        case PM_RETRY_NODE:
363
            return "PM_RETRY_NODE";
364
        case PM_RETURN_NODE:
365
            return "PM_RETURN_NODE";
366
        case PM_SELF_NODE:
367
            return "PM_SELF_NODE";
368
        case PM_SHAREABLE_CONSTANT_NODE:
369
            return "PM_SHAREABLE_CONSTANT_NODE";
370
        case PM_SINGLETON_CLASS_NODE:
371
            return "PM_SINGLETON_CLASS_NODE";
372
        case PM_SOURCE_ENCODING_NODE:
373
            return "PM_SOURCE_ENCODING_NODE";
374
        case PM_SOURCE_FILE_NODE:
375
            return "PM_SOURCE_FILE_NODE";
376
        case PM_SOURCE_LINE_NODE:
377
            return "PM_SOURCE_LINE_NODE";
378
        case PM_SPLAT_NODE:
379
            return "PM_SPLAT_NODE";
380
        case PM_STATEMENTS_NODE:
381
            return "PM_STATEMENTS_NODE";
382
        case PM_STRING_NODE:
383
            return "PM_STRING_NODE";
384
        case PM_SUPER_NODE:
385
            return "PM_SUPER_NODE";
386
        case PM_SYMBOL_NODE:
387
            return "PM_SYMBOL_NODE";
388
        case PM_TRUE_NODE:
389
            return "PM_TRUE_NODE";
390
        case PM_UNDEF_NODE:
391
            return "PM_UNDEF_NODE";
392
        case PM_UNLESS_NODE:
393
            return "PM_UNLESS_NODE";
394
        case PM_UNTIL_NODE:
395
            return "PM_UNTIL_NODE";
396
        case PM_WHEN_NODE:
397
            return "PM_WHEN_NODE";
398
        case PM_WHILE_NODE:
399
            return "PM_WHILE_NODE";
400
        case PM_X_STRING_NODE:
401
            return "PM_X_STRING_NODE";
402
        case PM_YIELD_NODE:
403
            return "PM_YIELD_NODE";
404
    }
405
    return "";
406
}
407
408
/**
409
 * Visit each of the nodes in this subtree using the given visitor callback. The
410
 * callback function will be called for each node in the subtree, and its
411
 * return value determines whether the walk visits that node's children, skips
412
 * them, or stops entirely. The data parameter is treated as an opaque pointer
413
 * and is passed to the visitor callback for consumers to use as they see fit.
414
 */
415
bool
416
1.27M
pm_visit_node(const pm_node_t *node, pm_visit_callback_t visitor, void *data) {
417
1.27M
    pm_visit_result_t result = visitor(node, data);
418
1.27M
    if (result == PM_VISIT_DESCEND) 
return pm_visit_child_nodes(node, visitor, data)1.15M
;
  Branch (418:9): [True: 1.15M, False: 121k]
419
121k
    return result != PM_VISIT_STOP;
420
1.27M
}
421
422
/**
423
 * Visit the children of the given node with the given callback. This is the
424
 * default behavior for walking the tree that is called from pm_visit_node if
425
 * the callback returns PM_VISIT_DESCEND. A stop from any child returns false
426
 * immediately, so that it propagates up through every enclosing call.
427
 */
428
bool
429
1.26M
pm_visit_child_nodes(const pm_node_t *node, pm_visit_callback_t visitor, void *data) {
430
1.26M
    switch (PM_NODE_TYPE(node)) {
431
105
        case PM_ALIAS_GLOBAL_VARIABLE_NODE: {
  Branch (431:9): [True: 105, False: 1.26M]
432
105
            const pm_alias_global_variable_node_t *cast = (const pm_alias_global_variable_node_t *) node;
433
434
            // Visit the new_name field
435
105
            if (!pm_visit_node((const pm_node_t *) cast->new_name, visitor, data)) 
return 0
false0
;
  Branch (435:17): [True: 0, False: 105]
436
437
            // Visit the old_name field
438
105
            if (!pm_visit_node((const pm_node_t *) cast->old_name, visitor, data)) 
return 0
false0
;
  Branch (438:17): [True: 0, False: 105]
439
440
105
            break;
441
105
        }
442
778
        case PM_ALIAS_METHOD_NODE: {
  Branch (442:9): [True: 778, False: 1.26M]
443
778
            const pm_alias_method_node_t *cast = (const pm_alias_method_node_t *) node;
444
445
            // Visit the new_name field
446
778
            if (!pm_visit_node((const pm_node_t *) cast->new_name, visitor, data)) 
return 0
false0
;
  Branch (446:17): [True: 0, False: 778]
447
448
            // Visit the old_name field
449
778
            if (!pm_visit_node((const pm_node_t *) cast->old_name, visitor, data)) 
return 0
false0
;
  Branch (449:17): [True: 0, False: 778]
450
451
778
            break;
452
778
        }
453
972
        case PM_ALTERNATION_PATTERN_NODE: {
  Branch (453:9): [True: 972, False: 1.26M]
454
972
            const pm_alternation_pattern_node_t *cast = (const pm_alternation_pattern_node_t *) node;
455
456
            // Visit the left field
457
972
            if (!pm_visit_node((const pm_node_t *) cast->left, visitor, data)) 
return 0
false0
;
  Branch (457:17): [True: 0, False: 972]
458
459
            // Visit the right field
460
972
            if (!pm_visit_node((const pm_node_t *) cast->right, visitor, data)) 
return 0
false0
;
  Branch (460:17): [True: 0, False: 972]
461
462
972
            break;
463
972
        }
464
1.32k
        case PM_AND_NODE: {
  Branch (464:9): [True: 1.32k, False: 1.26M]
465
1.32k
            const pm_and_node_t *cast = (const pm_and_node_t *) node;
466
467
            // Visit the left field
468
1.32k
            if (!pm_visit_node((const pm_node_t *) cast->left, visitor, data)) 
return 0
false0
;
  Branch (468:17): [True: 0, False: 1.32k]
469
470
            // Visit the right field
471
1.32k
            if (!pm_visit_node((const pm_node_t *) cast->right, visitor, data)) 
return 0
false0
;
  Branch (471:17): [True: 0, False: 1.32k]
472
473
1.32k
            break;
474
1.32k
        }
475
85.5k
        case PM_ARGUMENTS_NODE: {
  Branch (475:9): [True: 85.5k, False: 1.18M]
476
85.5k
            const pm_arguments_node_t *cast = (const pm_arguments_node_t *) node;
477
478
            // Visit the arguments field
479
85.5k
            const pm_node_list_t *arguments = &cast->arguments;
480
185k
            for (size_t index = 0; index < arguments->size; 
index++99.4k
) {
  Branch (480:36): [True: 99.4k, False: 85.5k]
481
99.4k
                if (!pm_visit_node(arguments->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (481:21): [True: 0, False: 99.4k]
482
99.4k
            }
483
484
85.5k
            break;
485
85.5k
        }
486
85.5k
        case PM_ARRAY_NODE: {
  Branch (486:9): [True: 53.6k, False: 1.21M]
487
53.6k
            const pm_array_node_t *cast = (const pm_array_node_t *) node;
488
489
            // Visit the elements field
490
53.6k
            const pm_node_list_t *elements = &cast->elements;
491
173k
            for (size_t index = 0; index < elements->size; 
index++119k
) {
  Branch (491:36): [True: 119k, False: 53.6k]
492
119k
                if (!pm_visit_node(elements->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (492:21): [True: 0, False: 119k]
493
119k
            }
494
495
53.6k
            break;
496
53.6k
        }
497
53.6k
        case PM_ARRAY_PATTERN_NODE: {
  Branch (497:9): [True: 5.44k, False: 1.26M]
498
5.44k
            const pm_array_pattern_node_t *cast = (const pm_array_pattern_node_t *) node;
499
500
            // Visit the constant field
501
5.44k
            if (cast->constant != NULL && 
!pm_visit_node((const pm_node_t *) cast->constant, visitor, data)629
)
return 0
false0
;
  Branch (501:17): [True: 629, False: 4.81k]
  Branch (501:43): [True: 0, False: 629]
502
503
            // Visit the requireds field
504
5.44k
            const pm_node_list_t *requireds = &cast->requireds;
505
14.0k
            for (size_t index = 0; index < requireds->size; 
index++8.62k
) {
  Branch (505:36): [True: 8.62k, False: 5.44k]
506
8.62k
                if (!pm_visit_node(requireds->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (506:21): [True: 0, False: 8.62k]
507
8.62k
            }
508
509
            // Visit the rest field
510
5.44k
            if (cast->rest != NULL && 
!pm_visit_node((const pm_node_t *) cast->rest, visitor, data)1.65k
)
return 0
false0
;
  Branch (510:17): [True: 1.65k, False: 3.79k]
  Branch (510:39): [True: 0, False: 1.65k]
511
512
            // Visit the posts field
513
5.44k
            const pm_node_list_t *posts = &cast->posts;
514
5.90k
            for (size_t index = 0; index < posts->size; 
index++463
) {
  Branch (514:36): [True: 463, False: 5.44k]
515
463
                if (!pm_visit_node(posts->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (515:21): [True: 0, False: 463]
516
463
            }
517
518
5.44k
            break;
519
5.44k
        }
520
25.2k
        case PM_ASSOC_NODE: {
  Branch (520:9): [True: 25.2k, False: 1.24M]
521
25.2k
            const pm_assoc_node_t *cast = (const pm_assoc_node_t *) node;
522
523
            // Visit the key field
524
25.2k
            if (!pm_visit_node((const pm_node_t *) cast->key, visitor, data)) 
return 0
false0
;
  Branch (524:17): [True: 0, False: 25.2k]
525
526
            // Visit the value field
527
25.2k
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (527:17): [True: 0, False: 25.2k]
528
529
25.2k
            break;
530
25.2k
        }
531
25.2k
        case PM_ASSOC_SPLAT_NODE: {
  Branch (531:9): [True: 3.14k, False: 1.26M]
532
3.14k
            const pm_assoc_splat_node_t *cast = (const pm_assoc_splat_node_t *) node;
533
534
            // Visit the value field
535
3.14k
            if (cast->value != NULL && 
!pm_visit_node((const pm_node_t *) cast->value, visitor, data)1.79k
)
return 0
false0
;
  Branch (535:17): [True: 1.79k, False: 1.35k]
  Branch (535:40): [True: 0, False: 1.79k]
536
537
3.14k
            break;
538
3.14k
        }
539
3.14k
        case PM_BACK_REFERENCE_READ_NODE:
  Branch (539:9): [True: 143, False: 1.26M]
540
143
            break;
541
2.95k
        case PM_BEGIN_NODE: {
  Branch (541:9): [True: 2.95k, False: 1.26M]
542
2.95k
            const pm_begin_node_t *cast = (const pm_begin_node_t *) node;
543
544
            // Visit the statements field
545
2.95k
            if (cast->statements != NULL && 
!pm_visit_node((const pm_node_t *) cast->statements, visitor, data)1.71k
)
return 0
false0
;
  Branch (545:17): [True: 1.71k, False: 1.23k]
  Branch (545:45): [True: 0, False: 1.71k]
546
547
            // Visit the rescue_clause field
548
2.95k
            if (cast->rescue_clause != NULL && 
!pm_visit_node((const pm_node_t *) cast->rescue_clause, visitor, data)1.42k
)
return 0
false0
;
  Branch (548:17): [True: 1.42k, False: 1.53k]
  Branch (548:48): [True: 0, False: 1.42k]
549
550
            // Visit the else_clause field
551
2.95k
            if (cast->else_clause != NULL && 
!pm_visit_node((const pm_node_t *) cast->else_clause, visitor, data)701
)
return 0
false0
;
  Branch (551:17): [True: 701, False: 2.25k]
  Branch (551:46): [True: 0, False: 701]
552
553
            // Visit the ensure_clause field
554
2.95k
            if (cast->ensure_clause != NULL && 
!pm_visit_node((const pm_node_t *) cast->ensure_clause, visitor, data)1.03k
)
return 0
false0
;
  Branch (554:17): [True: 1.03k, False: 1.91k]
  Branch (554:48): [True: 0, False: 1.03k]
555
556
2.95k
            break;
557
2.95k
        }
558
2.95k
        case PM_BLOCK_ARGUMENT_NODE: {
  Branch (558:9): [True: 1.86k, False: 1.26M]
559
1.86k
            const pm_block_argument_node_t *cast = (const pm_block_argument_node_t *) node;
560
561
            // Visit the expression field
562
1.86k
            if (cast->expression != NULL && 
!pm_visit_node((const pm_node_t *) cast->expression, visitor, data)1.81k
)
return 0
false0
;
  Branch (562:17): [True: 1.81k, False: 46]
  Branch (562:45): [True: 0, False: 1.81k]
563
564
1.86k
            break;
565
1.86k
        }
566
1.86k
        case PM_BLOCK_LOCAL_VARIABLE_NODE:
  Branch (566:9): [True: 776, False: 1.26M]
567
776
            break;
568
8.20k
        case PM_BLOCK_NODE: {
  Branch (568:9): [True: 8.20k, False: 1.25M]
569
8.20k
            const pm_block_node_t *cast = (const pm_block_node_t *) node;
570
571
            // Visit the parameters field
572
8.20k
            if (cast->parameters != NULL && 
!pm_visit_node((const pm_node_t *) cast->parameters, visitor, data)1.54k
)
return 0
false0
;
  Branch (572:17): [True: 1.54k, False: 6.66k]
  Branch (572:45): [True: 0, False: 1.54k]
573
574
            // Visit the body field
575
8.20k
            if (cast->body != NULL && 
!pm_visit_node((const pm_node_t *) cast->body, visitor, data)5.29k
)
return 0
false0
;
  Branch (575:17): [True: 5.29k, False: 2.90k]
  Branch (575:39): [True: 0, False: 5.29k]
576
577
8.20k
            break;
578
8.20k
        }
579
8.20k
        case PM_BLOCK_PARAMETER_NODE:
  Branch (579:9): [True: 7.39k, False: 1.25M]
580
7.39k
            break;
581
2.71k
        case PM_BLOCK_PARAMETERS_NODE: {
  Branch (581:9): [True: 2.71k, False: 1.26M]
582
2.71k
            const pm_block_parameters_node_t *cast = (const pm_block_parameters_node_t *) node;
583
584
            // Visit the parameters field
585
2.71k
            if (cast->parameters != NULL && 
!pm_visit_node((const pm_node_t *) cast->parameters, visitor, data)2.57k
)
return 0
false0
;
  Branch (585:17): [True: 2.57k, False: 138]
  Branch (585:45): [True: 0, False: 2.57k]
586
587
            // Visit the locals field
588
2.71k
            const pm_node_list_t *locals = &cast->locals;
589
3.49k
            for (size_t index = 0; index < locals->size; 
index++776
) {
  Branch (589:36): [True: 776, False: 2.71k]
590
776
                if (!pm_visit_node(locals->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (590:21): [True: 0, False: 776]
591
776
            }
592
593
2.71k
            break;
594
2.71k
        }
595
2.71k
        case PM_BREAK_NODE: {
  Branch (595:9): [True: 2.70k, False: 1.26M]
596
2.70k
            const pm_break_node_t *cast = (const pm_break_node_t *) node;
597
598
            // Visit the arguments field
599
2.70k
            if (cast->arguments != NULL && 
!pm_visit_node((const pm_node_t *) cast->arguments, visitor, data)1.84k
)
return 0
false0
;
  Branch (599:17): [True: 1.84k, False: 854]
  Branch (599:44): [True: 0, False: 1.84k]
600
601
2.70k
            break;
602
2.70k
        }
603
2.70k
        case PM_CALL_AND_WRITE_NODE: {
  Branch (603:9): [True: 215, False: 1.26M]
604
215
            const pm_call_and_write_node_t *cast = (const pm_call_and_write_node_t *) node;
605
606
            // Visit the receiver field
607
215
            if (cast->receiver != NULL && 
!pm_visit_node((const pm_node_t *) cast->receiver, visitor, data)179
)
return 0
false0
;
  Branch (607:17): [True: 179, False: 36]
  Branch (607:43): [True: 0, False: 179]
608
609
            // Visit the value field
610
215
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (610:17): [True: 0, False: 215]
611
612
215
            break;
613
215
        }
614
185k
        case PM_CALL_NODE: {
  Branch (614:9): [True: 185k, False: 1.08M]
615
185k
            const pm_call_node_t *cast = (const pm_call_node_t *) node;
616
617
            // Visit the receiver field
618
185k
            if (cast->receiver != NULL && 
!pm_visit_node((const pm_node_t *) cast->receiver, visitor, data)61.2k
)
return 0
false0
;
  Branch (618:17): [True: 61.2k, False: 124k]
  Branch (618:43): [True: 0, False: 61.2k]
619
620
            // Visit the arguments field
621
185k
            if (cast->arguments != NULL && 
!pm_visit_node((const pm_node_t *) cast->arguments, visitor, data)77.8k
)
return 0
false0
;
  Branch (621:17): [True: 77.8k, False: 107k]
  Branch (621:44): [True: 0, False: 77.8k]
622
623
            // Visit the block field
624
185k
            if (cast->block != NULL && 
!pm_visit_node((const pm_node_t *) cast->block, visitor, data)9.84k
)
return 0
false0
;
  Branch (624:17): [True: 9.84k, False: 175k]
  Branch (624:40): [True: 0, False: 9.84k]
625
626
185k
            break;
627
185k
        }
628
185k
        case PM_CALL_OPERATOR_WRITE_NODE: {
  Branch (628:9): [True: 764, False: 1.26M]
629
764
            const pm_call_operator_write_node_t *cast = (const pm_call_operator_write_node_t *) node;
630
631
            // Visit the receiver field
632
764
            if (cast->receiver != NULL && 
!pm_visit_node((const pm_node_t *) cast->receiver, visitor, data)734
)
return 0
false0
;
  Branch (632:17): [True: 734, False: 30]
  Branch (632:43): [True: 0, False: 734]
633
634
            // Visit the value field
635
764
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (635:17): [True: 0, False: 764]
636
637
764
            break;
638
764
        }
639
764
        case PM_CALL_OR_WRITE_NODE: {
  Branch (639:9): [True: 382, False: 1.26M]
640
382
            const pm_call_or_write_node_t *cast = (const pm_call_or_write_node_t *) node;
641
642
            // Visit the receiver field
643
382
            if (cast->receiver != NULL && 
!pm_visit_node((const pm_node_t *) cast->receiver, visitor, data)373
)
return 0
false0
;
  Branch (643:17): [True: 373, False: 9]
  Branch (643:43): [True: 0, False: 373]
644
645
            // Visit the value field
646
382
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (646:17): [True: 0, False: 382]
647
648
382
            break;
649
382
        }
650
2.33k
        case PM_CALL_TARGET_NODE: {
  Branch (650:9): [True: 2.33k, False: 1.26M]
651
2.33k
            const pm_call_target_node_t *cast = (const pm_call_target_node_t *) node;
652
653
            // Visit the receiver field
654
2.33k
            if (!pm_visit_node((const pm_node_t *) cast->receiver, visitor, data)) 
return 0
false0
;
  Branch (654:17): [True: 0, False: 2.33k]
655
656
2.33k
            break;
657
2.33k
        }
658
2.33k
        case PM_CAPTURE_PATTERN_NODE: {
  Branch (658:9): [True: 511, False: 1.26M]
659
511
            const pm_capture_pattern_node_t *cast = (const pm_capture_pattern_node_t *) node;
660
661
            // Visit the value field
662
511
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (662:17): [True: 0, False: 511]
663
664
            // Visit the target field
665
511
            if (!pm_visit_node((const pm_node_t *) cast->target, visitor, data)) 
return 0
false0
;
  Branch (665:17): [True: 0, False: 511]
666
667
511
            break;
668
511
        }
669
4.38k
        case PM_CASE_MATCH_NODE: {
  Branch (669:9): [True: 4.38k, False: 1.26M]
670
4.38k
            const pm_case_match_node_t *cast = (const pm_case_match_node_t *) node;
671
672
            // Visit the predicate field
673
4.38k
            if (cast->predicate != NULL && 
!pm_visit_node((const pm_node_t *) cast->predicate, visitor, data)4.28k
)
return 0
false0
;
  Branch (673:17): [True: 4.28k, False: 98]
  Branch (673:44): [True: 0, False: 4.28k]
674
675
            // Visit the conditions field
676
4.38k
            const pm_node_list_t *conditions = &cast->conditions;
677
11.2k
            for (size_t index = 0; index < conditions->size; 
index++6.91k
) {
  Branch (677:36): [True: 6.91k, False: 4.38k]
678
6.91k
                if (!pm_visit_node(conditions->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (678:21): [True: 0, False: 6.91k]
679
6.91k
            }
680
681
            // Visit the else_clause field
682
4.38k
            if (cast->else_clause != NULL && 
!pm_visit_node((const pm_node_t *) cast->else_clause, visitor, data)402
)
return 0
false0
;
  Branch (682:17): [True: 402, False: 3.98k]
  Branch (682:46): [True: 0, False: 402]
683
684
4.38k
            break;
685
4.38k
        }
686
4.38k
        case PM_CASE_NODE: {
  Branch (686:9): [True: 643, False: 1.26M]
687
643
            const pm_case_node_t *cast = (const pm_case_node_t *) node;
688
689
            // Visit the predicate field
690
643
            if (cast->predicate != NULL && 
!pm_visit_node((const pm_node_t *) cast->predicate, visitor, data)361
)
return 0
false0
;
  Branch (690:17): [True: 361, False: 282]
  Branch (690:44): [True: 0, False: 361]
691
692
            // Visit the conditions field
693
643
            const pm_node_list_t *conditions = &cast->conditions;
694
1.33k
            for (size_t index = 0; index < conditions->size; 
index++692
) {
  Branch (694:36): [True: 692, False: 643]
695
692
                if (!pm_visit_node(conditions->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (695:21): [True: 0, False: 692]
696
692
            }
697
698
            // Visit the else_clause field
699
643
            if (cast->else_clause != NULL && 
!pm_visit_node((const pm_node_t *) cast->else_clause, visitor, data)183
)
return 0
false0
;
  Branch (699:17): [True: 183, False: 460]
  Branch (699:46): [True: 0, False: 183]
700
701
643
            break;
702
643
        }
703
2.14k
        case PM_CLASS_NODE: {
  Branch (703:9): [True: 2.14k, False: 1.26M]
704
2.14k
            const pm_class_node_t *cast = (const pm_class_node_t *) node;
705
706
            // Visit the constant_path field
707
2.14k
            if (!pm_visit_node((const pm_node_t *) cast->constant_path, visitor, data)) 
return 0
false0
;
  Branch (707:17): [True: 0, False: 2.14k]
708
709
            // Visit the superclass field
710
2.14k
            if (cast->superclass != NULL && 
!pm_visit_node((const pm_node_t *) cast->superclass, visitor, data)508
)
return 0
false0
;
  Branch (710:17): [True: 508, False: 1.63k]
  Branch (710:45): [True: 0, False: 508]
711
712
            // Visit the body field
713
2.14k
            if (cast->body != NULL && 
!pm_visit_node((const pm_node_t *) cast->body, visitor, data)2.04k
)
return 0
false0
;
  Branch (713:17): [True: 2.04k, False: 102]
  Branch (713:39): [True: 0, False: 2.04k]
714
715
2.14k
            break;
716
2.14k
        }
717
2.14k
        case PM_CLASS_VARIABLE_AND_WRITE_NODE: {
  Branch (717:9): [True: 23, False: 1.26M]
718
23
            const pm_class_variable_and_write_node_t *cast = (const pm_class_variable_and_write_node_t *) node;
719
720
            // Visit the value field
721
23
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (721:17): [True: 0, False: 23]
722
723
23
            break;
724
23
        }
725
23
        case PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
  Branch (725:9): [True: 12, False: 1.26M]
726
12
            const pm_class_variable_operator_write_node_t *cast = (const pm_class_variable_operator_write_node_t *) node;
727
728
            // Visit the value field
729
12
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (729:17): [True: 0, False: 12]
730
731
12
            break;
732
12
        }
733
19
        case PM_CLASS_VARIABLE_OR_WRITE_NODE: {
  Branch (733:9): [True: 19, False: 1.26M]
734
19
            const pm_class_variable_or_write_node_t *cast = (const pm_class_variable_or_write_node_t *) node;
735
736
            // Visit the value field
737
19
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (737:17): [True: 0, False: 19]
738
739
19
            break;
740
19
        }
741
1.28k
        case PM_CLASS_VARIABLE_READ_NODE:
  Branch (741:9): [True: 1.28k, False: 1.26M]
742
1.28k
            break;
743
1.40k
        case PM_CLASS_VARIABLE_TARGET_NODE:
  Branch (743:9): [True: 1.40k, False: 1.26M]
744
1.40k
            break;
745
545
        case PM_CLASS_VARIABLE_WRITE_NODE: {
  Branch (745:9): [True: 545, False: 1.26M]
746
545
            const pm_class_variable_write_node_t *cast = (const pm_class_variable_write_node_t *) node;
747
748
            // Visit the value field
749
545
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (749:17): [True: 0, False: 545]
750
751
545
            break;
752
545
        }
753
545
        case PM_CONSTANT_AND_WRITE_NODE: {
  Branch (753:9): [True: 140, False: 1.26M]
754
140
            const pm_constant_and_write_node_t *cast = (const pm_constant_and_write_node_t *) node;
755
756
            // Visit the value field
757
140
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (757:17): [True: 0, False: 140]
758
759
140
            break;
760
140
        }
761
257
        case PM_CONSTANT_OPERATOR_WRITE_NODE: {
  Branch (761:9): [True: 257, False: 1.26M]
762
257
            const pm_constant_operator_write_node_t *cast = (const pm_constant_operator_write_node_t *) node;
763
764
            // Visit the value field
765
257
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (765:17): [True: 0, False: 257]
766
767
257
            break;
768
257
        }
769
347
        case PM_CONSTANT_OR_WRITE_NODE: {
  Branch (769:9): [True: 347, False: 1.26M]
770
347
            const pm_constant_or_write_node_t *cast = (const pm_constant_or_write_node_t *) node;
771
772
            // Visit the value field
773
347
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (773:17): [True: 0, False: 347]
774
775
347
            break;
776
347
        }
777
347
        case PM_CONSTANT_PATH_AND_WRITE_NODE: {
  Branch (777:9): [True: 18, False: 1.26M]
778
18
            const pm_constant_path_and_write_node_t *cast = (const pm_constant_path_and_write_node_t *) node;
779
780
            // Visit the target field
781
18
            if (!pm_visit_node((const pm_node_t *) cast->target, visitor, data)) 
return 0
false0
;
  Branch (781:17): [True: 0, False: 18]
782
783
            // Visit the value field
784
18
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (784:17): [True: 0, False: 18]
785
786
18
            break;
787
18
        }
788
6.56k
        case PM_CONSTANT_PATH_NODE: {
  Branch (788:9): [True: 6.56k, False: 1.25M]
789
6.56k
            const pm_constant_path_node_t *cast = (const pm_constant_path_node_t *) node;
790
791
            // Visit the parent field
792
6.56k
            if (cast->parent != NULL && 
!pm_visit_node((const pm_node_t *) cast->parent, visitor, data)4.16k
)
return 0
false0
;
  Branch (792:17): [True: 4.16k, False: 2.40k]
  Branch (792:41): [True: 0, False: 4.16k]
793
794
6.56k
            break;
795
6.56k
        }
796
6.56k
        case PM_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
  Branch (796:9): [True: 22, False: 1.26M]
797
22
            const pm_constant_path_operator_write_node_t *cast = (const pm_constant_path_operator_write_node_t *) node;
798
799
            // Visit the target field
800
22
            if (!pm_visit_node((const pm_node_t *) cast->target, visitor, data)) 
return 0
false0
;
  Branch (800:17): [True: 0, False: 22]
801
802
            // Visit the value field
803
22
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (803:17): [True: 0, False: 22]
804
805
22
            break;
806
22
        }
807
70
        case PM_CONSTANT_PATH_OR_WRITE_NODE: {
  Branch (807:9): [True: 70, False: 1.26M]
808
70
            const pm_constant_path_or_write_node_t *cast = (const pm_constant_path_or_write_node_t *) node;
809
810
            // Visit the target field
811
70
            if (!pm_visit_node((const pm_node_t *) cast->target, visitor, data)) 
return 0
false0
;
  Branch (811:17): [True: 0, False: 70]
812
813
            // Visit the value field
814
70
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (814:17): [True: 0, False: 70]
815
816
70
            break;
817
70
        }
818
168
        case PM_CONSTANT_PATH_TARGET_NODE: {
  Branch (818:9): [True: 168, False: 1.26M]
819
168
            const pm_constant_path_target_node_t *cast = (const pm_constant_path_target_node_t *) node;
820
821
            // Visit the parent field
822
168
            if (cast->parent != NULL && 
!pm_visit_node((const pm_node_t *) cast->parent, visitor, data)64
)
return 0
false0
;
  Branch (822:17): [True: 64, False: 104]
  Branch (822:41): [True: 0, False: 64]
823
824
168
            break;
825
168
        }
826
1.52k
        case PM_CONSTANT_PATH_WRITE_NODE: {
  Branch (826:9): [True: 1.52k, False: 1.26M]
827
1.52k
            const pm_constant_path_write_node_t *cast = (const pm_constant_path_write_node_t *) node;
828
829
            // Visit the target field
830
1.52k
            if (!pm_visit_node((const pm_node_t *) cast->target, visitor, data)) 
return 0
false0
;
  Branch (830:17): [True: 0, False: 1.52k]
831
832
            // Visit the value field
833
1.52k
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (833:17): [True: 0, False: 1.52k]
834
835
1.52k
            break;
836
1.52k
        }
837
24.5k
        case PM_CONSTANT_READ_NODE:
  Branch (837:9): [True: 24.5k, False: 1.24M]
838
24.5k
            break;
839
722
        case PM_CONSTANT_TARGET_NODE:
  Branch (839:9): [True: 722, False: 1.26M]
840
722
            break;
841
1.81k
        case PM_CONSTANT_WRITE_NODE: {
  Branch (841:9): [True: 1.81k, False: 1.26M]
842
1.81k
            const pm_constant_write_node_t *cast = (const pm_constant_write_node_t *) node;
843
844
            // Visit the value field
845
1.81k
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (845:17): [True: 0, False: 1.81k]
846
847
1.81k
            break;
848
1.81k
        }
849
28.3k
        case PM_DEF_NODE: {
  Branch (849:9): [True: 28.3k, False: 1.23M]
850
28.3k
            const pm_def_node_t *cast = (const pm_def_node_t *) node;
851
852
            // Visit the receiver field
853
28.3k
            if (cast->receiver != NULL && 
!pm_visit_node((const pm_node_t *) cast->receiver, visitor, data)2.16k
)
return 0
false0
;
  Branch (853:17): [True: 2.16k, False: 26.2k]
  Branch (853:43): [True: 0, False: 2.16k]
854
855
            // Visit the parameters field
856
28.3k
            if (cast->parameters != NULL && 
!pm_visit_node((const pm_node_t *) cast->parameters, visitor, data)21.6k
)
return 0
false0
;
  Branch (856:17): [True: 21.6k, False: 6.72k]
  Branch (856:45): [True: 0, False: 21.6k]
857
858
            // Visit the body field
859
28.3k
            if (cast->body != NULL && 
!pm_visit_node((const pm_node_t *) cast->body, visitor, data)10.3k
)
return 0
false0
;
  Branch (859:17): [True: 10.3k, False: 18.0k]
  Branch (859:39): [True: 0, False: 10.3k]
860
861
28.3k
            break;
862
28.3k
        }
863
28.3k
        case PM_DEFINED_NODE: {
  Branch (863:9): [True: 190, False: 1.26M]
864
190
            const pm_defined_node_t *cast = (const pm_defined_node_t *) node;
865
866
            // Visit the value field
867
190
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (867:17): [True: 0, False: 190]
868
869
190
            break;
870
190
        }
871
2.94k
        case PM_ELSE_NODE: {
  Branch (871:9): [True: 2.94k, False: 1.26M]
872
2.94k
            const pm_else_node_t *cast = (const pm_else_node_t *) node;
873
874
            // Visit the statements field
875
2.94k
            if (cast->statements != NULL && 
!pm_visit_node((const pm_node_t *) cast->statements, visitor, data)2.51k
)
return 0
false0
;
  Branch (875:17): [True: 2.51k, False: 431]
  Branch (875:45): [True: 0, False: 2.51k]
876
877
2.94k
            break;
878
2.94k
        }
879
11.4k
        case PM_EMBEDDED_STATEMENTS_NODE: {
  Branch (879:9): [True: 11.4k, False: 1.25M]
880
11.4k
            const pm_embedded_statements_node_t *cast = (const pm_embedded_statements_node_t *) node;
881
882
            // Visit the statements field
883
11.4k
            if (cast->statements != NULL && 
!pm_visit_node((const pm_node_t *) cast->statements, visitor, data)7.25k
)
return 0
false0
;
  Branch (883:17): [True: 7.25k, False: 4.18k]
  Branch (883:45): [True: 0, False: 7.25k]
884
885
11.4k
            break;
886
11.4k
        }
887
11.4k
        case PM_EMBEDDED_VARIABLE_NODE: {
  Branch (887:9): [True: 1.27k, False: 1.26M]
888
1.27k
            const pm_embedded_variable_node_t *cast = (const pm_embedded_variable_node_t *) node;
889
890
            // Visit the variable field
891
1.27k
            if (!pm_visit_node((const pm_node_t *) cast->variable, visitor, data)) 
return 0
false0
;
  Branch (891:17): [True: 0, False: 1.27k]
892
893
1.27k
            break;
894
1.27k
        }
895
1.27k
        case PM_ENSURE_NODE: {
  Branch (895:9): [True: 1.03k, False: 1.26M]
896
1.03k
            const pm_ensure_node_t *cast = (const pm_ensure_node_t *) node;
897
898
            // Visit the statements field
899
1.03k
            if (cast->statements != NULL && 
!pm_visit_node((const pm_node_t *) cast->statements, visitor, data)537
)
return 0
false0
;
  Branch (899:17): [True: 537, False: 497]
  Branch (899:45): [True: 0, False: 537]
900
901
1.03k
            break;
902
1.03k
        }
903
133k
        case PM_ERROR_RECOVERY_NODE: {
  Branch (903:9): [True: 133k, False: 1.13M]
904
133k
            const pm_error_recovery_node_t *cast = (const pm_error_recovery_node_t *) node;
905
906
            // Visit the unexpected field
907
133k
            if (cast->unexpected != NULL && 
!pm_visit_node((const pm_node_t *) cast->unexpected, visitor, data)717
)
return 0
false0
;
  Branch (907:17): [True: 717, False: 132k]
  Branch (907:45): [True: 0, False: 717]
908
909
133k
            break;
910
133k
        }
911
133k
        case PM_FALSE_NODE:
  Branch (911:9): [True: 1.10k, False: 1.26M]
912
1.10k
            break;
913
67
        case PM_FIND_PATTERN_NODE: {
  Branch (913:9): [True: 67, False: 1.26M]
914
67
            const pm_find_pattern_node_t *cast = (const pm_find_pattern_node_t *) node;
915
916
            // Visit the constant field
917
67
            if (cast->constant != NULL && 
!pm_visit_node((const pm_node_t *) cast->constant, visitor, data)36
)
return 0
false0
;
  Branch (917:17): [True: 36, False: 31]
  Branch (917:43): [True: 0, False: 36]
918
919
            // Visit the left field
920
67
            if (!pm_visit_node((const pm_node_t *) cast->left, visitor, data)) 
return 0
false0
;
  Branch (920:17): [True: 0, False: 67]
921
922
            // Visit the requireds field
923
67
            const pm_node_list_t *requireds = &cast->requireds;
924
142
            for (size_t index = 0; index < requireds->size; 
index++75
) {
  Branch (924:36): [True: 75, False: 67]
925
75
                if (!pm_visit_node(requireds->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (925:21): [True: 0, False: 75]
926
75
            }
927
928
            // Visit the right field
929
67
            if (!pm_visit_node((const pm_node_t *) cast->right, visitor, data)) 
return 0
false0
;
  Branch (929:17): [True: 0, False: 67]
930
931
67
            break;
932
67
        }
933
471
        case PM_FLIP_FLOP_NODE: {
  Branch (933:9): [True: 471, False: 1.26M]
934
471
            const pm_flip_flop_node_t *cast = (const pm_flip_flop_node_t *) node;
935
936
            // Visit the left field
937
471
            if (cast->left != NULL && 
!pm_visit_node((const pm_node_t *) cast->left, visitor, data)266
)
return 0
false0
;
  Branch (937:17): [True: 266, False: 205]
  Branch (937:39): [True: 0, False: 266]
938
939
            // Visit the right field
940
471
            if (cast->right != NULL && 
!pm_visit_node((const pm_node_t *) cast->right, visitor, data)415
)
return 0
false0
;
  Branch (940:17): [True: 415, False: 56]
  Branch (940:40): [True: 0, False: 415]
941
942
471
            break;
943
471
        }
944
2.87k
        case PM_FLOAT_NODE:
  Branch (944:9): [True: 2.87k, False: 1.26M]
945
2.87k
            break;
946
211
        case PM_FOR_NODE: {
  Branch (946:9): [True: 211, False: 1.26M]
947
211
            const pm_for_node_t *cast = (const pm_for_node_t *) node;
948
949
            // Visit the index field
950
211
            if (!pm_visit_node((const pm_node_t *) cast->index, visitor, data)) 
return 0
false0
;
  Branch (950:17): [True: 0, False: 211]
951
952
            // Visit the collection field
953
211
            if (!pm_visit_node((const pm_node_t *) cast->collection, visitor, data)) 
return 0
false0
;
  Branch (953:17): [True: 0, False: 211]
954
955
            // Visit the statements field
956
211
            if (cast->statements != NULL && 
!pm_visit_node((const pm_node_t *) cast->statements, visitor, data)202
)
return 0
false0
;
  Branch (956:17): [True: 202, False: 9]
  Branch (956:45): [True: 0, False: 202]
957
958
211
            break;
959
211
        }
960
299
        case PM_FORWARDING_ARGUMENTS_NODE:
  Branch (960:9): [True: 299, False: 1.26M]
961
299
            break;
962
396
        case PM_FORWARDING_PARAMETER_NODE:
  Branch (962:9): [True: 396, False: 1.26M]
963
396
            break;
964
87
        case PM_FORWARDING_SUPER_NODE: {
  Branch (964:9): [True: 87, False: 1.26M]
965
87
            const pm_forwarding_super_node_t *cast = (const pm_forwarding_super_node_t *) node;
966
967
            // Visit the block field
968
87
            if (cast->block != NULL && 
!pm_visit_node((const pm_node_t *) cast->block, visitor, data)24
)
return 0
false0
;
  Branch (968:17): [True: 24, False: 63]
  Branch (968:40): [True: 0, False: 24]
969
970
87
            break;
971
87
        }
972
87
        case PM_GLOBAL_VARIABLE_AND_WRITE_NODE: {
  Branch (972:9): [True: 32, False: 1.26M]
973
32
            const pm_global_variable_and_write_node_t *cast = (const pm_global_variable_and_write_node_t *) node;
974
975
            // Visit the value field
976
32
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (976:17): [True: 0, False: 32]
977
978
32
            break;
979
32
        }
980
38
        case PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
  Branch (980:9): [True: 38, False: 1.26M]
981
38
            const pm_global_variable_operator_write_node_t *cast = (const pm_global_variable_operator_write_node_t *) node;
982
983
            // Visit the value field
984
38
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (984:17): [True: 0, False: 38]
985
986
38
            break;
987
38
        }
988
38
        case PM_GLOBAL_VARIABLE_OR_WRITE_NODE: {
  Branch (988:9): [True: 26, False: 1.26M]
989
26
            const pm_global_variable_or_write_node_t *cast = (const pm_global_variable_or_write_node_t *) node;
990
991
            // Visit the value field
992
26
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (992:17): [True: 0, False: 26]
993
994
26
            break;
995
26
        }
996
9.66k
        case PM_GLOBAL_VARIABLE_READ_NODE:
  Branch (996:9): [True: 9.66k, False: 1.25M]
997
9.66k
            break;
998
1.55k
        case PM_GLOBAL_VARIABLE_TARGET_NODE:
  Branch (998:9): [True: 1.55k, False: 1.26M]
999
1.55k
            break;
1000
2.04k
        case PM_GLOBAL_VARIABLE_WRITE_NODE: {
  Branch (1000:9): [True: 2.04k, False: 1.26M]
1001
2.04k
            const pm_global_variable_write_node_t *cast = (const pm_global_variable_write_node_t *) node;
1002
1003
            // Visit the value field
1004
2.04k
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (1004:17): [True: 0, False: 2.04k]
1005
1006
2.04k
            break;
1007
2.04k
        }
1008
14.7k
        case PM_HASH_NODE: {
  Branch (1008:9): [True: 14.7k, False: 1.25M]
1009
14.7k
            const pm_hash_node_t *cast = (const pm_hash_node_t *) node;
1010
1011
            // Visit the elements field
1012
14.7k
            const pm_node_list_t *elements = &cast->elements;
1013
30.5k
            for (size_t index = 0; index < elements->size; 
index++15.7k
) {
  Branch (1013:36): [True: 15.7k, False: 14.7k]
1014
15.7k
                if (!pm_visit_node(elements->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (1014:21): [True: 0, False: 15.7k]
1015
15.7k
            }
1016
1017
14.7k
            break;
1018
14.7k
        }
1019
14.7k
        case PM_HASH_PATTERN_NODE: {
  Branch (1019:9): [True: 3.14k, False: 1.26M]
1020
3.14k
            const pm_hash_pattern_node_t *cast = (const pm_hash_pattern_node_t *) node;
1021
1022
            // Visit the constant field
1023
3.14k
            if (cast->constant != NULL && 
!pm_visit_node((const pm_node_t *) cast->constant, visitor, data)264
)
return 0
false0
;
  Branch (1023:17): [True: 264, False: 2.87k]
  Branch (1023:43): [True: 0, False: 264]
1024
1025
            // Visit the elements field
1026
3.14k
            const pm_node_list_t *elements = &cast->elements;
1027
7.83k
            for (size_t index = 0; index < elements->size; 
index++4.69k
) {
  Branch (1027:36): [True: 4.69k, False: 3.14k]
1028
4.69k
                if (!pm_visit_node(elements->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (1028:21): [True: 0, False: 4.69k]
1029
4.69k
            }
1030
1031
            // Visit the rest field
1032
3.14k
            if (cast->rest != NULL && 
!pm_visit_node((const pm_node_t *) cast->rest, visitor, data)659
)
return 0
false0
;
  Branch (1032:17): [True: 659, False: 2.48k]
  Branch (1032:39): [True: 0, False: 659]
1033
1034
3.14k
            break;
1035
3.14k
        }
1036
3.73k
        case PM_IF_NODE: {
  Branch (1036:9): [True: 3.73k, False: 1.26M]
1037
3.73k
            const pm_if_node_t *cast = (const pm_if_node_t *) node;
1038
1039
            // Visit the predicate field
1040
3.73k
            if (!pm_visit_node((const pm_node_t *) cast->predicate, visitor, data)) 
return 0
false0
;
  Branch (1040:17): [True: 0, False: 3.73k]
1041
1042
            // Visit the statements field
1043
3.73k
            if (cast->statements != NULL && 
!pm_visit_node((const pm_node_t *) cast->statements, visitor, data)3.48k
)
return 0
false0
;
  Branch (1043:17): [True: 3.48k, False: 251]
  Branch (1043:45): [True: 0, False: 3.48k]
1044
1045
            // Visit the subsequent field
1046
3.73k
            if (cast->subsequent != NULL && 
!pm_visit_node((const pm_node_t *) cast->subsequent, visitor, data)1.83k
)
return 0
false0
;
  Branch (1046:17): [True: 1.83k, False: 1.89k]
  Branch (1046:45): [True: 0, False: 1.83k]
1047
1048
3.73k
            break;
1049
3.73k
        }
1050
3.73k
        case PM_IMAGINARY_NODE: {
  Branch (1050:9): [True: 2.11k, False: 1.26M]
1051
2.11k
            const pm_imaginary_node_t *cast = (const pm_imaginary_node_t *) node;
1052
1053
            // Visit the numeric field
1054
2.11k
            if (!pm_visit_node((const pm_node_t *) cast->numeric, visitor, data)) 
return 0
false0
;
  Branch (1054:17): [True: 0, False: 2.11k]
1055
1056
2.11k
            break;
1057
2.11k
        }
1058
4.08k
        case PM_IMPLICIT_NODE: {
  Branch (1058:9): [True: 4.08k, False: 1.26M]
1059
4.08k
            const pm_implicit_node_t *cast = (const pm_implicit_node_t *) node;
1060
1061
            // Visit the value field
1062
4.08k
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (1062:17): [True: 0, False: 4.08k]
1063
1064
4.08k
            break;
1065
4.08k
        }
1066
4.08k
        case PM_IMPLICIT_REST_NODE:
  Branch (1066:9): [True: 3.19k, False: 1.26M]
1067
3.19k
            break;
1068
6.91k
        case PM_IN_NODE: {
  Branch (1068:9): [True: 6.91k, False: 1.25M]
1069
6.91k
            const pm_in_node_t *cast = (const pm_in_node_t *) node;
1070
1071
            // Visit the pattern field
1072
6.91k
            if (!pm_visit_node((const pm_node_t *) cast->pattern, visitor, data)) 
return 0
false0
;
  Branch (1072:17): [True: 0, False: 6.91k]
1073
1074
            // Visit the statements field
1075
6.91k
            if (cast->statements != NULL && 
!pm_visit_node((const pm_node_t *) cast->statements, visitor, data)4.67k
)
return 0
false0
;
  Branch (1075:17): [True: 4.67k, False: 2.24k]
  Branch (1075:45): [True: 0, False: 4.67k]
1076
1077
6.91k
            break;
1078
6.91k
        }
1079
6.91k
        case PM_INDEX_AND_WRITE_NODE: {
  Branch (1079:9): [True: 457, False: 1.26M]
1080
457
            const pm_index_and_write_node_t *cast = (const pm_index_and_write_node_t *) node;
1081
1082
            // Visit the receiver field
1083
457
            if (cast->receiver != NULL && !pm_visit_node((const pm_node_t *) cast->receiver, visitor, data)) 
return 0
false0
;
  Branch (1083:17): [True: 457, False: 0]
  Branch (1083:43): [True: 0, False: 457]
1084
1085
            // Visit the arguments field
1086
457
            if (cast->arguments != NULL && 
!pm_visit_node((const pm_node_t *) cast->arguments, visitor, data)288
)
return 0
false0
;
  Branch (1086:17): [True: 288, False: 169]
  Branch (1086:44): [True: 0, False: 288]
1087
1088
            // Visit the block field
1089
457
            if (cast->block != NULL && 
!pm_visit_node((const pm_node_t *) cast->block, visitor, data)9
)
return 0
false0
;
  Branch (1089:17): [True: 9, False: 448]
  Branch (1089:40): [True: 0, False: 9]
1090
1091
            // Visit the value field
1092
457
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (1092:17): [True: 0, False: 457]
1093
1094
457
            break;
1095
457
        }
1096
749
        case PM_INDEX_OPERATOR_WRITE_NODE: {
  Branch (1096:9): [True: 749, False: 1.26M]
1097
749
            const pm_index_operator_write_node_t *cast = (const pm_index_operator_write_node_t *) node;
1098
1099
            // Visit the receiver field
1100
749
            if (cast->receiver != NULL && !pm_visit_node((const pm_node_t *) cast->receiver, visitor, data)) 
return 0
false0
;
  Branch (1100:17): [True: 749, False: 0]
  Branch (1100:43): [True: 0, False: 749]
1101
1102
            // Visit the arguments field
1103
749
            if (cast->arguments != NULL && 
!pm_visit_node((const pm_node_t *) cast->arguments, visitor, data)582
)
return 0
false0
;
  Branch (1103:17): [True: 582, False: 167]
  Branch (1103:44): [True: 0, False: 582]
1104
1105
            // Visit the block field
1106
749
            if (cast->block != NULL && 
!pm_visit_node((const pm_node_t *) cast->block, visitor, data)8
)
return 0
false0
;
  Branch (1106:17): [True: 8, False: 741]
  Branch (1106:40): [True: 0, False: 8]
1107
1108
            // Visit the value field
1109
749
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (1109:17): [True: 0, False: 749]
1110
1111
749
            break;
1112
749
        }
1113
1.06k
        case PM_INDEX_OR_WRITE_NODE: {
  Branch (1113:9): [True: 1.06k, False: 1.26M]
1114
1.06k
            const pm_index_or_write_node_t *cast = (const pm_index_or_write_node_t *) node;
1115
1116
            // Visit the receiver field
1117
1.06k
            if (cast->receiver != NULL && !pm_visit_node((const pm_node_t *) cast->receiver, visitor, data)) 
return 0
false0
;
  Branch (1117:17): [True: 1.06k, False: 0]
  Branch (1117:43): [True: 0, False: 1.06k]
1118
1119
            // Visit the arguments field
1120
1.06k
            if (cast->arguments != NULL && 
!pm_visit_node((const pm_node_t *) cast->arguments, visitor, data)892
)
return 0
false0
;
  Branch (1120:17): [True: 892, False: 176]
  Branch (1120:44): [True: 0, False: 892]
1121
1122
            // Visit the block field
1123
1.06k
            if (cast->block != NULL && 
!pm_visit_node((const pm_node_t *) cast->block, visitor, data)8
)
return 0
false0
;
  Branch (1123:17): [True: 8, False: 1.06k]
  Branch (1123:40): [True: 0, False: 8]
1124
1125
            // Visit the value field
1126
1.06k
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (1126:17): [True: 0, False: 1.06k]
1127
1128
1.06k
            break;
1129
1.06k
        }
1130
3.15k
        case PM_INDEX_TARGET_NODE: {
  Branch (1130:9): [True: 3.15k, False: 1.26M]
1131
3.15k
            const pm_index_target_node_t *cast = (const pm_index_target_node_t *) node;
1132
1133
            // Visit the receiver field
1134
3.15k
            if (!pm_visit_node((const pm_node_t *) cast->receiver, visitor, data)) 
return 0
false0
;
  Branch (1134:17): [True: 0, False: 3.15k]
1135
1136
            // Visit the arguments field
1137
3.15k
            if (cast->arguments != NULL && 
!pm_visit_node((const pm_node_t *) cast->arguments, visitor, data)3.13k
)
return 0
false0
;
  Branch (1137:17): [True: 3.13k, False: 17]
  Branch (1137:44): [True: 0, False: 3.13k]
1138
1139
            // Visit the block field
1140
3.15k
            if (cast->block != NULL && 
!pm_visit_node((const pm_node_t *) cast->block, visitor, data)4
)
return 0
false0
;
  Branch (1140:17): [True: 4, False: 3.15k]
  Branch (1140:40): [True: 0, False: 4]
1141
1142
3.15k
            break;
1143
3.15k
        }
1144
3.15k
        case PM_INSTANCE_VARIABLE_AND_WRITE_NODE: {
  Branch (1144:9): [True: 12, False: 1.26M]
1145
12
            const pm_instance_variable_and_write_node_t *cast = (const pm_instance_variable_and_write_node_t *) node;
1146
1147
            // Visit the value field
1148
12
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (1148:17): [True: 0, False: 12]
1149
1150
12
            break;
1151
12
        }
1152
19
        case PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
  Branch (1152:9): [True: 19, False: 1.26M]
1153
19
            const pm_instance_variable_operator_write_node_t *cast = (const pm_instance_variable_operator_write_node_t *) node;
1154
1155
            // Visit the value field
1156
19
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (1156:17): [True: 0, False: 19]
1157
1158
19
            break;
1159
19
        }
1160
867
        case PM_INSTANCE_VARIABLE_OR_WRITE_NODE: {
  Branch (1160:9): [True: 867, False: 1.26M]
1161
867
            const pm_instance_variable_or_write_node_t *cast = (const pm_instance_variable_or_write_node_t *) node;
1162
1163
            // Visit the value field
1164
867
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (1164:17): [True: 0, False: 867]
1165
1166
867
            break;
1167
867
        }
1168
2.63k
        case PM_INSTANCE_VARIABLE_READ_NODE:
  Branch (1168:9): [True: 2.63k, False: 1.26M]
1169
2.63k
            break;
1170
1.30k
        case PM_INSTANCE_VARIABLE_TARGET_NODE:
  Branch (1170:9): [True: 1.30k, False: 1.26M]
1171
1.30k
            break;
1172
585
        case PM_INSTANCE_VARIABLE_WRITE_NODE: {
  Branch (1172:9): [True: 585, False: 1.26M]
1173
585
            const pm_instance_variable_write_node_t *cast = (const pm_instance_variable_write_node_t *) node;
1174
1175
            // Visit the value field
1176
585
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (1176:17): [True: 0, False: 585]
1177
1178
585
            break;
1179
585
        }
1180
89.8k
        case PM_INTEGER_NODE:
  Branch (1180:9): [True: 89.8k, False: 1.17M]
1181
89.8k
            break;
1182
136
        case PM_INTERPOLATED_MATCH_LAST_LINE_NODE: {
  Branch (1182:9): [True: 136, False: 1.26M]
1183
136
            const pm_interpolated_match_last_line_node_t *cast = (const pm_interpolated_match_last_line_node_t *) node;
1184
1185
            // Visit the parts field
1186
136
            const pm_node_list_t *parts = &cast->parts;
1187
477
            for (size_t index = 0; index < parts->size; 
index++341
) {
  Branch (1187:36): [True: 341, False: 136]
1188
341
                if (!pm_visit_node(parts->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (1188:21): [True: 0, False: 341]
1189
341
            }
1190
1191
136
            break;
1192
136
        }
1193
2.09k
        case PM_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
  Branch (1193:9): [True: 2.09k, False: 1.26M]
1194
2.09k
            const pm_interpolated_regular_expression_node_t *cast = (const pm_interpolated_regular_expression_node_t *) node;
1195
1196
            // Visit the parts field
1197
2.09k
            const pm_node_list_t *parts = &cast->parts;
1198
6.28k
            for (size_t index = 0; index < parts->size; 
index++4.18k
) {
  Branch (1198:36): [True: 4.18k, False: 2.09k]
1199
4.18k
                if (!pm_visit_node(parts->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (1199:21): [True: 0, False: 4.18k]
1200
4.18k
            }
1201
1202
2.09k
            break;
1203
2.09k
        }
1204
8.04k
        case PM_INTERPOLATED_STRING_NODE: {
  Branch (1204:9): [True: 8.04k, False: 1.25M]
1205
8.04k
            const pm_interpolated_string_node_t *cast = (const pm_interpolated_string_node_t *) node;
1206
1207
            // Visit the parts field
1208
8.04k
            const pm_node_list_t *parts = &cast->parts;
1209
36.1k
            for (size_t index = 0; index < parts->size; 
index++28.1k
) {
  Branch (1209:36): [True: 28.1k, False: 8.04k]
1210
28.1k
                if (!pm_visit_node(parts->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (1210:21): [True: 0, False: 28.1k]
1211
28.1k
            }
1212
1213
8.04k
            break;
1214
8.04k
        }
1215
8.04k
        case PM_INTERPOLATED_SYMBOL_NODE: {
  Branch (1215:9): [True: 1.89k, False: 1.26M]
1216
1.89k
            const pm_interpolated_symbol_node_t *cast = (const pm_interpolated_symbol_node_t *) node;
1217
1218
            // Visit the parts field
1219
1.89k
            const pm_node_list_t *parts = &cast->parts;
1220
6.24k
            for (size_t index = 0; index < parts->size; 
index++4.35k
) {
  Branch (1220:36): [True: 4.35k, False: 1.89k]
1221
4.35k
                if (!pm_visit_node(parts->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (1221:21): [True: 0, False: 4.35k]
1222
4.35k
            }
1223
1224
1.89k
            break;
1225
1.89k
        }
1226
1.89k
        case PM_INTERPOLATED_X_STRING_NODE: {
  Branch (1226:9): [True: 380, False: 1.26M]
1227
380
            const pm_interpolated_x_string_node_t *cast = (const pm_interpolated_x_string_node_t *) node;
1228
1229
            // Visit the parts field
1230
380
            const pm_node_list_t *parts = &cast->parts;
1231
1.75k
            for (size_t index = 0; index < parts->size; 
index++1.37k
) {
  Branch (1231:36): [True: 1.37k, False: 380]
1232
1.37k
                if (!pm_visit_node(parts->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (1232:21): [True: 0, False: 1.37k]
1233
1.37k
            }
1234
1235
380
            break;
1236
380
        }
1237
380
        case PM_IT_LOCAL_VARIABLE_READ_NODE:
  Branch (1237:9): [True: 311, False: 1.26M]
1238
311
            break;
1239
224
        case PM_IT_PARAMETERS_NODE:
  Branch (1239:9): [True: 224, False: 1.26M]
1240
224
            break;
1241
5.72k
        case PM_KEYWORD_HASH_NODE: {
  Branch (1241:9): [True: 5.72k, False: 1.26M]
1242
5.72k
            const pm_keyword_hash_node_t *cast = (const pm_keyword_hash_node_t *) node;
1243
1244
            // Visit the elements field
1245
5.72k
            const pm_node_list_t *elements = &cast->elements;
1246
13.3k
            for (size_t index = 0; index < elements->size; 
index++7.58k
) {
  Branch (1246:36): [True: 7.58k, False: 5.72k]
1247
7.58k
                if (!pm_visit_node(elements->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (1247:21): [True: 0, False: 7.58k]
1248
7.58k
            }
1249
1250
5.72k
            break;
1251
5.72k
        }
1252
5.72k
        case PM_KEYWORD_REST_PARAMETER_NODE:
  Branch (1252:9): [True: 2.09k, False: 1.26M]
1253
2.09k
            break;
1254
2.98k
        case PM_LAMBDA_NODE: {
  Branch (1254:9): [True: 2.98k, False: 1.26M]
1255
2.98k
            const pm_lambda_node_t *cast = (const pm_lambda_node_t *) node;
1256
1257
            // Visit the parameters field
1258
2.98k
            if (cast->parameters != NULL && 
!pm_visit_node((const pm_node_t *) cast->parameters, visitor, data)1.49k
)
return 0
false0
;
  Branch (1258:17): [True: 1.49k, False: 1.48k]
  Branch (1258:45): [True: 0, False: 1.49k]
1259
1260
            // Visit the body field
1261
2.98k
            if (cast->body != NULL && 
!pm_visit_node((const pm_node_t *) cast->body, visitor, data)2.84k
)
return 0
false0
;
  Branch (1261:17): [True: 2.84k, False: 143]
  Branch (1261:39): [True: 0, False: 2.84k]
1262
1263
2.98k
            break;
1264
2.98k
        }
1265
2.98k
        case PM_LOCAL_VARIABLE_AND_WRITE_NODE: {
  Branch (1265:9): [True: 163, False: 1.26M]
1266
163
            const pm_local_variable_and_write_node_t *cast = (const pm_local_variable_and_write_node_t *) node;
1267
1268
            // Visit the value field
1269
163
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (1269:17): [True: 0, False: 163]
1270
1271
163
            break;
1272
163
        }
1273
849
        case PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
  Branch (1273:9): [True: 849, False: 1.26M]
1274
849
            const pm_local_variable_operator_write_node_t *cast = (const pm_local_variable_operator_write_node_t *) node;
1275
1276
            // Visit the value field
1277
849
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (1277:17): [True: 0, False: 849]
1278
1279
849
            break;
1280
849
        }
1281
849
        case PM_LOCAL_VARIABLE_OR_WRITE_NODE: {
  Branch (1281:9): [True: 385, False: 1.26M]
1282
385
            const pm_local_variable_or_write_node_t *cast = (const pm_local_variable_or_write_node_t *) node;
1283
1284
            // Visit the value field
1285
385
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (1285:17): [True: 0, False: 385]
1286
1287
385
            break;
1288
385
        }
1289
25.7k
        case PM_LOCAL_VARIABLE_READ_NODE:
  Branch (1289:9): [True: 25.7k, False: 1.24M]
1290
25.7k
            break;
1291
33.4k
        case PM_LOCAL_VARIABLE_TARGET_NODE:
  Branch (1291:9): [True: 33.4k, False: 1.23M]
1292
33.4k
            break;
1293
12.8k
        case PM_LOCAL_VARIABLE_WRITE_NODE: {
  Branch (1293:9): [True: 12.8k, False: 1.25M]
1294
12.8k
            const pm_local_variable_write_node_t *cast = (const pm_local_variable_write_node_t *) node;
1295
1296
            // Visit the value field
1297
12.8k
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (1297:17): [True: 0, False: 12.8k]
1298
1299
12.8k
            break;
1300
12.8k
        }
1301
12.8k
        case PM_MATCH_LAST_LINE_NODE:
  Branch (1301:9): [True: 11, False: 1.26M]
1302
11
            break;
1303
1.91k
        case PM_MATCH_PREDICATE_NODE: {
  Branch (1303:9): [True: 1.91k, False: 1.26M]
1304
1.91k
            const pm_match_predicate_node_t *cast = (const pm_match_predicate_node_t *) node;
1305
1306
            // Visit the value field
1307
1.91k
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (1307:17): [True: 0, False: 1.91k]
1308
1309
            // Visit the pattern field
1310
1.91k
            if (!pm_visit_node((const pm_node_t *) cast->pattern, visitor, data)) 
return 0
false0
;
  Branch (1310:17): [True: 0, False: 1.91k]
1311
1312
1.91k
            break;
1313
1.91k
        }
1314
6.57k
        case PM_MATCH_REQUIRED_NODE: {
  Branch (1314:9): [True: 6.57k, False: 1.25M]
1315
6.57k
            const pm_match_required_node_t *cast = (const pm_match_required_node_t *) node;
1316
1317
            // Visit the value field
1318
6.57k
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (1318:17): [True: 0, False: 6.57k]
1319
1320
            // Visit the pattern field
1321
6.57k
            if (!pm_visit_node((const pm_node_t *) cast->pattern, visitor, data)) 
return 0
false0
;
  Branch (1321:17): [True: 0, False: 6.57k]
1322
1323
6.57k
            break;
1324
6.57k
        }
1325
6.57k
        case PM_MATCH_WRITE_NODE: {
  Branch (1325:9): [True: 1.16k, False: 1.26M]
1326
1.16k
            const pm_match_write_node_t *cast = (const pm_match_write_node_t *) node;
1327
1328
            // Visit the call field
1329
1.16k
            if (!pm_visit_node((const pm_node_t *) cast->call, visitor, data)) 
return 0
false0
;
  Branch (1329:17): [True: 0, False: 1.16k]
1330
1331
            // Visit the targets field
1332
1.16k
            const pm_node_list_t *targets = &cast->targets;
1333
4.34k
            for (size_t index = 0; index < targets->size; 
index++3.18k
) {
  Branch (1333:36): [True: 3.18k, False: 1.16k]
1334
3.18k
                if (!pm_visit_node(targets->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (1334:21): [True: 0, False: 3.18k]
1335
3.18k
            }
1336
1337
1.16k
            break;
1338
1.16k
        }
1339
1.40k
        case PM_MODULE_NODE: {
  Branch (1339:9): [True: 1.40k, False: 1.26M]
1340
1.40k
            const pm_module_node_t *cast = (const pm_module_node_t *) node;
1341
1342
            // Visit the constant_path field
1343
1.40k
            if (!pm_visit_node((const pm_node_t *) cast->constant_path, visitor, data)) 
return 0
false0
;
  Branch (1343:17): [True: 0, False: 1.40k]
1344
1345
            // Visit the body field
1346
1.40k
            if (cast->body != NULL && 
!pm_visit_node((const pm_node_t *) cast->body, visitor, data)1.25k
)
return 0
false0
;
  Branch (1346:17): [True: 1.25k, False: 145]
  Branch (1346:39): [True: 0, False: 1.25k]
1347
1348
1.40k
            break;
1349
1.40k
        }
1350
15.8k
        case PM_MULTI_TARGET_NODE: {
  Branch (1350:9): [True: 15.8k, False: 1.25M]
1351
15.8k
            const pm_multi_target_node_t *cast = (const pm_multi_target_node_t *) node;
1352
1353
            // Visit the lefts field
1354
15.8k
            const pm_node_list_t *lefts = &cast->lefts;
1355
34.4k
            for (size_t index = 0; index < lefts->size; 
index++18.6k
) {
  Branch (1355:36): [True: 18.6k, False: 15.8k]
1356
18.6k
                if (!pm_visit_node(lefts->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (1356:21): [True: 0, False: 18.6k]
1357
18.6k
            }
1358
1359
            // Visit the rest field
1360
15.8k
            if (cast->rest != NULL && 
!pm_visit_node((const pm_node_t *) cast->rest, visitor, data)8.15k
)
return 0
false0
;
  Branch (1360:17): [True: 8.15k, False: 7.65k]
  Branch (1360:39): [True: 0, False: 8.15k]
1361
1362
            // Visit the rights field
1363
15.8k
            const pm_node_list_t *rights = &cast->rights;
1364
21.2k
            for (size_t index = 0; index < rights->size; 
index++5.40k
) {
  Branch (1364:36): [True: 5.40k, False: 15.8k]
1365
5.40k
                if (!pm_visit_node(rights->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (1365:21): [True: 0, False: 5.40k]
1366
5.40k
            }
1367
1368
15.8k
            break;
1369
15.8k
        }
1370
15.8k
        case PM_MULTI_WRITE_NODE: {
  Branch (1370:9): [True: 11.7k, False: 1.25M]
1371
11.7k
            const pm_multi_write_node_t *cast = (const pm_multi_write_node_t *) node;
1372
1373
            // Visit the lefts field
1374
11.7k
            const pm_node_list_t *lefts = &cast->lefts;
1375
29.2k
            for (size_t index = 0; index < lefts->size; 
index++17.4k
) {
  Branch (1375:36): [True: 17.4k, False: 11.7k]
1376
17.4k
                if (!pm_visit_node(lefts->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (1376:21): [True: 0, False: 17.4k]
1377
17.4k
            }
1378
1379
            // Visit the rest field
1380
11.7k
            if (cast->rest != NULL && 
!pm_visit_node((const pm_node_t *) cast->rest, visitor, data)4.19k
)
return 0
false0
;
  Branch (1380:17): [True: 4.19k, False: 7.51k]
  Branch (1380:39): [True: 0, False: 4.19k]
1381
1382
            // Visit the rights field
1383
11.7k
            const pm_node_list_t *rights = &cast->rights;
1384
12.3k
            for (size_t index = 0; index < rights->size; 
index++625
) {
  Branch (1384:36): [True: 625, False: 11.7k]
1385
625
                if (!pm_visit_node(rights->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (1385:21): [True: 0, False: 625]
1386
625
            }
1387
1388
            // Visit the value field
1389
11.7k
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (1389:17): [True: 0, False: 11.7k]
1390
1391
11.7k
            break;
1392
11.7k
        }
1393
11.7k
        case PM_NEXT_NODE: {
  Branch (1393:9): [True: 145, False: 1.26M]
1394
145
            const pm_next_node_t *cast = (const pm_next_node_t *) node;
1395
1396
            // Visit the arguments field
1397
145
            if (cast->arguments != NULL && 
!pm_visit_node((const pm_node_t *) cast->arguments, visitor, data)18
)
return 0
false0
;
  Branch (1397:17): [True: 18, False: 127]
  Branch (1397:44): [True: 0, False: 18]
1398
1399
145
            break;
1400
145
        }
1401
1.43k
        case PM_NIL_NODE:
  Branch (1401:9): [True: 1.43k, False: 1.26M]
1402
1.43k
            break;
1403
1
        case PM_NO_BLOCK_PARAMETER_NODE:
  Branch (1403:9): [True: 1, False: 1.26M]
1404
1
            break;
1405
254
        case PM_NO_KEYWORDS_PARAMETER_NODE:
  Branch (1405:9): [True: 254, False: 1.26M]
1406
254
            break;
1407
100
        case PM_NUMBERED_PARAMETERS_NODE:
  Branch (1407:9): [True: 100, False: 1.26M]
1408
100
            break;
1409
373
        case PM_NUMBERED_REFERENCE_READ_NODE:
  Branch (1409:9): [True: 373, False: 1.26M]
1410
373
            break;
1411
2.90k
        case PM_OPTIONAL_KEYWORD_PARAMETER_NODE: {
  Branch (1411:9): [True: 2.90k, False: 1.26M]
1412
2.90k
            const pm_optional_keyword_parameter_node_t *cast = (const pm_optional_keyword_parameter_node_t *) node;
1413
1414
            // Visit the value field
1415
2.90k
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (1415:17): [True: 0, False: 2.90k]
1416
1417
2.90k
            break;
1418
2.90k
        }
1419
4.88k
        case PM_OPTIONAL_PARAMETER_NODE: {
  Branch (1419:9): [True: 4.88k, False: 1.26M]
1420
4.88k
            const pm_optional_parameter_node_t *cast = (const pm_optional_parameter_node_t *) node;
1421
1422
            // Visit the value field
1423
4.88k
            if (!pm_visit_node((const pm_node_t *) cast->value, visitor, data)) 
return 0
false0
;
  Branch (1423:17): [True: 0, False: 4.88k]
1424
1425
4.88k
            break;
1426
4.88k
        }
1427
4.88k
        case PM_OR_NODE: {
  Branch (1427:9): [True: 1.23k, False: 1.26M]
1428
1.23k
            const pm_or_node_t *cast = (const pm_or_node_t *) node;
1429
1430
            // Visit the left field
1431
1.23k
            if (!pm_visit_node((const pm_node_t *) cast->left, visitor, data)) 
return 0
false0
;
  Branch (1431:17): [True: 0, False: 1.23k]
1432
1433
            // Visit the right field
1434
1.23k
            if (!pm_visit_node((const pm_node_t *) cast->right, visitor, data)) 
return 0
false0
;
  Branch (1434:17): [True: 0, False: 1.23k]
1435
1436
1.23k
            break;
1437
1.23k
        }
1438
24.2k
        case PM_PARAMETERS_NODE: {
  Branch (1438:9): [True: 24.2k, False: 1.24M]
1439
24.2k
            const pm_parameters_node_t *cast = (const pm_parameters_node_t *) node;
1440
1441
            // Visit the requireds field
1442
24.2k
            const pm_node_list_t *requireds = &cast->requireds;
1443
40.0k
            for (size_t index = 0; index < requireds->size; 
index++15.7k
) {
  Branch (1443:36): [True: 15.7k, False: 24.2k]
1444
15.7k
                if (!pm_visit_node(requireds->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (1444:21): [True: 0, False: 15.7k]
1445
15.7k
            }
1446
1447
            // Visit the optionals field
1448
24.2k
            const pm_node_list_t *optionals = &cast->optionals;
1449
29.1k
            for (size_t index = 0; index < optionals->size; 
index++4.88k
) {
  Branch (1449:36): [True: 4.88k, False: 24.2k]
1450
4.88k
                if (!pm_visit_node(optionals->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (1450:21): [True: 0, False: 4.88k]
1451
4.88k
            }
1452
1453
            // Visit the rest field
1454
24.2k
            if (cast->rest != NULL && 
!pm_visit_node((const pm_node_t *) cast->rest, visitor, data)5.53k
)
return 0
false0
;
  Branch (1454:17): [True: 5.53k, False: 18.7k]
  Branch (1454:39): [True: 0, False: 5.53k]
1455
1456
            // Visit the posts field
1457
24.2k
            const pm_node_list_t *posts = &cast->posts;
1458
26.8k
            for (size_t index = 0; index < posts->size; 
index++2.59k
) {
  Branch (1458:36): [True: 2.59k, False: 24.2k]
1459
2.59k
                if (!pm_visit_node(posts->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (1459:21): [True: 0, False: 2.59k]
1460
2.59k
            }
1461
1462
            // Visit the keywords field
1463
24.2k
            const pm_node_list_t *keywords = &cast->keywords;
1464
29.0k
            for (size_t index = 0; index < keywords->size; 
index++4.77k
) {
  Branch (1464:36): [True: 4.77k, False: 24.2k]
1465
4.77k
                if (!pm_visit_node(keywords->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (1465:21): [True: 0, False: 4.77k]
1466
4.77k
            }
1467
1468
            // Visit the keyword_rest field
1469
24.2k
            if (cast->keyword_rest != NULL && 
!pm_visit_node((const pm_node_t *) cast->keyword_rest, visitor, data)2.51k
)
return 0
false0
;
  Branch (1469:17): [True: 2.51k, False: 21.7k]
  Branch (1469:47): [True: 0, False: 2.51k]
1470
1471
            // Visit the block field
1472
24.2k
            if (cast->block != NULL && 
!pm_visit_node((const pm_node_t *) cast->block, visitor, data)7.36k
)
return 0
false0
;
  Branch (1472:17): [True: 7.36k, False: 16.8k]
  Branch (1472:40): [True: 0, False: 7.36k]
1473
1474
24.2k
            break;
1475
24.2k
        }
1476
25.9k
        case PM_PARENTHESES_NODE: {
  Branch (1476:9): [True: 25.9k, False: 1.24M]
1477
25.9k
            const pm_parentheses_node_t *cast = (const pm_parentheses_node_t *) node;
1478
1479
            // Visit the body field
1480
25.9k
            if (cast->body != NULL && 
!pm_visit_node((const pm_node_t *) cast->body, visitor, data)25.3k
)
return 0
false0
;
  Branch (1480:17): [True: 25.3k, False: 653]
  Branch (1480:39): [True: 0, False: 25.3k]
1481
1482
25.9k
            break;
1483
25.9k
        }
1484
25.9k
        case PM_PINNED_EXPRESSION_NODE: {
  Branch (1484:9): [True: 397, False: 1.26M]
1485
397
            const pm_pinned_expression_node_t *cast = (const pm_pinned_expression_node_t *) node;
1486
1487
            // Visit the expression field
1488
397
            if (!pm_visit_node((const pm_node_t *) cast->expression, visitor, data)) 
return 0
false0
;
  Branch (1488:17): [True: 0, False: 397]
1489
1490
397
            break;
1491
397
        }
1492
730
        case PM_PINNED_VARIABLE_NODE: {
  Branch (1492:9): [True: 730, False: 1.26M]
1493
730
            const pm_pinned_variable_node_t *cast = (const pm_pinned_variable_node_t *) node;
1494
1495
            // Visit the variable field
1496
730
            if (!pm_visit_node((const pm_node_t *) cast->variable, visitor, data)) 
return 0
false0
;
  Branch (1496:17): [True: 0, False: 730]
1497
1498
730
            break;
1499
730
        }
1500
730
        case PM_POST_EXECUTION_NODE: {
  Branch (1500:9): [True: 611, False: 1.26M]
1501
611
            const pm_post_execution_node_t *cast = (const pm_post_execution_node_t *) node;
1502
1503
            // Visit the statements field
1504
611
            if (cast->statements != NULL && 
!pm_visit_node((const pm_node_t *) cast->statements, visitor, data)594
)
return 0
false0
;
  Branch (1504:17): [True: 594, False: 17]
  Branch (1504:45): [True: 0, False: 594]
1505
1506
611
            break;
1507
611
        }
1508
611
        case PM_PRE_EXECUTION_NODE: {
  Branch (1508:9): [True: 102, False: 1.26M]
1509
102
            const pm_pre_execution_node_t *cast = (const pm_pre_execution_node_t *) node;
1510
1511
            // Visit the statements field
1512
102
            if (cast->statements != NULL && 
!pm_visit_node((const pm_node_t *) cast->statements, visitor, data)94
)
return 0
false0
;
  Branch (1512:17): [True: 94, False: 8]
  Branch (1512:45): [True: 0, False: 94]
1513
1514
102
            break;
1515
102
        }
1516
16.2k
        case PM_PROGRAM_NODE: {
  Branch (1516:9): [True: 16.2k, False: 1.24M]
1517
16.2k
            const pm_program_node_t *cast = (const pm_program_node_t *) node;
1518
1519
            // Visit the statements field
1520
16.2k
            if (!pm_visit_node((const pm_node_t *) cast->statements, visitor, data)) 
return 0
false0
;
  Branch (1520:17): [True: 0, False: 16.2k]
1521
1522
16.2k
            break;
1523
16.2k
        }
1524
16.2k
        case PM_RANGE_NODE: {
  Branch (1524:9): [True: 5.80k, False: 1.26M]
1525
5.80k
            const pm_range_node_t *cast = (const pm_range_node_t *) node;
1526
1527
            // Visit the left field
1528
5.80k
            if (cast->left != NULL && 
!pm_visit_node((const pm_node_t *) cast->left, visitor, data)4.38k
)
return 0
false0
;
  Branch (1528:17): [True: 4.38k, False: 1.41k]
  Branch (1528:39): [True: 0, False: 4.38k]
1529
1530
            // Visit the right field
1531
5.80k
            if (cast->right != NULL && 
!pm_visit_node((const pm_node_t *) cast->right, visitor, data)5.47k
)
return 0
false0
;
  Branch (1531:17): [True: 5.47k, False: 331]
  Branch (1531:40): [True: 0, False: 5.47k]
1532
1533
5.80k
            break;
1534
5.80k
        }
1535
5.80k
        case PM_RATIONAL_NODE:
  Branch (1535:9): [True: 2.27k, False: 1.26M]
1536
2.27k
            break;
1537
72
        case PM_REDO_NODE:
  Branch (1537:9): [True: 72, False: 1.26M]
1538
72
            break;
1539
6.94k
        case PM_REGULAR_EXPRESSION_NODE:
  Branch (1539:9): [True: 6.94k, False: 1.25M]
1540
6.94k
            break;
1541
1.87k
        case PM_REQUIRED_KEYWORD_PARAMETER_NODE:
  Branch (1541:9): [True: 1.87k, False: 1.26M]
1542
1.87k
            break;
1543
24.3k
        case PM_REQUIRED_PARAMETER_NODE:
  Branch (1543:9): [True: 24.3k, False: 1.24M]
1544
24.3k
            break;
1545
1.70k
        case PM_RESCUE_MODIFIER_NODE: {
  Branch (1545:9): [True: 1.70k, False: 1.26M]
1546
1.70k
            const pm_rescue_modifier_node_t *cast = (const pm_rescue_modifier_node_t *) node;
1547
1548
            // Visit the expression field
1549
1.70k
            if (!pm_visit_node((const pm_node_t *) cast->expression, visitor, data)) 
return 0
false0
;
  Branch (1549:17): [True: 0, False: 1.70k]
1550
1551
            // Visit the rescue_expression field
1552
1.70k
            if (!pm_visit_node((const pm_node_t *) cast->rescue_expression, visitor, data)) 
return 0
false0
;
  Branch (1552:17): [True: 0, False: 1.70k]
1553
1554
1.70k
            break;
1555
1.70k
        }
1556
1.70k
        case PM_RESCUE_NODE: {
  Branch (1556:9): [True: 1.52k, False: 1.26M]
1557
1.52k
            const pm_rescue_node_t *cast = (const pm_rescue_node_t *) node;
1558
1559
            // Visit the exceptions field
1560
1.52k
            const pm_node_list_t *exceptions = &cast->exceptions;
1561
2.01k
            for (size_t index = 0; index < exceptions->size; 
index++485
) {
  Branch (1561:36): [True: 485, False: 1.52k]
1562
485
                if (!pm_visit_node(exceptions->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (1562:21): [True: 0, False: 485]
1563
485
            }
1564
1565
            // Visit the reference field
1566
1.52k
            if (cast->reference != NULL && 
!pm_visit_node((const pm_node_t *) cast->reference, visitor, data)254
)
return 0
false0
;
  Branch (1566:17): [True: 254, False: 1.27k]
  Branch (1566:44): [True: 0, False: 254]
1567
1568
            // Visit the statements field
1569
1.52k
            if (cast->statements != NULL && 
!pm_visit_node((const pm_node_t *) cast->statements, visitor, data)783
)
return 0
false0
;
  Branch (1569:17): [True: 783, False: 744]
  Branch (1569:45): [True: 0, False: 783]
1570
1571
            // Visit the subsequent field
1572
1.52k
            if (cast->subsequent != NULL && 
!pm_visit_node((const pm_node_t *) cast->subsequent, visitor, data)107
)
return 0
false0
;
  Branch (1572:17): [True: 107, False: 1.42k]
  Branch (1572:45): [True: 0, False: 107]
1573
1574
1.52k
            break;
1575
1.52k
        }
1576
5.52k
        case PM_REST_PARAMETER_NODE:
  Branch (1576:9): [True: 5.52k, False: 1.26M]
1577
5.52k
            break;
1578
318
        case PM_RETRY_NODE:
  Branch (1578:9): [True: 318, False: 1.26M]
1579
318
            break;
1580
1.78k
        case PM_RETURN_NODE: {
  Branch (1580:9): [True: 1.78k, False: 1.26M]
1581
1.78k
            const pm_return_node_t *cast = (const pm_return_node_t *) node;
1582
1583
            // Visit the arguments field
1584
1.78k
            if (cast->arguments != NULL && 
!pm_visit_node((const pm_node_t *) cast->arguments, visitor, data)367
)
return 0
false0
;
  Branch (1584:17): [True: 367, False: 1.42k]
  Branch (1584:44): [True: 0, False: 367]
1585
1586
1.78k
            break;
1587
1.78k
        }
1588
1.78k
        case PM_SELF_NODE:
  Branch (1588:9): [True: 1.30k, False: 1.26M]
1589
1.30k
            break;
1590
0
        case PM_SHAREABLE_CONSTANT_NODE: {
  Branch (1590:9): [True: 0, False: 1.26M]
1591
0
            const pm_shareable_constant_node_t *cast = (const pm_shareable_constant_node_t *) node;
1592
1593
            // Visit the write field
1594
0
            if (!pm_visit_node((const pm_node_t *) cast->write, visitor, data)) return false;
  Branch (1594:17): [True: 0, False: 0]
1595
1596
0
            break;
1597
0
        }
1598
1.08k
        case PM_SINGLETON_CLASS_NODE: {
  Branch (1598:9): [True: 1.08k, False: 1.26M]
1599
1.08k
            const pm_singleton_class_node_t *cast = (const pm_singleton_class_node_t *) node;
1600
1601
            // Visit the expression field
1602
1.08k
            if (!pm_visit_node((const pm_node_t *) cast->expression, visitor, data)) 
return 0
false0
;
  Branch (1602:17): [True: 0, False: 1.08k]
1603
1604
            // Visit the body field
1605
1.08k
            if (cast->body != NULL && 
!pm_visit_node((const pm_node_t *) cast->body, visitor, data)941
)
return 0
false0
;
  Branch (1605:17): [True: 941, False: 142]
  Branch (1605:39): [True: 0, False: 941]
1606
1607
1.08k
            break;
1608
1.08k
        }
1609
1.08k
        case PM_SOURCE_ENCODING_NODE:
  Branch (1609:9): [True: 300, False: 1.26M]
1610
300
            break;
1611
348
        case PM_SOURCE_FILE_NODE:
  Branch (1611:9): [True: 348, False: 1.26M]
1612
348
            break;
1613
373
        case PM_SOURCE_LINE_NODE:
  Branch (1613:9): [True: 373, False: 1.26M]
1614
373
            break;
1615
17.4k
        case PM_SPLAT_NODE: {
  Branch (1615:9): [True: 17.4k, False: 1.24M]
1616
17.4k
            const pm_splat_node_t *cast = (const pm_splat_node_t *) node;
1617
1618
            // Visit the expression field
1619
17.4k
            if (cast->expression != NULL && 
!pm_visit_node((const pm_node_t *) cast->expression, visitor, data)11.9k
)
return 0
false0
;
  Branch (1619:17): [True: 11.9k, False: 5.48k]
  Branch (1619:45): [True: 0, False: 11.9k]
1620
1621
17.4k
            break;
1622
17.4k
        }
1623
87.8k
        case PM_STATEMENTS_NODE: {
  Branch (1623:9): [True: 87.8k, False: 1.17M]
1624
87.8k
            const pm_statements_node_t *cast = (const pm_statements_node_t *) node;
1625
1626
            // Visit the body field
1627
87.8k
            const pm_node_list_t *body = &cast->body;
1628
449k
            for (size_t index = 0; index < body->size; 
index++361k
) {
  Branch (1628:36): [True: 361k, False: 87.8k]
1629
361k
                if (!pm_visit_node(body->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (1629:21): [True: 0, False: 361k]
1630
361k
            }
1631
1632
87.8k
            break;
1633
87.8k
        }
1634
87.8k
        case PM_STRING_NODE:
  Branch (1634:9): [True: 64.5k, False: 1.20M]
1635
64.5k
            break;
1636
260
        case PM_SUPER_NODE: {
  Branch (1636:9): [True: 260, False: 1.26M]
1637
260
            const pm_super_node_t *cast = (const pm_super_node_t *) node;
1638
1639
            // Visit the arguments field
1640
260
            if (cast->arguments != NULL && 
!pm_visit_node((const pm_node_t *) cast->arguments, visitor, data)166
)
return 0
false0
;
  Branch (1640:17): [True: 166, False: 94]
  Branch (1640:44): [True: 0, False: 166]
1641
1642
            // Visit the block field
1643
260
            if (cast->block != NULL && 
!pm_visit_node((const pm_node_t *) cast->block, visitor, data)124
)
return 0
false0
;
  Branch (1643:17): [True: 124, False: 136]
  Branch (1643:40): [True: 0, False: 124]
1644
1645
260
            break;
1646
260
        }
1647
33.6k
        case PM_SYMBOL_NODE:
  Branch (1647:9): [True: 33.6k, False: 1.23M]
1648
33.6k
            break;
1649
7.96k
        case PM_TRUE_NODE:
  Branch (1649:9): [True: 7.96k, False: 1.25M]
1650
7.96k
            break;
1651
383
        case PM_UNDEF_NODE: {
  Branch (1651:9): [True: 383, False: 1.26M]
1652
383
            const pm_undef_node_t *cast = (const pm_undef_node_t *) node;
1653
1654
            // Visit the names field
1655
383
            const pm_node_list_t *names = &cast->names;
1656
789
            for (size_t index = 0; index < names->size; 
index++406
) {
  Branch (1656:36): [True: 406, False: 383]
1657
406
                if (!pm_visit_node(names->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (1657:21): [True: 0, False: 406]
1658
406
            }
1659
1660
383
            break;
1661
383
        }
1662
383
        case PM_UNLESS_NODE: {
  Branch (1662:9): [True: 105, False: 1.26M]
1663
105
            const pm_unless_node_t *cast = (const pm_unless_node_t *) node;
1664
1665
            // Visit the predicate field
1666
105
            if (!pm_visit_node((const pm_node_t *) cast->predicate, visitor, data)) 
return 0
false0
;
  Branch (1666:17): [True: 0, False: 105]
1667
1668
            // Visit the statements field
1669
105
            if (cast->statements != NULL && 
!pm_visit_node((const pm_node_t *) cast->statements, visitor, data)95
)
return 0
false0
;
  Branch (1669:17): [True: 95, False: 10]
  Branch (1669:45): [True: 0, False: 95]
1670
1671
            // Visit the else_clause field
1672
105
            if (cast->else_clause != NULL && 
!pm_visit_node((const pm_node_t *) cast->else_clause, visitor, data)13
)
return 0
false0
;
  Branch (1672:17): [True: 13, False: 92]
  Branch (1672:46): [True: 0, False: 13]
1673
1674
105
            break;
1675
105
        }
1676
879
        case PM_UNTIL_NODE: {
  Branch (1676:9): [True: 879, False: 1.26M]
1677
879
            const pm_until_node_t *cast = (const pm_until_node_t *) node;
1678
1679
            // Visit the predicate field
1680
879
            if (!pm_visit_node((const pm_node_t *) cast->predicate, visitor, data)) 
return 0
false0
;
  Branch (1680:17): [True: 0, False: 879]
1681
1682
            // Visit the statements field
1683
879
            if (cast->statements != NULL && 
!pm_visit_node((const pm_node_t *) cast->statements, visitor, data)621
)
return 0
false0
;
  Branch (1683:17): [True: 621, False: 258]
  Branch (1683:45): [True: 0, False: 621]
1684
1685
879
            break;
1686
879
        }
1687
879
        case PM_WHEN_NODE: {
  Branch (1687:9): [True: 692, False: 1.26M]
1688
692
            const pm_when_node_t *cast = (const pm_when_node_t *) node;
1689
1690
            // Visit the conditions field
1691
692
            const pm_node_list_t *conditions = &cast->conditions;
1692
1.46k
            for (size_t index = 0; index < conditions->size; 
index++775
) {
  Branch (1692:36): [True: 775, False: 692]
1693
775
                if (!pm_visit_node(conditions->nodes[index], visitor, data)) 
return 0
false0
;
  Branch (1693:21): [True: 0, False: 775]
1694
775
            }
1695
1696
            // Visit the statements field
1697
692
            if (cast->statements != NULL && 
!pm_visit_node((const pm_node_t *) cast->statements, visitor, data)286
)
return 0
false0
;
  Branch (1697:17): [True: 286, False: 406]
  Branch (1697:45): [True: 0, False: 286]
1698
1699
692
            break;
1700
692
        }
1701
4.02k
        case PM_WHILE_NODE: {
  Branch (1701:9): [True: 4.02k, False: 1.26M]
1702
4.02k
            const pm_while_node_t *cast = (const pm_while_node_t *) node;
1703
1704
            // Visit the predicate field
1705
4.02k
            if (!pm_visit_node((const pm_node_t *) cast->predicate, visitor, data)) 
return 0
false0
;
  Branch (1705:17): [True: 0, False: 4.02k]
1706
1707
            // Visit the statements field
1708
4.02k
            if (cast->statements != NULL && 
!pm_visit_node((const pm_node_t *) cast->statements, visitor, data)3.79k
)
return 0
false0
;
  Branch (1708:17): [True: 3.79k, False: 225]
  Branch (1708:45): [True: 0, False: 3.79k]
1709
1710
4.02k
            break;
1711
4.02k
        }
1712
4.02k
        case PM_X_STRING_NODE:
  Branch (1712:9): [True: 1.85k, False: 1.26M]
1713
1.85k
            break;
1714
131
        case PM_YIELD_NODE: {
  Branch (1714:9): [True: 131, False: 1.26M]
1715
131
            const pm_yield_node_t *cast = (const pm_yield_node_t *) node;
1716
1717
            // Visit the arguments field
1718
131
            if (cast->arguments != NULL && 
!pm_visit_node((const pm_node_t *) cast->arguments, visitor, data)59
)
return 0
false0
;
  Branch (1718:17): [True: 59, False: 72]
  Branch (1718:44): [True: 0, False: 59]
1719
1720
131
            break;
1721
131
        }
1722
131
        case PM_SCOPE_NODE:
  Branch (1722:9): [True: 0, False: 1.26M]
1723
0
            break;
1724
1.26M
    }
1725
1726
1.24M
    return true;
1727
1.26M
}
1728
1729
/**
1730
 * Allocate and initialize a new AliasGlobalVariableNode node.
1731
 */
1732
pm_alias_global_variable_node_t *
1733
100
pm_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) {
1734
100
    pm_alias_global_variable_node_t *node = (pm_alias_global_variable_node_t *) pm_arena_alloc(arena, sizeof(pm_alias_global_variable_node_t), PRISM_ALIGNOF(pm_alias_global_variable_node_t));
1735
1736
100
    *node = (pm_alias_global_variable_node_t) {
1737
100
        .base = { .type = PM_ALIAS_GLOBAL_VARIABLE_NODE, .flags = flags, .node_id = node_id, .location = location },
1738
100
        .new_name = new_name,
1739
100
        .old_name = old_name,
1740
100
        .keyword_loc = keyword_loc
1741
100
    };
1742
1743
100
    return node;
1744
100
}
1745
1746
/**
1747
 * Allocate and initialize a new AliasMethodNode node.
1748
 */
1749
pm_alias_method_node_t *
1750
770
pm_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) {
1751
770
    pm_alias_method_node_t *node = (pm_alias_method_node_t *) pm_arena_alloc(arena, sizeof(pm_alias_method_node_t), PRISM_ALIGNOF(pm_alias_method_node_t));
1752
1753
770
    *node = (pm_alias_method_node_t) {
1754
770
        .base = { .type = PM_ALIAS_METHOD_NODE, .flags = flags, .node_id = node_id, .location = location },
1755
770
        .new_name = new_name,
1756
770
        .old_name = old_name,
1757
770
        .keyword_loc = keyword_loc
1758
770
    };
1759
1760
770
    return node;
1761
770
}
1762
1763
/**
1764
 * Allocate and initialize a new AlternationPatternNode node.
1765
 */
1766
pm_alternation_pattern_node_t *
1767
925
pm_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) {
1768
925
    pm_alternation_pattern_node_t *node = (pm_alternation_pattern_node_t *) pm_arena_alloc(arena, sizeof(pm_alternation_pattern_node_t), PRISM_ALIGNOF(pm_alternation_pattern_node_t));
1769
1770
925
    *node = (pm_alternation_pattern_node_t) {
1771
925
        .base = { .type = PM_ALTERNATION_PATTERN_NODE, .flags = flags, .node_id = node_id, .location = location },
1772
925
        .left = left,
1773
925
        .right = right,
1774
925
        .operator_loc = operator_loc
1775
925
    };
1776
1777
925
    return node;
1778
925
}
1779
1780
/**
1781
 * Allocate and initialize a new AndNode node.
1782
 */
1783
pm_and_node_t *
1784
1.27k
pm_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) {
1785
1.27k
    pm_and_node_t *node = (pm_and_node_t *) pm_arena_alloc(arena, sizeof(pm_and_node_t), PRISM_ALIGNOF(pm_and_node_t));
1786
1787
1.27k
    *node = (pm_and_node_t) {
1788
1.27k
        .base = { .type = PM_AND_NODE, .flags = flags, .node_id = node_id, .location = location },
1789
1.27k
        .left = left,
1790
1.27k
        .right = right,
1791
1.27k
        .operator_loc = operator_loc
1792
1.27k
    };
1793
1794
1.27k
    return node;
1795
1.27k
}
1796
1797
/**
1798
 * Allocate and initialize a new ArgumentsNode node.
1799
 */
1800
pm_arguments_node_t *
1801
81.3k
pm_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) {
1802
81.3k
    pm_arguments_node_t *node = (pm_arguments_node_t *) pm_arena_alloc(arena, sizeof(pm_arguments_node_t), PRISM_ALIGNOF(pm_arguments_node_t));
1803
1804
81.3k
    *node = (pm_arguments_node_t) {
1805
81.3k
        .base = { .type = PM_ARGUMENTS_NODE, .flags = flags, .node_id = node_id, .location = location },
1806
81.3k
        .arguments = arguments
1807
81.3k
    };
1808
1809
81.3k
    return node;
1810
81.3k
}
1811
1812
/**
1813
 * Allocate and initialize a new ArrayNode node.
1814
 */
1815
pm_array_node_t *
1816
52.3k
pm_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) {
1817
52.3k
    pm_array_node_t *node = (pm_array_node_t *) pm_arena_alloc(arena, sizeof(pm_array_node_t), PRISM_ALIGNOF(pm_array_node_t));
1818
1819
52.3k
    *node = (pm_array_node_t) {
1820
52.3k
        .base = { .type = PM_ARRAY_NODE, .flags = flags, .node_id = node_id, .location = location },
1821
52.3k
        .elements = elements,
1822
52.3k
        .opening_loc = opening_loc,
1823
52.3k
        .closing_loc = closing_loc
1824
52.3k
    };
1825
1826
52.3k
    return node;
1827
52.3k
}
1828
1829
/**
1830
 * Allocate and initialize a new ArrayPatternNode node.
1831
 */
1832
pm_array_pattern_node_t *
1833
4.97k
pm_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) {
1834
4.97k
    pm_array_pattern_node_t *node = (pm_array_pattern_node_t *) pm_arena_alloc(arena, sizeof(pm_array_pattern_node_t), PRISM_ALIGNOF(pm_array_pattern_node_t));
1835
1836
4.97k
    *node = (pm_array_pattern_node_t) {
1837
4.97k
        .base = { .type = PM_ARRAY_PATTERN_NODE, .flags = flags, .node_id = node_id, .location = location },
1838
4.97k
        .constant = constant,
1839
4.97k
        .requireds = requireds,
1840
4.97k
        .rest = rest,
1841
4.97k
        .posts = posts,
1842
4.97k
        .opening_loc = opening_loc,
1843
4.97k
        .closing_loc = closing_loc
1844
4.97k
    };
1845
1846
4.97k
    return node;
1847
4.97k
}
1848
1849
/**
1850
 * Allocate and initialize a new AssocNode node.
1851
 */
1852
pm_assoc_node_t *
1853
25.3k
pm_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) {
1854
25.3k
    pm_assoc_node_t *node = (pm_assoc_node_t *) pm_arena_alloc(arena, sizeof(pm_assoc_node_t), PRISM_ALIGNOF(pm_assoc_node_t));
1855
1856
25.3k
    *node = (pm_assoc_node_t) {
1857
25.3k
        .base = { .type = PM_ASSOC_NODE, .flags = flags, .node_id = node_id, .location = location },
1858
25.3k
        .key = key,
1859
25.3k
        .value = value,
1860
25.3k
        .operator_loc = operator_loc
1861
25.3k
    };
1862
1863
25.3k
    return node;
1864
25.3k
}
1865
1866
/**
1867
 * Allocate and initialize a new AssocSplatNode node.
1868
 */
1869
pm_assoc_splat_node_t *
1870
2.99k
pm_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) {
1871
2.99k
    pm_assoc_splat_node_t *node = (pm_assoc_splat_node_t *) pm_arena_alloc(arena, sizeof(pm_assoc_splat_node_t), PRISM_ALIGNOF(pm_assoc_splat_node_t));
1872
1873
2.99k
    *node = (pm_assoc_splat_node_t) {
1874
2.99k
        .base = { .type = PM_ASSOC_SPLAT_NODE, .flags = flags, .node_id = node_id, .location = location },
1875
2.99k
        .value = value,
1876
2.99k
        .operator_loc = operator_loc
1877
2.99k
    };
1878
1879
2.99k
    return node;
1880
2.99k
}
1881
1882
/**
1883
 * Allocate and initialize a new BackReferenceReadNode node.
1884
 */
1885
pm_back_reference_read_node_t *
1886
186
pm_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) {
1887
186
    pm_back_reference_read_node_t *node = (pm_back_reference_read_node_t *) pm_arena_alloc(arena, sizeof(pm_back_reference_read_node_t), PRISM_ALIGNOF(pm_back_reference_read_node_t));
1888
1889
186
    *node = (pm_back_reference_read_node_t) {
1890
186
        .base = { .type = PM_BACK_REFERENCE_READ_NODE, .flags = flags, .node_id = node_id, .location = location },
1891
186
        .name = name
1892
186
    };
1893
1894
186
    return node;
1895
186
}
1896
1897
/**
1898
 * Allocate and initialize a new BeginNode node.
1899
 */
1900
pm_begin_node_t *
1901
2.79k
pm_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) {
1902
2.79k
    pm_begin_node_t *node = (pm_begin_node_t *) pm_arena_alloc(arena, sizeof(pm_begin_node_t), PRISM_ALIGNOF(pm_begin_node_t));
1903
1904
2.79k
    *node = (pm_begin_node_t) {
1905
2.79k
        .base = { .type = PM_BEGIN_NODE, .flags = flags, .node_id = node_id, .location = location },
1906
2.79k
        .begin_keyword_loc = begin_keyword_loc,
1907
2.79k
        .statements = statements,
1908
2.79k
        .rescue_clause = rescue_clause,
1909
2.79k
        .else_clause = else_clause,
1910
2.79k
        .ensure_clause = ensure_clause,
1911
2.79k
        .end_keyword_loc = end_keyword_loc
1912
2.79k
    };
1913
1914
2.79k
    return node;
1915
2.79k
}
1916
1917
/**
1918
 * Allocate and initialize a new BlockArgumentNode node.
1919
 */
1920
pm_block_argument_node_t *
1921
1.45k
pm_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) {
1922
1.45k
    pm_block_argument_node_t *node = (pm_block_argument_node_t *) pm_arena_alloc(arena, sizeof(pm_block_argument_node_t), PRISM_ALIGNOF(pm_block_argument_node_t));
1923
1924
1.45k
    *node = (pm_block_argument_node_t) {
1925
1.45k
        .base = { .type = PM_BLOCK_ARGUMENT_NODE, .flags = flags, .node_id = node_id, .location = location },
1926
1.45k
        .expression = expression,
1927
1.45k
        .operator_loc = operator_loc
1928
1.45k
    };
1929
1930
1.45k
    return node;
1931
1.45k
}
1932
1933
/**
1934
 * Allocate and initialize a new BlockLocalVariableNode node.
1935
 */
1936
pm_block_local_variable_node_t *
1937
644
pm_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) {
1938
644
    pm_block_local_variable_node_t *node = (pm_block_local_variable_node_t *) pm_arena_alloc(arena, sizeof(pm_block_local_variable_node_t), PRISM_ALIGNOF(pm_block_local_variable_node_t));
1939
1940
644
    *node = (pm_block_local_variable_node_t) {
1941
644
        .base = { .type = PM_BLOCK_LOCAL_VARIABLE_NODE, .flags = flags, .node_id = node_id, .location = location },
1942
644
        .name = name
1943
644
    };
1944
1945
644
    return node;
1946
644
}
1947
1948
/**
1949
 * Allocate and initialize a new BlockNode node.
1950
 */
1951
pm_block_node_t *
1952
8.21k
pm_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) {
1953
8.21k
    pm_block_node_t *node = (pm_block_node_t *) pm_arena_alloc(arena, sizeof(pm_block_node_t), PRISM_ALIGNOF(pm_block_node_t));
1954
1955
8.21k
    *node = (pm_block_node_t) {
1956
8.21k
        .base = { .type = PM_BLOCK_NODE, .flags = flags, .node_id = node_id, .location = location },
1957
8.21k
        .locals = locals,
1958
8.21k
        .parameters = parameters,
1959
8.21k
        .body = body,
1960
8.21k
        .opening_loc = opening_loc,
1961
8.21k
        .closing_loc = closing_loc
1962
8.21k
    };
1963
1964
8.21k
    return node;
1965
8.21k
}
1966
1967
/**
1968
 * Allocate and initialize a new BlockParameterNode node.
1969
 */
1970
pm_block_parameter_node_t *
1971
5.71k
pm_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) {
1972
5.71k
    pm_block_parameter_node_t *node = (pm_block_parameter_node_t *) pm_arena_alloc(arena, sizeof(pm_block_parameter_node_t), PRISM_ALIGNOF(pm_block_parameter_node_t));
1973
1974
5.71k
    *node = (pm_block_parameter_node_t) {
1975
5.71k
        .base = { .type = PM_BLOCK_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
1976
5.71k
        .name = name,
1977
5.71k
        .name_loc = name_loc,
1978
5.71k
        .operator_loc = operator_loc
1979
5.71k
    };
1980
1981
5.71k
    return node;
1982
5.71k
}
1983
1984
/**
1985
 * Allocate and initialize a new BlockParametersNode node.
1986
 */
1987
pm_block_parameters_node_t *
1988
2.66k
pm_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) {
1989
2.66k
    pm_block_parameters_node_t *node = (pm_block_parameters_node_t *) pm_arena_alloc(arena, sizeof(pm_block_parameters_node_t), PRISM_ALIGNOF(pm_block_parameters_node_t));
1990
1991
2.66k
    *node = (pm_block_parameters_node_t) {
1992
2.66k
        .base = { .type = PM_BLOCK_PARAMETERS_NODE, .flags = flags, .node_id = node_id, .location = location },
1993
2.66k
        .parameters = parameters,
1994
2.66k
        .locals = locals,
1995
2.66k
        .opening_loc = opening_loc,
1996
2.66k
        .closing_loc = closing_loc
1997
2.66k
    };
1998
1999
2.66k
    return node;
2000
2.66k
}
2001
2002
/**
2003
 * Allocate and initialize a new BreakNode node.
2004
 */
2005
pm_break_node_t *
2006
2.67k
pm_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) {
2007
2.67k
    pm_break_node_t *node = (pm_break_node_t *) pm_arena_alloc(arena, sizeof(pm_break_node_t), PRISM_ALIGNOF(pm_break_node_t));
2008
2009
2.67k
    *node = (pm_break_node_t) {
2010
2.67k
        .base = { .type = PM_BREAK_NODE, .flags = flags, .node_id = node_id, .location = location },
2011
2.67k
        .arguments = arguments,
2012
2.67k
        .keyword_loc = keyword_loc
2013
2.67k
    };
2014
2015
2.67k
    return node;
2016
2.67k
}
2017
2018
/**
2019
 * Allocate and initialize a new CallAndWriteNode node.
2020
 */
2021
pm_call_and_write_node_t *
2022
198
pm_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) {
2023
198
    pm_call_and_write_node_t *node = (pm_call_and_write_node_t *) pm_arena_alloc(arena, sizeof(pm_call_and_write_node_t), PRISM_ALIGNOF(pm_call_and_write_node_t));
2024
2025
198
    *node = (pm_call_and_write_node_t) {
2026
198
        .base = { .type = PM_CALL_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2027
198
        .receiver = receiver,
2028
198
        .call_operator_loc = call_operator_loc,
2029
198
        .message_loc = message_loc,
2030
198
        .read_name = read_name,
2031
198
        .write_name = write_name,
2032
198
        .operator_loc = operator_loc,
2033
198
        .value = value
2034
198
    };
2035
2036
198
    return node;
2037
198
}
2038
2039
/**
2040
 * Allocate and initialize a new CallNode node.
2041
 */
2042
pm_call_node_t *
2043
204k
pm_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) {
2044
204k
    pm_call_node_t *node = (pm_call_node_t *) pm_arena_alloc(arena, sizeof(pm_call_node_t), PRISM_ALIGNOF(pm_call_node_t));
2045
2046
204k
    *node = (pm_call_node_t) {
2047
204k
        .base = { .type = PM_CALL_NODE, .flags = flags, .node_id = node_id, .location = location },
2048
204k
        .receiver = receiver,
2049
204k
        .call_operator_loc = call_operator_loc,
2050
204k
        .name = name,
2051
204k
        .message_loc = message_loc,
2052
204k
        .opening_loc = opening_loc,
2053
204k
        .arguments = arguments,
2054
204k
        .closing_loc = closing_loc,
2055
204k
        .equal_loc = equal_loc,
2056
204k
        .block = block
2057
204k
    };
2058
2059
204k
    return node;
2060
204k
}
2061
2062
/**
2063
 * Allocate and initialize a new CallOperatorWriteNode node.
2064
 */
2065
pm_call_operator_write_node_t *
2066
726
pm_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) {
2067
726
    pm_call_operator_write_node_t *node = (pm_call_operator_write_node_t *) pm_arena_alloc(arena, sizeof(pm_call_operator_write_node_t), PRISM_ALIGNOF(pm_call_operator_write_node_t));
2068
2069
726
    *node = (pm_call_operator_write_node_t) {
2070
726
        .base = { .type = PM_CALL_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2071
726
        .receiver = receiver,
2072
726
        .call_operator_loc = call_operator_loc,
2073
726
        .message_loc = message_loc,
2074
726
        .read_name = read_name,
2075
726
        .write_name = write_name,
2076
726
        .binary_operator = binary_operator,
2077
726
        .binary_operator_loc = binary_operator_loc,
2078
726
        .value = value
2079
726
    };
2080
2081
726
    return node;
2082
726
}
2083
2084
/**
2085
 * Allocate and initialize a new CallOrWriteNode node.
2086
 */
2087
pm_call_or_write_node_t *
2088
362
pm_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) {
2089
362
    pm_call_or_write_node_t *node = (pm_call_or_write_node_t *) pm_arena_alloc(arena, sizeof(pm_call_or_write_node_t), PRISM_ALIGNOF(pm_call_or_write_node_t));
2090
2091
362
    *node = (pm_call_or_write_node_t) {
2092
362
        .base = { .type = PM_CALL_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2093
362
        .receiver = receiver,
2094
362
        .call_operator_loc = call_operator_loc,
2095
362
        .message_loc = message_loc,
2096
362
        .read_name = read_name,
2097
362
        .write_name = write_name,
2098
362
        .operator_loc = operator_loc,
2099
362
        .value = value
2100
362
    };
2101
2102
362
    return node;
2103
362
}
2104
2105
/**
2106
 * Allocate and initialize a new CallTargetNode node.
2107
 */
2108
pm_call_target_node_t *
2109
2.26k
pm_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) {
2110
2.26k
    pm_call_target_node_t *node = (pm_call_target_node_t *) pm_arena_alloc(arena, sizeof(pm_call_target_node_t), PRISM_ALIGNOF(pm_call_target_node_t));
2111
2112
2.26k
    *node = (pm_call_target_node_t) {
2113
2.26k
        .base = { .type = PM_CALL_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
2114
2.26k
        .receiver = receiver,
2115
2.26k
        .call_operator_loc = call_operator_loc,
2116
2.26k
        .name = name,
2117
2.26k
        .message_loc = message_loc
2118
2.26k
    };
2119
2120
2.26k
    return node;
2121
2.26k
}
2122
2123
/**
2124
 * Allocate and initialize a new CapturePatternNode node.
2125
 */
2126
pm_capture_pattern_node_t *
2127
475
pm_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) {
2128
475
    pm_capture_pattern_node_t *node = (pm_capture_pattern_node_t *) pm_arena_alloc(arena, sizeof(pm_capture_pattern_node_t), PRISM_ALIGNOF(pm_capture_pattern_node_t));
2129
2130
475
    *node = (pm_capture_pattern_node_t) {
2131
475
        .base = { .type = PM_CAPTURE_PATTERN_NODE, .flags = flags, .node_id = node_id, .location = location },
2132
475
        .value = value,
2133
475
        .target = target,
2134
475
        .operator_loc = operator_loc
2135
475
    };
2136
2137
475
    return node;
2138
475
}
2139
2140
/**
2141
 * Allocate and initialize a new CaseMatchNode node.
2142
 */
2143
pm_case_match_node_t *
2144
4.23k
pm_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) {
2145
4.23k
    pm_case_match_node_t *node = (pm_case_match_node_t *) pm_arena_alloc(arena, sizeof(pm_case_match_node_t), PRISM_ALIGNOF(pm_case_match_node_t));
2146
2147
4.23k
    *node = (pm_case_match_node_t) {
2148
4.23k
        .base = { .type = PM_CASE_MATCH_NODE, .flags = flags, .node_id = node_id, .location = location },
2149
4.23k
        .predicate = predicate,
2150
4.23k
        .conditions = conditions,
2151
4.23k
        .else_clause = else_clause,
2152
4.23k
        .case_keyword_loc = case_keyword_loc,
2153
4.23k
        .end_keyword_loc = end_keyword_loc
2154
4.23k
    };
2155
2156
4.23k
    return node;
2157
4.23k
}
2158
2159
/**
2160
 * Allocate and initialize a new CaseNode node.
2161
 */
2162
pm_case_node_t *
2163
591
pm_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) {
2164
591
    pm_case_node_t *node = (pm_case_node_t *) pm_arena_alloc(arena, sizeof(pm_case_node_t), PRISM_ALIGNOF(pm_case_node_t));
2165
2166
591
    *node = (pm_case_node_t) {
2167
591
        .base = { .type = PM_CASE_NODE, .flags = flags, .node_id = node_id, .location = location },
2168
591
        .predicate = predicate,
2169
591
        .conditions = conditions,
2170
591
        .else_clause = else_clause,
2171
591
        .case_keyword_loc = case_keyword_loc,
2172
591
        .end_keyword_loc = end_keyword_loc
2173
591
    };
2174
2175
591
    return node;
2176
591
}
2177
2178
/**
2179
 * Allocate and initialize a new ClassNode node.
2180
 */
2181
pm_class_node_t *
2182
1.72k
pm_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) {
2183
1.72k
    pm_class_node_t *node = (pm_class_node_t *) pm_arena_alloc(arena, sizeof(pm_class_node_t), PRISM_ALIGNOF(pm_class_node_t));
2184
2185
1.72k
    *node = (pm_class_node_t) {
2186
1.72k
        .base = { .type = PM_CLASS_NODE, .flags = flags, .node_id = node_id, .location = location },
2187
1.72k
        .locals = locals,
2188
1.72k
        .class_keyword_loc = class_keyword_loc,
2189
1.72k
        .constant_path = constant_path,
2190
1.72k
        .inheritance_operator_loc = inheritance_operator_loc,
2191
1.72k
        .superclass = superclass,
2192
1.72k
        .body = body,
2193
1.72k
        .end_keyword_loc = end_keyword_loc,
2194
1.72k
        .name = name
2195
1.72k
    };
2196
2197
1.72k
    return node;
2198
1.72k
}
2199
2200
/**
2201
 * Allocate and initialize a new ClassVariableAndWriteNode node.
2202
 */
2203
pm_class_variable_and_write_node_t *
2204
17
pm_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) {
2205
17
    pm_class_variable_and_write_node_t *node = (pm_class_variable_and_write_node_t *) pm_arena_alloc(arena, sizeof(pm_class_variable_and_write_node_t), PRISM_ALIGNOF(pm_class_variable_and_write_node_t));
2206
2207
17
    *node = (pm_class_variable_and_write_node_t) {
2208
17
        .base = { .type = PM_CLASS_VARIABLE_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2209
17
        .name = name,
2210
17
        .name_loc = name_loc,
2211
17
        .operator_loc = operator_loc,
2212
17
        .value = value
2213
17
    };
2214
2215
17
    return node;
2216
17
}
2217
2218
/**
2219
 * Allocate and initialize a new ClassVariableOperatorWriteNode node.
2220
 */
2221
pm_class_variable_operator_write_node_t *
2222
9
pm_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) {
2223
9
    pm_class_variable_operator_write_node_t *node = (pm_class_variable_operator_write_node_t *) pm_arena_alloc(arena, sizeof(pm_class_variable_operator_write_node_t), PRISM_ALIGNOF(pm_class_variable_operator_write_node_t));
2224
2225
9
    *node = (pm_class_variable_operator_write_node_t) {
2226
9
        .base = { .type = PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2227
9
        .name = name,
2228
9
        .name_loc = name_loc,
2229
9
        .binary_operator_loc = binary_operator_loc,
2230
9
        .value = value,
2231
9
        .binary_operator = binary_operator
2232
9
    };
2233
2234
9
    return node;
2235
9
}
2236
2237
/**
2238
 * Allocate and initialize a new ClassVariableOrWriteNode node.
2239
 */
2240
pm_class_variable_or_write_node_t *
2241
15
pm_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) {
2242
15
    pm_class_variable_or_write_node_t *node = (pm_class_variable_or_write_node_t *) pm_arena_alloc(arena, sizeof(pm_class_variable_or_write_node_t), PRISM_ALIGNOF(pm_class_variable_or_write_node_t));
2243
2244
15
    *node = (pm_class_variable_or_write_node_t) {
2245
15
        .base = { .type = PM_CLASS_VARIABLE_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2246
15
        .name = name,
2247
15
        .name_loc = name_loc,
2248
15
        .operator_loc = operator_loc,
2249
15
        .value = value
2250
15
    };
2251
2252
15
    return node;
2253
15
}
2254
2255
/**
2256
 * Allocate and initialize a new ClassVariableReadNode node.
2257
 */
2258
pm_class_variable_read_node_t *
2259
3.18k
pm_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) {
2260
3.18k
    pm_class_variable_read_node_t *node = (pm_class_variable_read_node_t *) pm_arena_alloc(arena, sizeof(pm_class_variable_read_node_t), PRISM_ALIGNOF(pm_class_variable_read_node_t));
2261
2262
3.18k
    *node = (pm_class_variable_read_node_t) {
2263
3.18k
        .base = { .type = PM_CLASS_VARIABLE_READ_NODE, .flags = flags, .node_id = node_id, .location = location },
2264
3.18k
        .name = name
2265
3.18k
    };
2266
2267
3.18k
    return node;
2268
3.18k
}
2269
2270
/**
2271
 * Allocate and initialize a new ClassVariableTargetNode node.
2272
 */
2273
pm_class_variable_target_node_t *
2274
pm_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) {
2275
    pm_class_variable_target_node_t *node = (pm_class_variable_target_node_t *) pm_arena_alloc(arena, sizeof(pm_class_variable_target_node_t), PRISM_ALIGNOF(pm_class_variable_target_node_t));
2276
2277
    *node = (pm_class_variable_target_node_t) {
2278
        .base = { .type = PM_CLASS_VARIABLE_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
2279
        .name = name
2280
    };
2281
2282
    return node;
2283
}
2284
2285
/**
2286
 * Allocate and initialize a new ClassVariableWriteNode node.
2287
 */
2288
pm_class_variable_write_node_t *
2289
524
pm_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) {
2290
524
    pm_class_variable_write_node_t *node = (pm_class_variable_write_node_t *) pm_arena_alloc(arena, sizeof(pm_class_variable_write_node_t), PRISM_ALIGNOF(pm_class_variable_write_node_t));
2291
2292
524
    *node = (pm_class_variable_write_node_t) {
2293
524
        .base = { .type = PM_CLASS_VARIABLE_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2294
524
        .name = name,
2295
524
        .name_loc = name_loc,
2296
524
        .value = value,
2297
524
        .operator_loc = operator_loc
2298
524
    };
2299
2300
524
    return node;
2301
524
}
2302
2303
/**
2304
 * Allocate and initialize a new ConstantAndWriteNode node.
2305
 */
2306
pm_constant_and_write_node_t *
2307
133
pm_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) {
2308
133
    pm_constant_and_write_node_t *node = (pm_constant_and_write_node_t *) pm_arena_alloc(arena, sizeof(pm_constant_and_write_node_t), PRISM_ALIGNOF(pm_constant_and_write_node_t));
2309
2310
133
    *node = (pm_constant_and_write_node_t) {
2311
133
        .base = { .type = PM_CONSTANT_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2312
133
        .name = name,
2313
133
        .name_loc = name_loc,
2314
133
        .operator_loc = operator_loc,
2315
133
        .value = value
2316
133
    };
2317
2318
133
    return node;
2319
133
}
2320
2321
/**
2322
 * Allocate and initialize a new ConstantOperatorWriteNode node.
2323
 */
2324
pm_constant_operator_write_node_t *
2325
253
pm_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) {
2326
253
    pm_constant_operator_write_node_t *node = (pm_constant_operator_write_node_t *) pm_arena_alloc(arena, sizeof(pm_constant_operator_write_node_t), PRISM_ALIGNOF(pm_constant_operator_write_node_t));
2327
2328
253
    *node = (pm_constant_operator_write_node_t) {
2329
253
        .base = { .type = PM_CONSTANT_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2330
253
        .name = name,
2331
253
        .name_loc = name_loc,
2332
253
        .binary_operator_loc = binary_operator_loc,
2333
253
        .value = value,
2334
253
        .binary_operator = binary_operator
2335
253
    };
2336
2337
253
    return node;
2338
253
}
2339
2340
/**
2341
 * Allocate and initialize a new ConstantOrWriteNode node.
2342
 */
2343
pm_constant_or_write_node_t *
2344
338
pm_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) {
2345
338
    pm_constant_or_write_node_t *node = (pm_constant_or_write_node_t *) pm_arena_alloc(arena, sizeof(pm_constant_or_write_node_t), PRISM_ALIGNOF(pm_constant_or_write_node_t));
2346
2347
338
    *node = (pm_constant_or_write_node_t) {
2348
338
        .base = { .type = PM_CONSTANT_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2349
338
        .name = name,
2350
338
        .name_loc = name_loc,
2351
338
        .operator_loc = operator_loc,
2352
338
        .value = value
2353
338
    };
2354
2355
338
    return node;
2356
338
}
2357
2358
/**
2359
 * Allocate and initialize a new ConstantPathAndWriteNode node.
2360
 */
2361
pm_constant_path_and_write_node_t *
2362
9
pm_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) {
2363
9
    pm_constant_path_and_write_node_t *node = (pm_constant_path_and_write_node_t *) pm_arena_alloc(arena, sizeof(pm_constant_path_and_write_node_t), PRISM_ALIGNOF(pm_constant_path_and_write_node_t));
2364
2365
9
    *node = (pm_constant_path_and_write_node_t) {
2366
9
        .base = { .type = PM_CONSTANT_PATH_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2367
9
        .target = target,
2368
9
        .operator_loc = operator_loc,
2369
9
        .value = value
2370
9
    };
2371
2372
9
    return node;
2373
9
}
2374
2375
/**
2376
 * Allocate and initialize a new ConstantPathNode node.
2377
 */
2378
pm_constant_path_node_t *
2379
6.47k
pm_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) {
2380
6.47k
    pm_constant_path_node_t *node = (pm_constant_path_node_t *) pm_arena_alloc(arena, sizeof(pm_constant_path_node_t), PRISM_ALIGNOF(pm_constant_path_node_t));
2381
2382
6.47k
    *node = (pm_constant_path_node_t) {
2383
6.47k
        .base = { .type = PM_CONSTANT_PATH_NODE, .flags = flags, .node_id = node_id, .location = location },
2384
6.47k
        .parent = parent,
2385
6.47k
        .name = name,
2386
6.47k
        .delimiter_loc = delimiter_loc,
2387
6.47k
        .name_loc = name_loc
2388
6.47k
    };
2389
2390
6.47k
    return node;
2391
6.47k
}
2392
2393
/**
2394
 * Allocate and initialize a new ConstantPathOperatorWriteNode node.
2395
 */
2396
pm_constant_path_operator_write_node_t *
2397
18
pm_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) {
2398
18
    pm_constant_path_operator_write_node_t *node = (pm_constant_path_operator_write_node_t *) pm_arena_alloc(arena, sizeof(pm_constant_path_operator_write_node_t), PRISM_ALIGNOF(pm_constant_path_operator_write_node_t));
2399
2400
18
    *node = (pm_constant_path_operator_write_node_t) {
2401
18
        .base = { .type = PM_CONSTANT_PATH_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2402
18
        .target = target,
2403
18
        .binary_operator_loc = binary_operator_loc,
2404
18
        .value = value,
2405
18
        .binary_operator = binary_operator
2406
18
    };
2407
2408
18
    return node;
2409
18
}
2410
2411
/**
2412
 * Allocate and initialize a new ConstantPathOrWriteNode node.
2413
 */
2414
pm_constant_path_or_write_node_t *
2415
54
pm_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) {
2416
54
    pm_constant_path_or_write_node_t *node = (pm_constant_path_or_write_node_t *) pm_arena_alloc(arena, sizeof(pm_constant_path_or_write_node_t), PRISM_ALIGNOF(pm_constant_path_or_write_node_t));
2417
2418
54
    *node = (pm_constant_path_or_write_node_t) {
2419
54
        .base = { .type = PM_CONSTANT_PATH_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2420
54
        .target = target,
2421
54
        .operator_loc = operator_loc,
2422
54
        .value = value
2423
54
    };
2424
2425
54
    return node;
2426
54
}
2427
2428
/**
2429
 * Allocate and initialize a new ConstantPathTargetNode node.
2430
 */
2431
pm_constant_path_target_node_t *
2432
pm_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) {
2433
    pm_constant_path_target_node_t *node = (pm_constant_path_target_node_t *) pm_arena_alloc(arena, sizeof(pm_constant_path_target_node_t), PRISM_ALIGNOF(pm_constant_path_target_node_t));
2434
2435
    *node = (pm_constant_path_target_node_t) {
2436
        .base = { .type = PM_CONSTANT_PATH_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
2437
        .parent = parent,
2438
        .name = name,
2439
        .delimiter_loc = delimiter_loc,
2440
        .name_loc = name_loc
2441
    };
2442
2443
    return node;
2444
}
2445
2446
/**
2447
 * Allocate and initialize a new ConstantPathWriteNode node.
2448
 */
2449
pm_constant_path_write_node_t *
2450
1.47k
pm_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) {
2451
1.47k
    pm_constant_path_write_node_t *node = (pm_constant_path_write_node_t *) pm_arena_alloc(arena, sizeof(pm_constant_path_write_node_t), PRISM_ALIGNOF(pm_constant_path_write_node_t));
2452
2453
1.47k
    *node = (pm_constant_path_write_node_t) {
2454
1.47k
        .base = { .type = PM_CONSTANT_PATH_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2455
1.47k
        .target = target,
2456
1.47k
        .operator_loc = operator_loc,
2457
1.47k
        .value = value
2458
1.47k
    };
2459
2460
1.47k
    return node;
2461
1.47k
}
2462
2463
/**
2464
 * Allocate and initialize a new ConstantReadNode node.
2465
 */
2466
pm_constant_read_node_t *
2467
27.1k
pm_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) {
2468
27.1k
    pm_constant_read_node_t *node = (pm_constant_read_node_t *) pm_arena_alloc(arena, sizeof(pm_constant_read_node_t), PRISM_ALIGNOF(pm_constant_read_node_t));
2469
2470
27.1k
    *node = (pm_constant_read_node_t) {
2471
27.1k
        .base = { .type = PM_CONSTANT_READ_NODE, .flags = flags, .node_id = node_id, .location = location },
2472
27.1k
        .name = name
2473
27.1k
    };
2474
2475
27.1k
    return node;
2476
27.1k
}
2477
2478
/**
2479
 * Allocate and initialize a new ConstantTargetNode node.
2480
 */
2481
pm_constant_target_node_t *
2482
pm_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) {
2483
    pm_constant_target_node_t *node = (pm_constant_target_node_t *) pm_arena_alloc(arena, sizeof(pm_constant_target_node_t), PRISM_ALIGNOF(pm_constant_target_node_t));
2484
2485
    *node = (pm_constant_target_node_t) {
2486
        .base = { .type = PM_CONSTANT_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
2487
        .name = name
2488
    };
2489
2490
    return node;
2491
}
2492
2493
/**
2494
 * Allocate and initialize a new ConstantWriteNode node.
2495
 */
2496
pm_constant_write_node_t *
2497
1.60k
pm_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) {
2498
1.60k
    pm_constant_write_node_t *node = (pm_constant_write_node_t *) pm_arena_alloc(arena, sizeof(pm_constant_write_node_t), PRISM_ALIGNOF(pm_constant_write_node_t));
2499
2500
1.60k
    *node = (pm_constant_write_node_t) {
2501
1.60k
        .base = { .type = PM_CONSTANT_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2502
1.60k
        .name = name,
2503
1.60k
        .name_loc = name_loc,
2504
1.60k
        .value = value,
2505
1.60k
        .operator_loc = operator_loc
2506
1.60k
    };
2507
2508
1.60k
    return node;
2509
1.60k
}
2510
2511
/**
2512
 * Allocate and initialize a new DefNode node.
2513
 */
2514
pm_def_node_t *
2515
22.9k
pm_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) {
2516
22.9k
    pm_def_node_t *node = (pm_def_node_t *) pm_arena_alloc(arena, sizeof(pm_def_node_t), PRISM_ALIGNOF(pm_def_node_t));
2517
2518
22.9k
    *node = (pm_def_node_t) {
2519
22.9k
        .base = { .type = PM_DEF_NODE, .flags = flags, .node_id = node_id, .location = location },
2520
22.9k
        .name = name,
2521
22.9k
        .name_loc = name_loc,
2522
22.9k
        .receiver = receiver,
2523
22.9k
        .parameters = parameters,
2524
22.9k
        .body = body,
2525
22.9k
        .locals = locals,
2526
22.9k
        .def_keyword_loc = def_keyword_loc,
2527
22.9k
        .operator_loc = operator_loc,
2528
22.9k
        .lparen_loc = lparen_loc,
2529
22.9k
        .rparen_loc = rparen_loc,
2530
22.9k
        .equal_loc = equal_loc,
2531
22.9k
        .end_keyword_loc = end_keyword_loc
2532
22.9k
    };
2533
2534
22.9k
    return node;
2535
22.9k
}
2536
2537
/**
2538
 * Allocate and initialize a new DefinedNode node.
2539
 */
2540
pm_defined_node_t *
2541
184
pm_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) {
2542
184
    pm_defined_node_t *node = (pm_defined_node_t *) pm_arena_alloc(arena, sizeof(pm_defined_node_t), PRISM_ALIGNOF(pm_defined_node_t));
2543
2544
184
    *node = (pm_defined_node_t) {
2545
184
        .base = { .type = PM_DEFINED_NODE, .flags = flags, .node_id = node_id, .location = location },
2546
184
        .lparen_loc = lparen_loc,
2547
184
        .value = value,
2548
184
        .rparen_loc = rparen_loc,
2549
184
        .keyword_loc = keyword_loc
2550
184
    };
2551
2552
184
    return node;
2553
184
}
2554
2555
/**
2556
 * Allocate and initialize a new ElseNode node.
2557
 */
2558
pm_else_node_t *
2559
2.76k
pm_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) {
2560
2.76k
    pm_else_node_t *node = (pm_else_node_t *) pm_arena_alloc(arena, sizeof(pm_else_node_t), PRISM_ALIGNOF(pm_else_node_t));
2561
2562
2.76k
    *node = (pm_else_node_t) {
2563
2.76k
        .base = { .type = PM_ELSE_NODE, .flags = flags, .node_id = node_id, .location = location },
2564
2.76k
        .else_keyword_loc = else_keyword_loc,
2565
2.76k
        .statements = statements,
2566
2.76k
        .end_keyword_loc = end_keyword_loc
2567
2.76k
    };
2568
2569
2.76k
    return node;
2570
2.76k
}
2571
2572
/**
2573
 * Allocate and initialize a new EmbeddedStatementsNode node.
2574
 */
2575
pm_embedded_statements_node_t *
2576
14.1k
pm_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) {
2577
14.1k
    pm_embedded_statements_node_t *node = (pm_embedded_statements_node_t *) pm_arena_alloc(arena, sizeof(pm_embedded_statements_node_t), PRISM_ALIGNOF(pm_embedded_statements_node_t));
2578
2579
14.1k
    *node = (pm_embedded_statements_node_t) {
2580
14.1k
        .base = { .type = PM_EMBEDDED_STATEMENTS_NODE, .flags = flags, .node_id = node_id, .location = location },
2581
14.1k
        .opening_loc = opening_loc,
2582
14.1k
        .statements = statements,
2583
14.1k
        .closing_loc = closing_loc
2584
14.1k
    };
2585
2586
14.1k
    return node;
2587
14.1k
}
2588
2589
/**
2590
 * Allocate and initialize a new EmbeddedVariableNode node.
2591
 */
2592
pm_embedded_variable_node_t *
2593
1.46k
pm_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) {
2594
1.46k
    pm_embedded_variable_node_t *node = (pm_embedded_variable_node_t *) pm_arena_alloc(arena, sizeof(pm_embedded_variable_node_t), PRISM_ALIGNOF(pm_embedded_variable_node_t));
2595
2596
1.46k
    *node = (pm_embedded_variable_node_t) {
2597
1.46k
        .base = { .type = PM_EMBEDDED_VARIABLE_NODE, .flags = flags, .node_id = node_id, .location = location },
2598
1.46k
        .operator_loc = operator_loc,
2599
1.46k
        .variable = variable
2600
1.46k
    };
2601
2602
1.46k
    return node;
2603
1.46k
}
2604
2605
/**
2606
 * Allocate and initialize a new EnsureNode node.
2607
 */
2608
pm_ensure_node_t *
2609
961
pm_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) {
2610
961
    pm_ensure_node_t *node = (pm_ensure_node_t *) pm_arena_alloc(arena, sizeof(pm_ensure_node_t), PRISM_ALIGNOF(pm_ensure_node_t));
2611
2612
961
    *node = (pm_ensure_node_t) {
2613
961
        .base = { .type = PM_ENSURE_NODE, .flags = flags, .node_id = node_id, .location = location },
2614
961
        .ensure_keyword_loc = ensure_keyword_loc,
2615
961
        .statements = statements,
2616
961
        .end_keyword_loc = end_keyword_loc
2617
961
    };
2618
2619
961
    return node;
2620
961
}
2621
2622
/**
2623
 * Allocate and initialize a new ErrorRecoveryNode node.
2624
 */
2625
pm_error_recovery_node_t *
2626
132k
pm_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) {
2627
132k
    pm_error_recovery_node_t *node = (pm_error_recovery_node_t *) pm_arena_alloc(arena, sizeof(pm_error_recovery_node_t), PRISM_ALIGNOF(pm_error_recovery_node_t));
2628
2629
132k
    *node = (pm_error_recovery_node_t) {
2630
132k
        .base = { .type = PM_ERROR_RECOVERY_NODE, .flags = flags, .node_id = node_id, .location = location },
2631
132k
        .unexpected = unexpected
2632
132k
    };
2633
2634
132k
    return node;
2635
132k
}
2636
2637
/**
2638
 * Allocate and initialize a new FalseNode node.
2639
 */
2640
pm_false_node_t *
2641
1.07k
pm_false_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
2642
1.07k
    pm_false_node_t *node = (pm_false_node_t *) pm_arena_alloc(arena, sizeof(pm_false_node_t), PRISM_ALIGNOF(pm_false_node_t));
2643
2644
1.07k
    *node = (pm_false_node_t) {
2645
1.07k
        .base = { .type = PM_FALSE_NODE, .flags = flags, .node_id = node_id, .location = location }
2646
1.07k
    };
2647
2648
1.07k
    return node;
2649
1.07k
}
2650
2651
/**
2652
 * Allocate and initialize a new FindPatternNode node.
2653
 */
2654
pm_find_pattern_node_t *
2655
58
pm_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) {
2656
58
    pm_find_pattern_node_t *node = (pm_find_pattern_node_t *) pm_arena_alloc(arena, sizeof(pm_find_pattern_node_t), PRISM_ALIGNOF(pm_find_pattern_node_t));
2657
2658
58
    *node = (pm_find_pattern_node_t) {
2659
58
        .base = { .type = PM_FIND_PATTERN_NODE, .flags = flags, .node_id = node_id, .location = location },
2660
58
        .constant = constant,
2661
58
        .left = left,
2662
58
        .requireds = requireds,
2663
58
        .right = right,
2664
58
        .opening_loc = opening_loc,
2665
58
        .closing_loc = closing_loc
2666
58
    };
2667
2668
58
    return node;
2669
58
}
2670
2671
/**
2672
 * Allocate and initialize a new FlipFlopNode node.
2673
 */
2674
pm_flip_flop_node_t *
2675
pm_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) {
2676
    pm_flip_flop_node_t *node = (pm_flip_flop_node_t *) pm_arena_alloc(arena, sizeof(pm_flip_flop_node_t), PRISM_ALIGNOF(pm_flip_flop_node_t));
2677
2678
    *node = (pm_flip_flop_node_t) {
2679
        .base = { .type = PM_FLIP_FLOP_NODE, .flags = flags, .node_id = node_id, .location = location },
2680
        .left = left,
2681
        .right = right,
2682
        .operator_loc = operator_loc
2683
    };
2684
2685
    return node;
2686
}
2687
2688
/**
2689
 * Allocate and initialize a new FloatNode node.
2690
 */
2691
pm_float_node_t *
2692
3.31k
pm_float_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, double value) {
2693
3.31k
    pm_float_node_t *node = (pm_float_node_t *) pm_arena_alloc(arena, sizeof(pm_float_node_t), PRISM_ALIGNOF(pm_float_node_t));
2694
2695
3.31k
    *node = (pm_float_node_t) {
2696
3.31k
        .base = { .type = PM_FLOAT_NODE, .flags = flags, .node_id = node_id, .location = location },
2697
3.31k
        .value = value
2698
3.31k
    };
2699
2700
3.31k
    return node;
2701
3.31k
}
2702
2703
/**
2704
 * Allocate and initialize a new ForNode node.
2705
 */
2706
pm_for_node_t *
2707
202
pm_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) {
2708
202
    pm_for_node_t *node = (pm_for_node_t *) pm_arena_alloc(arena, sizeof(pm_for_node_t), PRISM_ALIGNOF(pm_for_node_t));
2709
2710
202
    *node = (pm_for_node_t) {
2711
202
        .base = { .type = PM_FOR_NODE, .flags = flags, .node_id = node_id, .location = location },
2712
202
        .index = index,
2713
202
        .collection = collection,
2714
202
        .statements = statements,
2715
202
        .for_keyword_loc = for_keyword_loc,
2716
202
        .in_keyword_loc = in_keyword_loc,
2717
202
        .do_keyword_loc = do_keyword_loc,
2718
202
        .end_keyword_loc = end_keyword_loc
2719
202
    };
2720
2721
202
    return node;
2722
202
}
2723
2724
/**
2725
 * Allocate and initialize a new ForwardingArgumentsNode node.
2726
 */
2727
pm_forwarding_arguments_node_t *
2728
307
pm_forwarding_arguments_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
2729
307
    pm_forwarding_arguments_node_t *node = (pm_forwarding_arguments_node_t *) pm_arena_alloc(arena, sizeof(pm_forwarding_arguments_node_t), PRISM_ALIGNOF(pm_forwarding_arguments_node_t));
2730
2731
307
    *node = (pm_forwarding_arguments_node_t) {
2732
307
        .base = { .type = PM_FORWARDING_ARGUMENTS_NODE, .flags = flags, .node_id = node_id, .location = location }
2733
307
    };
2734
2735
307
    return node;
2736
307
}
2737
2738
/**
2739
 * Allocate and initialize a new ForwardingParameterNode node.
2740
 */
2741
pm_forwarding_parameter_node_t *
2742
393
pm_forwarding_parameter_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
2743
393
    pm_forwarding_parameter_node_t *node = (pm_forwarding_parameter_node_t *) pm_arena_alloc(arena, sizeof(pm_forwarding_parameter_node_t), PRISM_ALIGNOF(pm_forwarding_parameter_node_t));
2744
2745
393
    *node = (pm_forwarding_parameter_node_t) {
2746
393
        .base = { .type = PM_FORWARDING_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location }
2747
393
    };
2748
2749
393
    return node;
2750
393
}
2751
2752
/**
2753
 * Allocate and initialize a new ForwardingSuperNode node.
2754
 */
2755
pm_forwarding_super_node_t *
2756
77
pm_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) {
2757
77
    pm_forwarding_super_node_t *node = (pm_forwarding_super_node_t *) pm_arena_alloc(arena, sizeof(pm_forwarding_super_node_t), PRISM_ALIGNOF(pm_forwarding_super_node_t));
2758
2759
77
    *node = (pm_forwarding_super_node_t) {
2760
77
        .base = { .type = PM_FORWARDING_SUPER_NODE, .flags = flags, .node_id = node_id, .location = location },
2761
77
        .keyword_loc = keyword_loc,
2762
77
        .block = block
2763
77
    };
2764
2765
77
    return node;
2766
77
}
2767
2768
/**
2769
 * Allocate and initialize a new GlobalVariableAndWriteNode node.
2770
 */
2771
pm_global_variable_and_write_node_t *
2772
29
pm_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) {
2773
29
    pm_global_variable_and_write_node_t *node = (pm_global_variable_and_write_node_t *) pm_arena_alloc(arena, sizeof(pm_global_variable_and_write_node_t), PRISM_ALIGNOF(pm_global_variable_and_write_node_t));
2774
2775
29
    *node = (pm_global_variable_and_write_node_t) {
2776
29
        .base = { .type = PM_GLOBAL_VARIABLE_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2777
29
        .name = name,
2778
29
        .name_loc = name_loc,
2779
29
        .operator_loc = operator_loc,
2780
29
        .value = value
2781
29
    };
2782
2783
29
    return node;
2784
29
}
2785
2786
/**
2787
 * Allocate and initialize a new GlobalVariableOperatorWriteNode node.
2788
 */
2789
pm_global_variable_operator_write_node_t *
2790
39
pm_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) {
2791
39
    pm_global_variable_operator_write_node_t *node = (pm_global_variable_operator_write_node_t *) pm_arena_alloc(arena, sizeof(pm_global_variable_operator_write_node_t), PRISM_ALIGNOF(pm_global_variable_operator_write_node_t));
2792
2793
39
    *node = (pm_global_variable_operator_write_node_t) {
2794
39
        .base = { .type = PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2795
39
        .name = name,
2796
39
        .name_loc = name_loc,
2797
39
        .binary_operator_loc = binary_operator_loc,
2798
39
        .value = value,
2799
39
        .binary_operator = binary_operator
2800
39
    };
2801
2802
39
    return node;
2803
39
}
2804
2805
/**
2806
 * Allocate and initialize a new GlobalVariableOrWriteNode node.
2807
 */
2808
pm_global_variable_or_write_node_t *
2809
21
pm_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) {
2810
21
    pm_global_variable_or_write_node_t *node = (pm_global_variable_or_write_node_t *) pm_arena_alloc(arena, sizeof(pm_global_variable_or_write_node_t), PRISM_ALIGNOF(pm_global_variable_or_write_node_t));
2811
2812
21
    *node = (pm_global_variable_or_write_node_t) {
2813
21
        .base = { .type = PM_GLOBAL_VARIABLE_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2814
21
        .name = name,
2815
21
        .name_loc = name_loc,
2816
21
        .operator_loc = operator_loc,
2817
21
        .value = value
2818
21
    };
2819
2820
21
    return node;
2821
21
}
2822
2823
/**
2824
 * Allocate and initialize a new GlobalVariableReadNode node.
2825
 */
2826
pm_global_variable_read_node_t *
2827
10.8k
pm_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) {
2828
10.8k
    pm_global_variable_read_node_t *node = (pm_global_variable_read_node_t *) pm_arena_alloc(arena, sizeof(pm_global_variable_read_node_t), PRISM_ALIGNOF(pm_global_variable_read_node_t));
2829
2830
10.8k
    *node = (pm_global_variable_read_node_t) {
2831
10.8k
        .base = { .type = PM_GLOBAL_VARIABLE_READ_NODE, .flags = flags, .node_id = node_id, .location = location },
2832
10.8k
        .name = name
2833
10.8k
    };
2834
2835
10.8k
    return node;
2836
10.8k
}
2837
2838
/**
2839
 * Allocate and initialize a new GlobalVariableTargetNode node.
2840
 */
2841
pm_global_variable_target_node_t *
2842
pm_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) {
2843
    pm_global_variable_target_node_t *node = (pm_global_variable_target_node_t *) pm_arena_alloc(arena, sizeof(pm_global_variable_target_node_t), PRISM_ALIGNOF(pm_global_variable_target_node_t));
2844
2845
    *node = (pm_global_variable_target_node_t) {
2846
        .base = { .type = PM_GLOBAL_VARIABLE_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
2847
        .name = name
2848
    };
2849
2850
    return node;
2851
}
2852
2853
/**
2854
 * Allocate and initialize a new GlobalVariableWriteNode node.
2855
 */
2856
pm_global_variable_write_node_t *
2857
1.84k
pm_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) {
2858
1.84k
    pm_global_variable_write_node_t *node = (pm_global_variable_write_node_t *) pm_arena_alloc(arena, sizeof(pm_global_variable_write_node_t), PRISM_ALIGNOF(pm_global_variable_write_node_t));
2859
2860
1.84k
    *node = (pm_global_variable_write_node_t) {
2861
1.84k
        .base = { .type = PM_GLOBAL_VARIABLE_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2862
1.84k
        .name = name,
2863
1.84k
        .name_loc = name_loc,
2864
1.84k
        .value = value,
2865
1.84k
        .operator_loc = operator_loc
2866
1.84k
    };
2867
2868
1.84k
    return node;
2869
1.84k
}
2870
2871
/**
2872
 * Allocate and initialize a new HashNode node.
2873
 */
2874
pm_hash_node_t *
2875
15.5k
pm_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) {
2876
15.5k
    pm_hash_node_t *node = (pm_hash_node_t *) pm_arena_alloc(arena, sizeof(pm_hash_node_t), PRISM_ALIGNOF(pm_hash_node_t));
2877
2878
15.5k
    *node = (pm_hash_node_t) {
2879
15.5k
        .base = { .type = PM_HASH_NODE, .flags = flags, .node_id = node_id, .location = location },
2880
15.5k
        .opening_loc = opening_loc,
2881
15.5k
        .elements = elements,
2882
15.5k
        .closing_loc = closing_loc
2883
15.5k
    };
2884
2885
15.5k
    return node;
2886
15.5k
}
2887
2888
/**
2889
 * Allocate and initialize a new HashPatternNode node.
2890
 */
2891
pm_hash_pattern_node_t *
2892
2.92k
pm_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) {
2893
2.92k
    pm_hash_pattern_node_t *node = (pm_hash_pattern_node_t *) pm_arena_alloc(arena, sizeof(pm_hash_pattern_node_t), PRISM_ALIGNOF(pm_hash_pattern_node_t));
2894
2895
2.92k
    *node = (pm_hash_pattern_node_t) {
2896
2.92k
        .base = { .type = PM_HASH_PATTERN_NODE, .flags = flags, .node_id = node_id, .location = location },
2897
2.92k
        .constant = constant,
2898
2.92k
        .elements = elements,
2899
2.92k
        .rest = rest,
2900
2.92k
        .opening_loc = opening_loc,
2901
2.92k
        .closing_loc = closing_loc
2902
2.92k
    };
2903
2904
2.92k
    return node;
2905
2.92k
}
2906
2907
/**
2908
 * Allocate and initialize a new IfNode node.
2909
 */
2910
pm_if_node_t *
2911
3.41k
pm_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) {
2912
3.41k
    pm_if_node_t *node = (pm_if_node_t *) pm_arena_alloc(arena, sizeof(pm_if_node_t), PRISM_ALIGNOF(pm_if_node_t));
2913
2914
3.41k
    *node = (pm_if_node_t) {
2915
3.41k
        .base = { .type = PM_IF_NODE, .flags = flags, .node_id = node_id, .location = location },
2916
3.41k
        .if_keyword_loc = if_keyword_loc,
2917
3.41k
        .predicate = predicate,
2918
3.41k
        .then_keyword_loc = then_keyword_loc,
2919
3.41k
        .statements = statements,
2920
3.41k
        .subsequent = subsequent,
2921
3.41k
        .end_keyword_loc = end_keyword_loc
2922
3.41k
    };
2923
2924
3.41k
    return node;
2925
3.41k
}
2926
2927
/**
2928
 * Allocate and initialize a new ImaginaryNode node.
2929
 */
2930
pm_imaginary_node_t *
2931
2.28k
pm_imaginary_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *numeric) {
2932
2.28k
    pm_imaginary_node_t *node = (pm_imaginary_node_t *) pm_arena_alloc(arena, sizeof(pm_imaginary_node_t), PRISM_ALIGNOF(pm_imaginary_node_t));
2933
2934
2.28k
    *node = (pm_imaginary_node_t) {
2935
2.28k
        .base = { .type = PM_IMAGINARY_NODE, .flags = flags, .node_id = node_id, .location = location },
2936
2.28k
        .numeric = numeric
2937
2.28k
    };
2938
2939
2.28k
    return node;
2940
2.28k
}
2941
2942
/**
2943
 * Allocate and initialize a new ImplicitNode node.
2944
 */
2945
pm_implicit_node_t *
2946
3.95k
pm_implicit_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, struct pm_node *value) {
2947
3.95k
    pm_implicit_node_t *node = (pm_implicit_node_t *) pm_arena_alloc(arena, sizeof(pm_implicit_node_t), PRISM_ALIGNOF(pm_implicit_node_t));
2948
2949
3.95k
    *node = (pm_implicit_node_t) {
2950
3.95k
        .base = { .type = PM_IMPLICIT_NODE, .flags = flags, .node_id = node_id, .location = location },
2951
3.95k
        .value = value
2952
3.95k
    };
2953
2954
3.95k
    return node;
2955
3.95k
}
2956
2957
/**
2958
 * Allocate and initialize a new ImplicitRestNode node.
2959
 */
2960
pm_implicit_rest_node_t *
2961
2.88k
pm_implicit_rest_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
2962
2.88k
    pm_implicit_rest_node_t *node = (pm_implicit_rest_node_t *) pm_arena_alloc(arena, sizeof(pm_implicit_rest_node_t), PRISM_ALIGNOF(pm_implicit_rest_node_t));
2963
2964
2.88k
    *node = (pm_implicit_rest_node_t) {
2965
2.88k
        .base = { .type = PM_IMPLICIT_REST_NODE, .flags = flags, .node_id = node_id, .location = location }
2966
2.88k
    };
2967
2968
2.88k
    return node;
2969
2.88k
}
2970
2971
/**
2972
 * Allocate and initialize a new InNode node.
2973
 */
2974
pm_in_node_t *
2975
6.58k
pm_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_keyword_loc, pm_location_t then_keyword_loc) {
2976
6.58k
    pm_in_node_t *node = (pm_in_node_t *) pm_arena_alloc(arena, sizeof(pm_in_node_t), PRISM_ALIGNOF(pm_in_node_t));
2977
2978
6.58k
    *node = (pm_in_node_t) {
2979
6.58k
        .base = { .type = PM_IN_NODE, .flags = flags, .node_id = node_id, .location = location },
2980
6.58k
        .pattern = pattern,
2981
6.58k
        .statements = statements,
2982
6.58k
        .in_keyword_loc = in_keyword_loc,
2983
6.58k
        .then_keyword_loc = then_keyword_loc
2984
6.58k
    };
2985
2986
6.58k
    return node;
2987
6.58k
}
2988
2989
/**
2990
 * Allocate and initialize a new IndexAndWriteNode node.
2991
 */
2992
pm_index_and_write_node_t *
2993
446
pm_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) {
2994
446
    pm_index_and_write_node_t *node = (pm_index_and_write_node_t *) pm_arena_alloc(arena, sizeof(pm_index_and_write_node_t), PRISM_ALIGNOF(pm_index_and_write_node_t));
2995
2996
446
    *node = (pm_index_and_write_node_t) {
2997
446
        .base = { .type = PM_INDEX_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
2998
446
        .receiver = receiver,
2999
446
        .call_operator_loc = call_operator_loc,
3000
446
        .opening_loc = opening_loc,
3001
446
        .arguments = arguments,
3002
446
        .closing_loc = closing_loc,
3003
446
        .block = block,
3004
446
        .operator_loc = operator_loc,
3005
446
        .value = value
3006
446
    };
3007
3008
446
    return node;
3009
446
}
3010
3011
/**
3012
 * Allocate and initialize a new IndexOperatorWriteNode node.
3013
 */
3014
pm_index_operator_write_node_t *
3015
726
pm_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) {
3016
726
    pm_index_operator_write_node_t *node = (pm_index_operator_write_node_t *) pm_arena_alloc(arena, sizeof(pm_index_operator_write_node_t), PRISM_ALIGNOF(pm_index_operator_write_node_t));
3017
3018
726
    *node = (pm_index_operator_write_node_t) {
3019
726
        .base = { .type = PM_INDEX_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3020
726
        .receiver = receiver,
3021
726
        .call_operator_loc = call_operator_loc,
3022
726
        .opening_loc = opening_loc,
3023
726
        .arguments = arguments,
3024
726
        .closing_loc = closing_loc,
3025
726
        .block = block,
3026
726
        .binary_operator = binary_operator,
3027
726
        .binary_operator_loc = binary_operator_loc,
3028
726
        .value = value
3029
726
    };
3030
3031
726
    return node;
3032
726
}
3033
3034
/**
3035
 * Allocate and initialize a new IndexOrWriteNode node.
3036
 */
3037
pm_index_or_write_node_t *
3038
1.14k
pm_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) {
3039
1.14k
    pm_index_or_write_node_t *node = (pm_index_or_write_node_t *) pm_arena_alloc(arena, sizeof(pm_index_or_write_node_t), PRISM_ALIGNOF(pm_index_or_write_node_t));
3040
3041
1.14k
    *node = (pm_index_or_write_node_t) {
3042
1.14k
        .base = { .type = PM_INDEX_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3043
1.14k
        .receiver = receiver,
3044
1.14k
        .call_operator_loc = call_operator_loc,
3045
1.14k
        .opening_loc = opening_loc,
3046
1.14k
        .arguments = arguments,
3047
1.14k
        .closing_loc = closing_loc,
3048
1.14k
        .block = block,
3049
1.14k
        .operator_loc = operator_loc,
3050
1.14k
        .value = value
3051
1.14k
    };
3052
3053
1.14k
    return node;
3054
1.14k
}
3055
3056
/**
3057
 * Allocate and initialize a new IndexTargetNode node.
3058
 */
3059
pm_index_target_node_t *
3060
3.03k
pm_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) {
3061
3.03k
    pm_index_target_node_t *node = (pm_index_target_node_t *) pm_arena_alloc(arena, sizeof(pm_index_target_node_t), PRISM_ALIGNOF(pm_index_target_node_t));
3062
3063
3.03k
    *node = (pm_index_target_node_t) {
3064
3.03k
        .base = { .type = PM_INDEX_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
3065
3.03k
        .receiver = receiver,
3066
3.03k
        .opening_loc = opening_loc,
3067
3.03k
        .arguments = arguments,
3068
3.03k
        .closing_loc = closing_loc,
3069
3.03k
        .block = block
3070
3.03k
    };
3071
3072
3.03k
    return node;
3073
3.03k
}
3074
3075
/**
3076
 * Allocate and initialize a new InstanceVariableAndWriteNode node.
3077
 */
3078
pm_instance_variable_and_write_node_t *
3079
11
pm_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) {
3080
11
    pm_instance_variable_and_write_node_t *node = (pm_instance_variable_and_write_node_t *) pm_arena_alloc(arena, sizeof(pm_instance_variable_and_write_node_t), PRISM_ALIGNOF(pm_instance_variable_and_write_node_t));
3081
3082
11
    *node = (pm_instance_variable_and_write_node_t) {
3083
11
        .base = { .type = PM_INSTANCE_VARIABLE_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3084
11
        .name = name,
3085
11
        .name_loc = name_loc,
3086
11
        .operator_loc = operator_loc,
3087
11
        .value = value
3088
11
    };
3089
3090
11
    return node;
3091
11
}
3092
3093
/**
3094
 * Allocate and initialize a new InstanceVariableOperatorWriteNode node.
3095
 */
3096
pm_instance_variable_operator_write_node_t *
3097
19
pm_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) {
3098
19
    pm_instance_variable_operator_write_node_t *node = (pm_instance_variable_operator_write_node_t *) pm_arena_alloc(arena, sizeof(pm_instance_variable_operator_write_node_t), PRISM_ALIGNOF(pm_instance_variable_operator_write_node_t));
3099
3100
19
    *node = (pm_instance_variable_operator_write_node_t) {
3101
19
        .base = { .type = PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3102
19
        .name = name,
3103
19
        .name_loc = name_loc,
3104
19
        .binary_operator_loc = binary_operator_loc,
3105
19
        .value = value,
3106
19
        .binary_operator = binary_operator
3107
19
    };
3108
3109
19
    return node;
3110
19
}
3111
3112
/**
3113
 * Allocate and initialize a new InstanceVariableOrWriteNode node.
3114
 */
3115
pm_instance_variable_or_write_node_t *
3116
1.06k
pm_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) {
3117
1.06k
    pm_instance_variable_or_write_node_t *node = (pm_instance_variable_or_write_node_t *) pm_arena_alloc(arena, sizeof(pm_instance_variable_or_write_node_t), PRISM_ALIGNOF(pm_instance_variable_or_write_node_t));
3118
3119
1.06k
    *node = (pm_instance_variable_or_write_node_t) {
3120
1.06k
        .base = { .type = PM_INSTANCE_VARIABLE_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3121
1.06k
        .name = name,
3122
1.06k
        .name_loc = name_loc,
3123
1.06k
        .operator_loc = operator_loc,
3124
1.06k
        .value = value
3125
1.06k
    };
3126
3127
1.06k
    return node;
3128
1.06k
}
3129
3130
/**
3131
 * Allocate and initialize a new InstanceVariableReadNode node.
3132
 */
3133
pm_instance_variable_read_node_t *
3134
6.02k
pm_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) {
3135
6.02k
    pm_instance_variable_read_node_t *node = (pm_instance_variable_read_node_t *) pm_arena_alloc(arena, sizeof(pm_instance_variable_read_node_t), PRISM_ALIGNOF(pm_instance_variable_read_node_t));
3136
3137
6.02k
    *node = (pm_instance_variable_read_node_t) {
3138
6.02k
        .base = { .type = PM_INSTANCE_VARIABLE_READ_NODE, .flags = flags, .node_id = node_id, .location = location },
3139
6.02k
        .name = name
3140
6.02k
    };
3141
3142
6.02k
    return node;
3143
6.02k
}
3144
3145
/**
3146
 * Allocate and initialize a new InstanceVariableTargetNode node.
3147
 */
3148
pm_instance_variable_target_node_t *
3149
pm_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) {
3150
    pm_instance_variable_target_node_t *node = (pm_instance_variable_target_node_t *) pm_arena_alloc(arena, sizeof(pm_instance_variable_target_node_t), PRISM_ALIGNOF(pm_instance_variable_target_node_t));
3151
3152
    *node = (pm_instance_variable_target_node_t) {
3153
        .base = { .type = PM_INSTANCE_VARIABLE_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
3154
        .name = name
3155
    };
3156
3157
    return node;
3158
}
3159
3160
/**
3161
 * Allocate and initialize a new InstanceVariableWriteNode node.
3162
 */
3163
pm_instance_variable_write_node_t *
3164
563
pm_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) {
3165
563
    pm_instance_variable_write_node_t *node = (pm_instance_variable_write_node_t *) pm_arena_alloc(arena, sizeof(pm_instance_variable_write_node_t), PRISM_ALIGNOF(pm_instance_variable_write_node_t));
3166
3167
563
    *node = (pm_instance_variable_write_node_t) {
3168
563
        .base = { .type = PM_INSTANCE_VARIABLE_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3169
563
        .name = name,
3170
563
        .name_loc = name_loc,
3171
563
        .value = value,
3172
563
        .operator_loc = operator_loc
3173
563
    };
3174
3175
563
    return node;
3176
563
}
3177
3178
/**
3179
 * Allocate and initialize a new IntegerNode node.
3180
 */
3181
pm_integer_node_t *
3182
85.9k
pm_integer_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_integer_t value) {
3183
85.9k
    pm_integer_node_t *node = (pm_integer_node_t *) pm_arena_alloc(arena, sizeof(pm_integer_node_t), PRISM_ALIGNOF(pm_integer_node_t));
3184
3185
85.9k
    *node = (pm_integer_node_t) {
3186
85.9k
        .base = { .type = PM_INTEGER_NODE, .flags = flags, .node_id = node_id, .location = location },
3187
85.9k
        .value = value
3188
85.9k
    };
3189
3190
85.9k
    return node;
3191
85.9k
}
3192
3193
/**
3194
 * Allocate and initialize a new InterpolatedMatchLastLineNode node.
3195
 */
3196
pm_interpolated_match_last_line_node_t *
3197
pm_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) {
3198
    pm_interpolated_match_last_line_node_t *node = (pm_interpolated_match_last_line_node_t *) pm_arena_alloc(arena, sizeof(pm_interpolated_match_last_line_node_t), PRISM_ALIGNOF(pm_interpolated_match_last_line_node_t));
3199
3200
    *node = (pm_interpolated_match_last_line_node_t) {
3201
        .base = { .type = PM_INTERPOLATED_MATCH_LAST_LINE_NODE, .flags = flags, .node_id = node_id, .location = location },
3202
        .opening_loc = opening_loc,
3203
        .parts = parts,
3204
        .closing_loc = closing_loc
3205
    };
3206
3207
    return node;
3208
}
3209
3210
/**
3211
 * Allocate and initialize a new InterpolatedRegularExpressionNode node.
3212
 */
3213
pm_interpolated_regular_expression_node_t *
3214
2.42k
pm_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) {
3215
2.42k
    pm_interpolated_regular_expression_node_t *node = (pm_interpolated_regular_expression_node_t *) pm_arena_alloc(arena, sizeof(pm_interpolated_regular_expression_node_t), PRISM_ALIGNOF(pm_interpolated_regular_expression_node_t));
3216
3217
2.42k
    *node = (pm_interpolated_regular_expression_node_t) {
3218
2.42k
        .base = { .type = PM_INTERPOLATED_REGULAR_EXPRESSION_NODE, .flags = flags, .node_id = node_id, .location = location },
3219
2.42k
        .opening_loc = opening_loc,
3220
2.42k
        .parts = parts,
3221
2.42k
        .closing_loc = closing_loc
3222
2.42k
    };
3223
3224
2.42k
    return node;
3225
2.42k
}
3226
3227
/**
3228
 * Allocate and initialize a new InterpolatedStringNode node.
3229
 */
3230
pm_interpolated_string_node_t *
3231
8.89k
pm_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) {
3232
8.89k
    pm_interpolated_string_node_t *node = (pm_interpolated_string_node_t *) pm_arena_alloc(arena, sizeof(pm_interpolated_string_node_t), PRISM_ALIGNOF(pm_interpolated_string_node_t));
3233
3234
8.89k
    *node = (pm_interpolated_string_node_t) {
3235
8.89k
        .base = { .type = PM_INTERPOLATED_STRING_NODE, .flags = flags, .node_id = node_id, .location = location },
3236
8.89k
        .opening_loc = opening_loc,
3237
8.89k
        .parts = parts,
3238
8.89k
        .closing_loc = closing_loc
3239
8.89k
    };
3240
3241
8.89k
    return node;
3242
8.89k
}
3243
3244
/**
3245
 * Allocate and initialize a new InterpolatedSymbolNode node.
3246
 */
3247
pm_interpolated_symbol_node_t *
3248
1.97k
pm_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) {
3249
1.97k
    pm_interpolated_symbol_node_t *node = (pm_interpolated_symbol_node_t *) pm_arena_alloc(arena, sizeof(pm_interpolated_symbol_node_t), PRISM_ALIGNOF(pm_interpolated_symbol_node_t));
3250
3251
1.97k
    *node = (pm_interpolated_symbol_node_t) {
3252
1.97k
        .base = { .type = PM_INTERPOLATED_SYMBOL_NODE, .flags = flags, .node_id = node_id, .location = location },
3253
1.97k
        .opening_loc = opening_loc,
3254
1.97k
        .parts = parts,
3255
1.97k
        .closing_loc = closing_loc
3256
1.97k
    };
3257
3258
1.97k
    return node;
3259
1.97k
}
3260
3261
/**
3262
 * Allocate and initialize a new InterpolatedXStringNode node.
3263
 */
3264
pm_interpolated_x_string_node_t *
3265
493
pm_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) {
3266
493
    pm_interpolated_x_string_node_t *node = (pm_interpolated_x_string_node_t *) pm_arena_alloc(arena, sizeof(pm_interpolated_x_string_node_t), PRISM_ALIGNOF(pm_interpolated_x_string_node_t));
3267
3268
493
    *node = (pm_interpolated_x_string_node_t) {
3269
493
        .base = { .type = PM_INTERPOLATED_X_STRING_NODE, .flags = flags, .node_id = node_id, .location = location },
3270
493
        .opening_loc = opening_loc,
3271
493
        .parts = parts,
3272
493
        .closing_loc = closing_loc
3273
493
    };
3274
3275
493
    return node;
3276
493
}
3277
3278
/**
3279
 * Allocate and initialize a new ItLocalVariableReadNode node.
3280
 */
3281
pm_it_local_variable_read_node_t *
3282
426
pm_it_local_variable_read_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
3283
426
    pm_it_local_variable_read_node_t *node = (pm_it_local_variable_read_node_t *) pm_arena_alloc(arena, sizeof(pm_it_local_variable_read_node_t), PRISM_ALIGNOF(pm_it_local_variable_read_node_t));
3284
3285
426
    *node = (pm_it_local_variable_read_node_t) {
3286
426
        .base = { .type = PM_IT_LOCAL_VARIABLE_READ_NODE, .flags = flags, .node_id = node_id, .location = location }
3287
426
    };
3288
3289
426
    return node;
3290
426
}
3291
3292
/**
3293
 * Allocate and initialize a new ItParametersNode node.
3294
 */
3295
pm_it_parameters_node_t *
3296
222
pm_it_parameters_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
3297
222
    pm_it_parameters_node_t *node = (pm_it_parameters_node_t *) pm_arena_alloc(arena, sizeof(pm_it_parameters_node_t), PRISM_ALIGNOF(pm_it_parameters_node_t));
3298
3299
222
    *node = (pm_it_parameters_node_t) {
3300
222
        .base = { .type = PM_IT_PARAMETERS_NODE, .flags = flags, .node_id = node_id, .location = location }
3301
222
    };
3302
3303
222
    return node;
3304
222
}
3305
3306
/**
3307
 * Allocate and initialize a new KeywordHashNode node.
3308
 */
3309
pm_keyword_hash_node_t *
3310
5.06k
pm_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) {
3311
5.06k
    pm_keyword_hash_node_t *node = (pm_keyword_hash_node_t *) pm_arena_alloc(arena, sizeof(pm_keyword_hash_node_t), PRISM_ALIGNOF(pm_keyword_hash_node_t));
3312
3313
5.06k
    *node = (pm_keyword_hash_node_t) {
3314
5.06k
        .base = { .type = PM_KEYWORD_HASH_NODE, .flags = flags, .node_id = node_id, .location = location },
3315
5.06k
        .elements = elements
3316
5.06k
    };
3317
3318
5.06k
    return node;
3319
5.06k
}
3320
3321
/**
3322
 * Allocate and initialize a new KeywordRestParameterNode node.
3323
 */
3324
pm_keyword_rest_parameter_node_t *
3325
1.67k
pm_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) {
3326
1.67k
    pm_keyword_rest_parameter_node_t *node = (pm_keyword_rest_parameter_node_t *) pm_arena_alloc(arena, sizeof(pm_keyword_rest_parameter_node_t), PRISM_ALIGNOF(pm_keyword_rest_parameter_node_t));
3327
3328
1.67k
    *node = (pm_keyword_rest_parameter_node_t) {
3329
1.67k
        .base = { .type = PM_KEYWORD_REST_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
3330
1.67k
        .name = name,
3331
1.67k
        .name_loc = name_loc,
3332
1.67k
        .operator_loc = operator_loc
3333
1.67k
    };
3334
3335
1.67k
    return node;
3336
1.67k
}
3337
3338
/**
3339
 * Allocate and initialize a new LambdaNode node.
3340
 */
3341
pm_lambda_node_t *
3342
2.83k
pm_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) {
3343
2.83k
    pm_lambda_node_t *node = (pm_lambda_node_t *) pm_arena_alloc(arena, sizeof(pm_lambda_node_t), PRISM_ALIGNOF(pm_lambda_node_t));
3344
3345
2.83k
    *node = (pm_lambda_node_t) {
3346
2.83k
        .base = { .type = PM_LAMBDA_NODE, .flags = flags, .node_id = node_id, .location = location },
3347
2.83k
        .locals = locals,
3348
2.83k
        .operator_loc = operator_loc,
3349
2.83k
        .opening_loc = opening_loc,
3350
2.83k
        .closing_loc = closing_loc,
3351
2.83k
        .parameters = parameters,
3352
2.83k
        .body = body
3353
2.83k
    };
3354
3355
2.83k
    return node;
3356
2.83k
}
3357
3358
/**
3359
 * Allocate and initialize a new LocalVariableAndWriteNode node.
3360
 */
3361
pm_local_variable_and_write_node_t *
3362
143
pm_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) {
3363
143
    pm_local_variable_and_write_node_t *node = (pm_local_variable_and_write_node_t *) pm_arena_alloc(arena, sizeof(pm_local_variable_and_write_node_t), PRISM_ALIGNOF(pm_local_variable_and_write_node_t));
3364
3365
143
    *node = (pm_local_variable_and_write_node_t) {
3366
143
        .base = { .type = PM_LOCAL_VARIABLE_AND_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3367
143
        .name_loc = name_loc,
3368
143
        .operator_loc = operator_loc,
3369
143
        .value = value,
3370
143
        .name = name,
3371
143
        .depth = depth
3372
143
    };
3373
3374
143
    return node;
3375
143
}
3376
3377
/**
3378
 * Allocate and initialize a new LocalVariableOperatorWriteNode node.
3379
 */
3380
pm_local_variable_operator_write_node_t *
3381
743
pm_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) {
3382
743
    pm_local_variable_operator_write_node_t *node = (pm_local_variable_operator_write_node_t *) pm_arena_alloc(arena, sizeof(pm_local_variable_operator_write_node_t), PRISM_ALIGNOF(pm_local_variable_operator_write_node_t));
3383
3384
743
    *node = (pm_local_variable_operator_write_node_t) {
3385
743
        .base = { .type = PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3386
743
        .name_loc = name_loc,
3387
743
        .binary_operator_loc = binary_operator_loc,
3388
743
        .value = value,
3389
743
        .name = name,
3390
743
        .binary_operator = binary_operator,
3391
743
        .depth = depth
3392
743
    };
3393
3394
743
    return node;
3395
743
}
3396
3397
/**
3398
 * Allocate and initialize a new LocalVariableOrWriteNode node.
3399
 */
3400
pm_local_variable_or_write_node_t *
3401
356
pm_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) {
3402
356
    pm_local_variable_or_write_node_t *node = (pm_local_variable_or_write_node_t *) pm_arena_alloc(arena, sizeof(pm_local_variable_or_write_node_t), PRISM_ALIGNOF(pm_local_variable_or_write_node_t));
3403
3404
356
    *node = (pm_local_variable_or_write_node_t) {
3405
356
        .base = { .type = PM_LOCAL_VARIABLE_OR_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3406
356
        .name_loc = name_loc,
3407
356
        .operator_loc = operator_loc,
3408
356
        .value = value,
3409
356
        .name = name,
3410
356
        .depth = depth
3411
356
    };
3412
3413
356
    return node;
3414
356
}
3415
3416
/**
3417
 * Allocate and initialize a new LocalVariableReadNode node.
3418
 */
3419
pm_local_variable_read_node_t *
3420
43.9k
pm_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) {
3421
43.9k
    pm_local_variable_read_node_t *node = (pm_local_variable_read_node_t *) pm_arena_alloc(arena, sizeof(pm_local_variable_read_node_t), PRISM_ALIGNOF(pm_local_variable_read_node_t));
3422
3423
43.9k
    *node = (pm_local_variable_read_node_t) {
3424
43.9k
        .base = { .type = PM_LOCAL_VARIABLE_READ_NODE, .flags = flags, .node_id = node_id, .location = location },
3425
43.9k
        .name = name,
3426
43.9k
        .depth = depth
3427
43.9k
    };
3428
3429
43.9k
    return node;
3430
43.9k
}
3431
3432
/**
3433
 * Allocate and initialize a new LocalVariableTargetNode node.
3434
 */
3435
pm_local_variable_target_node_t *
3436
22.2k
pm_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) {
3437
22.2k
    pm_local_variable_target_node_t *node = (pm_local_variable_target_node_t *) pm_arena_alloc(arena, sizeof(pm_local_variable_target_node_t), PRISM_ALIGNOF(pm_local_variable_target_node_t));
3438
3439
22.2k
    *node = (pm_local_variable_target_node_t) {
3440
22.2k
        .base = { .type = PM_LOCAL_VARIABLE_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
3441
22.2k
        .name = name,
3442
22.2k
        .depth = depth
3443
22.2k
    };
3444
3445
22.2k
    return node;
3446
22.2k
}
3447
3448
/**
3449
 * Allocate and initialize a new LocalVariableWriteNode node.
3450
 */
3451
pm_local_variable_write_node_t *
3452
12.1k
pm_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) {
3453
12.1k
    pm_local_variable_write_node_t *node = (pm_local_variable_write_node_t *) pm_arena_alloc(arena, sizeof(pm_local_variable_write_node_t), PRISM_ALIGNOF(pm_local_variable_write_node_t));
3454
3455
12.1k
    *node = (pm_local_variable_write_node_t) {
3456
12.1k
        .base = { .type = PM_LOCAL_VARIABLE_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3457
12.1k
        .name = name,
3458
12.1k
        .depth = depth,
3459
12.1k
        .name_loc = name_loc,
3460
12.1k
        .value = value,
3461
12.1k
        .operator_loc = operator_loc
3462
12.1k
    };
3463
3464
12.1k
    return node;
3465
12.1k
}
3466
3467
/**
3468
 * Allocate and initialize a new MatchLastLineNode node.
3469
 */
3470
pm_match_last_line_node_t *
3471
pm_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) {
3472
    pm_match_last_line_node_t *node = (pm_match_last_line_node_t *) pm_arena_alloc(arena, sizeof(pm_match_last_line_node_t), PRISM_ALIGNOF(pm_match_last_line_node_t));
3473
3474
    *node = (pm_match_last_line_node_t) {
3475
        .base = { .type = PM_MATCH_LAST_LINE_NODE, .flags = flags, .node_id = node_id, .location = location },
3476
        .opening_loc = opening_loc,
3477
        .content_loc = content_loc,
3478
        .closing_loc = closing_loc,
3479
        .unescaped = unescaped
3480
    };
3481
3482
    return node;
3483
}
3484
3485
/**
3486
 * Allocate and initialize a new MatchPredicateNode node.
3487
 */
3488
pm_match_predicate_node_t *
3489
1.86k
pm_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 keyword_loc) {
3490
1.86k
    pm_match_predicate_node_t *node = (pm_match_predicate_node_t *) pm_arena_alloc(arena, sizeof(pm_match_predicate_node_t), PRISM_ALIGNOF(pm_match_predicate_node_t));
3491
3492
1.86k
    *node = (pm_match_predicate_node_t) {
3493
1.86k
        .base = { .type = PM_MATCH_PREDICATE_NODE, .flags = flags, .node_id = node_id, .location = location },
3494
1.86k
        .value = value,
3495
1.86k
        .pattern = pattern,
3496
1.86k
        .keyword_loc = keyword_loc
3497
1.86k
    };
3498
3499
1.86k
    return node;
3500
1.86k
}
3501
3502
/**
3503
 * Allocate and initialize a new MatchRequiredNode node.
3504
 */
3505
pm_match_required_node_t *
3506
6.51k
pm_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) {
3507
6.51k
    pm_match_required_node_t *node = (pm_match_required_node_t *) pm_arena_alloc(arena, sizeof(pm_match_required_node_t), PRISM_ALIGNOF(pm_match_required_node_t));
3508
3509
6.51k
    *node = (pm_match_required_node_t) {
3510
6.51k
        .base = { .type = PM_MATCH_REQUIRED_NODE, .flags = flags, .node_id = node_id, .location = location },
3511
6.51k
        .value = value,
3512
6.51k
        .pattern = pattern,
3513
6.51k
        .operator_loc = operator_loc
3514
6.51k
    };
3515
3516
6.51k
    return node;
3517
6.51k
}
3518
3519
/**
3520
 * Allocate and initialize a new MatchWriteNode node.
3521
 */
3522
pm_match_write_node_t *
3523
1.16k
pm_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) {
3524
1.16k
    pm_match_write_node_t *node = (pm_match_write_node_t *) pm_arena_alloc(arena, sizeof(pm_match_write_node_t), PRISM_ALIGNOF(pm_match_write_node_t));
3525
3526
1.16k
    *node = (pm_match_write_node_t) {
3527
1.16k
        .base = { .type = PM_MATCH_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3528
1.16k
        .call = call,
3529
1.16k
        .targets = targets
3530
1.16k
    };
3531
3532
1.16k
    return node;
3533
1.16k
}
3534
3535
/**
3536
 * Allocate and initialize a new ModuleNode node.
3537
 */
3538
pm_module_node_t *
3539
1.20k
pm_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) {
3540
1.20k
    pm_module_node_t *node = (pm_module_node_t *) pm_arena_alloc(arena, sizeof(pm_module_node_t), PRISM_ALIGNOF(pm_module_node_t));
3541
3542
1.20k
    *node = (pm_module_node_t) {
3543
1.20k
        .base = { .type = PM_MODULE_NODE, .flags = flags, .node_id = node_id, .location = location },
3544
1.20k
        .locals = locals,
3545
1.20k
        .module_keyword_loc = module_keyword_loc,
3546
1.20k
        .constant_path = constant_path,
3547
1.20k
        .body = body,
3548
1.20k
        .end_keyword_loc = end_keyword_loc,
3549
1.20k
        .name = name
3550
1.20k
    };
3551
3552
1.20k
    return node;
3553
1.20k
}
3554
3555
/**
3556
 * Allocate and initialize a new MultiTargetNode node.
3557
 */
3558
pm_multi_target_node_t *
3559
24.0k
pm_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) {
3560
24.0k
    pm_multi_target_node_t *node = (pm_multi_target_node_t *) pm_arena_alloc(arena, sizeof(pm_multi_target_node_t), PRISM_ALIGNOF(pm_multi_target_node_t));
3561
3562
24.0k
    *node = (pm_multi_target_node_t) {
3563
24.0k
        .base = { .type = PM_MULTI_TARGET_NODE, .flags = flags, .node_id = node_id, .location = location },
3564
24.0k
        .lefts = lefts,
3565
24.0k
        .rest = rest,
3566
24.0k
        .rights = rights,
3567
24.0k
        .lparen_loc = lparen_loc,
3568
24.0k
        .rparen_loc = rparen_loc
3569
24.0k
    };
3570
3571
24.0k
    return node;
3572
24.0k
}
3573
3574
/**
3575
 * Allocate and initialize a new MultiWriteNode node.
3576
 */
3577
pm_multi_write_node_t *
3578
10.9k
pm_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) {
3579
10.9k
    pm_multi_write_node_t *node = (pm_multi_write_node_t *) pm_arena_alloc(arena, sizeof(pm_multi_write_node_t), PRISM_ALIGNOF(pm_multi_write_node_t));
3580
3581
10.9k
    *node = (pm_multi_write_node_t) {
3582
10.9k
        .base = { .type = PM_MULTI_WRITE_NODE, .flags = flags, .node_id = node_id, .location = location },
3583
10.9k
        .lefts = lefts,
3584
10.9k
        .rest = rest,
3585
10.9k
        .rights = rights,
3586
10.9k
        .lparen_loc = lparen_loc,
3587
10.9k
        .rparen_loc = rparen_loc,
3588
10.9k
        .operator_loc = operator_loc,
3589
10.9k
        .value = value
3590
10.9k
    };
3591
3592
10.9k
    return node;
3593
10.9k
}
3594
3595
/**
3596
 * Allocate and initialize a new NextNode node.
3597
 */
3598
pm_next_node_t *
3599
133
pm_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) {
3600
133
    pm_next_node_t *node = (pm_next_node_t *) pm_arena_alloc(arena, sizeof(pm_next_node_t), PRISM_ALIGNOF(pm_next_node_t));
3601
3602
133
    *node = (pm_next_node_t) {
3603
133
        .base = { .type = PM_NEXT_NODE, .flags = flags, .node_id = node_id, .location = location },
3604
133
        .arguments = arguments,
3605
133
        .keyword_loc = keyword_loc
3606
133
    };
3607
3608
133
    return node;
3609
133
}
3610
3611
/**
3612
 * Allocate and initialize a new NilNode node.
3613
 */
3614
pm_nil_node_t *
3615
1.45k
pm_nil_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
3616
1.45k
    pm_nil_node_t *node = (pm_nil_node_t *) pm_arena_alloc(arena, sizeof(pm_nil_node_t), PRISM_ALIGNOF(pm_nil_node_t));
3617
3618
1.45k
    *node = (pm_nil_node_t) {
3619
1.45k
        .base = { .type = PM_NIL_NODE, .flags = flags, .node_id = node_id, .location = location }
3620
1.45k
    };
3621
3622
1.45k
    return node;
3623
1.45k
}
3624
3625
/**
3626
 * Allocate and initialize a new NoBlockParameterNode node.
3627
 */
3628
pm_no_block_parameter_node_t *
3629
1
pm_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) {
3630
1
    pm_no_block_parameter_node_t *node = (pm_no_block_parameter_node_t *) pm_arena_alloc(arena, sizeof(pm_no_block_parameter_node_t), PRISM_ALIGNOF(pm_no_block_parameter_node_t));
3631
3632
1
    *node = (pm_no_block_parameter_node_t) {
3633
1
        .base = { .type = PM_NO_BLOCK_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
3634
1
        .operator_loc = operator_loc,
3635
1
        .keyword_loc = keyword_loc
3636
1
    };
3637
3638
1
    return node;
3639
1
}
3640
3641
/**
3642
 * Allocate and initialize a new NoKeywordsParameterNode node.
3643
 */
3644
pm_no_keywords_parameter_node_t *
3645
243
pm_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) {
3646
243
    pm_no_keywords_parameter_node_t *node = (pm_no_keywords_parameter_node_t *) pm_arena_alloc(arena, sizeof(pm_no_keywords_parameter_node_t), PRISM_ALIGNOF(pm_no_keywords_parameter_node_t));
3647
3648
243
    *node = (pm_no_keywords_parameter_node_t) {
3649
243
        .base = { .type = PM_NO_KEYWORDS_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
3650
243
        .operator_loc = operator_loc,
3651
243
        .keyword_loc = keyword_loc
3652
243
    };
3653
3654
243
    return node;
3655
243
}
3656
3657
/**
3658
 * Allocate and initialize a new NumberedParametersNode node.
3659
 */
3660
pm_numbered_parameters_node_t *
3661
97
pm_numbered_parameters_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, uint8_t maximum) {
3662
97
    pm_numbered_parameters_node_t *node = (pm_numbered_parameters_node_t *) pm_arena_alloc(arena, sizeof(pm_numbered_parameters_node_t), PRISM_ALIGNOF(pm_numbered_parameters_node_t));
3663
3664
97
    *node = (pm_numbered_parameters_node_t) {
3665
97
        .base = { .type = PM_NUMBERED_PARAMETERS_NODE, .flags = flags, .node_id = node_id, .location = location },
3666
97
        .maximum = maximum
3667
97
    };
3668
3669
97
    return node;
3670
97
}
3671
3672
/**
3673
 * Allocate and initialize a new NumberedReferenceReadNode node.
3674
 */
3675
pm_numbered_reference_read_node_t *
3676
409
pm_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) {
3677
409
    pm_numbered_reference_read_node_t *node = (pm_numbered_reference_read_node_t *) pm_arena_alloc(arena, sizeof(pm_numbered_reference_read_node_t), PRISM_ALIGNOF(pm_numbered_reference_read_node_t));
3678
3679
409
    *node = (pm_numbered_reference_read_node_t) {
3680
409
        .base = { .type = PM_NUMBERED_REFERENCE_READ_NODE, .flags = flags, .node_id = node_id, .location = location },
3681
409
        .number = number
3682
409
    };
3683
3684
409
    return node;
3685
409
}
3686
3687
/**
3688
 * Allocate and initialize a new OptionalKeywordParameterNode node.
3689
 */
3690
pm_optional_keyword_parameter_node_t *
3691
2.23k
pm_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) {
3692
2.23k
    pm_optional_keyword_parameter_node_t *node = (pm_optional_keyword_parameter_node_t *) pm_arena_alloc(arena, sizeof(pm_optional_keyword_parameter_node_t), PRISM_ALIGNOF(pm_optional_keyword_parameter_node_t));
3693
3694
2.23k
    *node = (pm_optional_keyword_parameter_node_t) {
3695
2.23k
        .base = { .type = PM_OPTIONAL_KEYWORD_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
3696
2.23k
        .name = name,
3697
2.23k
        .name_loc = name_loc,
3698
2.23k
        .value = value
3699
2.23k
    };
3700
3701
2.23k
    return node;
3702
2.23k
}
3703
3704
/**
3705
 * Allocate and initialize a new OptionalParameterNode node.
3706
 */
3707
pm_optional_parameter_node_t *
3708
3.79k
pm_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) {
3709
3.79k
    pm_optional_parameter_node_t *node = (pm_optional_parameter_node_t *) pm_arena_alloc(arena, sizeof(pm_optional_parameter_node_t), PRISM_ALIGNOF(pm_optional_parameter_node_t));
3710
3711
3.79k
    *node = (pm_optional_parameter_node_t) {
3712
3.79k
        .base = { .type = PM_OPTIONAL_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
3713
3.79k
        .name = name,
3714
3.79k
        .name_loc = name_loc,
3715
3.79k
        .operator_loc = operator_loc,
3716
3.79k
        .value = value
3717
3.79k
    };
3718
3719
3.79k
    return node;
3720
3.79k
}
3721
3722
/**
3723
 * Allocate and initialize a new OrNode node.
3724
 */
3725
pm_or_node_t *
3726
1.19k
pm_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) {
3727
1.19k
    pm_or_node_t *node = (pm_or_node_t *) pm_arena_alloc(arena, sizeof(pm_or_node_t), PRISM_ALIGNOF(pm_or_node_t));
3728
3729
1.19k
    *node = (pm_or_node_t) {
3730
1.19k
        .base = { .type = PM_OR_NODE, .flags = flags, .node_id = node_id, .location = location },
3731
1.19k
        .left = left,
3732
1.19k
        .right = right,
3733
1.19k
        .operator_loc = operator_loc
3734
1.19k
    };
3735
3736
1.19k
    return node;
3737
1.19k
}
3738
3739
/**
3740
 * Allocate and initialize a new ParametersNode node.
3741
 */
3742
pm_parameters_node_t *
3743
19.5k
pm_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) {
3744
19.5k
    pm_parameters_node_t *node = (pm_parameters_node_t *) pm_arena_alloc(arena, sizeof(pm_parameters_node_t), PRISM_ALIGNOF(pm_parameters_node_t));
3745
3746
19.5k
    *node = (pm_parameters_node_t) {
3747
19.5k
        .base = { .type = PM_PARAMETERS_NODE, .flags = flags, .node_id = node_id, .location = location },
3748
19.5k
        .requireds = requireds,
3749
19.5k
        .optionals = optionals,
3750
19.5k
        .rest = rest,
3751
19.5k
        .posts = posts,
3752
19.5k
        .keywords = keywords,
3753
19.5k
        .keyword_rest = keyword_rest,
3754
19.5k
        .block = block
3755
19.5k
    };
3756
3757
19.5k
    return node;
3758
19.5k
}
3759
3760
/**
3761
 * Allocate and initialize a new ParenthesesNode node.
3762
 */
3763
pm_parentheses_node_t *
3764
25.4k
pm_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) {
3765
25.4k
    pm_parentheses_node_t *node = (pm_parentheses_node_t *) pm_arena_alloc(arena, sizeof(pm_parentheses_node_t), PRISM_ALIGNOF(pm_parentheses_node_t));
3766
3767
25.4k
    *node = (pm_parentheses_node_t) {
3768
25.4k
        .base = { .type = PM_PARENTHESES_NODE, .flags = flags, .node_id = node_id, .location = location },
3769
25.4k
        .body = body,
3770
25.4k
        .opening_loc = opening_loc,
3771
25.4k
        .closing_loc = closing_loc
3772
25.4k
    };
3773
3774
25.4k
    return node;
3775
25.4k
}
3776
3777
/**
3778
 * Allocate and initialize a new PinnedExpressionNode node.
3779
 */
3780
pm_pinned_expression_node_t *
3781
382
pm_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) {
3782
382
    pm_pinned_expression_node_t *node = (pm_pinned_expression_node_t *) pm_arena_alloc(arena, sizeof(pm_pinned_expression_node_t), PRISM_ALIGNOF(pm_pinned_expression_node_t));
3783
3784
382
    *node = (pm_pinned_expression_node_t) {
3785
382
        .base = { .type = PM_PINNED_EXPRESSION_NODE, .flags = flags, .node_id = node_id, .location = location },
3786
382
        .expression = expression,
3787
382
        .operator_loc = operator_loc,
3788
382
        .lparen_loc = lparen_loc,
3789
382
        .rparen_loc = rparen_loc
3790
382
    };
3791
3792
382
    return node;
3793
382
}
3794
3795
/**
3796
 * Allocate and initialize a new PinnedVariableNode node.
3797
 */
3798
pm_pinned_variable_node_t *
3799
716
pm_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) {
3800
716
    pm_pinned_variable_node_t *node = (pm_pinned_variable_node_t *) pm_arena_alloc(arena, sizeof(pm_pinned_variable_node_t), PRISM_ALIGNOF(pm_pinned_variable_node_t));
3801
3802
716
    *node = (pm_pinned_variable_node_t) {
3803
716
        .base = { .type = PM_PINNED_VARIABLE_NODE, .flags = flags, .node_id = node_id, .location = location },
3804
716
        .variable = variable,
3805
716
        .operator_loc = operator_loc
3806
716
    };
3807
3808
716
    return node;
3809
716
}
3810
3811
/**
3812
 * Allocate and initialize a new PostExecutionNode node.
3813
 */
3814
pm_post_execution_node_t *
3815
600
pm_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) {
3816
600
    pm_post_execution_node_t *node = (pm_post_execution_node_t *) pm_arena_alloc(arena, sizeof(pm_post_execution_node_t), PRISM_ALIGNOF(pm_post_execution_node_t));
3817
3818
600
    *node = (pm_post_execution_node_t) {
3819
600
        .base = { .type = PM_POST_EXECUTION_NODE, .flags = flags, .node_id = node_id, .location = location },
3820
600
        .statements = statements,
3821
600
        .keyword_loc = keyword_loc,
3822
600
        .opening_loc = opening_loc,
3823
600
        .closing_loc = closing_loc
3824
600
    };
3825
3826
600
    return node;
3827
600
}
3828
3829
/**
3830
 * Allocate and initialize a new PreExecutionNode node.
3831
 */
3832
pm_pre_execution_node_t *
3833
92
pm_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) {
3834
92
    pm_pre_execution_node_t *node = (pm_pre_execution_node_t *) pm_arena_alloc(arena, sizeof(pm_pre_execution_node_t), PRISM_ALIGNOF(pm_pre_execution_node_t));
3835
3836
92
    *node = (pm_pre_execution_node_t) {
3837
92
        .base = { .type = PM_PRE_EXECUTION_NODE, .flags = flags, .node_id = node_id, .location = location },
3838
92
        .statements = statements,
3839
92
        .keyword_loc = keyword_loc,
3840
92
        .opening_loc = opening_loc,
3841
92
        .closing_loc = closing_loc
3842
92
    };
3843
3844
92
    return node;
3845
92
}
3846
3847
/**
3848
 * Allocate and initialize a new ProgramNode node.
3849
 */
3850
pm_program_node_t *
3851
15.1k
pm_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) {
3852
15.1k
    pm_program_node_t *node = (pm_program_node_t *) pm_arena_alloc(arena, sizeof(pm_program_node_t), PRISM_ALIGNOF(pm_program_node_t));
3853
3854
15.1k
    *node = (pm_program_node_t) {
3855
15.1k
        .base = { .type = PM_PROGRAM_NODE, .flags = flags, .node_id = node_id, .location = location },
3856
15.1k
        .locals = locals,
3857
15.1k
        .statements = statements
3858
15.1k
    };
3859
3860
15.1k
    return node;
3861
15.1k
}
3862
3863
/**
3864
 * Allocate and initialize a new RangeNode node.
3865
 */
3866
pm_range_node_t *
3867
6.15k
pm_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) {
3868
6.15k
    pm_range_node_t *node = (pm_range_node_t *) pm_arena_alloc(arena, sizeof(pm_range_node_t), PRISM_ALIGNOF(pm_range_node_t));
3869
3870
6.15k
    *node = (pm_range_node_t) {
3871
6.15k
        .base = { .type = PM_RANGE_NODE, .flags = flags, .node_id = node_id, .location = location },
3872
6.15k
        .left = left,
3873
6.15k
        .right = right,
3874
6.15k
        .operator_loc = operator_loc
3875
6.15k
    };
3876
3877
6.15k
    return node;
3878
6.15k
}
3879
3880
/**
3881
 * Allocate and initialize a new RationalNode node.
3882
 */
3883
pm_rational_node_t *
3884
2.37k
pm_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) {
3885
2.37k
    pm_rational_node_t *node = (pm_rational_node_t *) pm_arena_alloc(arena, sizeof(pm_rational_node_t), PRISM_ALIGNOF(pm_rational_node_t));
3886
3887
2.37k
    *node = (pm_rational_node_t) {
3888
2.37k
        .base = { .type = PM_RATIONAL_NODE, .flags = flags, .node_id = node_id, .location = location },
3889
2.37k
        .numerator = numerator,
3890
2.37k
        .denominator = denominator
3891
2.37k
    };
3892
3893
2.37k
    return node;
3894
2.37k
}
3895
3896
/**
3897
 * Allocate and initialize a new RedoNode node.
3898
 */
3899
pm_redo_node_t *
3900
71
pm_redo_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
3901
71
    pm_redo_node_t *node = (pm_redo_node_t *) pm_arena_alloc(arena, sizeof(pm_redo_node_t), PRISM_ALIGNOF(pm_redo_node_t));
3902
3903
71
    *node = (pm_redo_node_t) {
3904
71
        .base = { .type = PM_REDO_NODE, .flags = flags, .node_id = node_id, .location = location }
3905
71
    };
3906
3907
71
    return node;
3908
71
}
3909
3910
/**
3911
 * Allocate and initialize a new RegularExpressionNode node.
3912
 */
3913
pm_regular_expression_node_t *
3914
7.30k
pm_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) {
3915
7.30k
    pm_regular_expression_node_t *node = (pm_regular_expression_node_t *) pm_arena_alloc(arena, sizeof(pm_regular_expression_node_t), PRISM_ALIGNOF(pm_regular_expression_node_t));
3916
3917
7.30k
    *node = (pm_regular_expression_node_t) {
3918
7.30k
        .base = { .type = PM_REGULAR_EXPRESSION_NODE, .flags = flags, .node_id = node_id, .location = location },
3919
7.30k
        .opening_loc = opening_loc,
3920
7.30k
        .content_loc = content_loc,
3921
7.30k
        .closing_loc = closing_loc,
3922
7.30k
        .unescaped = unescaped
3923
7.30k
    };
3924
3925
7.30k
    return node;
3926
7.30k
}
3927
3928
/**
3929
 * Allocate and initialize a new RequiredKeywordParameterNode node.
3930
 */
3931
pm_required_keyword_parameter_node_t *
3932
1.71k
pm_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) {
3933
1.71k
    pm_required_keyword_parameter_node_t *node = (pm_required_keyword_parameter_node_t *) pm_arena_alloc(arena, sizeof(pm_required_keyword_parameter_node_t), PRISM_ALIGNOF(pm_required_keyword_parameter_node_t));
3934
3935
1.71k
    *node = (pm_required_keyword_parameter_node_t) {
3936
1.71k
        .base = { .type = PM_REQUIRED_KEYWORD_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
3937
1.71k
        .name = name,
3938
1.71k
        .name_loc = name_loc
3939
1.71k
    };
3940
3941
1.71k
    return node;
3942
1.71k
}
3943
3944
/**
3945
 * Allocate and initialize a new RequiredParameterNode node.
3946
 */
3947
pm_required_parameter_node_t *
3948
19.1k
pm_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) {
3949
19.1k
    pm_required_parameter_node_t *node = (pm_required_parameter_node_t *) pm_arena_alloc(arena, sizeof(pm_required_parameter_node_t), PRISM_ALIGNOF(pm_required_parameter_node_t));
3950
3951
19.1k
    *node = (pm_required_parameter_node_t) {
3952
19.1k
        .base = { .type = PM_REQUIRED_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
3953
19.1k
        .name = name
3954
19.1k
    };
3955
3956
19.1k
    return node;
3957
19.1k
}
3958
3959
/**
3960
 * Allocate and initialize a new RescueModifierNode node.
3961
 */
3962
pm_rescue_modifier_node_t *
3963
1.76k
pm_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) {
3964
1.76k
    pm_rescue_modifier_node_t *node = (pm_rescue_modifier_node_t *) pm_arena_alloc(arena, sizeof(pm_rescue_modifier_node_t), PRISM_ALIGNOF(pm_rescue_modifier_node_t));
3965
3966
1.76k
    *node = (pm_rescue_modifier_node_t) {
3967
1.76k
        .base = { .type = PM_RESCUE_MODIFIER_NODE, .flags = flags, .node_id = node_id, .location = location },
3968
1.76k
        .expression = expression,
3969
1.76k
        .keyword_loc = keyword_loc,
3970
1.76k
        .rescue_expression = rescue_expression
3971
1.76k
    };
3972
3973
1.76k
    return node;
3974
1.76k
}
3975
3976
/**
3977
 * Allocate and initialize a new RescueNode node.
3978
 */
3979
pm_rescue_node_t *
3980
1.46k
pm_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) {
3981
1.46k
    pm_rescue_node_t *node = (pm_rescue_node_t *) pm_arena_alloc(arena, sizeof(pm_rescue_node_t), PRISM_ALIGNOF(pm_rescue_node_t));
3982
3983
1.46k
    *node = (pm_rescue_node_t) {
3984
1.46k
        .base = { .type = PM_RESCUE_NODE, .flags = flags, .node_id = node_id, .location = location },
3985
1.46k
        .keyword_loc = keyword_loc,
3986
1.46k
        .exceptions = exceptions,
3987
1.46k
        .operator_loc = operator_loc,
3988
1.46k
        .reference = reference,
3989
1.46k
        .then_keyword_loc = then_keyword_loc,
3990
1.46k
        .statements = statements,
3991
1.46k
        .subsequent = subsequent
3992
1.46k
    };
3993
3994
1.46k
    return node;
3995
1.46k
}
3996
3997
/**
3998
 * Allocate and initialize a new RestParameterNode node.
3999
 */
4000
pm_rest_parameter_node_t *
4001
4.57k
pm_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) {
4002
4.57k
    pm_rest_parameter_node_t *node = (pm_rest_parameter_node_t *) pm_arena_alloc(arena, sizeof(pm_rest_parameter_node_t), PRISM_ALIGNOF(pm_rest_parameter_node_t));
4003
4004
4.57k
    *node = (pm_rest_parameter_node_t) {
4005
4.57k
        .base = { .type = PM_REST_PARAMETER_NODE, .flags = flags, .node_id = node_id, .location = location },
4006
4.57k
        .name = name,
4007
4.57k
        .name_loc = name_loc,
4008
4.57k
        .operator_loc = operator_loc
4009
4.57k
    };
4010
4011
4.57k
    return node;
4012
4.57k
}
4013
4014
/**
4015
 * Allocate and initialize a new RetryNode node.
4016
 */
4017
pm_retry_node_t *
4018
319
pm_retry_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
4019
319
    pm_retry_node_t *node = (pm_retry_node_t *) pm_arena_alloc(arena, sizeof(pm_retry_node_t), PRISM_ALIGNOF(pm_retry_node_t));
4020
4021
319
    *node = (pm_retry_node_t) {
4022
319
        .base = { .type = PM_RETRY_NODE, .flags = flags, .node_id = node_id, .location = location }
4023
319
    };
4024
4025
319
    return node;
4026
319
}
4027
4028
/**
4029
 * Allocate and initialize a new ReturnNode node.
4030
 */
4031
pm_return_node_t *
4032
1.80k
pm_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) {
4033
1.80k
    pm_return_node_t *node = (pm_return_node_t *) pm_arena_alloc(arena, sizeof(pm_return_node_t), PRISM_ALIGNOF(pm_return_node_t));
4034
4035
1.80k
    *node = (pm_return_node_t) {
4036
1.80k
        .base = { .type = PM_RETURN_NODE, .flags = flags, .node_id = node_id, .location = location },
4037
1.80k
        .keyword_loc = keyword_loc,
4038
1.80k
        .arguments = arguments
4039
1.80k
    };
4040
4041
1.80k
    return node;
4042
1.80k
}
4043
4044
/**
4045
 * Allocate and initialize a new SelfNode node.
4046
 */
4047
pm_self_node_t *
4048
1.22k
pm_self_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
4049
1.22k
    pm_self_node_t *node = (pm_self_node_t *) pm_arena_alloc(arena, sizeof(pm_self_node_t), PRISM_ALIGNOF(pm_self_node_t));
4050
4051
1.22k
    *node = (pm_self_node_t) {
4052
1.22k
        .base = { .type = PM_SELF_NODE, .flags = flags, .node_id = node_id, .location = location }
4053
1.22k
    };
4054
4055
1.22k
    return node;
4056
1.22k
}
4057
4058
/**
4059
 * Allocate and initialize a new ShareableConstantNode node.
4060
 */
4061
pm_shareable_constant_node_t *
4062
0
pm_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) {
4063
0
    pm_shareable_constant_node_t *node = (pm_shareable_constant_node_t *) pm_arena_alloc(arena, sizeof(pm_shareable_constant_node_t), PRISM_ALIGNOF(pm_shareable_constant_node_t));
4064
4065
0
    *node = (pm_shareable_constant_node_t) {
4066
0
        .base = { .type = PM_SHAREABLE_CONSTANT_NODE, .flags = flags, .node_id = node_id, .location = location },
4067
0
        .write = write
4068
0
    };
4069
4070
0
    return node;
4071
0
}
4072
4073
/**
4074
 * Allocate and initialize a new SingletonClassNode node.
4075
 */
4076
pm_singleton_class_node_t *
4077
1.06k
pm_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) {
4078
1.06k
    pm_singleton_class_node_t *node = (pm_singleton_class_node_t *) pm_arena_alloc(arena, sizeof(pm_singleton_class_node_t), PRISM_ALIGNOF(pm_singleton_class_node_t));
4079
4080
1.06k
    *node = (pm_singleton_class_node_t) {
4081
1.06k
        .base = { .type = PM_SINGLETON_CLASS_NODE, .flags = flags, .node_id = node_id, .location = location },
4082
1.06k
        .locals = locals,
4083
1.06k
        .class_keyword_loc = class_keyword_loc,
4084
1.06k
        .operator_loc = operator_loc,
4085
1.06k
        .expression = expression,
4086
1.06k
        .body = body,
4087
1.06k
        .end_keyword_loc = end_keyword_loc
4088
1.06k
    };
4089
4090
1.06k
    return node;
4091
1.06k
}
4092
4093
/**
4094
 * Allocate and initialize a new SourceEncodingNode node.
4095
 */
4096
pm_source_encoding_node_t *
4097
301
pm_source_encoding_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
4098
301
    pm_source_encoding_node_t *node = (pm_source_encoding_node_t *) pm_arena_alloc(arena, sizeof(pm_source_encoding_node_t), PRISM_ALIGNOF(pm_source_encoding_node_t));
4099
4100
301
    *node = (pm_source_encoding_node_t) {
4101
301
        .base = { .type = PM_SOURCE_ENCODING_NODE, .flags = flags, .node_id = node_id, .location = location }
4102
301
    };
4103
4104
301
    return node;
4105
301
}
4106
4107
/**
4108
 * Allocate and initialize a new SourceFileNode node.
4109
 */
4110
pm_source_file_node_t *
4111
356
pm_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) {
4112
356
    pm_source_file_node_t *node = (pm_source_file_node_t *) pm_arena_alloc(arena, sizeof(pm_source_file_node_t), PRISM_ALIGNOF(pm_source_file_node_t));
4113
4114
356
    *node = (pm_source_file_node_t) {
4115
356
        .base = { .type = PM_SOURCE_FILE_NODE, .flags = flags, .node_id = node_id, .location = location },
4116
356
        .filepath = filepath
4117
356
    };
4118
4119
356
    return node;
4120
356
}
4121
4122
/**
4123
 * Allocate and initialize a new SourceLineNode node.
4124
 */
4125
pm_source_line_node_t *
4126
374
pm_source_line_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
4127
374
    pm_source_line_node_t *node = (pm_source_line_node_t *) pm_arena_alloc(arena, sizeof(pm_source_line_node_t), PRISM_ALIGNOF(pm_source_line_node_t));
4128
4129
374
    *node = (pm_source_line_node_t) {
4130
374
        .base = { .type = PM_SOURCE_LINE_NODE, .flags = flags, .node_id = node_id, .location = location }
4131
374
    };
4132
4133
374
    return node;
4134
374
}
4135
4136
/**
4137
 * Allocate and initialize a new SplatNode node.
4138
 */
4139
pm_splat_node_t *
4140
14.9k
pm_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) {
4141
14.9k
    pm_splat_node_t *node = (pm_splat_node_t *) pm_arena_alloc(arena, sizeof(pm_splat_node_t), PRISM_ALIGNOF(pm_splat_node_t));
4142
4143
14.9k
    *node = (pm_splat_node_t) {
4144
14.9k
        .base = { .type = PM_SPLAT_NODE, .flags = flags, .node_id = node_id, .location = location },
4145
14.9k
        .operator_loc = operator_loc,
4146
14.9k
        .expression = expression
4147
14.9k
    };
4148
4149
14.9k
    return node;
4150
14.9k
}
4151
4152
/**
4153
 * Allocate and initialize a new StatementsNode node.
4154
 */
4155
pm_statements_node_t *
4156
83.5k
pm_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) {
4157
83.5k
    pm_statements_node_t *node = (pm_statements_node_t *) pm_arena_alloc(arena, sizeof(pm_statements_node_t), PRISM_ALIGNOF(pm_statements_node_t));
4158
4159
83.5k
    *node = (pm_statements_node_t) {
4160
83.5k
        .base = { .type = PM_STATEMENTS_NODE, .flags = flags, .node_id = node_id, .location = location },
4161
83.5k
        .body = body
4162
83.5k
    };
4163
4164
83.5k
    return node;
4165
83.5k
}
4166
4167
/**
4168
 * Allocate and initialize a new StringNode node.
4169
 */
4170
pm_string_node_t *
4171
67.2k
pm_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) {
4172
67.2k
    pm_string_node_t *node = (pm_string_node_t *) pm_arena_alloc(arena, sizeof(pm_string_node_t), PRISM_ALIGNOF(pm_string_node_t));
4173
4174
67.2k
    *node = (pm_string_node_t) {
4175
67.2k
        .base = { .type = PM_STRING_NODE, .flags = flags, .node_id = node_id, .location = location },
4176
67.2k
        .opening_loc = opening_loc,
4177
67.2k
        .content_loc = content_loc,
4178
67.2k
        .closing_loc = closing_loc,
4179
67.2k
        .unescaped = unescaped
4180
67.2k
    };
4181
4182
67.2k
    return node;
4183
67.2k
}
4184
4185
/**
4186
 * Allocate and initialize a new SuperNode node.
4187
 */
4188
pm_super_node_t *
4189
242
pm_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) {
4190
242
    pm_super_node_t *node = (pm_super_node_t *) pm_arena_alloc(arena, sizeof(pm_super_node_t), PRISM_ALIGNOF(pm_super_node_t));
4191
4192
242
    *node = (pm_super_node_t) {
4193
242
        .base = { .type = PM_SUPER_NODE, .flags = flags, .node_id = node_id, .location = location },
4194
242
        .keyword_loc = keyword_loc,
4195
242
        .lparen_loc = lparen_loc,
4196
242
        .arguments = arguments,
4197
242
        .rparen_loc = rparen_loc,
4198
242
        .block = block
4199
242
    };
4200
4201
242
    return node;
4202
242
}
4203
4204
/**
4205
 * Allocate and initialize a new SymbolNode node.
4206
 */
4207
pm_symbol_node_t *
4208
33.0k
pm_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 content_loc, pm_location_t closing_loc, pm_string_t unescaped) {
4209
33.0k
    pm_symbol_node_t *node = (pm_symbol_node_t *) pm_arena_alloc(arena, sizeof(pm_symbol_node_t), PRISM_ALIGNOF(pm_symbol_node_t));
4210
4211
33.0k
    *node = (pm_symbol_node_t) {
4212
33.0k
        .base = { .type = PM_SYMBOL_NODE, .flags = flags, .node_id = node_id, .location = location },
4213
33.0k
        .opening_loc = opening_loc,
4214
33.0k
        .content_loc = content_loc,
4215
33.0k
        .closing_loc = closing_loc,
4216
33.0k
        .unescaped = unescaped
4217
33.0k
    };
4218
4219
33.0k
    return node;
4220
33.0k
}
4221
4222
/**
4223
 * Allocate and initialize a new TrueNode node.
4224
 */
4225
pm_true_node_t *
4226
7.37k
pm_true_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location) {
4227
7.37k
    pm_true_node_t *node = (pm_true_node_t *) pm_arena_alloc(arena, sizeof(pm_true_node_t), PRISM_ALIGNOF(pm_true_node_t));
4228
4229
7.37k
    *node = (pm_true_node_t) {
4230
7.37k
        .base = { .type = PM_TRUE_NODE, .flags = flags, .node_id = node_id, .location = location }
4231
7.37k
    };
4232
4233
7.37k
    return node;
4234
7.37k
}
4235
4236
/**
4237
 * Allocate and initialize a new UndefNode node.
4238
 */
4239
pm_undef_node_t *
4240
367
pm_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) {
4241
367
    pm_undef_node_t *node = (pm_undef_node_t *) pm_arena_alloc(arena, sizeof(pm_undef_node_t), PRISM_ALIGNOF(pm_undef_node_t));
4242
4243
367
    *node = (pm_undef_node_t) {
4244
367
        .base = { .type = PM_UNDEF_NODE, .flags = flags, .node_id = node_id, .location = location },
4245
367
        .names = names,
4246
367
        .keyword_loc = keyword_loc
4247
367
    };
4248
4249
367
    return node;
4250
367
}
4251
4252
/**
4253
 * Allocate and initialize a new UnlessNode node.
4254
 */
4255
pm_unless_node_t *
4256
102
pm_unless_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t unless_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) {
4257
102
    pm_unless_node_t *node = (pm_unless_node_t *) pm_arena_alloc(arena, sizeof(pm_unless_node_t), PRISM_ALIGNOF(pm_unless_node_t));
4258
4259
102
    *node = (pm_unless_node_t) {
4260
102
        .base = { .type = PM_UNLESS_NODE, .flags = flags, .node_id = node_id, .location = location },
4261
102
        .unless_keyword_loc = unless_keyword_loc,
4262
102
        .predicate = predicate,
4263
102
        .then_keyword_loc = then_keyword_loc,
4264
102
        .statements = statements,
4265
102
        .else_clause = else_clause,
4266
102
        .end_keyword_loc = end_keyword_loc
4267
102
    };
4268
4269
102
    return node;
4270
102
}
4271
4272
/**
4273
 * Allocate and initialize a new UntilNode node.
4274
 */
4275
pm_until_node_t *
4276
824
pm_until_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t until_keyword_loc, pm_location_t do_keyword_loc, pm_location_t end_keyword_loc, struct pm_node *predicate, struct pm_statements_node *statements) {
4277
824
    pm_until_node_t *node = (pm_until_node_t *) pm_arena_alloc(arena, sizeof(pm_until_node_t), PRISM_ALIGNOF(pm_until_node_t));
4278
4279
824
    *node = (pm_until_node_t) {
4280
824
        .base = { .type = PM_UNTIL_NODE, .flags = flags, .node_id = node_id, .location = location },
4281
824
        .until_keyword_loc = until_keyword_loc,
4282
824
        .do_keyword_loc = do_keyword_loc,
4283
824
        .end_keyword_loc = end_keyword_loc,
4284
824
        .predicate = predicate,
4285
824
        .statements = statements
4286
824
    };
4287
4288
824
    return node;
4289
824
}
4290
4291
/**
4292
 * Allocate and initialize a new WhenNode node.
4293
 */
4294
pm_when_node_t *
4295
643
pm_when_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t when_keyword_loc, pm_node_list_t conditions, pm_location_t then_keyword_loc, struct pm_statements_node *statements) {
4296
643
    pm_when_node_t *node = (pm_when_node_t *) pm_arena_alloc(arena, sizeof(pm_when_node_t), PRISM_ALIGNOF(pm_when_node_t));
4297
4298
643
    *node = (pm_when_node_t) {
4299
643
        .base = { .type = PM_WHEN_NODE, .flags = flags, .node_id = node_id, .location = location },
4300
643
        .when_keyword_loc = when_keyword_loc,
4301
643
        .conditions = conditions,
4302
643
        .then_keyword_loc = then_keyword_loc,
4303
643
        .statements = statements
4304
643
    };
4305
4306
643
    return node;
4307
643
}
4308
4309
/**
4310
 * Allocate and initialize a new WhileNode node.
4311
 */
4312
pm_while_node_t *
4313
3.40k
pm_while_node_new(pm_arena_t *arena, uint32_t node_id, pm_node_flags_t flags, pm_location_t location, pm_location_t while_keyword_loc, pm_location_t do_keyword_loc, pm_location_t end_keyword_loc, struct pm_node *predicate, struct pm_statements_node *statements) {
4314
3.40k
    pm_while_node_t *node = (pm_while_node_t *) pm_arena_alloc(arena, sizeof(pm_while_node_t), PRISM_ALIGNOF(pm_while_node_t));
4315
4316
3.40k
    *node = (pm_while_node_t) {
4317
3.40k
        .base = { .type = PM_WHILE_NODE, .flags = flags, .node_id = node_id, .location = location },
4318
3.40k
        .while_keyword_loc = while_keyword_loc,
4319
3.40k
        .do_keyword_loc = do_keyword_loc,
4320
3.40k
        .end_keyword_loc = end_keyword_loc,
4321
3.40k
        .predicate = predicate,
4322
3.40k
        .statements = statements
4323
3.40k
    };
4324
4325
3.40k
    return node;
4326
3.40k
}
4327
4328
/**
4329
 * Allocate and initialize a new XStringNode node.
4330
 */
4331
pm_x_string_node_t *
4332
1.99k
pm_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) {
4333
1.99k
    pm_x_string_node_t *node = (pm_x_string_node_t *) pm_arena_alloc(arena, sizeof(pm_x_string_node_t), PRISM_ALIGNOF(pm_x_string_node_t));
4334
4335
1.99k
    *node = (pm_x_string_node_t) {
4336
1.99k
        .base = { .type = PM_X_STRING_NODE, .flags = flags, .node_id = node_id, .location = location },
4337
1.99k
        .opening_loc = opening_loc,
4338
1.99k
        .content_loc = content_loc,
4339
1.99k
        .closing_loc = closing_loc,
4340
1.99k
        .unescaped = unescaped
4341
1.99k
    };
4342
4343
1.99k
    return node;
4344
1.99k
}
4345
4346
/**
4347
 * Allocate and initialize a new YieldNode node.
4348
 */
4349
pm_yield_node_t *
4350
128
pm_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) {
4351
128
    pm_yield_node_t *node = (pm_yield_node_t *) pm_arena_alloc(arena, sizeof(pm_yield_node_t), PRISM_ALIGNOF(pm_yield_node_t));
4352
4353
128
    *node = (pm_yield_node_t) {
4354
128
        .base = { .type = PM_YIELD_NODE, .flags = flags, .node_id = node_id, .location = location },
4355
128
        .keyword_loc = keyword_loc,
4356
128
        .lparen_loc = lparen_loc,
4357
128
        .arguments = arguments,
4358
128
        .rparen_loc = rparen_loc
4359
128
    };
4360
4361
128
    return node;
4362
128
}