prism 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +172 -0
  3. data/CODE_OF_CONDUCT.md +76 -0
  4. data/CONTRIBUTING.md +62 -0
  5. data/LICENSE.md +7 -0
  6. data/Makefile +84 -0
  7. data/README.md +89 -0
  8. data/config.yml +2481 -0
  9. data/docs/build_system.md +74 -0
  10. data/docs/building.md +22 -0
  11. data/docs/configuration.md +60 -0
  12. data/docs/design.md +53 -0
  13. data/docs/encoding.md +117 -0
  14. data/docs/fuzzing.md +93 -0
  15. data/docs/heredocs.md +36 -0
  16. data/docs/mapping.md +117 -0
  17. data/docs/ripper.md +36 -0
  18. data/docs/ruby_api.md +25 -0
  19. data/docs/serialization.md +181 -0
  20. data/docs/testing.md +55 -0
  21. data/ext/prism/api_node.c +4725 -0
  22. data/ext/prism/api_pack.c +256 -0
  23. data/ext/prism/extconf.rb +136 -0
  24. data/ext/prism/extension.c +626 -0
  25. data/ext/prism/extension.h +18 -0
  26. data/include/prism/ast.h +1932 -0
  27. data/include/prism/defines.h +45 -0
  28. data/include/prism/diagnostic.h +231 -0
  29. data/include/prism/enc/pm_encoding.h +95 -0
  30. data/include/prism/node.h +41 -0
  31. data/include/prism/pack.h +141 -0
  32. data/include/prism/parser.h +418 -0
  33. data/include/prism/regexp.h +19 -0
  34. data/include/prism/unescape.h +48 -0
  35. data/include/prism/util/pm_buffer.h +51 -0
  36. data/include/prism/util/pm_char.h +91 -0
  37. data/include/prism/util/pm_constant_pool.h +78 -0
  38. data/include/prism/util/pm_list.h +67 -0
  39. data/include/prism/util/pm_memchr.h +14 -0
  40. data/include/prism/util/pm_newline_list.h +61 -0
  41. data/include/prism/util/pm_state_stack.h +24 -0
  42. data/include/prism/util/pm_string.h +61 -0
  43. data/include/prism/util/pm_string_list.h +25 -0
  44. data/include/prism/util/pm_strpbrk.h +29 -0
  45. data/include/prism/version.h +4 -0
  46. data/include/prism.h +82 -0
  47. data/lib/prism/compiler.rb +465 -0
  48. data/lib/prism/debug.rb +157 -0
  49. data/lib/prism/desugar_compiler.rb +206 -0
  50. data/lib/prism/dispatcher.rb +2051 -0
  51. data/lib/prism/dsl.rb +750 -0
  52. data/lib/prism/ffi.rb +251 -0
  53. data/lib/prism/lex_compat.rb +838 -0
  54. data/lib/prism/mutation_compiler.rb +718 -0
  55. data/lib/prism/node.rb +14540 -0
  56. data/lib/prism/node_ext.rb +55 -0
  57. data/lib/prism/node_inspector.rb +68 -0
  58. data/lib/prism/pack.rb +185 -0
  59. data/lib/prism/parse_result/comments.rb +172 -0
  60. data/lib/prism/parse_result/newlines.rb +60 -0
  61. data/lib/prism/parse_result.rb +266 -0
  62. data/lib/prism/pattern.rb +239 -0
  63. data/lib/prism/ripper_compat.rb +174 -0
  64. data/lib/prism/serialize.rb +662 -0
  65. data/lib/prism/visitor.rb +470 -0
  66. data/lib/prism.rb +64 -0
  67. data/prism.gemspec +113 -0
  68. data/src/diagnostic.c +287 -0
  69. data/src/enc/pm_big5.c +52 -0
  70. data/src/enc/pm_euc_jp.c +58 -0
  71. data/src/enc/pm_gbk.c +61 -0
  72. data/src/enc/pm_shift_jis.c +56 -0
  73. data/src/enc/pm_tables.c +507 -0
  74. data/src/enc/pm_unicode.c +2324 -0
  75. data/src/enc/pm_windows_31j.c +56 -0
  76. data/src/node.c +2633 -0
  77. data/src/pack.c +493 -0
  78. data/src/prettyprint.c +2136 -0
  79. data/src/prism.c +14587 -0
  80. data/src/regexp.c +580 -0
  81. data/src/serialize.c +1899 -0
  82. data/src/token_type.c +349 -0
  83. data/src/unescape.c +637 -0
  84. data/src/util/pm_buffer.c +103 -0
  85. data/src/util/pm_char.c +272 -0
  86. data/src/util/pm_constant_pool.c +252 -0
  87. data/src/util/pm_list.c +41 -0
  88. data/src/util/pm_memchr.c +33 -0
  89. data/src/util/pm_newline_list.c +134 -0
  90. data/src/util/pm_state_stack.c +19 -0
  91. data/src/util/pm_string.c +200 -0
  92. data/src/util/pm_string_list.c +29 -0
  93. data/src/util/pm_strncasecmp.c +17 -0
  94. data/src/util/pm_strpbrk.c +66 -0
  95. metadata +138 -0
data/src/node.c ADDED
@@ -0,0 +1,2633 @@
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
+ #line 2 "node.c.erb"
9
+ #include "prism/node.h"
10
+
11
+ // Clear the node but preserves the location.
12
+ void pm_node_clear(pm_node_t *node) {
13
+ pm_location_t location = node->location;
14
+ memset(node, 0, sizeof(pm_node_t));
15
+ node->location = location;
16
+ }
17
+
18
+ static void
19
+ pm_node_memsize_node(pm_node_t *node, pm_memsize_t *memsize);
20
+
21
+ // Calculate the size of the node list in bytes.
22
+ static size_t
23
+ pm_node_list_memsize(pm_node_list_t *node_list, pm_memsize_t *memsize) {
24
+ size_t size = sizeof(pm_node_list_t) + (node_list->capacity * sizeof(pm_node_t *));
25
+ for (size_t index = 0; index < node_list->size; index++) {
26
+ pm_node_memsize_node(node_list->nodes[index], memsize);
27
+ }
28
+ return size;
29
+ }
30
+
31
+ // Append a new node onto the end of the node list.
32
+ void
33
+ pm_node_list_append(pm_node_list_t *list, pm_node_t *node) {
34
+ if (list->size == list->capacity) {
35
+ list->capacity = list->capacity == 0 ? 4 : list->capacity * 2;
36
+ list->nodes = (pm_node_t **) realloc(list->nodes, sizeof(pm_node_t *) * list->capacity);
37
+ }
38
+ list->nodes[list->size++] = node;
39
+ }
40
+
41
+ PRISM_EXPORTED_FUNCTION void
42
+ pm_node_destroy(pm_parser_t *parser, pm_node_t *node);
43
+
44
+ // Deallocate the inner memory of a list of nodes. The parser argument is not
45
+ // used, but is here for the future possibility of pre-allocating memory pools.
46
+ static void
47
+ pm_node_list_free(pm_parser_t *parser, pm_node_list_t *list) {
48
+ if (list->capacity > 0) {
49
+ for (size_t index = 0; index < list->size; index++) {
50
+ pm_node_destroy(parser, list->nodes[index]);
51
+ }
52
+ free(list->nodes);
53
+ }
54
+ }
55
+
56
+ // Deallocate the space for a pm_node_t. Similarly to pm_node_alloc, we're not
57
+ // using the parser argument, but it's there to allow for the future possibility
58
+ // of pre-allocating larger memory pools.
59
+ PRISM_EXPORTED_FUNCTION void
60
+ pm_node_destroy(pm_parser_t *parser, pm_node_t *node) {
61
+ switch (PM_NODE_TYPE(node)) {
62
+ #line 57 "node.c.erb"
63
+ case PM_ALIAS_GLOBAL_VARIABLE_NODE: {
64
+ pm_alias_global_variable_node_t *cast = (pm_alias_global_variable_node_t *) node;
65
+ pm_node_destroy(parser, (pm_node_t *)cast->new_name);
66
+ pm_node_destroy(parser, (pm_node_t *)cast->old_name);
67
+ break;
68
+ }
69
+ #line 57 "node.c.erb"
70
+ case PM_ALIAS_METHOD_NODE: {
71
+ pm_alias_method_node_t *cast = (pm_alias_method_node_t *) node;
72
+ pm_node_destroy(parser, (pm_node_t *)cast->new_name);
73
+ pm_node_destroy(parser, (pm_node_t *)cast->old_name);
74
+ break;
75
+ }
76
+ #line 57 "node.c.erb"
77
+ case PM_ALTERNATION_PATTERN_NODE: {
78
+ pm_alternation_pattern_node_t *cast = (pm_alternation_pattern_node_t *) node;
79
+ pm_node_destroy(parser, (pm_node_t *)cast->left);
80
+ pm_node_destroy(parser, (pm_node_t *)cast->right);
81
+ break;
82
+ }
83
+ #line 57 "node.c.erb"
84
+ case PM_AND_NODE: {
85
+ pm_and_node_t *cast = (pm_and_node_t *) node;
86
+ pm_node_destroy(parser, (pm_node_t *)cast->left);
87
+ pm_node_destroy(parser, (pm_node_t *)cast->right);
88
+ break;
89
+ }
90
+ #line 57 "node.c.erb"
91
+ case PM_ARGUMENTS_NODE: {
92
+ pm_arguments_node_t *cast = (pm_arguments_node_t *) node;
93
+ pm_node_list_free(parser, &cast->arguments);
94
+ break;
95
+ }
96
+ #line 57 "node.c.erb"
97
+ case PM_ARRAY_NODE: {
98
+ pm_array_node_t *cast = (pm_array_node_t *) node;
99
+ pm_node_list_free(parser, &cast->elements);
100
+ break;
101
+ }
102
+ #line 57 "node.c.erb"
103
+ case PM_ARRAY_PATTERN_NODE: {
104
+ pm_array_pattern_node_t *cast = (pm_array_pattern_node_t *) node;
105
+ if (cast->constant != NULL) {
106
+ pm_node_destroy(parser, (pm_node_t *)cast->constant);
107
+ }
108
+ pm_node_list_free(parser, &cast->requireds);
109
+ if (cast->rest != NULL) {
110
+ pm_node_destroy(parser, (pm_node_t *)cast->rest);
111
+ }
112
+ pm_node_list_free(parser, &cast->posts);
113
+ break;
114
+ }
115
+ #line 57 "node.c.erb"
116
+ case PM_ASSOC_NODE: {
117
+ pm_assoc_node_t *cast = (pm_assoc_node_t *) node;
118
+ pm_node_destroy(parser, (pm_node_t *)cast->key);
119
+ if (cast->value != NULL) {
120
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
121
+ }
122
+ break;
123
+ }
124
+ #line 57 "node.c.erb"
125
+ case PM_ASSOC_SPLAT_NODE: {
126
+ pm_assoc_splat_node_t *cast = (pm_assoc_splat_node_t *) node;
127
+ if (cast->value != NULL) {
128
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
129
+ }
130
+ break;
131
+ }
132
+ #line 57 "node.c.erb"
133
+ case PM_BACK_REFERENCE_READ_NODE: {
134
+ break;
135
+ }
136
+ #line 57 "node.c.erb"
137
+ case PM_BEGIN_NODE: {
138
+ pm_begin_node_t *cast = (pm_begin_node_t *) node;
139
+ if (cast->statements != NULL) {
140
+ pm_node_destroy(parser, (pm_node_t *)cast->statements);
141
+ }
142
+ if (cast->rescue_clause != NULL) {
143
+ pm_node_destroy(parser, (pm_node_t *)cast->rescue_clause);
144
+ }
145
+ if (cast->else_clause != NULL) {
146
+ pm_node_destroy(parser, (pm_node_t *)cast->else_clause);
147
+ }
148
+ if (cast->ensure_clause != NULL) {
149
+ pm_node_destroy(parser, (pm_node_t *)cast->ensure_clause);
150
+ }
151
+ break;
152
+ }
153
+ #line 57 "node.c.erb"
154
+ case PM_BLOCK_ARGUMENT_NODE: {
155
+ pm_block_argument_node_t *cast = (pm_block_argument_node_t *) node;
156
+ if (cast->expression != NULL) {
157
+ pm_node_destroy(parser, (pm_node_t *)cast->expression);
158
+ }
159
+ break;
160
+ }
161
+ #line 57 "node.c.erb"
162
+ case PM_BLOCK_LOCAL_VARIABLE_NODE: {
163
+ break;
164
+ }
165
+ #line 57 "node.c.erb"
166
+ case PM_BLOCK_NODE: {
167
+ pm_block_node_t *cast = (pm_block_node_t *) node;
168
+ pm_constant_id_list_free(&cast->locals);
169
+ if (cast->parameters != NULL) {
170
+ pm_node_destroy(parser, (pm_node_t *)cast->parameters);
171
+ }
172
+ if (cast->body != NULL) {
173
+ pm_node_destroy(parser, (pm_node_t *)cast->body);
174
+ }
175
+ break;
176
+ }
177
+ #line 57 "node.c.erb"
178
+ case PM_BLOCK_PARAMETER_NODE: {
179
+ break;
180
+ }
181
+ #line 57 "node.c.erb"
182
+ case PM_BLOCK_PARAMETERS_NODE: {
183
+ pm_block_parameters_node_t *cast = (pm_block_parameters_node_t *) node;
184
+ if (cast->parameters != NULL) {
185
+ pm_node_destroy(parser, (pm_node_t *)cast->parameters);
186
+ }
187
+ pm_node_list_free(parser, &cast->locals);
188
+ break;
189
+ }
190
+ #line 57 "node.c.erb"
191
+ case PM_BREAK_NODE: {
192
+ pm_break_node_t *cast = (pm_break_node_t *) node;
193
+ if (cast->arguments != NULL) {
194
+ pm_node_destroy(parser, (pm_node_t *)cast->arguments);
195
+ }
196
+ break;
197
+ }
198
+ #line 57 "node.c.erb"
199
+ case PM_CALL_AND_WRITE_NODE: {
200
+ pm_call_and_write_node_t *cast = (pm_call_and_write_node_t *) node;
201
+ if (cast->receiver != NULL) {
202
+ pm_node_destroy(parser, (pm_node_t *)cast->receiver);
203
+ }
204
+ if (cast->arguments != NULL) {
205
+ pm_node_destroy(parser, (pm_node_t *)cast->arguments);
206
+ }
207
+ pm_string_free(&cast->read_name);
208
+ pm_string_free(&cast->write_name);
209
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
210
+ break;
211
+ }
212
+ #line 57 "node.c.erb"
213
+ case PM_CALL_NODE: {
214
+ pm_call_node_t *cast = (pm_call_node_t *) node;
215
+ if (cast->receiver != NULL) {
216
+ pm_node_destroy(parser, (pm_node_t *)cast->receiver);
217
+ }
218
+ if (cast->arguments != NULL) {
219
+ pm_node_destroy(parser, (pm_node_t *)cast->arguments);
220
+ }
221
+ if (cast->block != NULL) {
222
+ pm_node_destroy(parser, (pm_node_t *)cast->block);
223
+ }
224
+ pm_string_free(&cast->name);
225
+ break;
226
+ }
227
+ #line 57 "node.c.erb"
228
+ case PM_CALL_OPERATOR_WRITE_NODE: {
229
+ pm_call_operator_write_node_t *cast = (pm_call_operator_write_node_t *) node;
230
+ if (cast->receiver != NULL) {
231
+ pm_node_destroy(parser, (pm_node_t *)cast->receiver);
232
+ }
233
+ if (cast->arguments != NULL) {
234
+ pm_node_destroy(parser, (pm_node_t *)cast->arguments);
235
+ }
236
+ pm_string_free(&cast->read_name);
237
+ pm_string_free(&cast->write_name);
238
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
239
+ break;
240
+ }
241
+ #line 57 "node.c.erb"
242
+ case PM_CALL_OR_WRITE_NODE: {
243
+ pm_call_or_write_node_t *cast = (pm_call_or_write_node_t *) node;
244
+ if (cast->receiver != NULL) {
245
+ pm_node_destroy(parser, (pm_node_t *)cast->receiver);
246
+ }
247
+ if (cast->arguments != NULL) {
248
+ pm_node_destroy(parser, (pm_node_t *)cast->arguments);
249
+ }
250
+ pm_string_free(&cast->read_name);
251
+ pm_string_free(&cast->write_name);
252
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
253
+ break;
254
+ }
255
+ #line 57 "node.c.erb"
256
+ case PM_CAPTURE_PATTERN_NODE: {
257
+ pm_capture_pattern_node_t *cast = (pm_capture_pattern_node_t *) node;
258
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
259
+ pm_node_destroy(parser, (pm_node_t *)cast->target);
260
+ break;
261
+ }
262
+ #line 57 "node.c.erb"
263
+ case PM_CASE_NODE: {
264
+ pm_case_node_t *cast = (pm_case_node_t *) node;
265
+ if (cast->predicate != NULL) {
266
+ pm_node_destroy(parser, (pm_node_t *)cast->predicate);
267
+ }
268
+ pm_node_list_free(parser, &cast->conditions);
269
+ if (cast->consequent != NULL) {
270
+ pm_node_destroy(parser, (pm_node_t *)cast->consequent);
271
+ }
272
+ break;
273
+ }
274
+ #line 57 "node.c.erb"
275
+ case PM_CLASS_NODE: {
276
+ pm_class_node_t *cast = (pm_class_node_t *) node;
277
+ pm_constant_id_list_free(&cast->locals);
278
+ pm_node_destroy(parser, (pm_node_t *)cast->constant_path);
279
+ if (cast->superclass != NULL) {
280
+ pm_node_destroy(parser, (pm_node_t *)cast->superclass);
281
+ }
282
+ if (cast->body != NULL) {
283
+ pm_node_destroy(parser, (pm_node_t *)cast->body);
284
+ }
285
+ break;
286
+ }
287
+ #line 57 "node.c.erb"
288
+ case PM_CLASS_VARIABLE_AND_WRITE_NODE: {
289
+ pm_class_variable_and_write_node_t *cast = (pm_class_variable_and_write_node_t *) node;
290
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
291
+ break;
292
+ }
293
+ #line 57 "node.c.erb"
294
+ case PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
295
+ pm_class_variable_operator_write_node_t *cast = (pm_class_variable_operator_write_node_t *) node;
296
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
297
+ break;
298
+ }
299
+ #line 57 "node.c.erb"
300
+ case PM_CLASS_VARIABLE_OR_WRITE_NODE: {
301
+ pm_class_variable_or_write_node_t *cast = (pm_class_variable_or_write_node_t *) node;
302
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
303
+ break;
304
+ }
305
+ #line 57 "node.c.erb"
306
+ case PM_CLASS_VARIABLE_READ_NODE: {
307
+ break;
308
+ }
309
+ #line 57 "node.c.erb"
310
+ case PM_CLASS_VARIABLE_TARGET_NODE: {
311
+ break;
312
+ }
313
+ #line 57 "node.c.erb"
314
+ case PM_CLASS_VARIABLE_WRITE_NODE: {
315
+ pm_class_variable_write_node_t *cast = (pm_class_variable_write_node_t *) node;
316
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
317
+ break;
318
+ }
319
+ #line 57 "node.c.erb"
320
+ case PM_CONSTANT_AND_WRITE_NODE: {
321
+ pm_constant_and_write_node_t *cast = (pm_constant_and_write_node_t *) node;
322
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
323
+ break;
324
+ }
325
+ #line 57 "node.c.erb"
326
+ case PM_CONSTANT_OPERATOR_WRITE_NODE: {
327
+ pm_constant_operator_write_node_t *cast = (pm_constant_operator_write_node_t *) node;
328
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
329
+ break;
330
+ }
331
+ #line 57 "node.c.erb"
332
+ case PM_CONSTANT_OR_WRITE_NODE: {
333
+ pm_constant_or_write_node_t *cast = (pm_constant_or_write_node_t *) node;
334
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
335
+ break;
336
+ }
337
+ #line 57 "node.c.erb"
338
+ case PM_CONSTANT_PATH_AND_WRITE_NODE: {
339
+ pm_constant_path_and_write_node_t *cast = (pm_constant_path_and_write_node_t *) node;
340
+ pm_node_destroy(parser, (pm_node_t *)cast->target);
341
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
342
+ break;
343
+ }
344
+ #line 57 "node.c.erb"
345
+ case PM_CONSTANT_PATH_NODE: {
346
+ pm_constant_path_node_t *cast = (pm_constant_path_node_t *) node;
347
+ if (cast->parent != NULL) {
348
+ pm_node_destroy(parser, (pm_node_t *)cast->parent);
349
+ }
350
+ pm_node_destroy(parser, (pm_node_t *)cast->child);
351
+ break;
352
+ }
353
+ #line 57 "node.c.erb"
354
+ case PM_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
355
+ pm_constant_path_operator_write_node_t *cast = (pm_constant_path_operator_write_node_t *) node;
356
+ pm_node_destroy(parser, (pm_node_t *)cast->target);
357
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
358
+ break;
359
+ }
360
+ #line 57 "node.c.erb"
361
+ case PM_CONSTANT_PATH_OR_WRITE_NODE: {
362
+ pm_constant_path_or_write_node_t *cast = (pm_constant_path_or_write_node_t *) node;
363
+ pm_node_destroy(parser, (pm_node_t *)cast->target);
364
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
365
+ break;
366
+ }
367
+ #line 57 "node.c.erb"
368
+ case PM_CONSTANT_PATH_TARGET_NODE: {
369
+ pm_constant_path_target_node_t *cast = (pm_constant_path_target_node_t *) node;
370
+ if (cast->parent != NULL) {
371
+ pm_node_destroy(parser, (pm_node_t *)cast->parent);
372
+ }
373
+ pm_node_destroy(parser, (pm_node_t *)cast->child);
374
+ break;
375
+ }
376
+ #line 57 "node.c.erb"
377
+ case PM_CONSTANT_PATH_WRITE_NODE: {
378
+ pm_constant_path_write_node_t *cast = (pm_constant_path_write_node_t *) node;
379
+ pm_node_destroy(parser, (pm_node_t *)cast->target);
380
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
381
+ break;
382
+ }
383
+ #line 57 "node.c.erb"
384
+ case PM_CONSTANT_READ_NODE: {
385
+ break;
386
+ }
387
+ #line 57 "node.c.erb"
388
+ case PM_CONSTANT_TARGET_NODE: {
389
+ break;
390
+ }
391
+ #line 57 "node.c.erb"
392
+ case PM_CONSTANT_WRITE_NODE: {
393
+ pm_constant_write_node_t *cast = (pm_constant_write_node_t *) node;
394
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
395
+ break;
396
+ }
397
+ #line 57 "node.c.erb"
398
+ case PM_DEF_NODE: {
399
+ pm_def_node_t *cast = (pm_def_node_t *) node;
400
+ if (cast->receiver != NULL) {
401
+ pm_node_destroy(parser, (pm_node_t *)cast->receiver);
402
+ }
403
+ if (cast->parameters != NULL) {
404
+ pm_node_destroy(parser, (pm_node_t *)cast->parameters);
405
+ }
406
+ if (cast->body != NULL) {
407
+ pm_node_destroy(parser, (pm_node_t *)cast->body);
408
+ }
409
+ pm_constant_id_list_free(&cast->locals);
410
+ break;
411
+ }
412
+ #line 57 "node.c.erb"
413
+ case PM_DEFINED_NODE: {
414
+ pm_defined_node_t *cast = (pm_defined_node_t *) node;
415
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
416
+ break;
417
+ }
418
+ #line 57 "node.c.erb"
419
+ case PM_ELSE_NODE: {
420
+ pm_else_node_t *cast = (pm_else_node_t *) node;
421
+ if (cast->statements != NULL) {
422
+ pm_node_destroy(parser, (pm_node_t *)cast->statements);
423
+ }
424
+ break;
425
+ }
426
+ #line 57 "node.c.erb"
427
+ case PM_EMBEDDED_STATEMENTS_NODE: {
428
+ pm_embedded_statements_node_t *cast = (pm_embedded_statements_node_t *) node;
429
+ if (cast->statements != NULL) {
430
+ pm_node_destroy(parser, (pm_node_t *)cast->statements);
431
+ }
432
+ break;
433
+ }
434
+ #line 57 "node.c.erb"
435
+ case PM_EMBEDDED_VARIABLE_NODE: {
436
+ pm_embedded_variable_node_t *cast = (pm_embedded_variable_node_t *) node;
437
+ pm_node_destroy(parser, (pm_node_t *)cast->variable);
438
+ break;
439
+ }
440
+ #line 57 "node.c.erb"
441
+ case PM_ENSURE_NODE: {
442
+ pm_ensure_node_t *cast = (pm_ensure_node_t *) node;
443
+ if (cast->statements != NULL) {
444
+ pm_node_destroy(parser, (pm_node_t *)cast->statements);
445
+ }
446
+ break;
447
+ }
448
+ #line 57 "node.c.erb"
449
+ case PM_FALSE_NODE: {
450
+ break;
451
+ }
452
+ #line 57 "node.c.erb"
453
+ case PM_FIND_PATTERN_NODE: {
454
+ pm_find_pattern_node_t *cast = (pm_find_pattern_node_t *) node;
455
+ if (cast->constant != NULL) {
456
+ pm_node_destroy(parser, (pm_node_t *)cast->constant);
457
+ }
458
+ pm_node_destroy(parser, (pm_node_t *)cast->left);
459
+ pm_node_list_free(parser, &cast->requireds);
460
+ pm_node_destroy(parser, (pm_node_t *)cast->right);
461
+ break;
462
+ }
463
+ #line 57 "node.c.erb"
464
+ case PM_FLIP_FLOP_NODE: {
465
+ pm_flip_flop_node_t *cast = (pm_flip_flop_node_t *) node;
466
+ if (cast->left != NULL) {
467
+ pm_node_destroy(parser, (pm_node_t *)cast->left);
468
+ }
469
+ if (cast->right != NULL) {
470
+ pm_node_destroy(parser, (pm_node_t *)cast->right);
471
+ }
472
+ break;
473
+ }
474
+ #line 57 "node.c.erb"
475
+ case PM_FLOAT_NODE: {
476
+ break;
477
+ }
478
+ #line 57 "node.c.erb"
479
+ case PM_FOR_NODE: {
480
+ pm_for_node_t *cast = (pm_for_node_t *) node;
481
+ pm_node_destroy(parser, (pm_node_t *)cast->index);
482
+ pm_node_destroy(parser, (pm_node_t *)cast->collection);
483
+ if (cast->statements != NULL) {
484
+ pm_node_destroy(parser, (pm_node_t *)cast->statements);
485
+ }
486
+ break;
487
+ }
488
+ #line 57 "node.c.erb"
489
+ case PM_FORWARDING_ARGUMENTS_NODE: {
490
+ break;
491
+ }
492
+ #line 57 "node.c.erb"
493
+ case PM_FORWARDING_PARAMETER_NODE: {
494
+ break;
495
+ }
496
+ #line 57 "node.c.erb"
497
+ case PM_FORWARDING_SUPER_NODE: {
498
+ pm_forwarding_super_node_t *cast = (pm_forwarding_super_node_t *) node;
499
+ if (cast->block != NULL) {
500
+ pm_node_destroy(parser, (pm_node_t *)cast->block);
501
+ }
502
+ break;
503
+ }
504
+ #line 57 "node.c.erb"
505
+ case PM_GLOBAL_VARIABLE_AND_WRITE_NODE: {
506
+ pm_global_variable_and_write_node_t *cast = (pm_global_variable_and_write_node_t *) node;
507
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
508
+ break;
509
+ }
510
+ #line 57 "node.c.erb"
511
+ case PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
512
+ pm_global_variable_operator_write_node_t *cast = (pm_global_variable_operator_write_node_t *) node;
513
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
514
+ break;
515
+ }
516
+ #line 57 "node.c.erb"
517
+ case PM_GLOBAL_VARIABLE_OR_WRITE_NODE: {
518
+ pm_global_variable_or_write_node_t *cast = (pm_global_variable_or_write_node_t *) node;
519
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
520
+ break;
521
+ }
522
+ #line 57 "node.c.erb"
523
+ case PM_GLOBAL_VARIABLE_READ_NODE: {
524
+ break;
525
+ }
526
+ #line 57 "node.c.erb"
527
+ case PM_GLOBAL_VARIABLE_TARGET_NODE: {
528
+ break;
529
+ }
530
+ #line 57 "node.c.erb"
531
+ case PM_GLOBAL_VARIABLE_WRITE_NODE: {
532
+ pm_global_variable_write_node_t *cast = (pm_global_variable_write_node_t *) node;
533
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
534
+ break;
535
+ }
536
+ #line 57 "node.c.erb"
537
+ case PM_HASH_NODE: {
538
+ pm_hash_node_t *cast = (pm_hash_node_t *) node;
539
+ pm_node_list_free(parser, &cast->elements);
540
+ break;
541
+ }
542
+ #line 57 "node.c.erb"
543
+ case PM_HASH_PATTERN_NODE: {
544
+ pm_hash_pattern_node_t *cast = (pm_hash_pattern_node_t *) node;
545
+ if (cast->constant != NULL) {
546
+ pm_node_destroy(parser, (pm_node_t *)cast->constant);
547
+ }
548
+ pm_node_list_free(parser, &cast->assocs);
549
+ if (cast->kwrest != NULL) {
550
+ pm_node_destroy(parser, (pm_node_t *)cast->kwrest);
551
+ }
552
+ break;
553
+ }
554
+ #line 57 "node.c.erb"
555
+ case PM_IF_NODE: {
556
+ pm_if_node_t *cast = (pm_if_node_t *) node;
557
+ pm_node_destroy(parser, (pm_node_t *)cast->predicate);
558
+ if (cast->statements != NULL) {
559
+ pm_node_destroy(parser, (pm_node_t *)cast->statements);
560
+ }
561
+ if (cast->consequent != NULL) {
562
+ pm_node_destroy(parser, (pm_node_t *)cast->consequent);
563
+ }
564
+ break;
565
+ }
566
+ #line 57 "node.c.erb"
567
+ case PM_IMAGINARY_NODE: {
568
+ pm_imaginary_node_t *cast = (pm_imaginary_node_t *) node;
569
+ pm_node_destroy(parser, (pm_node_t *)cast->numeric);
570
+ break;
571
+ }
572
+ #line 57 "node.c.erb"
573
+ case PM_IMPLICIT_NODE: {
574
+ pm_implicit_node_t *cast = (pm_implicit_node_t *) node;
575
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
576
+ break;
577
+ }
578
+ #line 57 "node.c.erb"
579
+ case PM_IN_NODE: {
580
+ pm_in_node_t *cast = (pm_in_node_t *) node;
581
+ pm_node_destroy(parser, (pm_node_t *)cast->pattern);
582
+ if (cast->statements != NULL) {
583
+ pm_node_destroy(parser, (pm_node_t *)cast->statements);
584
+ }
585
+ break;
586
+ }
587
+ #line 57 "node.c.erb"
588
+ case PM_INSTANCE_VARIABLE_AND_WRITE_NODE: {
589
+ pm_instance_variable_and_write_node_t *cast = (pm_instance_variable_and_write_node_t *) node;
590
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
591
+ break;
592
+ }
593
+ #line 57 "node.c.erb"
594
+ case PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
595
+ pm_instance_variable_operator_write_node_t *cast = (pm_instance_variable_operator_write_node_t *) node;
596
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
597
+ break;
598
+ }
599
+ #line 57 "node.c.erb"
600
+ case PM_INSTANCE_VARIABLE_OR_WRITE_NODE: {
601
+ pm_instance_variable_or_write_node_t *cast = (pm_instance_variable_or_write_node_t *) node;
602
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
603
+ break;
604
+ }
605
+ #line 57 "node.c.erb"
606
+ case PM_INSTANCE_VARIABLE_READ_NODE: {
607
+ break;
608
+ }
609
+ #line 57 "node.c.erb"
610
+ case PM_INSTANCE_VARIABLE_TARGET_NODE: {
611
+ break;
612
+ }
613
+ #line 57 "node.c.erb"
614
+ case PM_INSTANCE_VARIABLE_WRITE_NODE: {
615
+ pm_instance_variable_write_node_t *cast = (pm_instance_variable_write_node_t *) node;
616
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
617
+ break;
618
+ }
619
+ #line 57 "node.c.erb"
620
+ case PM_INTEGER_NODE: {
621
+ break;
622
+ }
623
+ #line 57 "node.c.erb"
624
+ case PM_INTERPOLATED_MATCH_LAST_LINE_NODE: {
625
+ pm_interpolated_match_last_line_node_t *cast = (pm_interpolated_match_last_line_node_t *) node;
626
+ pm_node_list_free(parser, &cast->parts);
627
+ break;
628
+ }
629
+ #line 57 "node.c.erb"
630
+ case PM_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
631
+ pm_interpolated_regular_expression_node_t *cast = (pm_interpolated_regular_expression_node_t *) node;
632
+ pm_node_list_free(parser, &cast->parts);
633
+ break;
634
+ }
635
+ #line 57 "node.c.erb"
636
+ case PM_INTERPOLATED_STRING_NODE: {
637
+ pm_interpolated_string_node_t *cast = (pm_interpolated_string_node_t *) node;
638
+ pm_node_list_free(parser, &cast->parts);
639
+ break;
640
+ }
641
+ #line 57 "node.c.erb"
642
+ case PM_INTERPOLATED_SYMBOL_NODE: {
643
+ pm_interpolated_symbol_node_t *cast = (pm_interpolated_symbol_node_t *) node;
644
+ pm_node_list_free(parser, &cast->parts);
645
+ break;
646
+ }
647
+ #line 57 "node.c.erb"
648
+ case PM_INTERPOLATED_X_STRING_NODE: {
649
+ pm_interpolated_x_string_node_t *cast = (pm_interpolated_x_string_node_t *) node;
650
+ pm_node_list_free(parser, &cast->parts);
651
+ break;
652
+ }
653
+ #line 57 "node.c.erb"
654
+ case PM_KEYWORD_HASH_NODE: {
655
+ pm_keyword_hash_node_t *cast = (pm_keyword_hash_node_t *) node;
656
+ pm_node_list_free(parser, &cast->elements);
657
+ break;
658
+ }
659
+ #line 57 "node.c.erb"
660
+ case PM_KEYWORD_PARAMETER_NODE: {
661
+ pm_keyword_parameter_node_t *cast = (pm_keyword_parameter_node_t *) node;
662
+ if (cast->value != NULL) {
663
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
664
+ }
665
+ break;
666
+ }
667
+ #line 57 "node.c.erb"
668
+ case PM_KEYWORD_REST_PARAMETER_NODE: {
669
+ break;
670
+ }
671
+ #line 57 "node.c.erb"
672
+ case PM_LAMBDA_NODE: {
673
+ pm_lambda_node_t *cast = (pm_lambda_node_t *) node;
674
+ pm_constant_id_list_free(&cast->locals);
675
+ if (cast->parameters != NULL) {
676
+ pm_node_destroy(parser, (pm_node_t *)cast->parameters);
677
+ }
678
+ if (cast->body != NULL) {
679
+ pm_node_destroy(parser, (pm_node_t *)cast->body);
680
+ }
681
+ break;
682
+ }
683
+ #line 57 "node.c.erb"
684
+ case PM_LOCAL_VARIABLE_AND_WRITE_NODE: {
685
+ pm_local_variable_and_write_node_t *cast = (pm_local_variable_and_write_node_t *) node;
686
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
687
+ break;
688
+ }
689
+ #line 57 "node.c.erb"
690
+ case PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
691
+ pm_local_variable_operator_write_node_t *cast = (pm_local_variable_operator_write_node_t *) node;
692
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
693
+ break;
694
+ }
695
+ #line 57 "node.c.erb"
696
+ case PM_LOCAL_VARIABLE_OR_WRITE_NODE: {
697
+ pm_local_variable_or_write_node_t *cast = (pm_local_variable_or_write_node_t *) node;
698
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
699
+ break;
700
+ }
701
+ #line 57 "node.c.erb"
702
+ case PM_LOCAL_VARIABLE_READ_NODE: {
703
+ break;
704
+ }
705
+ #line 57 "node.c.erb"
706
+ case PM_LOCAL_VARIABLE_TARGET_NODE: {
707
+ break;
708
+ }
709
+ #line 57 "node.c.erb"
710
+ case PM_LOCAL_VARIABLE_WRITE_NODE: {
711
+ pm_local_variable_write_node_t *cast = (pm_local_variable_write_node_t *) node;
712
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
713
+ break;
714
+ }
715
+ #line 57 "node.c.erb"
716
+ case PM_MATCH_LAST_LINE_NODE: {
717
+ pm_match_last_line_node_t *cast = (pm_match_last_line_node_t *) node;
718
+ pm_string_free(&cast->unescaped);
719
+ break;
720
+ }
721
+ #line 57 "node.c.erb"
722
+ case PM_MATCH_PREDICATE_NODE: {
723
+ pm_match_predicate_node_t *cast = (pm_match_predicate_node_t *) node;
724
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
725
+ pm_node_destroy(parser, (pm_node_t *)cast->pattern);
726
+ break;
727
+ }
728
+ #line 57 "node.c.erb"
729
+ case PM_MATCH_REQUIRED_NODE: {
730
+ pm_match_required_node_t *cast = (pm_match_required_node_t *) node;
731
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
732
+ pm_node_destroy(parser, (pm_node_t *)cast->pattern);
733
+ break;
734
+ }
735
+ #line 57 "node.c.erb"
736
+ case PM_MATCH_WRITE_NODE: {
737
+ pm_match_write_node_t *cast = (pm_match_write_node_t *) node;
738
+ pm_node_destroy(parser, (pm_node_t *)cast->call);
739
+ pm_constant_id_list_free(&cast->locals);
740
+ break;
741
+ }
742
+ #line 57 "node.c.erb"
743
+ case PM_MISSING_NODE: {
744
+ break;
745
+ }
746
+ #line 57 "node.c.erb"
747
+ case PM_MODULE_NODE: {
748
+ pm_module_node_t *cast = (pm_module_node_t *) node;
749
+ pm_constant_id_list_free(&cast->locals);
750
+ pm_node_destroy(parser, (pm_node_t *)cast->constant_path);
751
+ if (cast->body != NULL) {
752
+ pm_node_destroy(parser, (pm_node_t *)cast->body);
753
+ }
754
+ break;
755
+ }
756
+ #line 57 "node.c.erb"
757
+ case PM_MULTI_TARGET_NODE: {
758
+ pm_multi_target_node_t *cast = (pm_multi_target_node_t *) node;
759
+ pm_node_list_free(parser, &cast->targets);
760
+ break;
761
+ }
762
+ #line 57 "node.c.erb"
763
+ case PM_MULTI_WRITE_NODE: {
764
+ pm_multi_write_node_t *cast = (pm_multi_write_node_t *) node;
765
+ pm_node_list_free(parser, &cast->targets);
766
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
767
+ break;
768
+ }
769
+ #line 57 "node.c.erb"
770
+ case PM_NEXT_NODE: {
771
+ pm_next_node_t *cast = (pm_next_node_t *) node;
772
+ if (cast->arguments != NULL) {
773
+ pm_node_destroy(parser, (pm_node_t *)cast->arguments);
774
+ }
775
+ break;
776
+ }
777
+ #line 57 "node.c.erb"
778
+ case PM_NIL_NODE: {
779
+ break;
780
+ }
781
+ #line 57 "node.c.erb"
782
+ case PM_NO_KEYWORDS_PARAMETER_NODE: {
783
+ break;
784
+ }
785
+ #line 57 "node.c.erb"
786
+ case PM_NUMBERED_REFERENCE_READ_NODE: {
787
+ break;
788
+ }
789
+ #line 57 "node.c.erb"
790
+ case PM_OPTIONAL_PARAMETER_NODE: {
791
+ pm_optional_parameter_node_t *cast = (pm_optional_parameter_node_t *) node;
792
+ pm_node_destroy(parser, (pm_node_t *)cast->value);
793
+ break;
794
+ }
795
+ #line 57 "node.c.erb"
796
+ case PM_OR_NODE: {
797
+ pm_or_node_t *cast = (pm_or_node_t *) node;
798
+ pm_node_destroy(parser, (pm_node_t *)cast->left);
799
+ pm_node_destroy(parser, (pm_node_t *)cast->right);
800
+ break;
801
+ }
802
+ #line 57 "node.c.erb"
803
+ case PM_PARAMETERS_NODE: {
804
+ pm_parameters_node_t *cast = (pm_parameters_node_t *) node;
805
+ pm_node_list_free(parser, &cast->requireds);
806
+ pm_node_list_free(parser, &cast->optionals);
807
+ if (cast->rest != NULL) {
808
+ pm_node_destroy(parser, (pm_node_t *)cast->rest);
809
+ }
810
+ pm_node_list_free(parser, &cast->posts);
811
+ pm_node_list_free(parser, &cast->keywords);
812
+ if (cast->keyword_rest != NULL) {
813
+ pm_node_destroy(parser, (pm_node_t *)cast->keyword_rest);
814
+ }
815
+ if (cast->block != NULL) {
816
+ pm_node_destroy(parser, (pm_node_t *)cast->block);
817
+ }
818
+ break;
819
+ }
820
+ #line 57 "node.c.erb"
821
+ case PM_PARENTHESES_NODE: {
822
+ pm_parentheses_node_t *cast = (pm_parentheses_node_t *) node;
823
+ if (cast->body != NULL) {
824
+ pm_node_destroy(parser, (pm_node_t *)cast->body);
825
+ }
826
+ break;
827
+ }
828
+ #line 57 "node.c.erb"
829
+ case PM_PINNED_EXPRESSION_NODE: {
830
+ pm_pinned_expression_node_t *cast = (pm_pinned_expression_node_t *) node;
831
+ pm_node_destroy(parser, (pm_node_t *)cast->expression);
832
+ break;
833
+ }
834
+ #line 57 "node.c.erb"
835
+ case PM_PINNED_VARIABLE_NODE: {
836
+ pm_pinned_variable_node_t *cast = (pm_pinned_variable_node_t *) node;
837
+ pm_node_destroy(parser, (pm_node_t *)cast->variable);
838
+ break;
839
+ }
840
+ #line 57 "node.c.erb"
841
+ case PM_POST_EXECUTION_NODE: {
842
+ pm_post_execution_node_t *cast = (pm_post_execution_node_t *) node;
843
+ if (cast->statements != NULL) {
844
+ pm_node_destroy(parser, (pm_node_t *)cast->statements);
845
+ }
846
+ break;
847
+ }
848
+ #line 57 "node.c.erb"
849
+ case PM_PRE_EXECUTION_NODE: {
850
+ pm_pre_execution_node_t *cast = (pm_pre_execution_node_t *) node;
851
+ if (cast->statements != NULL) {
852
+ pm_node_destroy(parser, (pm_node_t *)cast->statements);
853
+ }
854
+ break;
855
+ }
856
+ #line 57 "node.c.erb"
857
+ case PM_PROGRAM_NODE: {
858
+ pm_program_node_t *cast = (pm_program_node_t *) node;
859
+ pm_constant_id_list_free(&cast->locals);
860
+ pm_node_destroy(parser, (pm_node_t *)cast->statements);
861
+ break;
862
+ }
863
+ #line 57 "node.c.erb"
864
+ case PM_RANGE_NODE: {
865
+ pm_range_node_t *cast = (pm_range_node_t *) node;
866
+ if (cast->left != NULL) {
867
+ pm_node_destroy(parser, (pm_node_t *)cast->left);
868
+ }
869
+ if (cast->right != NULL) {
870
+ pm_node_destroy(parser, (pm_node_t *)cast->right);
871
+ }
872
+ break;
873
+ }
874
+ #line 57 "node.c.erb"
875
+ case PM_RATIONAL_NODE: {
876
+ pm_rational_node_t *cast = (pm_rational_node_t *) node;
877
+ pm_node_destroy(parser, (pm_node_t *)cast->numeric);
878
+ break;
879
+ }
880
+ #line 57 "node.c.erb"
881
+ case PM_REDO_NODE: {
882
+ break;
883
+ }
884
+ #line 57 "node.c.erb"
885
+ case PM_REGULAR_EXPRESSION_NODE: {
886
+ pm_regular_expression_node_t *cast = (pm_regular_expression_node_t *) node;
887
+ pm_string_free(&cast->unescaped);
888
+ break;
889
+ }
890
+ #line 57 "node.c.erb"
891
+ case PM_REQUIRED_DESTRUCTURED_PARAMETER_NODE: {
892
+ pm_required_destructured_parameter_node_t *cast = (pm_required_destructured_parameter_node_t *) node;
893
+ pm_node_list_free(parser, &cast->parameters);
894
+ break;
895
+ }
896
+ #line 57 "node.c.erb"
897
+ case PM_REQUIRED_PARAMETER_NODE: {
898
+ break;
899
+ }
900
+ #line 57 "node.c.erb"
901
+ case PM_RESCUE_MODIFIER_NODE: {
902
+ pm_rescue_modifier_node_t *cast = (pm_rescue_modifier_node_t *) node;
903
+ pm_node_destroy(parser, (pm_node_t *)cast->expression);
904
+ pm_node_destroy(parser, (pm_node_t *)cast->rescue_expression);
905
+ break;
906
+ }
907
+ #line 57 "node.c.erb"
908
+ case PM_RESCUE_NODE: {
909
+ pm_rescue_node_t *cast = (pm_rescue_node_t *) node;
910
+ pm_node_list_free(parser, &cast->exceptions);
911
+ if (cast->reference != NULL) {
912
+ pm_node_destroy(parser, (pm_node_t *)cast->reference);
913
+ }
914
+ if (cast->statements != NULL) {
915
+ pm_node_destroy(parser, (pm_node_t *)cast->statements);
916
+ }
917
+ if (cast->consequent != NULL) {
918
+ pm_node_destroy(parser, (pm_node_t *)cast->consequent);
919
+ }
920
+ break;
921
+ }
922
+ #line 57 "node.c.erb"
923
+ case PM_REST_PARAMETER_NODE: {
924
+ break;
925
+ }
926
+ #line 57 "node.c.erb"
927
+ case PM_RETRY_NODE: {
928
+ break;
929
+ }
930
+ #line 57 "node.c.erb"
931
+ case PM_RETURN_NODE: {
932
+ pm_return_node_t *cast = (pm_return_node_t *) node;
933
+ if (cast->arguments != NULL) {
934
+ pm_node_destroy(parser, (pm_node_t *)cast->arguments);
935
+ }
936
+ break;
937
+ }
938
+ #line 57 "node.c.erb"
939
+ case PM_SELF_NODE: {
940
+ break;
941
+ }
942
+ #line 57 "node.c.erb"
943
+ case PM_SINGLETON_CLASS_NODE: {
944
+ pm_singleton_class_node_t *cast = (pm_singleton_class_node_t *) node;
945
+ pm_constant_id_list_free(&cast->locals);
946
+ pm_node_destroy(parser, (pm_node_t *)cast->expression);
947
+ if (cast->body != NULL) {
948
+ pm_node_destroy(parser, (pm_node_t *)cast->body);
949
+ }
950
+ break;
951
+ }
952
+ #line 57 "node.c.erb"
953
+ case PM_SOURCE_ENCODING_NODE: {
954
+ break;
955
+ }
956
+ #line 57 "node.c.erb"
957
+ case PM_SOURCE_FILE_NODE: {
958
+ pm_source_file_node_t *cast = (pm_source_file_node_t *) node;
959
+ pm_string_free(&cast->filepath);
960
+ break;
961
+ }
962
+ #line 57 "node.c.erb"
963
+ case PM_SOURCE_LINE_NODE: {
964
+ break;
965
+ }
966
+ #line 57 "node.c.erb"
967
+ case PM_SPLAT_NODE: {
968
+ pm_splat_node_t *cast = (pm_splat_node_t *) node;
969
+ if (cast->expression != NULL) {
970
+ pm_node_destroy(parser, (pm_node_t *)cast->expression);
971
+ }
972
+ break;
973
+ }
974
+ #line 57 "node.c.erb"
975
+ case PM_STATEMENTS_NODE: {
976
+ pm_statements_node_t *cast = (pm_statements_node_t *) node;
977
+ pm_node_list_free(parser, &cast->body);
978
+ break;
979
+ }
980
+ #line 57 "node.c.erb"
981
+ case PM_STRING_CONCAT_NODE: {
982
+ pm_string_concat_node_t *cast = (pm_string_concat_node_t *) node;
983
+ pm_node_destroy(parser, (pm_node_t *)cast->left);
984
+ pm_node_destroy(parser, (pm_node_t *)cast->right);
985
+ break;
986
+ }
987
+ #line 57 "node.c.erb"
988
+ case PM_STRING_NODE: {
989
+ pm_string_node_t *cast = (pm_string_node_t *) node;
990
+ pm_string_free(&cast->unescaped);
991
+ break;
992
+ }
993
+ #line 57 "node.c.erb"
994
+ case PM_SUPER_NODE: {
995
+ pm_super_node_t *cast = (pm_super_node_t *) node;
996
+ if (cast->arguments != NULL) {
997
+ pm_node_destroy(parser, (pm_node_t *)cast->arguments);
998
+ }
999
+ if (cast->block != NULL) {
1000
+ pm_node_destroy(parser, (pm_node_t *)cast->block);
1001
+ }
1002
+ break;
1003
+ }
1004
+ #line 57 "node.c.erb"
1005
+ case PM_SYMBOL_NODE: {
1006
+ pm_symbol_node_t *cast = (pm_symbol_node_t *) node;
1007
+ pm_string_free(&cast->unescaped);
1008
+ break;
1009
+ }
1010
+ #line 57 "node.c.erb"
1011
+ case PM_TRUE_NODE: {
1012
+ break;
1013
+ }
1014
+ #line 57 "node.c.erb"
1015
+ case PM_UNDEF_NODE: {
1016
+ pm_undef_node_t *cast = (pm_undef_node_t *) node;
1017
+ pm_node_list_free(parser, &cast->names);
1018
+ break;
1019
+ }
1020
+ #line 57 "node.c.erb"
1021
+ case PM_UNLESS_NODE: {
1022
+ pm_unless_node_t *cast = (pm_unless_node_t *) node;
1023
+ pm_node_destroy(parser, (pm_node_t *)cast->predicate);
1024
+ if (cast->statements != NULL) {
1025
+ pm_node_destroy(parser, (pm_node_t *)cast->statements);
1026
+ }
1027
+ if (cast->consequent != NULL) {
1028
+ pm_node_destroy(parser, (pm_node_t *)cast->consequent);
1029
+ }
1030
+ break;
1031
+ }
1032
+ #line 57 "node.c.erb"
1033
+ case PM_UNTIL_NODE: {
1034
+ pm_until_node_t *cast = (pm_until_node_t *) node;
1035
+ pm_node_destroy(parser, (pm_node_t *)cast->predicate);
1036
+ if (cast->statements != NULL) {
1037
+ pm_node_destroy(parser, (pm_node_t *)cast->statements);
1038
+ }
1039
+ break;
1040
+ }
1041
+ #line 57 "node.c.erb"
1042
+ case PM_WHEN_NODE: {
1043
+ pm_when_node_t *cast = (pm_when_node_t *) node;
1044
+ pm_node_list_free(parser, &cast->conditions);
1045
+ if (cast->statements != NULL) {
1046
+ pm_node_destroy(parser, (pm_node_t *)cast->statements);
1047
+ }
1048
+ break;
1049
+ }
1050
+ #line 57 "node.c.erb"
1051
+ case PM_WHILE_NODE: {
1052
+ pm_while_node_t *cast = (pm_while_node_t *) node;
1053
+ pm_node_destroy(parser, (pm_node_t *)cast->predicate);
1054
+ if (cast->statements != NULL) {
1055
+ pm_node_destroy(parser, (pm_node_t *)cast->statements);
1056
+ }
1057
+ break;
1058
+ }
1059
+ #line 57 "node.c.erb"
1060
+ case PM_X_STRING_NODE: {
1061
+ pm_x_string_node_t *cast = (pm_x_string_node_t *) node;
1062
+ pm_string_free(&cast->unescaped);
1063
+ break;
1064
+ }
1065
+ #line 57 "node.c.erb"
1066
+ case PM_YIELD_NODE: {
1067
+ pm_yield_node_t *cast = (pm_yield_node_t *) node;
1068
+ if (cast->arguments != NULL) {
1069
+ pm_node_destroy(parser, (pm_node_t *)cast->arguments);
1070
+ }
1071
+ break;
1072
+ }
1073
+ #line 84 "node.c.erb"
1074
+ default:
1075
+ assert(false && "unreachable");
1076
+ break;
1077
+ }
1078
+ free(node);
1079
+ }
1080
+
1081
+ static void
1082
+ pm_node_memsize_node(pm_node_t *node, pm_memsize_t *memsize) {
1083
+ memsize->node_count++;
1084
+
1085
+ switch (PM_NODE_TYPE(node)) {
1086
+ // We do not calculate memsize of a ScopeNode
1087
+ // as it should never be generated
1088
+ case PM_SCOPE_NODE:
1089
+ return;
1090
+ #line 102 "node.c.erb"
1091
+ case PM_ALIAS_GLOBAL_VARIABLE_NODE: {
1092
+ pm_alias_global_variable_node_t *cast = (pm_alias_global_variable_node_t *) node;
1093
+ memsize->memsize += sizeof(*cast);
1094
+ pm_node_memsize_node((pm_node_t *)cast->new_name, memsize);
1095
+ pm_node_memsize_node((pm_node_t *)cast->old_name, memsize);
1096
+ break;
1097
+ }
1098
+ #line 102 "node.c.erb"
1099
+ case PM_ALIAS_METHOD_NODE: {
1100
+ pm_alias_method_node_t *cast = (pm_alias_method_node_t *) node;
1101
+ memsize->memsize += sizeof(*cast);
1102
+ pm_node_memsize_node((pm_node_t *)cast->new_name, memsize);
1103
+ pm_node_memsize_node((pm_node_t *)cast->old_name, memsize);
1104
+ break;
1105
+ }
1106
+ #line 102 "node.c.erb"
1107
+ case PM_ALTERNATION_PATTERN_NODE: {
1108
+ pm_alternation_pattern_node_t *cast = (pm_alternation_pattern_node_t *) node;
1109
+ memsize->memsize += sizeof(*cast);
1110
+ pm_node_memsize_node((pm_node_t *)cast->left, memsize);
1111
+ pm_node_memsize_node((pm_node_t *)cast->right, memsize);
1112
+ break;
1113
+ }
1114
+ #line 102 "node.c.erb"
1115
+ case PM_AND_NODE: {
1116
+ pm_and_node_t *cast = (pm_and_node_t *) node;
1117
+ memsize->memsize += sizeof(*cast);
1118
+ pm_node_memsize_node((pm_node_t *)cast->left, memsize);
1119
+ pm_node_memsize_node((pm_node_t *)cast->right, memsize);
1120
+ break;
1121
+ }
1122
+ #line 102 "node.c.erb"
1123
+ case PM_ARGUMENTS_NODE: {
1124
+ pm_arguments_node_t *cast = (pm_arguments_node_t *) node;
1125
+ memsize->memsize += sizeof(*cast);
1126
+ // Node lists will add in their own sizes below.
1127
+ memsize->memsize -= sizeof(pm_node_list_t) * 1;
1128
+ memsize->memsize += pm_node_list_memsize(&cast->arguments, memsize);
1129
+ break;
1130
+ }
1131
+ #line 102 "node.c.erb"
1132
+ case PM_ARRAY_NODE: {
1133
+ pm_array_node_t *cast = (pm_array_node_t *) node;
1134
+ memsize->memsize += sizeof(*cast);
1135
+ // Node lists will add in their own sizes below.
1136
+ memsize->memsize -= sizeof(pm_node_list_t) * 1;
1137
+ memsize->memsize += pm_node_list_memsize(&cast->elements, memsize);
1138
+ break;
1139
+ }
1140
+ #line 102 "node.c.erb"
1141
+ case PM_ARRAY_PATTERN_NODE: {
1142
+ pm_array_pattern_node_t *cast = (pm_array_pattern_node_t *) node;
1143
+ memsize->memsize += sizeof(*cast);
1144
+ // Node lists will add in their own sizes below.
1145
+ memsize->memsize -= sizeof(pm_node_list_t) * 2;
1146
+ if (cast->constant != NULL) {
1147
+ pm_node_memsize_node((pm_node_t *)cast->constant, memsize);
1148
+ }
1149
+ memsize->memsize += pm_node_list_memsize(&cast->requireds, memsize);
1150
+ if (cast->rest != NULL) {
1151
+ pm_node_memsize_node((pm_node_t *)cast->rest, memsize);
1152
+ }
1153
+ memsize->memsize += pm_node_list_memsize(&cast->posts, memsize);
1154
+ break;
1155
+ }
1156
+ #line 102 "node.c.erb"
1157
+ case PM_ASSOC_NODE: {
1158
+ pm_assoc_node_t *cast = (pm_assoc_node_t *) node;
1159
+ memsize->memsize += sizeof(*cast);
1160
+ pm_node_memsize_node((pm_node_t *)cast->key, memsize);
1161
+ if (cast->value != NULL) {
1162
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1163
+ }
1164
+ break;
1165
+ }
1166
+ #line 102 "node.c.erb"
1167
+ case PM_ASSOC_SPLAT_NODE: {
1168
+ pm_assoc_splat_node_t *cast = (pm_assoc_splat_node_t *) node;
1169
+ memsize->memsize += sizeof(*cast);
1170
+ if (cast->value != NULL) {
1171
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1172
+ }
1173
+ break;
1174
+ }
1175
+ #line 102 "node.c.erb"
1176
+ case PM_BACK_REFERENCE_READ_NODE: {
1177
+ pm_back_reference_read_node_t *cast = (pm_back_reference_read_node_t *) node;
1178
+ memsize->memsize += sizeof(*cast);
1179
+ break;
1180
+ }
1181
+ #line 102 "node.c.erb"
1182
+ case PM_BEGIN_NODE: {
1183
+ pm_begin_node_t *cast = (pm_begin_node_t *) node;
1184
+ memsize->memsize += sizeof(*cast);
1185
+ if (cast->statements != NULL) {
1186
+ pm_node_memsize_node((pm_node_t *)cast->statements, memsize);
1187
+ }
1188
+ if (cast->rescue_clause != NULL) {
1189
+ pm_node_memsize_node((pm_node_t *)cast->rescue_clause, memsize);
1190
+ }
1191
+ if (cast->else_clause != NULL) {
1192
+ pm_node_memsize_node((pm_node_t *)cast->else_clause, memsize);
1193
+ }
1194
+ if (cast->ensure_clause != NULL) {
1195
+ pm_node_memsize_node((pm_node_t *)cast->ensure_clause, memsize);
1196
+ }
1197
+ break;
1198
+ }
1199
+ #line 102 "node.c.erb"
1200
+ case PM_BLOCK_ARGUMENT_NODE: {
1201
+ pm_block_argument_node_t *cast = (pm_block_argument_node_t *) node;
1202
+ memsize->memsize += sizeof(*cast);
1203
+ if (cast->expression != NULL) {
1204
+ pm_node_memsize_node((pm_node_t *)cast->expression, memsize);
1205
+ }
1206
+ break;
1207
+ }
1208
+ #line 102 "node.c.erb"
1209
+ case PM_BLOCK_LOCAL_VARIABLE_NODE: {
1210
+ pm_block_local_variable_node_t *cast = (pm_block_local_variable_node_t *) node;
1211
+ memsize->memsize += sizeof(*cast);
1212
+ break;
1213
+ }
1214
+ #line 102 "node.c.erb"
1215
+ case PM_BLOCK_NODE: {
1216
+ pm_block_node_t *cast = (pm_block_node_t *) node;
1217
+ memsize->memsize += sizeof(*cast);
1218
+ // Constant id lists will add in their own sizes below.
1219
+ memsize->memsize -= sizeof(pm_constant_id_list_t) * 1;
1220
+ memsize->memsize += pm_constant_id_list_memsize(&cast->locals);
1221
+ if (cast->parameters != NULL) {
1222
+ pm_node_memsize_node((pm_node_t *)cast->parameters, memsize);
1223
+ }
1224
+ if (cast->body != NULL) {
1225
+ pm_node_memsize_node((pm_node_t *)cast->body, memsize);
1226
+ }
1227
+ break;
1228
+ }
1229
+ #line 102 "node.c.erb"
1230
+ case PM_BLOCK_PARAMETER_NODE: {
1231
+ pm_block_parameter_node_t *cast = (pm_block_parameter_node_t *) node;
1232
+ memsize->memsize += sizeof(*cast);
1233
+ break;
1234
+ }
1235
+ #line 102 "node.c.erb"
1236
+ case PM_BLOCK_PARAMETERS_NODE: {
1237
+ pm_block_parameters_node_t *cast = (pm_block_parameters_node_t *) node;
1238
+ memsize->memsize += sizeof(*cast);
1239
+ // Node lists will add in their own sizes below.
1240
+ memsize->memsize -= sizeof(pm_node_list_t) * 1;
1241
+ if (cast->parameters != NULL) {
1242
+ pm_node_memsize_node((pm_node_t *)cast->parameters, memsize);
1243
+ }
1244
+ memsize->memsize += pm_node_list_memsize(&cast->locals, memsize);
1245
+ break;
1246
+ }
1247
+ #line 102 "node.c.erb"
1248
+ case PM_BREAK_NODE: {
1249
+ pm_break_node_t *cast = (pm_break_node_t *) node;
1250
+ memsize->memsize += sizeof(*cast);
1251
+ if (cast->arguments != NULL) {
1252
+ pm_node_memsize_node((pm_node_t *)cast->arguments, memsize);
1253
+ }
1254
+ break;
1255
+ }
1256
+ #line 102 "node.c.erb"
1257
+ case PM_CALL_AND_WRITE_NODE: {
1258
+ pm_call_and_write_node_t *cast = (pm_call_and_write_node_t *) node;
1259
+ memsize->memsize += sizeof(*cast);
1260
+ if (cast->receiver != NULL) {
1261
+ pm_node_memsize_node((pm_node_t *)cast->receiver, memsize);
1262
+ }
1263
+ if (cast->arguments != NULL) {
1264
+ pm_node_memsize_node((pm_node_t *)cast->arguments, memsize);
1265
+ }
1266
+ memsize->memsize += pm_string_memsize(&cast->read_name);
1267
+ memsize->memsize += pm_string_memsize(&cast->write_name);
1268
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1269
+ break;
1270
+ }
1271
+ #line 102 "node.c.erb"
1272
+ case PM_CALL_NODE: {
1273
+ pm_call_node_t *cast = (pm_call_node_t *) node;
1274
+ memsize->memsize += sizeof(*cast);
1275
+ if (cast->receiver != NULL) {
1276
+ pm_node_memsize_node((pm_node_t *)cast->receiver, memsize);
1277
+ }
1278
+ if (cast->arguments != NULL) {
1279
+ pm_node_memsize_node((pm_node_t *)cast->arguments, memsize);
1280
+ }
1281
+ if (cast->block != NULL) {
1282
+ pm_node_memsize_node((pm_node_t *)cast->block, memsize);
1283
+ }
1284
+ memsize->memsize += pm_string_memsize(&cast->name);
1285
+ break;
1286
+ }
1287
+ #line 102 "node.c.erb"
1288
+ case PM_CALL_OPERATOR_WRITE_NODE: {
1289
+ pm_call_operator_write_node_t *cast = (pm_call_operator_write_node_t *) node;
1290
+ memsize->memsize += sizeof(*cast);
1291
+ if (cast->receiver != NULL) {
1292
+ pm_node_memsize_node((pm_node_t *)cast->receiver, memsize);
1293
+ }
1294
+ if (cast->arguments != NULL) {
1295
+ pm_node_memsize_node((pm_node_t *)cast->arguments, memsize);
1296
+ }
1297
+ memsize->memsize += pm_string_memsize(&cast->read_name);
1298
+ memsize->memsize += pm_string_memsize(&cast->write_name);
1299
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1300
+ break;
1301
+ }
1302
+ #line 102 "node.c.erb"
1303
+ case PM_CALL_OR_WRITE_NODE: {
1304
+ pm_call_or_write_node_t *cast = (pm_call_or_write_node_t *) node;
1305
+ memsize->memsize += sizeof(*cast);
1306
+ if (cast->receiver != NULL) {
1307
+ pm_node_memsize_node((pm_node_t *)cast->receiver, memsize);
1308
+ }
1309
+ if (cast->arguments != NULL) {
1310
+ pm_node_memsize_node((pm_node_t *)cast->arguments, memsize);
1311
+ }
1312
+ memsize->memsize += pm_string_memsize(&cast->read_name);
1313
+ memsize->memsize += pm_string_memsize(&cast->write_name);
1314
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1315
+ break;
1316
+ }
1317
+ #line 102 "node.c.erb"
1318
+ case PM_CAPTURE_PATTERN_NODE: {
1319
+ pm_capture_pattern_node_t *cast = (pm_capture_pattern_node_t *) node;
1320
+ memsize->memsize += sizeof(*cast);
1321
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1322
+ pm_node_memsize_node((pm_node_t *)cast->target, memsize);
1323
+ break;
1324
+ }
1325
+ #line 102 "node.c.erb"
1326
+ case PM_CASE_NODE: {
1327
+ pm_case_node_t *cast = (pm_case_node_t *) node;
1328
+ memsize->memsize += sizeof(*cast);
1329
+ // Node lists will add in their own sizes below.
1330
+ memsize->memsize -= sizeof(pm_node_list_t) * 1;
1331
+ if (cast->predicate != NULL) {
1332
+ pm_node_memsize_node((pm_node_t *)cast->predicate, memsize);
1333
+ }
1334
+ memsize->memsize += pm_node_list_memsize(&cast->conditions, memsize);
1335
+ if (cast->consequent != NULL) {
1336
+ pm_node_memsize_node((pm_node_t *)cast->consequent, memsize);
1337
+ }
1338
+ break;
1339
+ }
1340
+ #line 102 "node.c.erb"
1341
+ case PM_CLASS_NODE: {
1342
+ pm_class_node_t *cast = (pm_class_node_t *) node;
1343
+ memsize->memsize += sizeof(*cast);
1344
+ // Constant id lists will add in their own sizes below.
1345
+ memsize->memsize -= sizeof(pm_constant_id_list_t) * 1;
1346
+ memsize->memsize += pm_constant_id_list_memsize(&cast->locals);
1347
+ pm_node_memsize_node((pm_node_t *)cast->constant_path, memsize);
1348
+ if (cast->superclass != NULL) {
1349
+ pm_node_memsize_node((pm_node_t *)cast->superclass, memsize);
1350
+ }
1351
+ if (cast->body != NULL) {
1352
+ pm_node_memsize_node((pm_node_t *)cast->body, memsize);
1353
+ }
1354
+ break;
1355
+ }
1356
+ #line 102 "node.c.erb"
1357
+ case PM_CLASS_VARIABLE_AND_WRITE_NODE: {
1358
+ pm_class_variable_and_write_node_t *cast = (pm_class_variable_and_write_node_t *) node;
1359
+ memsize->memsize += sizeof(*cast);
1360
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1361
+ break;
1362
+ }
1363
+ #line 102 "node.c.erb"
1364
+ case PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
1365
+ pm_class_variable_operator_write_node_t *cast = (pm_class_variable_operator_write_node_t *) node;
1366
+ memsize->memsize += sizeof(*cast);
1367
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1368
+ break;
1369
+ }
1370
+ #line 102 "node.c.erb"
1371
+ case PM_CLASS_VARIABLE_OR_WRITE_NODE: {
1372
+ pm_class_variable_or_write_node_t *cast = (pm_class_variable_or_write_node_t *) node;
1373
+ memsize->memsize += sizeof(*cast);
1374
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1375
+ break;
1376
+ }
1377
+ #line 102 "node.c.erb"
1378
+ case PM_CLASS_VARIABLE_READ_NODE: {
1379
+ pm_class_variable_read_node_t *cast = (pm_class_variable_read_node_t *) node;
1380
+ memsize->memsize += sizeof(*cast);
1381
+ break;
1382
+ }
1383
+ #line 102 "node.c.erb"
1384
+ case PM_CLASS_VARIABLE_TARGET_NODE: {
1385
+ pm_class_variable_target_node_t *cast = (pm_class_variable_target_node_t *) node;
1386
+ memsize->memsize += sizeof(*cast);
1387
+ break;
1388
+ }
1389
+ #line 102 "node.c.erb"
1390
+ case PM_CLASS_VARIABLE_WRITE_NODE: {
1391
+ pm_class_variable_write_node_t *cast = (pm_class_variable_write_node_t *) node;
1392
+ memsize->memsize += sizeof(*cast);
1393
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1394
+ break;
1395
+ }
1396
+ #line 102 "node.c.erb"
1397
+ case PM_CONSTANT_AND_WRITE_NODE: {
1398
+ pm_constant_and_write_node_t *cast = (pm_constant_and_write_node_t *) node;
1399
+ memsize->memsize += sizeof(*cast);
1400
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1401
+ break;
1402
+ }
1403
+ #line 102 "node.c.erb"
1404
+ case PM_CONSTANT_OPERATOR_WRITE_NODE: {
1405
+ pm_constant_operator_write_node_t *cast = (pm_constant_operator_write_node_t *) node;
1406
+ memsize->memsize += sizeof(*cast);
1407
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1408
+ break;
1409
+ }
1410
+ #line 102 "node.c.erb"
1411
+ case PM_CONSTANT_OR_WRITE_NODE: {
1412
+ pm_constant_or_write_node_t *cast = (pm_constant_or_write_node_t *) node;
1413
+ memsize->memsize += sizeof(*cast);
1414
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1415
+ break;
1416
+ }
1417
+ #line 102 "node.c.erb"
1418
+ case PM_CONSTANT_PATH_AND_WRITE_NODE: {
1419
+ pm_constant_path_and_write_node_t *cast = (pm_constant_path_and_write_node_t *) node;
1420
+ memsize->memsize += sizeof(*cast);
1421
+ pm_node_memsize_node((pm_node_t *)cast->target, memsize);
1422
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1423
+ break;
1424
+ }
1425
+ #line 102 "node.c.erb"
1426
+ case PM_CONSTANT_PATH_NODE: {
1427
+ pm_constant_path_node_t *cast = (pm_constant_path_node_t *) node;
1428
+ memsize->memsize += sizeof(*cast);
1429
+ if (cast->parent != NULL) {
1430
+ pm_node_memsize_node((pm_node_t *)cast->parent, memsize);
1431
+ }
1432
+ pm_node_memsize_node((pm_node_t *)cast->child, memsize);
1433
+ break;
1434
+ }
1435
+ #line 102 "node.c.erb"
1436
+ case PM_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
1437
+ pm_constant_path_operator_write_node_t *cast = (pm_constant_path_operator_write_node_t *) node;
1438
+ memsize->memsize += sizeof(*cast);
1439
+ pm_node_memsize_node((pm_node_t *)cast->target, memsize);
1440
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1441
+ break;
1442
+ }
1443
+ #line 102 "node.c.erb"
1444
+ case PM_CONSTANT_PATH_OR_WRITE_NODE: {
1445
+ pm_constant_path_or_write_node_t *cast = (pm_constant_path_or_write_node_t *) node;
1446
+ memsize->memsize += sizeof(*cast);
1447
+ pm_node_memsize_node((pm_node_t *)cast->target, memsize);
1448
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1449
+ break;
1450
+ }
1451
+ #line 102 "node.c.erb"
1452
+ case PM_CONSTANT_PATH_TARGET_NODE: {
1453
+ pm_constant_path_target_node_t *cast = (pm_constant_path_target_node_t *) node;
1454
+ memsize->memsize += sizeof(*cast);
1455
+ if (cast->parent != NULL) {
1456
+ pm_node_memsize_node((pm_node_t *)cast->parent, memsize);
1457
+ }
1458
+ pm_node_memsize_node((pm_node_t *)cast->child, memsize);
1459
+ break;
1460
+ }
1461
+ #line 102 "node.c.erb"
1462
+ case PM_CONSTANT_PATH_WRITE_NODE: {
1463
+ pm_constant_path_write_node_t *cast = (pm_constant_path_write_node_t *) node;
1464
+ memsize->memsize += sizeof(*cast);
1465
+ pm_node_memsize_node((pm_node_t *)cast->target, memsize);
1466
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1467
+ break;
1468
+ }
1469
+ #line 102 "node.c.erb"
1470
+ case PM_CONSTANT_READ_NODE: {
1471
+ pm_constant_read_node_t *cast = (pm_constant_read_node_t *) node;
1472
+ memsize->memsize += sizeof(*cast);
1473
+ break;
1474
+ }
1475
+ #line 102 "node.c.erb"
1476
+ case PM_CONSTANT_TARGET_NODE: {
1477
+ pm_constant_target_node_t *cast = (pm_constant_target_node_t *) node;
1478
+ memsize->memsize += sizeof(*cast);
1479
+ break;
1480
+ }
1481
+ #line 102 "node.c.erb"
1482
+ case PM_CONSTANT_WRITE_NODE: {
1483
+ pm_constant_write_node_t *cast = (pm_constant_write_node_t *) node;
1484
+ memsize->memsize += sizeof(*cast);
1485
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1486
+ break;
1487
+ }
1488
+ #line 102 "node.c.erb"
1489
+ case PM_DEF_NODE: {
1490
+ pm_def_node_t *cast = (pm_def_node_t *) node;
1491
+ memsize->memsize += sizeof(*cast);
1492
+ // Constant id lists will add in their own sizes below.
1493
+ memsize->memsize -= sizeof(pm_constant_id_list_t) * 1;
1494
+ if (cast->receiver != NULL) {
1495
+ pm_node_memsize_node((pm_node_t *)cast->receiver, memsize);
1496
+ }
1497
+ if (cast->parameters != NULL) {
1498
+ pm_node_memsize_node((pm_node_t *)cast->parameters, memsize);
1499
+ }
1500
+ if (cast->body != NULL) {
1501
+ pm_node_memsize_node((pm_node_t *)cast->body, memsize);
1502
+ }
1503
+ memsize->memsize += pm_constant_id_list_memsize(&cast->locals);
1504
+ break;
1505
+ }
1506
+ #line 102 "node.c.erb"
1507
+ case PM_DEFINED_NODE: {
1508
+ pm_defined_node_t *cast = (pm_defined_node_t *) node;
1509
+ memsize->memsize += sizeof(*cast);
1510
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1511
+ break;
1512
+ }
1513
+ #line 102 "node.c.erb"
1514
+ case PM_ELSE_NODE: {
1515
+ pm_else_node_t *cast = (pm_else_node_t *) node;
1516
+ memsize->memsize += sizeof(*cast);
1517
+ if (cast->statements != NULL) {
1518
+ pm_node_memsize_node((pm_node_t *)cast->statements, memsize);
1519
+ }
1520
+ break;
1521
+ }
1522
+ #line 102 "node.c.erb"
1523
+ case PM_EMBEDDED_STATEMENTS_NODE: {
1524
+ pm_embedded_statements_node_t *cast = (pm_embedded_statements_node_t *) node;
1525
+ memsize->memsize += sizeof(*cast);
1526
+ if (cast->statements != NULL) {
1527
+ pm_node_memsize_node((pm_node_t *)cast->statements, memsize);
1528
+ }
1529
+ break;
1530
+ }
1531
+ #line 102 "node.c.erb"
1532
+ case PM_EMBEDDED_VARIABLE_NODE: {
1533
+ pm_embedded_variable_node_t *cast = (pm_embedded_variable_node_t *) node;
1534
+ memsize->memsize += sizeof(*cast);
1535
+ pm_node_memsize_node((pm_node_t *)cast->variable, memsize);
1536
+ break;
1537
+ }
1538
+ #line 102 "node.c.erb"
1539
+ case PM_ENSURE_NODE: {
1540
+ pm_ensure_node_t *cast = (pm_ensure_node_t *) node;
1541
+ memsize->memsize += sizeof(*cast);
1542
+ if (cast->statements != NULL) {
1543
+ pm_node_memsize_node((pm_node_t *)cast->statements, memsize);
1544
+ }
1545
+ break;
1546
+ }
1547
+ #line 102 "node.c.erb"
1548
+ case PM_FALSE_NODE: {
1549
+ pm_false_node_t *cast = (pm_false_node_t *) node;
1550
+ memsize->memsize += sizeof(*cast);
1551
+ break;
1552
+ }
1553
+ #line 102 "node.c.erb"
1554
+ case PM_FIND_PATTERN_NODE: {
1555
+ pm_find_pattern_node_t *cast = (pm_find_pattern_node_t *) node;
1556
+ memsize->memsize += sizeof(*cast);
1557
+ // Node lists will add in their own sizes below.
1558
+ memsize->memsize -= sizeof(pm_node_list_t) * 1;
1559
+ if (cast->constant != NULL) {
1560
+ pm_node_memsize_node((pm_node_t *)cast->constant, memsize);
1561
+ }
1562
+ pm_node_memsize_node((pm_node_t *)cast->left, memsize);
1563
+ memsize->memsize += pm_node_list_memsize(&cast->requireds, memsize);
1564
+ pm_node_memsize_node((pm_node_t *)cast->right, memsize);
1565
+ break;
1566
+ }
1567
+ #line 102 "node.c.erb"
1568
+ case PM_FLIP_FLOP_NODE: {
1569
+ pm_flip_flop_node_t *cast = (pm_flip_flop_node_t *) node;
1570
+ memsize->memsize += sizeof(*cast);
1571
+ if (cast->left != NULL) {
1572
+ pm_node_memsize_node((pm_node_t *)cast->left, memsize);
1573
+ }
1574
+ if (cast->right != NULL) {
1575
+ pm_node_memsize_node((pm_node_t *)cast->right, memsize);
1576
+ }
1577
+ break;
1578
+ }
1579
+ #line 102 "node.c.erb"
1580
+ case PM_FLOAT_NODE: {
1581
+ pm_float_node_t *cast = (pm_float_node_t *) node;
1582
+ memsize->memsize += sizeof(*cast);
1583
+ break;
1584
+ }
1585
+ #line 102 "node.c.erb"
1586
+ case PM_FOR_NODE: {
1587
+ pm_for_node_t *cast = (pm_for_node_t *) node;
1588
+ memsize->memsize += sizeof(*cast);
1589
+ pm_node_memsize_node((pm_node_t *)cast->index, memsize);
1590
+ pm_node_memsize_node((pm_node_t *)cast->collection, memsize);
1591
+ if (cast->statements != NULL) {
1592
+ pm_node_memsize_node((pm_node_t *)cast->statements, memsize);
1593
+ }
1594
+ break;
1595
+ }
1596
+ #line 102 "node.c.erb"
1597
+ case PM_FORWARDING_ARGUMENTS_NODE: {
1598
+ pm_forwarding_arguments_node_t *cast = (pm_forwarding_arguments_node_t *) node;
1599
+ memsize->memsize += sizeof(*cast);
1600
+ break;
1601
+ }
1602
+ #line 102 "node.c.erb"
1603
+ case PM_FORWARDING_PARAMETER_NODE: {
1604
+ pm_forwarding_parameter_node_t *cast = (pm_forwarding_parameter_node_t *) node;
1605
+ memsize->memsize += sizeof(*cast);
1606
+ break;
1607
+ }
1608
+ #line 102 "node.c.erb"
1609
+ case PM_FORWARDING_SUPER_NODE: {
1610
+ pm_forwarding_super_node_t *cast = (pm_forwarding_super_node_t *) node;
1611
+ memsize->memsize += sizeof(*cast);
1612
+ if (cast->block != NULL) {
1613
+ pm_node_memsize_node((pm_node_t *)cast->block, memsize);
1614
+ }
1615
+ break;
1616
+ }
1617
+ #line 102 "node.c.erb"
1618
+ case PM_GLOBAL_VARIABLE_AND_WRITE_NODE: {
1619
+ pm_global_variable_and_write_node_t *cast = (pm_global_variable_and_write_node_t *) node;
1620
+ memsize->memsize += sizeof(*cast);
1621
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1622
+ break;
1623
+ }
1624
+ #line 102 "node.c.erb"
1625
+ case PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
1626
+ pm_global_variable_operator_write_node_t *cast = (pm_global_variable_operator_write_node_t *) node;
1627
+ memsize->memsize += sizeof(*cast);
1628
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1629
+ break;
1630
+ }
1631
+ #line 102 "node.c.erb"
1632
+ case PM_GLOBAL_VARIABLE_OR_WRITE_NODE: {
1633
+ pm_global_variable_or_write_node_t *cast = (pm_global_variable_or_write_node_t *) node;
1634
+ memsize->memsize += sizeof(*cast);
1635
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1636
+ break;
1637
+ }
1638
+ #line 102 "node.c.erb"
1639
+ case PM_GLOBAL_VARIABLE_READ_NODE: {
1640
+ pm_global_variable_read_node_t *cast = (pm_global_variable_read_node_t *) node;
1641
+ memsize->memsize += sizeof(*cast);
1642
+ break;
1643
+ }
1644
+ #line 102 "node.c.erb"
1645
+ case PM_GLOBAL_VARIABLE_TARGET_NODE: {
1646
+ pm_global_variable_target_node_t *cast = (pm_global_variable_target_node_t *) node;
1647
+ memsize->memsize += sizeof(*cast);
1648
+ break;
1649
+ }
1650
+ #line 102 "node.c.erb"
1651
+ case PM_GLOBAL_VARIABLE_WRITE_NODE: {
1652
+ pm_global_variable_write_node_t *cast = (pm_global_variable_write_node_t *) node;
1653
+ memsize->memsize += sizeof(*cast);
1654
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1655
+ break;
1656
+ }
1657
+ #line 102 "node.c.erb"
1658
+ case PM_HASH_NODE: {
1659
+ pm_hash_node_t *cast = (pm_hash_node_t *) node;
1660
+ memsize->memsize += sizeof(*cast);
1661
+ // Node lists will add in their own sizes below.
1662
+ memsize->memsize -= sizeof(pm_node_list_t) * 1;
1663
+ memsize->memsize += pm_node_list_memsize(&cast->elements, memsize);
1664
+ break;
1665
+ }
1666
+ #line 102 "node.c.erb"
1667
+ case PM_HASH_PATTERN_NODE: {
1668
+ pm_hash_pattern_node_t *cast = (pm_hash_pattern_node_t *) node;
1669
+ memsize->memsize += sizeof(*cast);
1670
+ // Node lists will add in their own sizes below.
1671
+ memsize->memsize -= sizeof(pm_node_list_t) * 1;
1672
+ if (cast->constant != NULL) {
1673
+ pm_node_memsize_node((pm_node_t *)cast->constant, memsize);
1674
+ }
1675
+ memsize->memsize += pm_node_list_memsize(&cast->assocs, memsize);
1676
+ if (cast->kwrest != NULL) {
1677
+ pm_node_memsize_node((pm_node_t *)cast->kwrest, memsize);
1678
+ }
1679
+ break;
1680
+ }
1681
+ #line 102 "node.c.erb"
1682
+ case PM_IF_NODE: {
1683
+ pm_if_node_t *cast = (pm_if_node_t *) node;
1684
+ memsize->memsize += sizeof(*cast);
1685
+ pm_node_memsize_node((pm_node_t *)cast->predicate, memsize);
1686
+ if (cast->statements != NULL) {
1687
+ pm_node_memsize_node((pm_node_t *)cast->statements, memsize);
1688
+ }
1689
+ if (cast->consequent != NULL) {
1690
+ pm_node_memsize_node((pm_node_t *)cast->consequent, memsize);
1691
+ }
1692
+ break;
1693
+ }
1694
+ #line 102 "node.c.erb"
1695
+ case PM_IMAGINARY_NODE: {
1696
+ pm_imaginary_node_t *cast = (pm_imaginary_node_t *) node;
1697
+ memsize->memsize += sizeof(*cast);
1698
+ pm_node_memsize_node((pm_node_t *)cast->numeric, memsize);
1699
+ break;
1700
+ }
1701
+ #line 102 "node.c.erb"
1702
+ case PM_IMPLICIT_NODE: {
1703
+ pm_implicit_node_t *cast = (pm_implicit_node_t *) node;
1704
+ memsize->memsize += sizeof(*cast);
1705
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1706
+ break;
1707
+ }
1708
+ #line 102 "node.c.erb"
1709
+ case PM_IN_NODE: {
1710
+ pm_in_node_t *cast = (pm_in_node_t *) node;
1711
+ memsize->memsize += sizeof(*cast);
1712
+ pm_node_memsize_node((pm_node_t *)cast->pattern, memsize);
1713
+ if (cast->statements != NULL) {
1714
+ pm_node_memsize_node((pm_node_t *)cast->statements, memsize);
1715
+ }
1716
+ break;
1717
+ }
1718
+ #line 102 "node.c.erb"
1719
+ case PM_INSTANCE_VARIABLE_AND_WRITE_NODE: {
1720
+ pm_instance_variable_and_write_node_t *cast = (pm_instance_variable_and_write_node_t *) node;
1721
+ memsize->memsize += sizeof(*cast);
1722
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1723
+ break;
1724
+ }
1725
+ #line 102 "node.c.erb"
1726
+ case PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
1727
+ pm_instance_variable_operator_write_node_t *cast = (pm_instance_variable_operator_write_node_t *) node;
1728
+ memsize->memsize += sizeof(*cast);
1729
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1730
+ break;
1731
+ }
1732
+ #line 102 "node.c.erb"
1733
+ case PM_INSTANCE_VARIABLE_OR_WRITE_NODE: {
1734
+ pm_instance_variable_or_write_node_t *cast = (pm_instance_variable_or_write_node_t *) node;
1735
+ memsize->memsize += sizeof(*cast);
1736
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1737
+ break;
1738
+ }
1739
+ #line 102 "node.c.erb"
1740
+ case PM_INSTANCE_VARIABLE_READ_NODE: {
1741
+ pm_instance_variable_read_node_t *cast = (pm_instance_variable_read_node_t *) node;
1742
+ memsize->memsize += sizeof(*cast);
1743
+ break;
1744
+ }
1745
+ #line 102 "node.c.erb"
1746
+ case PM_INSTANCE_VARIABLE_TARGET_NODE: {
1747
+ pm_instance_variable_target_node_t *cast = (pm_instance_variable_target_node_t *) node;
1748
+ memsize->memsize += sizeof(*cast);
1749
+ break;
1750
+ }
1751
+ #line 102 "node.c.erb"
1752
+ case PM_INSTANCE_VARIABLE_WRITE_NODE: {
1753
+ pm_instance_variable_write_node_t *cast = (pm_instance_variable_write_node_t *) node;
1754
+ memsize->memsize += sizeof(*cast);
1755
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1756
+ break;
1757
+ }
1758
+ #line 102 "node.c.erb"
1759
+ case PM_INTEGER_NODE: {
1760
+ pm_integer_node_t *cast = (pm_integer_node_t *) node;
1761
+ memsize->memsize += sizeof(*cast);
1762
+ break;
1763
+ }
1764
+ #line 102 "node.c.erb"
1765
+ case PM_INTERPOLATED_MATCH_LAST_LINE_NODE: {
1766
+ pm_interpolated_match_last_line_node_t *cast = (pm_interpolated_match_last_line_node_t *) node;
1767
+ memsize->memsize += sizeof(*cast);
1768
+ // Node lists will add in their own sizes below.
1769
+ memsize->memsize -= sizeof(pm_node_list_t) * 1;
1770
+ memsize->memsize += pm_node_list_memsize(&cast->parts, memsize);
1771
+ break;
1772
+ }
1773
+ #line 102 "node.c.erb"
1774
+ case PM_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
1775
+ pm_interpolated_regular_expression_node_t *cast = (pm_interpolated_regular_expression_node_t *) node;
1776
+ memsize->memsize += sizeof(*cast);
1777
+ // Node lists will add in their own sizes below.
1778
+ memsize->memsize -= sizeof(pm_node_list_t) * 1;
1779
+ memsize->memsize += pm_node_list_memsize(&cast->parts, memsize);
1780
+ break;
1781
+ }
1782
+ #line 102 "node.c.erb"
1783
+ case PM_INTERPOLATED_STRING_NODE: {
1784
+ pm_interpolated_string_node_t *cast = (pm_interpolated_string_node_t *) node;
1785
+ memsize->memsize += sizeof(*cast);
1786
+ // Node lists will add in their own sizes below.
1787
+ memsize->memsize -= sizeof(pm_node_list_t) * 1;
1788
+ memsize->memsize += pm_node_list_memsize(&cast->parts, memsize);
1789
+ break;
1790
+ }
1791
+ #line 102 "node.c.erb"
1792
+ case PM_INTERPOLATED_SYMBOL_NODE: {
1793
+ pm_interpolated_symbol_node_t *cast = (pm_interpolated_symbol_node_t *) node;
1794
+ memsize->memsize += sizeof(*cast);
1795
+ // Node lists will add in their own sizes below.
1796
+ memsize->memsize -= sizeof(pm_node_list_t) * 1;
1797
+ memsize->memsize += pm_node_list_memsize(&cast->parts, memsize);
1798
+ break;
1799
+ }
1800
+ #line 102 "node.c.erb"
1801
+ case PM_INTERPOLATED_X_STRING_NODE: {
1802
+ pm_interpolated_x_string_node_t *cast = (pm_interpolated_x_string_node_t *) node;
1803
+ memsize->memsize += sizeof(*cast);
1804
+ // Node lists will add in their own sizes below.
1805
+ memsize->memsize -= sizeof(pm_node_list_t) * 1;
1806
+ memsize->memsize += pm_node_list_memsize(&cast->parts, memsize);
1807
+ break;
1808
+ }
1809
+ #line 102 "node.c.erb"
1810
+ case PM_KEYWORD_HASH_NODE: {
1811
+ pm_keyword_hash_node_t *cast = (pm_keyword_hash_node_t *) node;
1812
+ memsize->memsize += sizeof(*cast);
1813
+ // Node lists will add in their own sizes below.
1814
+ memsize->memsize -= sizeof(pm_node_list_t) * 1;
1815
+ memsize->memsize += pm_node_list_memsize(&cast->elements, memsize);
1816
+ break;
1817
+ }
1818
+ #line 102 "node.c.erb"
1819
+ case PM_KEYWORD_PARAMETER_NODE: {
1820
+ pm_keyword_parameter_node_t *cast = (pm_keyword_parameter_node_t *) node;
1821
+ memsize->memsize += sizeof(*cast);
1822
+ if (cast->value != NULL) {
1823
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1824
+ }
1825
+ break;
1826
+ }
1827
+ #line 102 "node.c.erb"
1828
+ case PM_KEYWORD_REST_PARAMETER_NODE: {
1829
+ pm_keyword_rest_parameter_node_t *cast = (pm_keyword_rest_parameter_node_t *) node;
1830
+ memsize->memsize += sizeof(*cast);
1831
+ break;
1832
+ }
1833
+ #line 102 "node.c.erb"
1834
+ case PM_LAMBDA_NODE: {
1835
+ pm_lambda_node_t *cast = (pm_lambda_node_t *) node;
1836
+ memsize->memsize += sizeof(*cast);
1837
+ // Constant id lists will add in their own sizes below.
1838
+ memsize->memsize -= sizeof(pm_constant_id_list_t) * 1;
1839
+ memsize->memsize += pm_constant_id_list_memsize(&cast->locals);
1840
+ if (cast->parameters != NULL) {
1841
+ pm_node_memsize_node((pm_node_t *)cast->parameters, memsize);
1842
+ }
1843
+ if (cast->body != NULL) {
1844
+ pm_node_memsize_node((pm_node_t *)cast->body, memsize);
1845
+ }
1846
+ break;
1847
+ }
1848
+ #line 102 "node.c.erb"
1849
+ case PM_LOCAL_VARIABLE_AND_WRITE_NODE: {
1850
+ pm_local_variable_and_write_node_t *cast = (pm_local_variable_and_write_node_t *) node;
1851
+ memsize->memsize += sizeof(*cast);
1852
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1853
+ break;
1854
+ }
1855
+ #line 102 "node.c.erb"
1856
+ case PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
1857
+ pm_local_variable_operator_write_node_t *cast = (pm_local_variable_operator_write_node_t *) node;
1858
+ memsize->memsize += sizeof(*cast);
1859
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1860
+ break;
1861
+ }
1862
+ #line 102 "node.c.erb"
1863
+ case PM_LOCAL_VARIABLE_OR_WRITE_NODE: {
1864
+ pm_local_variable_or_write_node_t *cast = (pm_local_variable_or_write_node_t *) node;
1865
+ memsize->memsize += sizeof(*cast);
1866
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1867
+ break;
1868
+ }
1869
+ #line 102 "node.c.erb"
1870
+ case PM_LOCAL_VARIABLE_READ_NODE: {
1871
+ pm_local_variable_read_node_t *cast = (pm_local_variable_read_node_t *) node;
1872
+ memsize->memsize += sizeof(*cast);
1873
+ break;
1874
+ }
1875
+ #line 102 "node.c.erb"
1876
+ case PM_LOCAL_VARIABLE_TARGET_NODE: {
1877
+ pm_local_variable_target_node_t *cast = (pm_local_variable_target_node_t *) node;
1878
+ memsize->memsize += sizeof(*cast);
1879
+ break;
1880
+ }
1881
+ #line 102 "node.c.erb"
1882
+ case PM_LOCAL_VARIABLE_WRITE_NODE: {
1883
+ pm_local_variable_write_node_t *cast = (pm_local_variable_write_node_t *) node;
1884
+ memsize->memsize += sizeof(*cast);
1885
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1886
+ break;
1887
+ }
1888
+ #line 102 "node.c.erb"
1889
+ case PM_MATCH_LAST_LINE_NODE: {
1890
+ pm_match_last_line_node_t *cast = (pm_match_last_line_node_t *) node;
1891
+ memsize->memsize += sizeof(*cast);
1892
+ memsize->memsize += pm_string_memsize(&cast->unescaped);
1893
+ break;
1894
+ }
1895
+ #line 102 "node.c.erb"
1896
+ case PM_MATCH_PREDICATE_NODE: {
1897
+ pm_match_predicate_node_t *cast = (pm_match_predicate_node_t *) node;
1898
+ memsize->memsize += sizeof(*cast);
1899
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1900
+ pm_node_memsize_node((pm_node_t *)cast->pattern, memsize);
1901
+ break;
1902
+ }
1903
+ #line 102 "node.c.erb"
1904
+ case PM_MATCH_REQUIRED_NODE: {
1905
+ pm_match_required_node_t *cast = (pm_match_required_node_t *) node;
1906
+ memsize->memsize += sizeof(*cast);
1907
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1908
+ pm_node_memsize_node((pm_node_t *)cast->pattern, memsize);
1909
+ break;
1910
+ }
1911
+ #line 102 "node.c.erb"
1912
+ case PM_MATCH_WRITE_NODE: {
1913
+ pm_match_write_node_t *cast = (pm_match_write_node_t *) node;
1914
+ memsize->memsize += sizeof(*cast);
1915
+ // Constant id lists will add in their own sizes below.
1916
+ memsize->memsize -= sizeof(pm_constant_id_list_t) * 1;
1917
+ pm_node_memsize_node((pm_node_t *)cast->call, memsize);
1918
+ memsize->memsize += pm_constant_id_list_memsize(&cast->locals);
1919
+ break;
1920
+ }
1921
+ #line 102 "node.c.erb"
1922
+ case PM_MISSING_NODE: {
1923
+ pm_missing_node_t *cast = (pm_missing_node_t *) node;
1924
+ memsize->memsize += sizeof(*cast);
1925
+ break;
1926
+ }
1927
+ #line 102 "node.c.erb"
1928
+ case PM_MODULE_NODE: {
1929
+ pm_module_node_t *cast = (pm_module_node_t *) node;
1930
+ memsize->memsize += sizeof(*cast);
1931
+ // Constant id lists will add in their own sizes below.
1932
+ memsize->memsize -= sizeof(pm_constant_id_list_t) * 1;
1933
+ memsize->memsize += pm_constant_id_list_memsize(&cast->locals);
1934
+ pm_node_memsize_node((pm_node_t *)cast->constant_path, memsize);
1935
+ if (cast->body != NULL) {
1936
+ pm_node_memsize_node((pm_node_t *)cast->body, memsize);
1937
+ }
1938
+ break;
1939
+ }
1940
+ #line 102 "node.c.erb"
1941
+ case PM_MULTI_TARGET_NODE: {
1942
+ pm_multi_target_node_t *cast = (pm_multi_target_node_t *) node;
1943
+ memsize->memsize += sizeof(*cast);
1944
+ // Node lists will add in their own sizes below.
1945
+ memsize->memsize -= sizeof(pm_node_list_t) * 1;
1946
+ memsize->memsize += pm_node_list_memsize(&cast->targets, memsize);
1947
+ break;
1948
+ }
1949
+ #line 102 "node.c.erb"
1950
+ case PM_MULTI_WRITE_NODE: {
1951
+ pm_multi_write_node_t *cast = (pm_multi_write_node_t *) node;
1952
+ memsize->memsize += sizeof(*cast);
1953
+ // Node lists will add in their own sizes below.
1954
+ memsize->memsize -= sizeof(pm_node_list_t) * 1;
1955
+ memsize->memsize += pm_node_list_memsize(&cast->targets, memsize);
1956
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1957
+ break;
1958
+ }
1959
+ #line 102 "node.c.erb"
1960
+ case PM_NEXT_NODE: {
1961
+ pm_next_node_t *cast = (pm_next_node_t *) node;
1962
+ memsize->memsize += sizeof(*cast);
1963
+ if (cast->arguments != NULL) {
1964
+ pm_node_memsize_node((pm_node_t *)cast->arguments, memsize);
1965
+ }
1966
+ break;
1967
+ }
1968
+ #line 102 "node.c.erb"
1969
+ case PM_NIL_NODE: {
1970
+ pm_nil_node_t *cast = (pm_nil_node_t *) node;
1971
+ memsize->memsize += sizeof(*cast);
1972
+ break;
1973
+ }
1974
+ #line 102 "node.c.erb"
1975
+ case PM_NO_KEYWORDS_PARAMETER_NODE: {
1976
+ pm_no_keywords_parameter_node_t *cast = (pm_no_keywords_parameter_node_t *) node;
1977
+ memsize->memsize += sizeof(*cast);
1978
+ break;
1979
+ }
1980
+ #line 102 "node.c.erb"
1981
+ case PM_NUMBERED_REFERENCE_READ_NODE: {
1982
+ pm_numbered_reference_read_node_t *cast = (pm_numbered_reference_read_node_t *) node;
1983
+ memsize->memsize += sizeof(*cast);
1984
+ break;
1985
+ }
1986
+ #line 102 "node.c.erb"
1987
+ case PM_OPTIONAL_PARAMETER_NODE: {
1988
+ pm_optional_parameter_node_t *cast = (pm_optional_parameter_node_t *) node;
1989
+ memsize->memsize += sizeof(*cast);
1990
+ pm_node_memsize_node((pm_node_t *)cast->value, memsize);
1991
+ break;
1992
+ }
1993
+ #line 102 "node.c.erb"
1994
+ case PM_OR_NODE: {
1995
+ pm_or_node_t *cast = (pm_or_node_t *) node;
1996
+ memsize->memsize += sizeof(*cast);
1997
+ pm_node_memsize_node((pm_node_t *)cast->left, memsize);
1998
+ pm_node_memsize_node((pm_node_t *)cast->right, memsize);
1999
+ break;
2000
+ }
2001
+ #line 102 "node.c.erb"
2002
+ case PM_PARAMETERS_NODE: {
2003
+ pm_parameters_node_t *cast = (pm_parameters_node_t *) node;
2004
+ memsize->memsize += sizeof(*cast);
2005
+ // Node lists will add in their own sizes below.
2006
+ memsize->memsize -= sizeof(pm_node_list_t) * 4;
2007
+ memsize->memsize += pm_node_list_memsize(&cast->requireds, memsize);
2008
+ memsize->memsize += pm_node_list_memsize(&cast->optionals, memsize);
2009
+ if (cast->rest != NULL) {
2010
+ pm_node_memsize_node((pm_node_t *)cast->rest, memsize);
2011
+ }
2012
+ memsize->memsize += pm_node_list_memsize(&cast->posts, memsize);
2013
+ memsize->memsize += pm_node_list_memsize(&cast->keywords, memsize);
2014
+ if (cast->keyword_rest != NULL) {
2015
+ pm_node_memsize_node((pm_node_t *)cast->keyword_rest, memsize);
2016
+ }
2017
+ if (cast->block != NULL) {
2018
+ pm_node_memsize_node((pm_node_t *)cast->block, memsize);
2019
+ }
2020
+ break;
2021
+ }
2022
+ #line 102 "node.c.erb"
2023
+ case PM_PARENTHESES_NODE: {
2024
+ pm_parentheses_node_t *cast = (pm_parentheses_node_t *) node;
2025
+ memsize->memsize += sizeof(*cast);
2026
+ if (cast->body != NULL) {
2027
+ pm_node_memsize_node((pm_node_t *)cast->body, memsize);
2028
+ }
2029
+ break;
2030
+ }
2031
+ #line 102 "node.c.erb"
2032
+ case PM_PINNED_EXPRESSION_NODE: {
2033
+ pm_pinned_expression_node_t *cast = (pm_pinned_expression_node_t *) node;
2034
+ memsize->memsize += sizeof(*cast);
2035
+ pm_node_memsize_node((pm_node_t *)cast->expression, memsize);
2036
+ break;
2037
+ }
2038
+ #line 102 "node.c.erb"
2039
+ case PM_PINNED_VARIABLE_NODE: {
2040
+ pm_pinned_variable_node_t *cast = (pm_pinned_variable_node_t *) node;
2041
+ memsize->memsize += sizeof(*cast);
2042
+ pm_node_memsize_node((pm_node_t *)cast->variable, memsize);
2043
+ break;
2044
+ }
2045
+ #line 102 "node.c.erb"
2046
+ case PM_POST_EXECUTION_NODE: {
2047
+ pm_post_execution_node_t *cast = (pm_post_execution_node_t *) node;
2048
+ memsize->memsize += sizeof(*cast);
2049
+ if (cast->statements != NULL) {
2050
+ pm_node_memsize_node((pm_node_t *)cast->statements, memsize);
2051
+ }
2052
+ break;
2053
+ }
2054
+ #line 102 "node.c.erb"
2055
+ case PM_PRE_EXECUTION_NODE: {
2056
+ pm_pre_execution_node_t *cast = (pm_pre_execution_node_t *) node;
2057
+ memsize->memsize += sizeof(*cast);
2058
+ if (cast->statements != NULL) {
2059
+ pm_node_memsize_node((pm_node_t *)cast->statements, memsize);
2060
+ }
2061
+ break;
2062
+ }
2063
+ #line 102 "node.c.erb"
2064
+ case PM_PROGRAM_NODE: {
2065
+ pm_program_node_t *cast = (pm_program_node_t *) node;
2066
+ memsize->memsize += sizeof(*cast);
2067
+ // Constant id lists will add in their own sizes below.
2068
+ memsize->memsize -= sizeof(pm_constant_id_list_t) * 1;
2069
+ memsize->memsize += pm_constant_id_list_memsize(&cast->locals);
2070
+ pm_node_memsize_node((pm_node_t *)cast->statements, memsize);
2071
+ break;
2072
+ }
2073
+ #line 102 "node.c.erb"
2074
+ case PM_RANGE_NODE: {
2075
+ pm_range_node_t *cast = (pm_range_node_t *) node;
2076
+ memsize->memsize += sizeof(*cast);
2077
+ if (cast->left != NULL) {
2078
+ pm_node_memsize_node((pm_node_t *)cast->left, memsize);
2079
+ }
2080
+ if (cast->right != NULL) {
2081
+ pm_node_memsize_node((pm_node_t *)cast->right, memsize);
2082
+ }
2083
+ break;
2084
+ }
2085
+ #line 102 "node.c.erb"
2086
+ case PM_RATIONAL_NODE: {
2087
+ pm_rational_node_t *cast = (pm_rational_node_t *) node;
2088
+ memsize->memsize += sizeof(*cast);
2089
+ pm_node_memsize_node((pm_node_t *)cast->numeric, memsize);
2090
+ break;
2091
+ }
2092
+ #line 102 "node.c.erb"
2093
+ case PM_REDO_NODE: {
2094
+ pm_redo_node_t *cast = (pm_redo_node_t *) node;
2095
+ memsize->memsize += sizeof(*cast);
2096
+ break;
2097
+ }
2098
+ #line 102 "node.c.erb"
2099
+ case PM_REGULAR_EXPRESSION_NODE: {
2100
+ pm_regular_expression_node_t *cast = (pm_regular_expression_node_t *) node;
2101
+ memsize->memsize += sizeof(*cast);
2102
+ memsize->memsize += pm_string_memsize(&cast->unescaped);
2103
+ break;
2104
+ }
2105
+ #line 102 "node.c.erb"
2106
+ case PM_REQUIRED_DESTRUCTURED_PARAMETER_NODE: {
2107
+ pm_required_destructured_parameter_node_t *cast = (pm_required_destructured_parameter_node_t *) node;
2108
+ memsize->memsize += sizeof(*cast);
2109
+ // Node lists will add in their own sizes below.
2110
+ memsize->memsize -= sizeof(pm_node_list_t) * 1;
2111
+ memsize->memsize += pm_node_list_memsize(&cast->parameters, memsize);
2112
+ break;
2113
+ }
2114
+ #line 102 "node.c.erb"
2115
+ case PM_REQUIRED_PARAMETER_NODE: {
2116
+ pm_required_parameter_node_t *cast = (pm_required_parameter_node_t *) node;
2117
+ memsize->memsize += sizeof(*cast);
2118
+ break;
2119
+ }
2120
+ #line 102 "node.c.erb"
2121
+ case PM_RESCUE_MODIFIER_NODE: {
2122
+ pm_rescue_modifier_node_t *cast = (pm_rescue_modifier_node_t *) node;
2123
+ memsize->memsize += sizeof(*cast);
2124
+ pm_node_memsize_node((pm_node_t *)cast->expression, memsize);
2125
+ pm_node_memsize_node((pm_node_t *)cast->rescue_expression, memsize);
2126
+ break;
2127
+ }
2128
+ #line 102 "node.c.erb"
2129
+ case PM_RESCUE_NODE: {
2130
+ pm_rescue_node_t *cast = (pm_rescue_node_t *) node;
2131
+ memsize->memsize += sizeof(*cast);
2132
+ // Node lists will add in their own sizes below.
2133
+ memsize->memsize -= sizeof(pm_node_list_t) * 1;
2134
+ memsize->memsize += pm_node_list_memsize(&cast->exceptions, memsize);
2135
+ if (cast->reference != NULL) {
2136
+ pm_node_memsize_node((pm_node_t *)cast->reference, memsize);
2137
+ }
2138
+ if (cast->statements != NULL) {
2139
+ pm_node_memsize_node((pm_node_t *)cast->statements, memsize);
2140
+ }
2141
+ if (cast->consequent != NULL) {
2142
+ pm_node_memsize_node((pm_node_t *)cast->consequent, memsize);
2143
+ }
2144
+ break;
2145
+ }
2146
+ #line 102 "node.c.erb"
2147
+ case PM_REST_PARAMETER_NODE: {
2148
+ pm_rest_parameter_node_t *cast = (pm_rest_parameter_node_t *) node;
2149
+ memsize->memsize += sizeof(*cast);
2150
+ break;
2151
+ }
2152
+ #line 102 "node.c.erb"
2153
+ case PM_RETRY_NODE: {
2154
+ pm_retry_node_t *cast = (pm_retry_node_t *) node;
2155
+ memsize->memsize += sizeof(*cast);
2156
+ break;
2157
+ }
2158
+ #line 102 "node.c.erb"
2159
+ case PM_RETURN_NODE: {
2160
+ pm_return_node_t *cast = (pm_return_node_t *) node;
2161
+ memsize->memsize += sizeof(*cast);
2162
+ if (cast->arguments != NULL) {
2163
+ pm_node_memsize_node((pm_node_t *)cast->arguments, memsize);
2164
+ }
2165
+ break;
2166
+ }
2167
+ #line 102 "node.c.erb"
2168
+ case PM_SELF_NODE: {
2169
+ pm_self_node_t *cast = (pm_self_node_t *) node;
2170
+ memsize->memsize += sizeof(*cast);
2171
+ break;
2172
+ }
2173
+ #line 102 "node.c.erb"
2174
+ case PM_SINGLETON_CLASS_NODE: {
2175
+ pm_singleton_class_node_t *cast = (pm_singleton_class_node_t *) node;
2176
+ memsize->memsize += sizeof(*cast);
2177
+ // Constant id lists will add in their own sizes below.
2178
+ memsize->memsize -= sizeof(pm_constant_id_list_t) * 1;
2179
+ memsize->memsize += pm_constant_id_list_memsize(&cast->locals);
2180
+ pm_node_memsize_node((pm_node_t *)cast->expression, memsize);
2181
+ if (cast->body != NULL) {
2182
+ pm_node_memsize_node((pm_node_t *)cast->body, memsize);
2183
+ }
2184
+ break;
2185
+ }
2186
+ #line 102 "node.c.erb"
2187
+ case PM_SOURCE_ENCODING_NODE: {
2188
+ pm_source_encoding_node_t *cast = (pm_source_encoding_node_t *) node;
2189
+ memsize->memsize += sizeof(*cast);
2190
+ break;
2191
+ }
2192
+ #line 102 "node.c.erb"
2193
+ case PM_SOURCE_FILE_NODE: {
2194
+ pm_source_file_node_t *cast = (pm_source_file_node_t *) node;
2195
+ memsize->memsize += sizeof(*cast);
2196
+ memsize->memsize += pm_string_memsize(&cast->filepath);
2197
+ break;
2198
+ }
2199
+ #line 102 "node.c.erb"
2200
+ case PM_SOURCE_LINE_NODE: {
2201
+ pm_source_line_node_t *cast = (pm_source_line_node_t *) node;
2202
+ memsize->memsize += sizeof(*cast);
2203
+ break;
2204
+ }
2205
+ #line 102 "node.c.erb"
2206
+ case PM_SPLAT_NODE: {
2207
+ pm_splat_node_t *cast = (pm_splat_node_t *) node;
2208
+ memsize->memsize += sizeof(*cast);
2209
+ if (cast->expression != NULL) {
2210
+ pm_node_memsize_node((pm_node_t *)cast->expression, memsize);
2211
+ }
2212
+ break;
2213
+ }
2214
+ #line 102 "node.c.erb"
2215
+ case PM_STATEMENTS_NODE: {
2216
+ pm_statements_node_t *cast = (pm_statements_node_t *) node;
2217
+ memsize->memsize += sizeof(*cast);
2218
+ // Node lists will add in their own sizes below.
2219
+ memsize->memsize -= sizeof(pm_node_list_t) * 1;
2220
+ memsize->memsize += pm_node_list_memsize(&cast->body, memsize);
2221
+ break;
2222
+ }
2223
+ #line 102 "node.c.erb"
2224
+ case PM_STRING_CONCAT_NODE: {
2225
+ pm_string_concat_node_t *cast = (pm_string_concat_node_t *) node;
2226
+ memsize->memsize += sizeof(*cast);
2227
+ pm_node_memsize_node((pm_node_t *)cast->left, memsize);
2228
+ pm_node_memsize_node((pm_node_t *)cast->right, memsize);
2229
+ break;
2230
+ }
2231
+ #line 102 "node.c.erb"
2232
+ case PM_STRING_NODE: {
2233
+ pm_string_node_t *cast = (pm_string_node_t *) node;
2234
+ memsize->memsize += sizeof(*cast);
2235
+ memsize->memsize += pm_string_memsize(&cast->unescaped);
2236
+ break;
2237
+ }
2238
+ #line 102 "node.c.erb"
2239
+ case PM_SUPER_NODE: {
2240
+ pm_super_node_t *cast = (pm_super_node_t *) node;
2241
+ memsize->memsize += sizeof(*cast);
2242
+ if (cast->arguments != NULL) {
2243
+ pm_node_memsize_node((pm_node_t *)cast->arguments, memsize);
2244
+ }
2245
+ if (cast->block != NULL) {
2246
+ pm_node_memsize_node((pm_node_t *)cast->block, memsize);
2247
+ }
2248
+ break;
2249
+ }
2250
+ #line 102 "node.c.erb"
2251
+ case PM_SYMBOL_NODE: {
2252
+ pm_symbol_node_t *cast = (pm_symbol_node_t *) node;
2253
+ memsize->memsize += sizeof(*cast);
2254
+ memsize->memsize += pm_string_memsize(&cast->unescaped);
2255
+ break;
2256
+ }
2257
+ #line 102 "node.c.erb"
2258
+ case PM_TRUE_NODE: {
2259
+ pm_true_node_t *cast = (pm_true_node_t *) node;
2260
+ memsize->memsize += sizeof(*cast);
2261
+ break;
2262
+ }
2263
+ #line 102 "node.c.erb"
2264
+ case PM_UNDEF_NODE: {
2265
+ pm_undef_node_t *cast = (pm_undef_node_t *) node;
2266
+ memsize->memsize += sizeof(*cast);
2267
+ // Node lists will add in their own sizes below.
2268
+ memsize->memsize -= sizeof(pm_node_list_t) * 1;
2269
+ memsize->memsize += pm_node_list_memsize(&cast->names, memsize);
2270
+ break;
2271
+ }
2272
+ #line 102 "node.c.erb"
2273
+ case PM_UNLESS_NODE: {
2274
+ pm_unless_node_t *cast = (pm_unless_node_t *) node;
2275
+ memsize->memsize += sizeof(*cast);
2276
+ pm_node_memsize_node((pm_node_t *)cast->predicate, memsize);
2277
+ if (cast->statements != NULL) {
2278
+ pm_node_memsize_node((pm_node_t *)cast->statements, memsize);
2279
+ }
2280
+ if (cast->consequent != NULL) {
2281
+ pm_node_memsize_node((pm_node_t *)cast->consequent, memsize);
2282
+ }
2283
+ break;
2284
+ }
2285
+ #line 102 "node.c.erb"
2286
+ case PM_UNTIL_NODE: {
2287
+ pm_until_node_t *cast = (pm_until_node_t *) node;
2288
+ memsize->memsize += sizeof(*cast);
2289
+ pm_node_memsize_node((pm_node_t *)cast->predicate, memsize);
2290
+ if (cast->statements != NULL) {
2291
+ pm_node_memsize_node((pm_node_t *)cast->statements, memsize);
2292
+ }
2293
+ break;
2294
+ }
2295
+ #line 102 "node.c.erb"
2296
+ case PM_WHEN_NODE: {
2297
+ pm_when_node_t *cast = (pm_when_node_t *) node;
2298
+ memsize->memsize += sizeof(*cast);
2299
+ // Node lists will add in their own sizes below.
2300
+ memsize->memsize -= sizeof(pm_node_list_t) * 1;
2301
+ memsize->memsize += pm_node_list_memsize(&cast->conditions, memsize);
2302
+ if (cast->statements != NULL) {
2303
+ pm_node_memsize_node((pm_node_t *)cast->statements, memsize);
2304
+ }
2305
+ break;
2306
+ }
2307
+ #line 102 "node.c.erb"
2308
+ case PM_WHILE_NODE: {
2309
+ pm_while_node_t *cast = (pm_while_node_t *) node;
2310
+ memsize->memsize += sizeof(*cast);
2311
+ pm_node_memsize_node((pm_node_t *)cast->predicate, memsize);
2312
+ if (cast->statements != NULL) {
2313
+ pm_node_memsize_node((pm_node_t *)cast->statements, memsize);
2314
+ }
2315
+ break;
2316
+ }
2317
+ #line 102 "node.c.erb"
2318
+ case PM_X_STRING_NODE: {
2319
+ pm_x_string_node_t *cast = (pm_x_string_node_t *) node;
2320
+ memsize->memsize += sizeof(*cast);
2321
+ memsize->memsize += pm_string_memsize(&cast->unescaped);
2322
+ break;
2323
+ }
2324
+ #line 102 "node.c.erb"
2325
+ case PM_YIELD_NODE: {
2326
+ pm_yield_node_t *cast = (pm_yield_node_t *) node;
2327
+ memsize->memsize += sizeof(*cast);
2328
+ if (cast->arguments != NULL) {
2329
+ pm_node_memsize_node((pm_node_t *)cast->arguments, memsize);
2330
+ }
2331
+ break;
2332
+ }
2333
+ #line 136 "node.c.erb"
2334
+ }
2335
+ }
2336
+
2337
+ // Calculates the memory footprint of a given node.
2338
+ PRISM_EXPORTED_FUNCTION void
2339
+ pm_node_memsize(pm_node_t *node, pm_memsize_t *memsize) {
2340
+ *memsize = (pm_memsize_t) { .memsize = 0, .node_count = 0 };
2341
+ pm_node_memsize_node(node, memsize);
2342
+ }
2343
+
2344
+ // Returns a string representation of the given node type.
2345
+ PRISM_EXPORTED_FUNCTION const char *
2346
+ pm_node_type_to_str(pm_node_type_t node_type)
2347
+ {
2348
+ switch (node_type) {
2349
+ case PM_ALIAS_GLOBAL_VARIABLE_NODE:
2350
+ return "PM_ALIAS_GLOBAL_VARIABLE_NODE";
2351
+ case PM_ALIAS_METHOD_NODE:
2352
+ return "PM_ALIAS_METHOD_NODE";
2353
+ case PM_ALTERNATION_PATTERN_NODE:
2354
+ return "PM_ALTERNATION_PATTERN_NODE";
2355
+ case PM_AND_NODE:
2356
+ return "PM_AND_NODE";
2357
+ case PM_ARGUMENTS_NODE:
2358
+ return "PM_ARGUMENTS_NODE";
2359
+ case PM_ARRAY_NODE:
2360
+ return "PM_ARRAY_NODE";
2361
+ case PM_ARRAY_PATTERN_NODE:
2362
+ return "PM_ARRAY_PATTERN_NODE";
2363
+ case PM_ASSOC_NODE:
2364
+ return "PM_ASSOC_NODE";
2365
+ case PM_ASSOC_SPLAT_NODE:
2366
+ return "PM_ASSOC_SPLAT_NODE";
2367
+ case PM_BACK_REFERENCE_READ_NODE:
2368
+ return "PM_BACK_REFERENCE_READ_NODE";
2369
+ case PM_BEGIN_NODE:
2370
+ return "PM_BEGIN_NODE";
2371
+ case PM_BLOCK_ARGUMENT_NODE:
2372
+ return "PM_BLOCK_ARGUMENT_NODE";
2373
+ case PM_BLOCK_LOCAL_VARIABLE_NODE:
2374
+ return "PM_BLOCK_LOCAL_VARIABLE_NODE";
2375
+ case PM_BLOCK_NODE:
2376
+ return "PM_BLOCK_NODE";
2377
+ case PM_BLOCK_PARAMETER_NODE:
2378
+ return "PM_BLOCK_PARAMETER_NODE";
2379
+ case PM_BLOCK_PARAMETERS_NODE:
2380
+ return "PM_BLOCK_PARAMETERS_NODE";
2381
+ case PM_BREAK_NODE:
2382
+ return "PM_BREAK_NODE";
2383
+ case PM_CALL_AND_WRITE_NODE:
2384
+ return "PM_CALL_AND_WRITE_NODE";
2385
+ case PM_CALL_NODE:
2386
+ return "PM_CALL_NODE";
2387
+ case PM_CALL_OPERATOR_WRITE_NODE:
2388
+ return "PM_CALL_OPERATOR_WRITE_NODE";
2389
+ case PM_CALL_OR_WRITE_NODE:
2390
+ return "PM_CALL_OR_WRITE_NODE";
2391
+ case PM_CAPTURE_PATTERN_NODE:
2392
+ return "PM_CAPTURE_PATTERN_NODE";
2393
+ case PM_CASE_NODE:
2394
+ return "PM_CASE_NODE";
2395
+ case PM_CLASS_NODE:
2396
+ return "PM_CLASS_NODE";
2397
+ case PM_CLASS_VARIABLE_AND_WRITE_NODE:
2398
+ return "PM_CLASS_VARIABLE_AND_WRITE_NODE";
2399
+ case PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE:
2400
+ return "PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE";
2401
+ case PM_CLASS_VARIABLE_OR_WRITE_NODE:
2402
+ return "PM_CLASS_VARIABLE_OR_WRITE_NODE";
2403
+ case PM_CLASS_VARIABLE_READ_NODE:
2404
+ return "PM_CLASS_VARIABLE_READ_NODE";
2405
+ case PM_CLASS_VARIABLE_TARGET_NODE:
2406
+ return "PM_CLASS_VARIABLE_TARGET_NODE";
2407
+ case PM_CLASS_VARIABLE_WRITE_NODE:
2408
+ return "PM_CLASS_VARIABLE_WRITE_NODE";
2409
+ case PM_CONSTANT_AND_WRITE_NODE:
2410
+ return "PM_CONSTANT_AND_WRITE_NODE";
2411
+ case PM_CONSTANT_OPERATOR_WRITE_NODE:
2412
+ return "PM_CONSTANT_OPERATOR_WRITE_NODE";
2413
+ case PM_CONSTANT_OR_WRITE_NODE:
2414
+ return "PM_CONSTANT_OR_WRITE_NODE";
2415
+ case PM_CONSTANT_PATH_AND_WRITE_NODE:
2416
+ return "PM_CONSTANT_PATH_AND_WRITE_NODE";
2417
+ case PM_CONSTANT_PATH_NODE:
2418
+ return "PM_CONSTANT_PATH_NODE";
2419
+ case PM_CONSTANT_PATH_OPERATOR_WRITE_NODE:
2420
+ return "PM_CONSTANT_PATH_OPERATOR_WRITE_NODE";
2421
+ case PM_CONSTANT_PATH_OR_WRITE_NODE:
2422
+ return "PM_CONSTANT_PATH_OR_WRITE_NODE";
2423
+ case PM_CONSTANT_PATH_TARGET_NODE:
2424
+ return "PM_CONSTANT_PATH_TARGET_NODE";
2425
+ case PM_CONSTANT_PATH_WRITE_NODE:
2426
+ return "PM_CONSTANT_PATH_WRITE_NODE";
2427
+ case PM_CONSTANT_READ_NODE:
2428
+ return "PM_CONSTANT_READ_NODE";
2429
+ case PM_CONSTANT_TARGET_NODE:
2430
+ return "PM_CONSTANT_TARGET_NODE";
2431
+ case PM_CONSTANT_WRITE_NODE:
2432
+ return "PM_CONSTANT_WRITE_NODE";
2433
+ case PM_DEF_NODE:
2434
+ return "PM_DEF_NODE";
2435
+ case PM_DEFINED_NODE:
2436
+ return "PM_DEFINED_NODE";
2437
+ case PM_ELSE_NODE:
2438
+ return "PM_ELSE_NODE";
2439
+ case PM_EMBEDDED_STATEMENTS_NODE:
2440
+ return "PM_EMBEDDED_STATEMENTS_NODE";
2441
+ case PM_EMBEDDED_VARIABLE_NODE:
2442
+ return "PM_EMBEDDED_VARIABLE_NODE";
2443
+ case PM_ENSURE_NODE:
2444
+ return "PM_ENSURE_NODE";
2445
+ case PM_FALSE_NODE:
2446
+ return "PM_FALSE_NODE";
2447
+ case PM_FIND_PATTERN_NODE:
2448
+ return "PM_FIND_PATTERN_NODE";
2449
+ case PM_FLIP_FLOP_NODE:
2450
+ return "PM_FLIP_FLOP_NODE";
2451
+ case PM_FLOAT_NODE:
2452
+ return "PM_FLOAT_NODE";
2453
+ case PM_FOR_NODE:
2454
+ return "PM_FOR_NODE";
2455
+ case PM_FORWARDING_ARGUMENTS_NODE:
2456
+ return "PM_FORWARDING_ARGUMENTS_NODE";
2457
+ case PM_FORWARDING_PARAMETER_NODE:
2458
+ return "PM_FORWARDING_PARAMETER_NODE";
2459
+ case PM_FORWARDING_SUPER_NODE:
2460
+ return "PM_FORWARDING_SUPER_NODE";
2461
+ case PM_GLOBAL_VARIABLE_AND_WRITE_NODE:
2462
+ return "PM_GLOBAL_VARIABLE_AND_WRITE_NODE";
2463
+ case PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE:
2464
+ return "PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE";
2465
+ case PM_GLOBAL_VARIABLE_OR_WRITE_NODE:
2466
+ return "PM_GLOBAL_VARIABLE_OR_WRITE_NODE";
2467
+ case PM_GLOBAL_VARIABLE_READ_NODE:
2468
+ return "PM_GLOBAL_VARIABLE_READ_NODE";
2469
+ case PM_GLOBAL_VARIABLE_TARGET_NODE:
2470
+ return "PM_GLOBAL_VARIABLE_TARGET_NODE";
2471
+ case PM_GLOBAL_VARIABLE_WRITE_NODE:
2472
+ return "PM_GLOBAL_VARIABLE_WRITE_NODE";
2473
+ case PM_HASH_NODE:
2474
+ return "PM_HASH_NODE";
2475
+ case PM_HASH_PATTERN_NODE:
2476
+ return "PM_HASH_PATTERN_NODE";
2477
+ case PM_IF_NODE:
2478
+ return "PM_IF_NODE";
2479
+ case PM_IMAGINARY_NODE:
2480
+ return "PM_IMAGINARY_NODE";
2481
+ case PM_IMPLICIT_NODE:
2482
+ return "PM_IMPLICIT_NODE";
2483
+ case PM_IN_NODE:
2484
+ return "PM_IN_NODE";
2485
+ case PM_INSTANCE_VARIABLE_AND_WRITE_NODE:
2486
+ return "PM_INSTANCE_VARIABLE_AND_WRITE_NODE";
2487
+ case PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE:
2488
+ return "PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE";
2489
+ case PM_INSTANCE_VARIABLE_OR_WRITE_NODE:
2490
+ return "PM_INSTANCE_VARIABLE_OR_WRITE_NODE";
2491
+ case PM_INSTANCE_VARIABLE_READ_NODE:
2492
+ return "PM_INSTANCE_VARIABLE_READ_NODE";
2493
+ case PM_INSTANCE_VARIABLE_TARGET_NODE:
2494
+ return "PM_INSTANCE_VARIABLE_TARGET_NODE";
2495
+ case PM_INSTANCE_VARIABLE_WRITE_NODE:
2496
+ return "PM_INSTANCE_VARIABLE_WRITE_NODE";
2497
+ case PM_INTEGER_NODE:
2498
+ return "PM_INTEGER_NODE";
2499
+ case PM_INTERPOLATED_MATCH_LAST_LINE_NODE:
2500
+ return "PM_INTERPOLATED_MATCH_LAST_LINE_NODE";
2501
+ case PM_INTERPOLATED_REGULAR_EXPRESSION_NODE:
2502
+ return "PM_INTERPOLATED_REGULAR_EXPRESSION_NODE";
2503
+ case PM_INTERPOLATED_STRING_NODE:
2504
+ return "PM_INTERPOLATED_STRING_NODE";
2505
+ case PM_INTERPOLATED_SYMBOL_NODE:
2506
+ return "PM_INTERPOLATED_SYMBOL_NODE";
2507
+ case PM_INTERPOLATED_X_STRING_NODE:
2508
+ return "PM_INTERPOLATED_X_STRING_NODE";
2509
+ case PM_KEYWORD_HASH_NODE:
2510
+ return "PM_KEYWORD_HASH_NODE";
2511
+ case PM_KEYWORD_PARAMETER_NODE:
2512
+ return "PM_KEYWORD_PARAMETER_NODE";
2513
+ case PM_KEYWORD_REST_PARAMETER_NODE:
2514
+ return "PM_KEYWORD_REST_PARAMETER_NODE";
2515
+ case PM_LAMBDA_NODE:
2516
+ return "PM_LAMBDA_NODE";
2517
+ case PM_LOCAL_VARIABLE_AND_WRITE_NODE:
2518
+ return "PM_LOCAL_VARIABLE_AND_WRITE_NODE";
2519
+ case PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE:
2520
+ return "PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE";
2521
+ case PM_LOCAL_VARIABLE_OR_WRITE_NODE:
2522
+ return "PM_LOCAL_VARIABLE_OR_WRITE_NODE";
2523
+ case PM_LOCAL_VARIABLE_READ_NODE:
2524
+ return "PM_LOCAL_VARIABLE_READ_NODE";
2525
+ case PM_LOCAL_VARIABLE_TARGET_NODE:
2526
+ return "PM_LOCAL_VARIABLE_TARGET_NODE";
2527
+ case PM_LOCAL_VARIABLE_WRITE_NODE:
2528
+ return "PM_LOCAL_VARIABLE_WRITE_NODE";
2529
+ case PM_MATCH_LAST_LINE_NODE:
2530
+ return "PM_MATCH_LAST_LINE_NODE";
2531
+ case PM_MATCH_PREDICATE_NODE:
2532
+ return "PM_MATCH_PREDICATE_NODE";
2533
+ case PM_MATCH_REQUIRED_NODE:
2534
+ return "PM_MATCH_REQUIRED_NODE";
2535
+ case PM_MATCH_WRITE_NODE:
2536
+ return "PM_MATCH_WRITE_NODE";
2537
+ case PM_MISSING_NODE:
2538
+ return "PM_MISSING_NODE";
2539
+ case PM_MODULE_NODE:
2540
+ return "PM_MODULE_NODE";
2541
+ case PM_MULTI_TARGET_NODE:
2542
+ return "PM_MULTI_TARGET_NODE";
2543
+ case PM_MULTI_WRITE_NODE:
2544
+ return "PM_MULTI_WRITE_NODE";
2545
+ case PM_NEXT_NODE:
2546
+ return "PM_NEXT_NODE";
2547
+ case PM_NIL_NODE:
2548
+ return "PM_NIL_NODE";
2549
+ case PM_NO_KEYWORDS_PARAMETER_NODE:
2550
+ return "PM_NO_KEYWORDS_PARAMETER_NODE";
2551
+ case PM_NUMBERED_REFERENCE_READ_NODE:
2552
+ return "PM_NUMBERED_REFERENCE_READ_NODE";
2553
+ case PM_OPTIONAL_PARAMETER_NODE:
2554
+ return "PM_OPTIONAL_PARAMETER_NODE";
2555
+ case PM_OR_NODE:
2556
+ return "PM_OR_NODE";
2557
+ case PM_PARAMETERS_NODE:
2558
+ return "PM_PARAMETERS_NODE";
2559
+ case PM_PARENTHESES_NODE:
2560
+ return "PM_PARENTHESES_NODE";
2561
+ case PM_PINNED_EXPRESSION_NODE:
2562
+ return "PM_PINNED_EXPRESSION_NODE";
2563
+ case PM_PINNED_VARIABLE_NODE:
2564
+ return "PM_PINNED_VARIABLE_NODE";
2565
+ case PM_POST_EXECUTION_NODE:
2566
+ return "PM_POST_EXECUTION_NODE";
2567
+ case PM_PRE_EXECUTION_NODE:
2568
+ return "PM_PRE_EXECUTION_NODE";
2569
+ case PM_PROGRAM_NODE:
2570
+ return "PM_PROGRAM_NODE";
2571
+ case PM_RANGE_NODE:
2572
+ return "PM_RANGE_NODE";
2573
+ case PM_RATIONAL_NODE:
2574
+ return "PM_RATIONAL_NODE";
2575
+ case PM_REDO_NODE:
2576
+ return "PM_REDO_NODE";
2577
+ case PM_REGULAR_EXPRESSION_NODE:
2578
+ return "PM_REGULAR_EXPRESSION_NODE";
2579
+ case PM_REQUIRED_DESTRUCTURED_PARAMETER_NODE:
2580
+ return "PM_REQUIRED_DESTRUCTURED_PARAMETER_NODE";
2581
+ case PM_REQUIRED_PARAMETER_NODE:
2582
+ return "PM_REQUIRED_PARAMETER_NODE";
2583
+ case PM_RESCUE_MODIFIER_NODE:
2584
+ return "PM_RESCUE_MODIFIER_NODE";
2585
+ case PM_RESCUE_NODE:
2586
+ return "PM_RESCUE_NODE";
2587
+ case PM_REST_PARAMETER_NODE:
2588
+ return "PM_REST_PARAMETER_NODE";
2589
+ case PM_RETRY_NODE:
2590
+ return "PM_RETRY_NODE";
2591
+ case PM_RETURN_NODE:
2592
+ return "PM_RETURN_NODE";
2593
+ case PM_SELF_NODE:
2594
+ return "PM_SELF_NODE";
2595
+ case PM_SINGLETON_CLASS_NODE:
2596
+ return "PM_SINGLETON_CLASS_NODE";
2597
+ case PM_SOURCE_ENCODING_NODE:
2598
+ return "PM_SOURCE_ENCODING_NODE";
2599
+ case PM_SOURCE_FILE_NODE:
2600
+ return "PM_SOURCE_FILE_NODE";
2601
+ case PM_SOURCE_LINE_NODE:
2602
+ return "PM_SOURCE_LINE_NODE";
2603
+ case PM_SPLAT_NODE:
2604
+ return "PM_SPLAT_NODE";
2605
+ case PM_STATEMENTS_NODE:
2606
+ return "PM_STATEMENTS_NODE";
2607
+ case PM_STRING_CONCAT_NODE:
2608
+ return "PM_STRING_CONCAT_NODE";
2609
+ case PM_STRING_NODE:
2610
+ return "PM_STRING_NODE";
2611
+ case PM_SUPER_NODE:
2612
+ return "PM_SUPER_NODE";
2613
+ case PM_SYMBOL_NODE:
2614
+ return "PM_SYMBOL_NODE";
2615
+ case PM_TRUE_NODE:
2616
+ return "PM_TRUE_NODE";
2617
+ case PM_UNDEF_NODE:
2618
+ return "PM_UNDEF_NODE";
2619
+ case PM_UNLESS_NODE:
2620
+ return "PM_UNLESS_NODE";
2621
+ case PM_UNTIL_NODE:
2622
+ return "PM_UNTIL_NODE";
2623
+ case PM_WHEN_NODE:
2624
+ return "PM_WHEN_NODE";
2625
+ case PM_WHILE_NODE:
2626
+ return "PM_WHILE_NODE";
2627
+ case PM_X_STRING_NODE:
2628
+ return "PM_X_STRING_NODE";
2629
+ case PM_YIELD_NODE:
2630
+ return "PM_YIELD_NODE";
2631
+ }
2632
+ return "";
2633
+ }