yarp 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +7 -0
  2. data/CODE_OF_CONDUCT.md +76 -0
  3. data/CONTRIBUTING.md +51 -0
  4. data/LICENSE.md +7 -0
  5. data/Makefile.in +79 -0
  6. data/README.md +86 -0
  7. data/config.h.in +25 -0
  8. data/config.yml +2147 -0
  9. data/configure +4487 -0
  10. data/docs/build_system.md +85 -0
  11. data/docs/building.md +26 -0
  12. data/docs/configuration.md +56 -0
  13. data/docs/design.md +53 -0
  14. data/docs/encoding.md +116 -0
  15. data/docs/extension.md +20 -0
  16. data/docs/fuzzing.md +93 -0
  17. data/docs/heredocs.md +36 -0
  18. data/docs/mapping.md +117 -0
  19. data/docs/ripper.md +36 -0
  20. data/docs/serialization.md +130 -0
  21. data/docs/testing.md +55 -0
  22. data/ext/yarp/api_node.c +3680 -0
  23. data/ext/yarp/api_pack.c +256 -0
  24. data/ext/yarp/extconf.rb +131 -0
  25. data/ext/yarp/extension.c +547 -0
  26. data/ext/yarp/extension.h +18 -0
  27. data/include/yarp/ast.h +1412 -0
  28. data/include/yarp/defines.h +54 -0
  29. data/include/yarp/diagnostic.h +24 -0
  30. data/include/yarp/enc/yp_encoding.h +94 -0
  31. data/include/yarp/node.h +36 -0
  32. data/include/yarp/pack.h +141 -0
  33. data/include/yarp/parser.h +389 -0
  34. data/include/yarp/regexp.h +19 -0
  35. data/include/yarp/unescape.h +42 -0
  36. data/include/yarp/util/yp_buffer.h +39 -0
  37. data/include/yarp/util/yp_char.h +75 -0
  38. data/include/yarp/util/yp_constant_pool.h +64 -0
  39. data/include/yarp/util/yp_list.h +67 -0
  40. data/include/yarp/util/yp_memchr.h +14 -0
  41. data/include/yarp/util/yp_newline_list.h +54 -0
  42. data/include/yarp/util/yp_state_stack.h +24 -0
  43. data/include/yarp/util/yp_string.h +57 -0
  44. data/include/yarp/util/yp_string_list.h +28 -0
  45. data/include/yarp/util/yp_strpbrk.h +29 -0
  46. data/include/yarp/version.h +5 -0
  47. data/include/yarp.h +69 -0
  48. data/lib/yarp/lex_compat.rb +759 -0
  49. data/lib/yarp/node.rb +7428 -0
  50. data/lib/yarp/pack.rb +185 -0
  51. data/lib/yarp/ripper_compat.rb +174 -0
  52. data/lib/yarp/serialize.rb +389 -0
  53. data/lib/yarp.rb +330 -0
  54. data/src/diagnostic.c +25 -0
  55. data/src/enc/yp_big5.c +79 -0
  56. data/src/enc/yp_euc_jp.c +85 -0
  57. data/src/enc/yp_gbk.c +88 -0
  58. data/src/enc/yp_shift_jis.c +83 -0
  59. data/src/enc/yp_tables.c +509 -0
  60. data/src/enc/yp_unicode.c +2320 -0
  61. data/src/enc/yp_windows_31j.c +83 -0
  62. data/src/node.c +2011 -0
  63. data/src/pack.c +493 -0
  64. data/src/prettyprint.c +1782 -0
  65. data/src/regexp.c +580 -0
  66. data/src/serialize.c +1576 -0
  67. data/src/token_type.c +347 -0
  68. data/src/unescape.c +576 -0
  69. data/src/util/yp_buffer.c +78 -0
  70. data/src/util/yp_char.c +229 -0
  71. data/src/util/yp_constant_pool.c +147 -0
  72. data/src/util/yp_list.c +50 -0
  73. data/src/util/yp_memchr.c +31 -0
  74. data/src/util/yp_newline_list.c +119 -0
  75. data/src/util/yp_state_stack.c +25 -0
  76. data/src/util/yp_string.c +207 -0
  77. data/src/util/yp_string_list.c +32 -0
  78. data/src/util/yp_strncasecmp.c +20 -0
  79. data/src/util/yp_strpbrk.c +66 -0
  80. data/src/yarp.c +13211 -0
  81. data/yarp.gemspec +100 -0
  82. metadata +125 -0
data/src/node.c ADDED
@@ -0,0 +1,2011 @@
1
+ /******************************************************************************/
2
+ /* This file is generated by the bin/template script and should not be */
3
+ /* 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 "yarp/node.h"
10
+
11
+ // Clear the node but preserves the location.
12
+ void yp_node_clear(yp_node_t *node) {
13
+ yp_location_t location = node->location;
14
+ memset(node, 0, sizeof(yp_node_t));
15
+ node->location = location;
16
+ }
17
+
18
+ // Calculate the size of the token list in bytes.
19
+ static size_t
20
+ yp_location_list_memsize(yp_location_list_t *list) {
21
+ return sizeof(yp_location_list_t) + (list->capacity * sizeof(yp_location_t));
22
+ }
23
+
24
+ // Append a token to the given list.
25
+ void
26
+ yp_location_list_append(yp_location_list_t *list, const yp_token_t *token) {
27
+ if (list->size == list->capacity) {
28
+ list->capacity = list->capacity == 0 ? 2 : list->capacity * 2;
29
+ list->locations = (yp_location_t *) realloc(list->locations, sizeof(yp_location_t) * list->capacity);
30
+ }
31
+ list->locations[list->size++] = (yp_location_t) { .start = token->start, .end = token->end };
32
+ }
33
+
34
+ // Free the memory associated with the token list.
35
+ static void
36
+ yp_location_list_free(yp_location_list_t *list) {
37
+ if (list->locations != NULL) {
38
+ free(list->locations);
39
+ }
40
+ }
41
+
42
+ static void
43
+ yp_node_memsize_node(yp_node_t *node, yp_memsize_t *memsize);
44
+
45
+ // Calculate the size of the node list in bytes.
46
+ static size_t
47
+ yp_node_list_memsize(yp_node_list_t *node_list, yp_memsize_t *memsize) {
48
+ size_t size = sizeof(yp_node_list_t) + (node_list->capacity * sizeof(yp_node_t *));
49
+ for (size_t index = 0; index < node_list->size; index++) {
50
+ yp_node_memsize_node(node_list->nodes[index], memsize);
51
+ }
52
+ return size;
53
+ }
54
+
55
+ // Append a new node onto the end of the node list.
56
+ void
57
+ yp_node_list_append(yp_node_list_t *list, yp_node_t *node) {
58
+ if (list->size == list->capacity) {
59
+ list->capacity = list->capacity == 0 ? 4 : list->capacity * 2;
60
+ list->nodes = (yp_node_t **) realloc(list->nodes, sizeof(yp_node_t *) * list->capacity);
61
+ }
62
+ list->nodes[list->size++] = node;
63
+ }
64
+
65
+ YP_EXPORTED_FUNCTION void
66
+ yp_node_destroy(yp_parser_t *parser, yp_node_t *node);
67
+
68
+ // Deallocate the inner memory of a list of nodes. The parser argument is not
69
+ // used, but is here for the future possibility of pre-allocating memory pools.
70
+ static void
71
+ yp_node_list_free(yp_parser_t *parser, yp_node_list_t *list) {
72
+ if (list->capacity > 0) {
73
+ for (size_t index = 0; index < list->size; index++) {
74
+ yp_node_destroy(parser, list->nodes[index]);
75
+ }
76
+ free(list->nodes);
77
+ }
78
+ }
79
+
80
+ // Deallocate the space for a yp_node_t. Similarly to yp_node_alloc, we're not
81
+ // using the parser argument, but it's there to allow for the future possibility
82
+ // of pre-allocating larger memory pools.
83
+ YP_EXPORTED_FUNCTION void
84
+ yp_node_destroy(yp_parser_t *parser, yp_node_t *node) {
85
+ switch (YP_NODE_TYPE(node)) {
86
+ #line 81 "node.c.erb"
87
+ case YP_NODE_ALIAS_NODE:
88
+ yp_node_destroy(parser, (yp_node_t *)((yp_alias_node_t *)node)->new_name);
89
+ yp_node_destroy(parser, (yp_node_t *)((yp_alias_node_t *)node)->old_name);
90
+ break;
91
+ #line 81 "node.c.erb"
92
+ case YP_NODE_ALTERNATION_PATTERN_NODE:
93
+ yp_node_destroy(parser, (yp_node_t *)((yp_alternation_pattern_node_t *)node)->left);
94
+ yp_node_destroy(parser, (yp_node_t *)((yp_alternation_pattern_node_t *)node)->right);
95
+ break;
96
+ #line 81 "node.c.erb"
97
+ case YP_NODE_AND_NODE:
98
+ yp_node_destroy(parser, (yp_node_t *)((yp_and_node_t *)node)->left);
99
+ yp_node_destroy(parser, (yp_node_t *)((yp_and_node_t *)node)->right);
100
+ break;
101
+ #line 81 "node.c.erb"
102
+ case YP_NODE_ARGUMENTS_NODE:
103
+ yp_node_list_free(parser, &((yp_arguments_node_t *)node)->arguments);
104
+ break;
105
+ #line 81 "node.c.erb"
106
+ case YP_NODE_ARRAY_NODE:
107
+ yp_node_list_free(parser, &((yp_array_node_t *)node)->elements);
108
+ break;
109
+ #line 81 "node.c.erb"
110
+ case YP_NODE_ARRAY_PATTERN_NODE:
111
+ if (((yp_array_pattern_node_t *)node)->constant != NULL) {
112
+ yp_node_destroy(parser, (yp_node_t *)((yp_array_pattern_node_t *)node)->constant);
113
+ }
114
+ yp_node_list_free(parser, &((yp_array_pattern_node_t *)node)->requireds);
115
+ if (((yp_array_pattern_node_t *)node)->rest != NULL) {
116
+ yp_node_destroy(parser, (yp_node_t *)((yp_array_pattern_node_t *)node)->rest);
117
+ }
118
+ yp_node_list_free(parser, &((yp_array_pattern_node_t *)node)->posts);
119
+ break;
120
+ #line 81 "node.c.erb"
121
+ case YP_NODE_ASSOC_NODE:
122
+ yp_node_destroy(parser, (yp_node_t *)((yp_assoc_node_t *)node)->key);
123
+ if (((yp_assoc_node_t *)node)->value != NULL) {
124
+ yp_node_destroy(parser, (yp_node_t *)((yp_assoc_node_t *)node)->value);
125
+ }
126
+ break;
127
+ #line 81 "node.c.erb"
128
+ case YP_NODE_ASSOC_SPLAT_NODE:
129
+ if (((yp_assoc_splat_node_t *)node)->value != NULL) {
130
+ yp_node_destroy(parser, (yp_node_t *)((yp_assoc_splat_node_t *)node)->value);
131
+ }
132
+ break;
133
+ #line 81 "node.c.erb"
134
+ case YP_NODE_BACK_REFERENCE_READ_NODE:
135
+ break;
136
+ #line 81 "node.c.erb"
137
+ case YP_NODE_BEGIN_NODE:
138
+ if (((yp_begin_node_t *)node)->statements != NULL) {
139
+ yp_node_destroy(parser, (yp_node_t *)((yp_begin_node_t *)node)->statements);
140
+ }
141
+ if (((yp_begin_node_t *)node)->rescue_clause != NULL) {
142
+ yp_node_destroy(parser, (yp_node_t *)((yp_begin_node_t *)node)->rescue_clause);
143
+ }
144
+ if (((yp_begin_node_t *)node)->else_clause != NULL) {
145
+ yp_node_destroy(parser, (yp_node_t *)((yp_begin_node_t *)node)->else_clause);
146
+ }
147
+ if (((yp_begin_node_t *)node)->ensure_clause != NULL) {
148
+ yp_node_destroy(parser, (yp_node_t *)((yp_begin_node_t *)node)->ensure_clause);
149
+ }
150
+ break;
151
+ #line 81 "node.c.erb"
152
+ case YP_NODE_BLOCK_ARGUMENT_NODE:
153
+ if (((yp_block_argument_node_t *)node)->expression != NULL) {
154
+ yp_node_destroy(parser, (yp_node_t *)((yp_block_argument_node_t *)node)->expression);
155
+ }
156
+ break;
157
+ #line 81 "node.c.erb"
158
+ case YP_NODE_BLOCK_NODE:
159
+ yp_constant_id_list_free(&((yp_block_node_t *)node)->locals);
160
+ if (((yp_block_node_t *)node)->parameters != NULL) {
161
+ yp_node_destroy(parser, (yp_node_t *)((yp_block_node_t *)node)->parameters);
162
+ }
163
+ if (((yp_block_node_t *)node)->statements != NULL) {
164
+ yp_node_destroy(parser, (yp_node_t *)((yp_block_node_t *)node)->statements);
165
+ }
166
+ break;
167
+ #line 81 "node.c.erb"
168
+ case YP_NODE_BLOCK_PARAMETER_NODE:
169
+ break;
170
+ #line 81 "node.c.erb"
171
+ case YP_NODE_BLOCK_PARAMETERS_NODE:
172
+ if (((yp_block_parameters_node_t *)node)->parameters != NULL) {
173
+ yp_node_destroy(parser, (yp_node_t *)((yp_block_parameters_node_t *)node)->parameters);
174
+ }
175
+ yp_location_list_free(&((yp_block_parameters_node_t *)node)->locals);
176
+ break;
177
+ #line 81 "node.c.erb"
178
+ case YP_NODE_BREAK_NODE:
179
+ if (((yp_break_node_t *)node)->arguments != NULL) {
180
+ yp_node_destroy(parser, (yp_node_t *)((yp_break_node_t *)node)->arguments);
181
+ }
182
+ break;
183
+ #line 81 "node.c.erb"
184
+ case YP_NODE_CALL_NODE:
185
+ if (((yp_call_node_t *)node)->receiver != NULL) {
186
+ yp_node_destroy(parser, (yp_node_t *)((yp_call_node_t *)node)->receiver);
187
+ }
188
+ if (((yp_call_node_t *)node)->arguments != NULL) {
189
+ yp_node_destroy(parser, (yp_node_t *)((yp_call_node_t *)node)->arguments);
190
+ }
191
+ if (((yp_call_node_t *)node)->block != NULL) {
192
+ yp_node_destroy(parser, (yp_node_t *)((yp_call_node_t *)node)->block);
193
+ }
194
+ yp_string_free(&((yp_call_node_t *)node)->name);
195
+ break;
196
+ #line 81 "node.c.erb"
197
+ case YP_NODE_CALL_OPERATOR_AND_WRITE_NODE:
198
+ yp_node_destroy(parser, (yp_node_t *)((yp_call_operator_and_write_node_t *)node)->target);
199
+ yp_node_destroy(parser, (yp_node_t *)((yp_call_operator_and_write_node_t *)node)->value);
200
+ break;
201
+ #line 81 "node.c.erb"
202
+ case YP_NODE_CALL_OPERATOR_OR_WRITE_NODE:
203
+ yp_node_destroy(parser, (yp_node_t *)((yp_call_operator_or_write_node_t *)node)->target);
204
+ yp_node_destroy(parser, (yp_node_t *)((yp_call_operator_or_write_node_t *)node)->value);
205
+ break;
206
+ #line 81 "node.c.erb"
207
+ case YP_NODE_CALL_OPERATOR_WRITE_NODE:
208
+ yp_node_destroy(parser, (yp_node_t *)((yp_call_operator_write_node_t *)node)->target);
209
+ yp_node_destroy(parser, (yp_node_t *)((yp_call_operator_write_node_t *)node)->value);
210
+ break;
211
+ #line 81 "node.c.erb"
212
+ case YP_NODE_CAPTURE_PATTERN_NODE:
213
+ yp_node_destroy(parser, (yp_node_t *)((yp_capture_pattern_node_t *)node)->value);
214
+ yp_node_destroy(parser, (yp_node_t *)((yp_capture_pattern_node_t *)node)->target);
215
+ break;
216
+ #line 81 "node.c.erb"
217
+ case YP_NODE_CASE_NODE:
218
+ if (((yp_case_node_t *)node)->predicate != NULL) {
219
+ yp_node_destroy(parser, (yp_node_t *)((yp_case_node_t *)node)->predicate);
220
+ }
221
+ yp_node_list_free(parser, &((yp_case_node_t *)node)->conditions);
222
+ if (((yp_case_node_t *)node)->consequent != NULL) {
223
+ yp_node_destroy(parser, (yp_node_t *)((yp_case_node_t *)node)->consequent);
224
+ }
225
+ break;
226
+ #line 81 "node.c.erb"
227
+ case YP_NODE_CLASS_NODE:
228
+ yp_constant_id_list_free(&((yp_class_node_t *)node)->locals);
229
+ yp_node_destroy(parser, (yp_node_t *)((yp_class_node_t *)node)->constant_path);
230
+ if (((yp_class_node_t *)node)->superclass != NULL) {
231
+ yp_node_destroy(parser, (yp_node_t *)((yp_class_node_t *)node)->superclass);
232
+ }
233
+ if (((yp_class_node_t *)node)->statements != NULL) {
234
+ yp_node_destroy(parser, (yp_node_t *)((yp_class_node_t *)node)->statements);
235
+ }
236
+ break;
237
+ #line 81 "node.c.erb"
238
+ case YP_NODE_CLASS_VARIABLE_OPERATOR_AND_WRITE_NODE:
239
+ yp_node_destroy(parser, (yp_node_t *)((yp_class_variable_operator_and_write_node_t *)node)->value);
240
+ break;
241
+ #line 81 "node.c.erb"
242
+ case YP_NODE_CLASS_VARIABLE_OPERATOR_OR_WRITE_NODE:
243
+ yp_node_destroy(parser, (yp_node_t *)((yp_class_variable_operator_or_write_node_t *)node)->value);
244
+ break;
245
+ #line 81 "node.c.erb"
246
+ case YP_NODE_CLASS_VARIABLE_OPERATOR_WRITE_NODE:
247
+ yp_node_destroy(parser, (yp_node_t *)((yp_class_variable_operator_write_node_t *)node)->value);
248
+ break;
249
+ #line 81 "node.c.erb"
250
+ case YP_NODE_CLASS_VARIABLE_READ_NODE:
251
+ break;
252
+ #line 81 "node.c.erb"
253
+ case YP_NODE_CLASS_VARIABLE_WRITE_NODE:
254
+ if (((yp_class_variable_write_node_t *)node)->value != NULL) {
255
+ yp_node_destroy(parser, (yp_node_t *)((yp_class_variable_write_node_t *)node)->value);
256
+ }
257
+ break;
258
+ #line 81 "node.c.erb"
259
+ case YP_NODE_CONSTANT_OPERATOR_AND_WRITE_NODE:
260
+ yp_node_destroy(parser, (yp_node_t *)((yp_constant_operator_and_write_node_t *)node)->value);
261
+ break;
262
+ #line 81 "node.c.erb"
263
+ case YP_NODE_CONSTANT_OPERATOR_OR_WRITE_NODE:
264
+ yp_node_destroy(parser, (yp_node_t *)((yp_constant_operator_or_write_node_t *)node)->value);
265
+ break;
266
+ #line 81 "node.c.erb"
267
+ case YP_NODE_CONSTANT_OPERATOR_WRITE_NODE:
268
+ yp_node_destroy(parser, (yp_node_t *)((yp_constant_operator_write_node_t *)node)->value);
269
+ break;
270
+ #line 81 "node.c.erb"
271
+ case YP_NODE_CONSTANT_PATH_NODE:
272
+ if (((yp_constant_path_node_t *)node)->parent != NULL) {
273
+ yp_node_destroy(parser, (yp_node_t *)((yp_constant_path_node_t *)node)->parent);
274
+ }
275
+ yp_node_destroy(parser, (yp_node_t *)((yp_constant_path_node_t *)node)->child);
276
+ break;
277
+ #line 81 "node.c.erb"
278
+ case YP_NODE_CONSTANT_PATH_OPERATOR_AND_WRITE_NODE:
279
+ yp_node_destroy(parser, (yp_node_t *)((yp_constant_path_operator_and_write_node_t *)node)->target);
280
+ yp_node_destroy(parser, (yp_node_t *)((yp_constant_path_operator_and_write_node_t *)node)->value);
281
+ break;
282
+ #line 81 "node.c.erb"
283
+ case YP_NODE_CONSTANT_PATH_OPERATOR_OR_WRITE_NODE:
284
+ yp_node_destroy(parser, (yp_node_t *)((yp_constant_path_operator_or_write_node_t *)node)->target);
285
+ yp_node_destroy(parser, (yp_node_t *)((yp_constant_path_operator_or_write_node_t *)node)->value);
286
+ break;
287
+ #line 81 "node.c.erb"
288
+ case YP_NODE_CONSTANT_PATH_OPERATOR_WRITE_NODE:
289
+ yp_node_destroy(parser, (yp_node_t *)((yp_constant_path_operator_write_node_t *)node)->target);
290
+ yp_node_destroy(parser, (yp_node_t *)((yp_constant_path_operator_write_node_t *)node)->value);
291
+ break;
292
+ #line 81 "node.c.erb"
293
+ case YP_NODE_CONSTANT_PATH_WRITE_NODE:
294
+ yp_node_destroy(parser, (yp_node_t *)((yp_constant_path_write_node_t *)node)->target);
295
+ if (((yp_constant_path_write_node_t *)node)->value != NULL) {
296
+ yp_node_destroy(parser, (yp_node_t *)((yp_constant_path_write_node_t *)node)->value);
297
+ }
298
+ break;
299
+ #line 81 "node.c.erb"
300
+ case YP_NODE_CONSTANT_READ_NODE:
301
+ break;
302
+ #line 81 "node.c.erb"
303
+ case YP_NODE_CONSTANT_WRITE_NODE:
304
+ if (((yp_constant_write_node_t *)node)->value != NULL) {
305
+ yp_node_destroy(parser, (yp_node_t *)((yp_constant_write_node_t *)node)->value);
306
+ }
307
+ break;
308
+ #line 81 "node.c.erb"
309
+ case YP_NODE_DEF_NODE:
310
+ if (((yp_def_node_t *)node)->receiver != NULL) {
311
+ yp_node_destroy(parser, (yp_node_t *)((yp_def_node_t *)node)->receiver);
312
+ }
313
+ if (((yp_def_node_t *)node)->parameters != NULL) {
314
+ yp_node_destroy(parser, (yp_node_t *)((yp_def_node_t *)node)->parameters);
315
+ }
316
+ if (((yp_def_node_t *)node)->statements != NULL) {
317
+ yp_node_destroy(parser, (yp_node_t *)((yp_def_node_t *)node)->statements);
318
+ }
319
+ yp_constant_id_list_free(&((yp_def_node_t *)node)->locals);
320
+ break;
321
+ #line 81 "node.c.erb"
322
+ case YP_NODE_DEFINED_NODE:
323
+ yp_node_destroy(parser, (yp_node_t *)((yp_defined_node_t *)node)->value);
324
+ break;
325
+ #line 81 "node.c.erb"
326
+ case YP_NODE_ELSE_NODE:
327
+ if (((yp_else_node_t *)node)->statements != NULL) {
328
+ yp_node_destroy(parser, (yp_node_t *)((yp_else_node_t *)node)->statements);
329
+ }
330
+ break;
331
+ #line 81 "node.c.erb"
332
+ case YP_NODE_EMBEDDED_STATEMENTS_NODE:
333
+ if (((yp_embedded_statements_node_t *)node)->statements != NULL) {
334
+ yp_node_destroy(parser, (yp_node_t *)((yp_embedded_statements_node_t *)node)->statements);
335
+ }
336
+ break;
337
+ #line 81 "node.c.erb"
338
+ case YP_NODE_EMBEDDED_VARIABLE_NODE:
339
+ yp_node_destroy(parser, (yp_node_t *)((yp_embedded_variable_node_t *)node)->variable);
340
+ break;
341
+ #line 81 "node.c.erb"
342
+ case YP_NODE_ENSURE_NODE:
343
+ if (((yp_ensure_node_t *)node)->statements != NULL) {
344
+ yp_node_destroy(parser, (yp_node_t *)((yp_ensure_node_t *)node)->statements);
345
+ }
346
+ break;
347
+ #line 81 "node.c.erb"
348
+ case YP_NODE_FALSE_NODE:
349
+ break;
350
+ #line 81 "node.c.erb"
351
+ case YP_NODE_FIND_PATTERN_NODE:
352
+ if (((yp_find_pattern_node_t *)node)->constant != NULL) {
353
+ yp_node_destroy(parser, (yp_node_t *)((yp_find_pattern_node_t *)node)->constant);
354
+ }
355
+ yp_node_destroy(parser, (yp_node_t *)((yp_find_pattern_node_t *)node)->left);
356
+ yp_node_list_free(parser, &((yp_find_pattern_node_t *)node)->requireds);
357
+ yp_node_destroy(parser, (yp_node_t *)((yp_find_pattern_node_t *)node)->right);
358
+ break;
359
+ #line 81 "node.c.erb"
360
+ case YP_NODE_FLOAT_NODE:
361
+ break;
362
+ #line 81 "node.c.erb"
363
+ case YP_NODE_FOR_NODE:
364
+ yp_node_destroy(parser, (yp_node_t *)((yp_for_node_t *)node)->index);
365
+ yp_node_destroy(parser, (yp_node_t *)((yp_for_node_t *)node)->collection);
366
+ if (((yp_for_node_t *)node)->statements != NULL) {
367
+ yp_node_destroy(parser, (yp_node_t *)((yp_for_node_t *)node)->statements);
368
+ }
369
+ break;
370
+ #line 81 "node.c.erb"
371
+ case YP_NODE_FORWARDING_ARGUMENTS_NODE:
372
+ break;
373
+ #line 81 "node.c.erb"
374
+ case YP_NODE_FORWARDING_PARAMETER_NODE:
375
+ break;
376
+ #line 81 "node.c.erb"
377
+ case YP_NODE_FORWARDING_SUPER_NODE:
378
+ if (((yp_forwarding_super_node_t *)node)->block != NULL) {
379
+ yp_node_destroy(parser, (yp_node_t *)((yp_forwarding_super_node_t *)node)->block);
380
+ }
381
+ break;
382
+ #line 81 "node.c.erb"
383
+ case YP_NODE_GLOBAL_VARIABLE_OPERATOR_AND_WRITE_NODE:
384
+ yp_node_destroy(parser, (yp_node_t *)((yp_global_variable_operator_and_write_node_t *)node)->value);
385
+ break;
386
+ #line 81 "node.c.erb"
387
+ case YP_NODE_GLOBAL_VARIABLE_OPERATOR_OR_WRITE_NODE:
388
+ yp_node_destroy(parser, (yp_node_t *)((yp_global_variable_operator_or_write_node_t *)node)->value);
389
+ break;
390
+ #line 81 "node.c.erb"
391
+ case YP_NODE_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE:
392
+ yp_node_destroy(parser, (yp_node_t *)((yp_global_variable_operator_write_node_t *)node)->value);
393
+ break;
394
+ #line 81 "node.c.erb"
395
+ case YP_NODE_GLOBAL_VARIABLE_READ_NODE:
396
+ break;
397
+ #line 81 "node.c.erb"
398
+ case YP_NODE_GLOBAL_VARIABLE_WRITE_NODE:
399
+ if (((yp_global_variable_write_node_t *)node)->value != NULL) {
400
+ yp_node_destroy(parser, (yp_node_t *)((yp_global_variable_write_node_t *)node)->value);
401
+ }
402
+ break;
403
+ #line 81 "node.c.erb"
404
+ case YP_NODE_HASH_NODE:
405
+ yp_node_list_free(parser, &((yp_hash_node_t *)node)->elements);
406
+ break;
407
+ #line 81 "node.c.erb"
408
+ case YP_NODE_HASH_PATTERN_NODE:
409
+ if (((yp_hash_pattern_node_t *)node)->constant != NULL) {
410
+ yp_node_destroy(parser, (yp_node_t *)((yp_hash_pattern_node_t *)node)->constant);
411
+ }
412
+ yp_node_list_free(parser, &((yp_hash_pattern_node_t *)node)->assocs);
413
+ if (((yp_hash_pattern_node_t *)node)->kwrest != NULL) {
414
+ yp_node_destroy(parser, (yp_node_t *)((yp_hash_pattern_node_t *)node)->kwrest);
415
+ }
416
+ break;
417
+ #line 81 "node.c.erb"
418
+ case YP_NODE_IF_NODE:
419
+ yp_node_destroy(parser, (yp_node_t *)((yp_if_node_t *)node)->predicate);
420
+ if (((yp_if_node_t *)node)->statements != NULL) {
421
+ yp_node_destroy(parser, (yp_node_t *)((yp_if_node_t *)node)->statements);
422
+ }
423
+ if (((yp_if_node_t *)node)->consequent != NULL) {
424
+ yp_node_destroy(parser, (yp_node_t *)((yp_if_node_t *)node)->consequent);
425
+ }
426
+ break;
427
+ #line 81 "node.c.erb"
428
+ case YP_NODE_IMAGINARY_NODE:
429
+ yp_node_destroy(parser, (yp_node_t *)((yp_imaginary_node_t *)node)->numeric);
430
+ break;
431
+ #line 81 "node.c.erb"
432
+ case YP_NODE_IN_NODE:
433
+ yp_node_destroy(parser, (yp_node_t *)((yp_in_node_t *)node)->pattern);
434
+ if (((yp_in_node_t *)node)->statements != NULL) {
435
+ yp_node_destroy(parser, (yp_node_t *)((yp_in_node_t *)node)->statements);
436
+ }
437
+ break;
438
+ #line 81 "node.c.erb"
439
+ case YP_NODE_INSTANCE_VARIABLE_OPERATOR_AND_WRITE_NODE:
440
+ yp_node_destroy(parser, (yp_node_t *)((yp_instance_variable_operator_and_write_node_t *)node)->value);
441
+ break;
442
+ #line 81 "node.c.erb"
443
+ case YP_NODE_INSTANCE_VARIABLE_OPERATOR_OR_WRITE_NODE:
444
+ yp_node_destroy(parser, (yp_node_t *)((yp_instance_variable_operator_or_write_node_t *)node)->value);
445
+ break;
446
+ #line 81 "node.c.erb"
447
+ case YP_NODE_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE:
448
+ yp_node_destroy(parser, (yp_node_t *)((yp_instance_variable_operator_write_node_t *)node)->value);
449
+ break;
450
+ #line 81 "node.c.erb"
451
+ case YP_NODE_INSTANCE_VARIABLE_READ_NODE:
452
+ break;
453
+ #line 81 "node.c.erb"
454
+ case YP_NODE_INSTANCE_VARIABLE_WRITE_NODE:
455
+ if (((yp_instance_variable_write_node_t *)node)->value != NULL) {
456
+ yp_node_destroy(parser, (yp_node_t *)((yp_instance_variable_write_node_t *)node)->value);
457
+ }
458
+ break;
459
+ #line 81 "node.c.erb"
460
+ case YP_NODE_INTEGER_NODE:
461
+ break;
462
+ #line 81 "node.c.erb"
463
+ case YP_NODE_INTERPOLATED_REGULAR_EXPRESSION_NODE:
464
+ yp_node_list_free(parser, &((yp_interpolated_regular_expression_node_t *)node)->parts);
465
+ break;
466
+ #line 81 "node.c.erb"
467
+ case YP_NODE_INTERPOLATED_STRING_NODE:
468
+ yp_node_list_free(parser, &((yp_interpolated_string_node_t *)node)->parts);
469
+ break;
470
+ #line 81 "node.c.erb"
471
+ case YP_NODE_INTERPOLATED_SYMBOL_NODE:
472
+ yp_node_list_free(parser, &((yp_interpolated_symbol_node_t *)node)->parts);
473
+ break;
474
+ #line 81 "node.c.erb"
475
+ case YP_NODE_INTERPOLATED_X_STRING_NODE:
476
+ yp_node_list_free(parser, &((yp_interpolated_x_string_node_t *)node)->parts);
477
+ break;
478
+ #line 81 "node.c.erb"
479
+ case YP_NODE_KEYWORD_HASH_NODE:
480
+ yp_node_list_free(parser, &((yp_keyword_hash_node_t *)node)->elements);
481
+ break;
482
+ #line 81 "node.c.erb"
483
+ case YP_NODE_KEYWORD_PARAMETER_NODE:
484
+ if (((yp_keyword_parameter_node_t *)node)->value != NULL) {
485
+ yp_node_destroy(parser, (yp_node_t *)((yp_keyword_parameter_node_t *)node)->value);
486
+ }
487
+ break;
488
+ #line 81 "node.c.erb"
489
+ case YP_NODE_KEYWORD_REST_PARAMETER_NODE:
490
+ break;
491
+ #line 81 "node.c.erb"
492
+ case YP_NODE_LAMBDA_NODE:
493
+ yp_constant_id_list_free(&((yp_lambda_node_t *)node)->locals);
494
+ if (((yp_lambda_node_t *)node)->parameters != NULL) {
495
+ yp_node_destroy(parser, (yp_node_t *)((yp_lambda_node_t *)node)->parameters);
496
+ }
497
+ if (((yp_lambda_node_t *)node)->statements != NULL) {
498
+ yp_node_destroy(parser, (yp_node_t *)((yp_lambda_node_t *)node)->statements);
499
+ }
500
+ break;
501
+ #line 81 "node.c.erb"
502
+ case YP_NODE_LOCAL_VARIABLE_OPERATOR_AND_WRITE_NODE:
503
+ yp_node_destroy(parser, (yp_node_t *)((yp_local_variable_operator_and_write_node_t *)node)->value);
504
+ break;
505
+ #line 81 "node.c.erb"
506
+ case YP_NODE_LOCAL_VARIABLE_OPERATOR_OR_WRITE_NODE:
507
+ yp_node_destroy(parser, (yp_node_t *)((yp_local_variable_operator_or_write_node_t *)node)->value);
508
+ break;
509
+ #line 81 "node.c.erb"
510
+ case YP_NODE_LOCAL_VARIABLE_OPERATOR_WRITE_NODE:
511
+ yp_node_destroy(parser, (yp_node_t *)((yp_local_variable_operator_write_node_t *)node)->value);
512
+ break;
513
+ #line 81 "node.c.erb"
514
+ case YP_NODE_LOCAL_VARIABLE_READ_NODE:
515
+ break;
516
+ #line 81 "node.c.erb"
517
+ case YP_NODE_LOCAL_VARIABLE_WRITE_NODE:
518
+ if (((yp_local_variable_write_node_t *)node)->value != NULL) {
519
+ yp_node_destroy(parser, (yp_node_t *)((yp_local_variable_write_node_t *)node)->value);
520
+ }
521
+ break;
522
+ #line 81 "node.c.erb"
523
+ case YP_NODE_MATCH_PREDICATE_NODE:
524
+ yp_node_destroy(parser, (yp_node_t *)((yp_match_predicate_node_t *)node)->value);
525
+ yp_node_destroy(parser, (yp_node_t *)((yp_match_predicate_node_t *)node)->pattern);
526
+ break;
527
+ #line 81 "node.c.erb"
528
+ case YP_NODE_MATCH_REQUIRED_NODE:
529
+ yp_node_destroy(parser, (yp_node_t *)((yp_match_required_node_t *)node)->value);
530
+ yp_node_destroy(parser, (yp_node_t *)((yp_match_required_node_t *)node)->pattern);
531
+ break;
532
+ #line 81 "node.c.erb"
533
+ case YP_NODE_MISSING_NODE:
534
+ break;
535
+ #line 81 "node.c.erb"
536
+ case YP_NODE_MODULE_NODE:
537
+ yp_constant_id_list_free(&((yp_module_node_t *)node)->locals);
538
+ yp_node_destroy(parser, (yp_node_t *)((yp_module_node_t *)node)->constant_path);
539
+ if (((yp_module_node_t *)node)->statements != NULL) {
540
+ yp_node_destroy(parser, (yp_node_t *)((yp_module_node_t *)node)->statements);
541
+ }
542
+ break;
543
+ #line 81 "node.c.erb"
544
+ case YP_NODE_MULTI_WRITE_NODE:
545
+ yp_node_list_free(parser, &((yp_multi_write_node_t *)node)->targets);
546
+ if (((yp_multi_write_node_t *)node)->value != NULL) {
547
+ yp_node_destroy(parser, (yp_node_t *)((yp_multi_write_node_t *)node)->value);
548
+ }
549
+ break;
550
+ #line 81 "node.c.erb"
551
+ case YP_NODE_NEXT_NODE:
552
+ if (((yp_next_node_t *)node)->arguments != NULL) {
553
+ yp_node_destroy(parser, (yp_node_t *)((yp_next_node_t *)node)->arguments);
554
+ }
555
+ break;
556
+ #line 81 "node.c.erb"
557
+ case YP_NODE_NIL_NODE:
558
+ break;
559
+ #line 81 "node.c.erb"
560
+ case YP_NODE_NO_KEYWORDS_PARAMETER_NODE:
561
+ break;
562
+ #line 81 "node.c.erb"
563
+ case YP_NODE_NUMBERED_REFERENCE_READ_NODE:
564
+ break;
565
+ #line 81 "node.c.erb"
566
+ case YP_NODE_OPTIONAL_PARAMETER_NODE:
567
+ yp_node_destroy(parser, (yp_node_t *)((yp_optional_parameter_node_t *)node)->value);
568
+ break;
569
+ #line 81 "node.c.erb"
570
+ case YP_NODE_OR_NODE:
571
+ yp_node_destroy(parser, (yp_node_t *)((yp_or_node_t *)node)->left);
572
+ yp_node_destroy(parser, (yp_node_t *)((yp_or_node_t *)node)->right);
573
+ break;
574
+ #line 81 "node.c.erb"
575
+ case YP_NODE_PARAMETERS_NODE:
576
+ yp_node_list_free(parser, &((yp_parameters_node_t *)node)->requireds);
577
+ yp_node_list_free(parser, &((yp_parameters_node_t *)node)->optionals);
578
+ yp_node_list_free(parser, &((yp_parameters_node_t *)node)->posts);
579
+ if (((yp_parameters_node_t *)node)->rest != NULL) {
580
+ yp_node_destroy(parser, (yp_node_t *)((yp_parameters_node_t *)node)->rest);
581
+ }
582
+ yp_node_list_free(parser, &((yp_parameters_node_t *)node)->keywords);
583
+ if (((yp_parameters_node_t *)node)->keyword_rest != NULL) {
584
+ yp_node_destroy(parser, (yp_node_t *)((yp_parameters_node_t *)node)->keyword_rest);
585
+ }
586
+ if (((yp_parameters_node_t *)node)->block != NULL) {
587
+ yp_node_destroy(parser, (yp_node_t *)((yp_parameters_node_t *)node)->block);
588
+ }
589
+ break;
590
+ #line 81 "node.c.erb"
591
+ case YP_NODE_PARENTHESES_NODE:
592
+ if (((yp_parentheses_node_t *)node)->statements != NULL) {
593
+ yp_node_destroy(parser, (yp_node_t *)((yp_parentheses_node_t *)node)->statements);
594
+ }
595
+ break;
596
+ #line 81 "node.c.erb"
597
+ case YP_NODE_PINNED_EXPRESSION_NODE:
598
+ yp_node_destroy(parser, (yp_node_t *)((yp_pinned_expression_node_t *)node)->expression);
599
+ break;
600
+ #line 81 "node.c.erb"
601
+ case YP_NODE_PINNED_VARIABLE_NODE:
602
+ yp_node_destroy(parser, (yp_node_t *)((yp_pinned_variable_node_t *)node)->variable);
603
+ break;
604
+ #line 81 "node.c.erb"
605
+ case YP_NODE_POST_EXECUTION_NODE:
606
+ if (((yp_post_execution_node_t *)node)->statements != NULL) {
607
+ yp_node_destroy(parser, (yp_node_t *)((yp_post_execution_node_t *)node)->statements);
608
+ }
609
+ break;
610
+ #line 81 "node.c.erb"
611
+ case YP_NODE_PRE_EXECUTION_NODE:
612
+ if (((yp_pre_execution_node_t *)node)->statements != NULL) {
613
+ yp_node_destroy(parser, (yp_node_t *)((yp_pre_execution_node_t *)node)->statements);
614
+ }
615
+ break;
616
+ #line 81 "node.c.erb"
617
+ case YP_NODE_PROGRAM_NODE:
618
+ yp_constant_id_list_free(&((yp_program_node_t *)node)->locals);
619
+ yp_node_destroy(parser, (yp_node_t *)((yp_program_node_t *)node)->statements);
620
+ break;
621
+ #line 81 "node.c.erb"
622
+ case YP_NODE_RANGE_NODE:
623
+ if (((yp_range_node_t *)node)->left != NULL) {
624
+ yp_node_destroy(parser, (yp_node_t *)((yp_range_node_t *)node)->left);
625
+ }
626
+ if (((yp_range_node_t *)node)->right != NULL) {
627
+ yp_node_destroy(parser, (yp_node_t *)((yp_range_node_t *)node)->right);
628
+ }
629
+ break;
630
+ #line 81 "node.c.erb"
631
+ case YP_NODE_RATIONAL_NODE:
632
+ yp_node_destroy(parser, (yp_node_t *)((yp_rational_node_t *)node)->numeric);
633
+ break;
634
+ #line 81 "node.c.erb"
635
+ case YP_NODE_REDO_NODE:
636
+ break;
637
+ #line 81 "node.c.erb"
638
+ case YP_NODE_REGULAR_EXPRESSION_NODE:
639
+ yp_string_free(&((yp_regular_expression_node_t *)node)->unescaped);
640
+ break;
641
+ #line 81 "node.c.erb"
642
+ case YP_NODE_REQUIRED_DESTRUCTURED_PARAMETER_NODE:
643
+ yp_node_list_free(parser, &((yp_required_destructured_parameter_node_t *)node)->parameters);
644
+ break;
645
+ #line 81 "node.c.erb"
646
+ case YP_NODE_REQUIRED_PARAMETER_NODE:
647
+ break;
648
+ #line 81 "node.c.erb"
649
+ case YP_NODE_RESCUE_MODIFIER_NODE:
650
+ yp_node_destroy(parser, (yp_node_t *)((yp_rescue_modifier_node_t *)node)->expression);
651
+ yp_node_destroy(parser, (yp_node_t *)((yp_rescue_modifier_node_t *)node)->rescue_expression);
652
+ break;
653
+ #line 81 "node.c.erb"
654
+ case YP_NODE_RESCUE_NODE:
655
+ yp_node_list_free(parser, &((yp_rescue_node_t *)node)->exceptions);
656
+ if (((yp_rescue_node_t *)node)->reference != NULL) {
657
+ yp_node_destroy(parser, (yp_node_t *)((yp_rescue_node_t *)node)->reference);
658
+ }
659
+ if (((yp_rescue_node_t *)node)->statements != NULL) {
660
+ yp_node_destroy(parser, (yp_node_t *)((yp_rescue_node_t *)node)->statements);
661
+ }
662
+ if (((yp_rescue_node_t *)node)->consequent != NULL) {
663
+ yp_node_destroy(parser, (yp_node_t *)((yp_rescue_node_t *)node)->consequent);
664
+ }
665
+ break;
666
+ #line 81 "node.c.erb"
667
+ case YP_NODE_REST_PARAMETER_NODE:
668
+ break;
669
+ #line 81 "node.c.erb"
670
+ case YP_NODE_RETRY_NODE:
671
+ break;
672
+ #line 81 "node.c.erb"
673
+ case YP_NODE_RETURN_NODE:
674
+ if (((yp_return_node_t *)node)->arguments != NULL) {
675
+ yp_node_destroy(parser, (yp_node_t *)((yp_return_node_t *)node)->arguments);
676
+ }
677
+ break;
678
+ #line 81 "node.c.erb"
679
+ case YP_NODE_SELF_NODE:
680
+ break;
681
+ #line 81 "node.c.erb"
682
+ case YP_NODE_SINGLETON_CLASS_NODE:
683
+ yp_constant_id_list_free(&((yp_singleton_class_node_t *)node)->locals);
684
+ yp_node_destroy(parser, (yp_node_t *)((yp_singleton_class_node_t *)node)->expression);
685
+ if (((yp_singleton_class_node_t *)node)->statements != NULL) {
686
+ yp_node_destroy(parser, (yp_node_t *)((yp_singleton_class_node_t *)node)->statements);
687
+ }
688
+ break;
689
+ #line 81 "node.c.erb"
690
+ case YP_NODE_SOURCE_ENCODING_NODE:
691
+ break;
692
+ #line 81 "node.c.erb"
693
+ case YP_NODE_SOURCE_FILE_NODE:
694
+ yp_string_free(&((yp_source_file_node_t *)node)->filepath);
695
+ break;
696
+ #line 81 "node.c.erb"
697
+ case YP_NODE_SOURCE_LINE_NODE:
698
+ break;
699
+ #line 81 "node.c.erb"
700
+ case YP_NODE_SPLAT_NODE:
701
+ if (((yp_splat_node_t *)node)->expression != NULL) {
702
+ yp_node_destroy(parser, (yp_node_t *)((yp_splat_node_t *)node)->expression);
703
+ }
704
+ break;
705
+ #line 81 "node.c.erb"
706
+ case YP_NODE_STATEMENTS_NODE:
707
+ yp_node_list_free(parser, &((yp_statements_node_t *)node)->body);
708
+ break;
709
+ #line 81 "node.c.erb"
710
+ case YP_NODE_STRING_CONCAT_NODE:
711
+ yp_node_destroy(parser, (yp_node_t *)((yp_string_concat_node_t *)node)->left);
712
+ yp_node_destroy(parser, (yp_node_t *)((yp_string_concat_node_t *)node)->right);
713
+ break;
714
+ #line 81 "node.c.erb"
715
+ case YP_NODE_STRING_NODE:
716
+ yp_string_free(&((yp_string_node_t *)node)->unescaped);
717
+ break;
718
+ #line 81 "node.c.erb"
719
+ case YP_NODE_SUPER_NODE:
720
+ if (((yp_super_node_t *)node)->arguments != NULL) {
721
+ yp_node_destroy(parser, (yp_node_t *)((yp_super_node_t *)node)->arguments);
722
+ }
723
+ if (((yp_super_node_t *)node)->block != NULL) {
724
+ yp_node_destroy(parser, (yp_node_t *)((yp_super_node_t *)node)->block);
725
+ }
726
+ break;
727
+ #line 81 "node.c.erb"
728
+ case YP_NODE_SYMBOL_NODE:
729
+ yp_string_free(&((yp_symbol_node_t *)node)->unescaped);
730
+ break;
731
+ #line 81 "node.c.erb"
732
+ case YP_NODE_TRUE_NODE:
733
+ break;
734
+ #line 81 "node.c.erb"
735
+ case YP_NODE_UNDEF_NODE:
736
+ yp_node_list_free(parser, &((yp_undef_node_t *)node)->names);
737
+ break;
738
+ #line 81 "node.c.erb"
739
+ case YP_NODE_UNLESS_NODE:
740
+ yp_node_destroy(parser, (yp_node_t *)((yp_unless_node_t *)node)->predicate);
741
+ if (((yp_unless_node_t *)node)->statements != NULL) {
742
+ yp_node_destroy(parser, (yp_node_t *)((yp_unless_node_t *)node)->statements);
743
+ }
744
+ if (((yp_unless_node_t *)node)->consequent != NULL) {
745
+ yp_node_destroy(parser, (yp_node_t *)((yp_unless_node_t *)node)->consequent);
746
+ }
747
+ break;
748
+ #line 81 "node.c.erb"
749
+ case YP_NODE_UNTIL_NODE:
750
+ yp_node_destroy(parser, (yp_node_t *)((yp_until_node_t *)node)->predicate);
751
+ if (((yp_until_node_t *)node)->statements != NULL) {
752
+ yp_node_destroy(parser, (yp_node_t *)((yp_until_node_t *)node)->statements);
753
+ }
754
+ break;
755
+ #line 81 "node.c.erb"
756
+ case YP_NODE_WHEN_NODE:
757
+ yp_node_list_free(parser, &((yp_when_node_t *)node)->conditions);
758
+ if (((yp_when_node_t *)node)->statements != NULL) {
759
+ yp_node_destroy(parser, (yp_node_t *)((yp_when_node_t *)node)->statements);
760
+ }
761
+ break;
762
+ #line 81 "node.c.erb"
763
+ case YP_NODE_WHILE_NODE:
764
+ yp_node_destroy(parser, (yp_node_t *)((yp_while_node_t *)node)->predicate);
765
+ if (((yp_while_node_t *)node)->statements != NULL) {
766
+ yp_node_destroy(parser, (yp_node_t *)((yp_while_node_t *)node)->statements);
767
+ }
768
+ break;
769
+ #line 81 "node.c.erb"
770
+ case YP_NODE_X_STRING_NODE:
771
+ yp_string_free(&((yp_x_string_node_t *)node)->unescaped);
772
+ break;
773
+ #line 81 "node.c.erb"
774
+ case YP_NODE_YIELD_NODE:
775
+ if (((yp_yield_node_t *)node)->arguments != NULL) {
776
+ yp_node_destroy(parser, (yp_node_t *)((yp_yield_node_t *)node)->arguments);
777
+ }
778
+ break;
779
+ #line 106 "node.c.erb"
780
+ default:
781
+ assert(false && "unreachable");
782
+ break;
783
+ }
784
+ free(node);
785
+ }
786
+
787
+ static void
788
+ yp_node_memsize_node(yp_node_t *node, yp_memsize_t *memsize) {
789
+ memsize->node_count++;
790
+
791
+ switch (YP_NODE_TYPE(node)) {
792
+ #line 120 "node.c.erb"
793
+ case YP_NODE_ALIAS_NODE: {
794
+ memsize->memsize += sizeof(yp_alias_node_t);
795
+ yp_node_memsize_node((yp_node_t *)((yp_alias_node_t *)node)->new_name, memsize);
796
+ yp_node_memsize_node((yp_node_t *)((yp_alias_node_t *)node)->old_name, memsize);
797
+ break;
798
+ }
799
+ #line 120 "node.c.erb"
800
+ case YP_NODE_ALTERNATION_PATTERN_NODE: {
801
+ memsize->memsize += sizeof(yp_alternation_pattern_node_t);
802
+ yp_node_memsize_node((yp_node_t *)((yp_alternation_pattern_node_t *)node)->left, memsize);
803
+ yp_node_memsize_node((yp_node_t *)((yp_alternation_pattern_node_t *)node)->right, memsize);
804
+ break;
805
+ }
806
+ #line 120 "node.c.erb"
807
+ case YP_NODE_AND_NODE: {
808
+ memsize->memsize += sizeof(yp_and_node_t);
809
+ yp_node_memsize_node((yp_node_t *)((yp_and_node_t *)node)->left, memsize);
810
+ yp_node_memsize_node((yp_node_t *)((yp_and_node_t *)node)->right, memsize);
811
+ break;
812
+ }
813
+ #line 120 "node.c.erb"
814
+ case YP_NODE_ARGUMENTS_NODE: {
815
+ memsize->memsize += sizeof(yp_arguments_node_t);
816
+ yp_node_list_memsize(&((yp_arguments_node_t *)node)->arguments, memsize);
817
+ break;
818
+ }
819
+ #line 120 "node.c.erb"
820
+ case YP_NODE_ARRAY_NODE: {
821
+ memsize->memsize += sizeof(yp_array_node_t);
822
+ yp_node_list_memsize(&((yp_array_node_t *)node)->elements, memsize);
823
+ break;
824
+ }
825
+ #line 120 "node.c.erb"
826
+ case YP_NODE_ARRAY_PATTERN_NODE: {
827
+ memsize->memsize += sizeof(yp_array_pattern_node_t);
828
+ if (((yp_array_pattern_node_t *)node)->constant != NULL) {
829
+ yp_node_memsize_node((yp_node_t *)((yp_array_pattern_node_t *)node)->constant, memsize);
830
+ }
831
+ yp_node_list_memsize(&((yp_array_pattern_node_t *)node)->requireds, memsize);
832
+ if (((yp_array_pattern_node_t *)node)->rest != NULL) {
833
+ yp_node_memsize_node((yp_node_t *)((yp_array_pattern_node_t *)node)->rest, memsize);
834
+ }
835
+ yp_node_list_memsize(&((yp_array_pattern_node_t *)node)->posts, memsize);
836
+ break;
837
+ }
838
+ #line 120 "node.c.erb"
839
+ case YP_NODE_ASSOC_NODE: {
840
+ memsize->memsize += sizeof(yp_assoc_node_t);
841
+ yp_node_memsize_node((yp_node_t *)((yp_assoc_node_t *)node)->key, memsize);
842
+ if (((yp_assoc_node_t *)node)->value != NULL) {
843
+ yp_node_memsize_node((yp_node_t *)((yp_assoc_node_t *)node)->value, memsize);
844
+ }
845
+ break;
846
+ }
847
+ #line 120 "node.c.erb"
848
+ case YP_NODE_ASSOC_SPLAT_NODE: {
849
+ memsize->memsize += sizeof(yp_assoc_splat_node_t);
850
+ if (((yp_assoc_splat_node_t *)node)->value != NULL) {
851
+ yp_node_memsize_node((yp_node_t *)((yp_assoc_splat_node_t *)node)->value, memsize);
852
+ }
853
+ break;
854
+ }
855
+ #line 120 "node.c.erb"
856
+ case YP_NODE_BACK_REFERENCE_READ_NODE: {
857
+ memsize->memsize += sizeof(yp_back_reference_read_node_t);
858
+ break;
859
+ }
860
+ #line 120 "node.c.erb"
861
+ case YP_NODE_BEGIN_NODE: {
862
+ memsize->memsize += sizeof(yp_begin_node_t);
863
+ if (((yp_begin_node_t *)node)->statements != NULL) {
864
+ yp_node_memsize_node((yp_node_t *)((yp_begin_node_t *)node)->statements, memsize);
865
+ }
866
+ if (((yp_begin_node_t *)node)->rescue_clause != NULL) {
867
+ yp_node_memsize_node((yp_node_t *)((yp_begin_node_t *)node)->rescue_clause, memsize);
868
+ }
869
+ if (((yp_begin_node_t *)node)->else_clause != NULL) {
870
+ yp_node_memsize_node((yp_node_t *)((yp_begin_node_t *)node)->else_clause, memsize);
871
+ }
872
+ if (((yp_begin_node_t *)node)->ensure_clause != NULL) {
873
+ yp_node_memsize_node((yp_node_t *)((yp_begin_node_t *)node)->ensure_clause, memsize);
874
+ }
875
+ break;
876
+ }
877
+ #line 120 "node.c.erb"
878
+ case YP_NODE_BLOCK_ARGUMENT_NODE: {
879
+ memsize->memsize += sizeof(yp_block_argument_node_t);
880
+ if (((yp_block_argument_node_t *)node)->expression != NULL) {
881
+ yp_node_memsize_node((yp_node_t *)((yp_block_argument_node_t *)node)->expression, memsize);
882
+ }
883
+ break;
884
+ }
885
+ #line 120 "node.c.erb"
886
+ case YP_NODE_BLOCK_NODE: {
887
+ memsize->memsize += sizeof(yp_block_node_t);
888
+ memsize->memsize += yp_constant_id_list_memsize(&((yp_block_node_t *)node)->locals);
889
+ if (((yp_block_node_t *)node)->parameters != NULL) {
890
+ yp_node_memsize_node((yp_node_t *)((yp_block_node_t *)node)->parameters, memsize);
891
+ }
892
+ if (((yp_block_node_t *)node)->statements != NULL) {
893
+ yp_node_memsize_node((yp_node_t *)((yp_block_node_t *)node)->statements, memsize);
894
+ }
895
+ break;
896
+ }
897
+ #line 120 "node.c.erb"
898
+ case YP_NODE_BLOCK_PARAMETER_NODE: {
899
+ memsize->memsize += sizeof(yp_block_parameter_node_t);
900
+ break;
901
+ }
902
+ #line 120 "node.c.erb"
903
+ case YP_NODE_BLOCK_PARAMETERS_NODE: {
904
+ memsize->memsize += sizeof(yp_block_parameters_node_t);
905
+ if (((yp_block_parameters_node_t *)node)->parameters != NULL) {
906
+ yp_node_memsize_node((yp_node_t *)((yp_block_parameters_node_t *)node)->parameters, memsize);
907
+ }
908
+ memsize->memsize += yp_location_list_memsize(&((yp_block_parameters_node_t *)node)->locals);
909
+ break;
910
+ }
911
+ #line 120 "node.c.erb"
912
+ case YP_NODE_BREAK_NODE: {
913
+ memsize->memsize += sizeof(yp_break_node_t);
914
+ if (((yp_break_node_t *)node)->arguments != NULL) {
915
+ yp_node_memsize_node((yp_node_t *)((yp_break_node_t *)node)->arguments, memsize);
916
+ }
917
+ break;
918
+ }
919
+ #line 120 "node.c.erb"
920
+ case YP_NODE_CALL_NODE: {
921
+ memsize->memsize += sizeof(yp_call_node_t);
922
+ if (((yp_call_node_t *)node)->receiver != NULL) {
923
+ yp_node_memsize_node((yp_node_t *)((yp_call_node_t *)node)->receiver, memsize);
924
+ }
925
+ if (((yp_call_node_t *)node)->arguments != NULL) {
926
+ yp_node_memsize_node((yp_node_t *)((yp_call_node_t *)node)->arguments, memsize);
927
+ }
928
+ if (((yp_call_node_t *)node)->block != NULL) {
929
+ yp_node_memsize_node((yp_node_t *)((yp_call_node_t *)node)->block, memsize);
930
+ }
931
+ memsize->memsize += yp_string_memsize(&((yp_call_node_t *)node)->name);
932
+ break;
933
+ }
934
+ #line 120 "node.c.erb"
935
+ case YP_NODE_CALL_OPERATOR_AND_WRITE_NODE: {
936
+ memsize->memsize += sizeof(yp_call_operator_and_write_node_t);
937
+ yp_node_memsize_node((yp_node_t *)((yp_call_operator_and_write_node_t *)node)->target, memsize);
938
+ yp_node_memsize_node((yp_node_t *)((yp_call_operator_and_write_node_t *)node)->value, memsize);
939
+ break;
940
+ }
941
+ #line 120 "node.c.erb"
942
+ case YP_NODE_CALL_OPERATOR_OR_WRITE_NODE: {
943
+ memsize->memsize += sizeof(yp_call_operator_or_write_node_t);
944
+ yp_node_memsize_node((yp_node_t *)((yp_call_operator_or_write_node_t *)node)->target, memsize);
945
+ yp_node_memsize_node((yp_node_t *)((yp_call_operator_or_write_node_t *)node)->value, memsize);
946
+ break;
947
+ }
948
+ #line 120 "node.c.erb"
949
+ case YP_NODE_CALL_OPERATOR_WRITE_NODE: {
950
+ memsize->memsize += sizeof(yp_call_operator_write_node_t);
951
+ yp_node_memsize_node((yp_node_t *)((yp_call_operator_write_node_t *)node)->target, memsize);
952
+ yp_node_memsize_node((yp_node_t *)((yp_call_operator_write_node_t *)node)->value, memsize);
953
+ break;
954
+ }
955
+ #line 120 "node.c.erb"
956
+ case YP_NODE_CAPTURE_PATTERN_NODE: {
957
+ memsize->memsize += sizeof(yp_capture_pattern_node_t);
958
+ yp_node_memsize_node((yp_node_t *)((yp_capture_pattern_node_t *)node)->value, memsize);
959
+ yp_node_memsize_node((yp_node_t *)((yp_capture_pattern_node_t *)node)->target, memsize);
960
+ break;
961
+ }
962
+ #line 120 "node.c.erb"
963
+ case YP_NODE_CASE_NODE: {
964
+ memsize->memsize += sizeof(yp_case_node_t);
965
+ if (((yp_case_node_t *)node)->predicate != NULL) {
966
+ yp_node_memsize_node((yp_node_t *)((yp_case_node_t *)node)->predicate, memsize);
967
+ }
968
+ yp_node_list_memsize(&((yp_case_node_t *)node)->conditions, memsize);
969
+ if (((yp_case_node_t *)node)->consequent != NULL) {
970
+ yp_node_memsize_node((yp_node_t *)((yp_case_node_t *)node)->consequent, memsize);
971
+ }
972
+ break;
973
+ }
974
+ #line 120 "node.c.erb"
975
+ case YP_NODE_CLASS_NODE: {
976
+ memsize->memsize += sizeof(yp_class_node_t);
977
+ memsize->memsize += yp_constant_id_list_memsize(&((yp_class_node_t *)node)->locals);
978
+ yp_node_memsize_node((yp_node_t *)((yp_class_node_t *)node)->constant_path, memsize);
979
+ if (((yp_class_node_t *)node)->superclass != NULL) {
980
+ yp_node_memsize_node((yp_node_t *)((yp_class_node_t *)node)->superclass, memsize);
981
+ }
982
+ if (((yp_class_node_t *)node)->statements != NULL) {
983
+ yp_node_memsize_node((yp_node_t *)((yp_class_node_t *)node)->statements, memsize);
984
+ }
985
+ break;
986
+ }
987
+ #line 120 "node.c.erb"
988
+ case YP_NODE_CLASS_VARIABLE_OPERATOR_AND_WRITE_NODE: {
989
+ memsize->memsize += sizeof(yp_class_variable_operator_and_write_node_t);
990
+ yp_node_memsize_node((yp_node_t *)((yp_class_variable_operator_and_write_node_t *)node)->value, memsize);
991
+ break;
992
+ }
993
+ #line 120 "node.c.erb"
994
+ case YP_NODE_CLASS_VARIABLE_OPERATOR_OR_WRITE_NODE: {
995
+ memsize->memsize += sizeof(yp_class_variable_operator_or_write_node_t);
996
+ yp_node_memsize_node((yp_node_t *)((yp_class_variable_operator_or_write_node_t *)node)->value, memsize);
997
+ break;
998
+ }
999
+ #line 120 "node.c.erb"
1000
+ case YP_NODE_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
1001
+ memsize->memsize += sizeof(yp_class_variable_operator_write_node_t);
1002
+ yp_node_memsize_node((yp_node_t *)((yp_class_variable_operator_write_node_t *)node)->value, memsize);
1003
+ break;
1004
+ }
1005
+ #line 120 "node.c.erb"
1006
+ case YP_NODE_CLASS_VARIABLE_READ_NODE: {
1007
+ memsize->memsize += sizeof(yp_class_variable_read_node_t);
1008
+ break;
1009
+ }
1010
+ #line 120 "node.c.erb"
1011
+ case YP_NODE_CLASS_VARIABLE_WRITE_NODE: {
1012
+ memsize->memsize += sizeof(yp_class_variable_write_node_t);
1013
+ if (((yp_class_variable_write_node_t *)node)->value != NULL) {
1014
+ yp_node_memsize_node((yp_node_t *)((yp_class_variable_write_node_t *)node)->value, memsize);
1015
+ }
1016
+ break;
1017
+ }
1018
+ #line 120 "node.c.erb"
1019
+ case YP_NODE_CONSTANT_OPERATOR_AND_WRITE_NODE: {
1020
+ memsize->memsize += sizeof(yp_constant_operator_and_write_node_t);
1021
+ yp_node_memsize_node((yp_node_t *)((yp_constant_operator_and_write_node_t *)node)->value, memsize);
1022
+ break;
1023
+ }
1024
+ #line 120 "node.c.erb"
1025
+ case YP_NODE_CONSTANT_OPERATOR_OR_WRITE_NODE: {
1026
+ memsize->memsize += sizeof(yp_constant_operator_or_write_node_t);
1027
+ yp_node_memsize_node((yp_node_t *)((yp_constant_operator_or_write_node_t *)node)->value, memsize);
1028
+ break;
1029
+ }
1030
+ #line 120 "node.c.erb"
1031
+ case YP_NODE_CONSTANT_OPERATOR_WRITE_NODE: {
1032
+ memsize->memsize += sizeof(yp_constant_operator_write_node_t);
1033
+ yp_node_memsize_node((yp_node_t *)((yp_constant_operator_write_node_t *)node)->value, memsize);
1034
+ break;
1035
+ }
1036
+ #line 120 "node.c.erb"
1037
+ case YP_NODE_CONSTANT_PATH_NODE: {
1038
+ memsize->memsize += sizeof(yp_constant_path_node_t);
1039
+ if (((yp_constant_path_node_t *)node)->parent != NULL) {
1040
+ yp_node_memsize_node((yp_node_t *)((yp_constant_path_node_t *)node)->parent, memsize);
1041
+ }
1042
+ yp_node_memsize_node((yp_node_t *)((yp_constant_path_node_t *)node)->child, memsize);
1043
+ break;
1044
+ }
1045
+ #line 120 "node.c.erb"
1046
+ case YP_NODE_CONSTANT_PATH_OPERATOR_AND_WRITE_NODE: {
1047
+ memsize->memsize += sizeof(yp_constant_path_operator_and_write_node_t);
1048
+ yp_node_memsize_node((yp_node_t *)((yp_constant_path_operator_and_write_node_t *)node)->target, memsize);
1049
+ yp_node_memsize_node((yp_node_t *)((yp_constant_path_operator_and_write_node_t *)node)->value, memsize);
1050
+ break;
1051
+ }
1052
+ #line 120 "node.c.erb"
1053
+ case YP_NODE_CONSTANT_PATH_OPERATOR_OR_WRITE_NODE: {
1054
+ memsize->memsize += sizeof(yp_constant_path_operator_or_write_node_t);
1055
+ yp_node_memsize_node((yp_node_t *)((yp_constant_path_operator_or_write_node_t *)node)->target, memsize);
1056
+ yp_node_memsize_node((yp_node_t *)((yp_constant_path_operator_or_write_node_t *)node)->value, memsize);
1057
+ break;
1058
+ }
1059
+ #line 120 "node.c.erb"
1060
+ case YP_NODE_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
1061
+ memsize->memsize += sizeof(yp_constant_path_operator_write_node_t);
1062
+ yp_node_memsize_node((yp_node_t *)((yp_constant_path_operator_write_node_t *)node)->target, memsize);
1063
+ yp_node_memsize_node((yp_node_t *)((yp_constant_path_operator_write_node_t *)node)->value, memsize);
1064
+ break;
1065
+ }
1066
+ #line 120 "node.c.erb"
1067
+ case YP_NODE_CONSTANT_PATH_WRITE_NODE: {
1068
+ memsize->memsize += sizeof(yp_constant_path_write_node_t);
1069
+ yp_node_memsize_node((yp_node_t *)((yp_constant_path_write_node_t *)node)->target, memsize);
1070
+ if (((yp_constant_path_write_node_t *)node)->value != NULL) {
1071
+ yp_node_memsize_node((yp_node_t *)((yp_constant_path_write_node_t *)node)->value, memsize);
1072
+ }
1073
+ break;
1074
+ }
1075
+ #line 120 "node.c.erb"
1076
+ case YP_NODE_CONSTANT_READ_NODE: {
1077
+ memsize->memsize += sizeof(yp_constant_read_node_t);
1078
+ break;
1079
+ }
1080
+ #line 120 "node.c.erb"
1081
+ case YP_NODE_CONSTANT_WRITE_NODE: {
1082
+ memsize->memsize += sizeof(yp_constant_write_node_t);
1083
+ if (((yp_constant_write_node_t *)node)->value != NULL) {
1084
+ yp_node_memsize_node((yp_node_t *)((yp_constant_write_node_t *)node)->value, memsize);
1085
+ }
1086
+ break;
1087
+ }
1088
+ #line 120 "node.c.erb"
1089
+ case YP_NODE_DEF_NODE: {
1090
+ memsize->memsize += sizeof(yp_def_node_t);
1091
+ if (((yp_def_node_t *)node)->receiver != NULL) {
1092
+ yp_node_memsize_node((yp_node_t *)((yp_def_node_t *)node)->receiver, memsize);
1093
+ }
1094
+ if (((yp_def_node_t *)node)->parameters != NULL) {
1095
+ yp_node_memsize_node((yp_node_t *)((yp_def_node_t *)node)->parameters, memsize);
1096
+ }
1097
+ if (((yp_def_node_t *)node)->statements != NULL) {
1098
+ yp_node_memsize_node((yp_node_t *)((yp_def_node_t *)node)->statements, memsize);
1099
+ }
1100
+ memsize->memsize += yp_constant_id_list_memsize(&((yp_def_node_t *)node)->locals);
1101
+ break;
1102
+ }
1103
+ #line 120 "node.c.erb"
1104
+ case YP_NODE_DEFINED_NODE: {
1105
+ memsize->memsize += sizeof(yp_defined_node_t);
1106
+ yp_node_memsize_node((yp_node_t *)((yp_defined_node_t *)node)->value, memsize);
1107
+ break;
1108
+ }
1109
+ #line 120 "node.c.erb"
1110
+ case YP_NODE_ELSE_NODE: {
1111
+ memsize->memsize += sizeof(yp_else_node_t);
1112
+ if (((yp_else_node_t *)node)->statements != NULL) {
1113
+ yp_node_memsize_node((yp_node_t *)((yp_else_node_t *)node)->statements, memsize);
1114
+ }
1115
+ break;
1116
+ }
1117
+ #line 120 "node.c.erb"
1118
+ case YP_NODE_EMBEDDED_STATEMENTS_NODE: {
1119
+ memsize->memsize += sizeof(yp_embedded_statements_node_t);
1120
+ if (((yp_embedded_statements_node_t *)node)->statements != NULL) {
1121
+ yp_node_memsize_node((yp_node_t *)((yp_embedded_statements_node_t *)node)->statements, memsize);
1122
+ }
1123
+ break;
1124
+ }
1125
+ #line 120 "node.c.erb"
1126
+ case YP_NODE_EMBEDDED_VARIABLE_NODE: {
1127
+ memsize->memsize += sizeof(yp_embedded_variable_node_t);
1128
+ yp_node_memsize_node((yp_node_t *)((yp_embedded_variable_node_t *)node)->variable, memsize);
1129
+ break;
1130
+ }
1131
+ #line 120 "node.c.erb"
1132
+ case YP_NODE_ENSURE_NODE: {
1133
+ memsize->memsize += sizeof(yp_ensure_node_t);
1134
+ if (((yp_ensure_node_t *)node)->statements != NULL) {
1135
+ yp_node_memsize_node((yp_node_t *)((yp_ensure_node_t *)node)->statements, memsize);
1136
+ }
1137
+ break;
1138
+ }
1139
+ #line 120 "node.c.erb"
1140
+ case YP_NODE_FALSE_NODE: {
1141
+ memsize->memsize += sizeof(yp_false_node_t);
1142
+ break;
1143
+ }
1144
+ #line 120 "node.c.erb"
1145
+ case YP_NODE_FIND_PATTERN_NODE: {
1146
+ memsize->memsize += sizeof(yp_find_pattern_node_t);
1147
+ if (((yp_find_pattern_node_t *)node)->constant != NULL) {
1148
+ yp_node_memsize_node((yp_node_t *)((yp_find_pattern_node_t *)node)->constant, memsize);
1149
+ }
1150
+ yp_node_memsize_node((yp_node_t *)((yp_find_pattern_node_t *)node)->left, memsize);
1151
+ yp_node_list_memsize(&((yp_find_pattern_node_t *)node)->requireds, memsize);
1152
+ yp_node_memsize_node((yp_node_t *)((yp_find_pattern_node_t *)node)->right, memsize);
1153
+ break;
1154
+ }
1155
+ #line 120 "node.c.erb"
1156
+ case YP_NODE_FLOAT_NODE: {
1157
+ memsize->memsize += sizeof(yp_float_node_t);
1158
+ break;
1159
+ }
1160
+ #line 120 "node.c.erb"
1161
+ case YP_NODE_FOR_NODE: {
1162
+ memsize->memsize += sizeof(yp_for_node_t);
1163
+ yp_node_memsize_node((yp_node_t *)((yp_for_node_t *)node)->index, memsize);
1164
+ yp_node_memsize_node((yp_node_t *)((yp_for_node_t *)node)->collection, memsize);
1165
+ if (((yp_for_node_t *)node)->statements != NULL) {
1166
+ yp_node_memsize_node((yp_node_t *)((yp_for_node_t *)node)->statements, memsize);
1167
+ }
1168
+ break;
1169
+ }
1170
+ #line 120 "node.c.erb"
1171
+ case YP_NODE_FORWARDING_ARGUMENTS_NODE: {
1172
+ memsize->memsize += sizeof(yp_forwarding_arguments_node_t);
1173
+ break;
1174
+ }
1175
+ #line 120 "node.c.erb"
1176
+ case YP_NODE_FORWARDING_PARAMETER_NODE: {
1177
+ memsize->memsize += sizeof(yp_forwarding_parameter_node_t);
1178
+ break;
1179
+ }
1180
+ #line 120 "node.c.erb"
1181
+ case YP_NODE_FORWARDING_SUPER_NODE: {
1182
+ memsize->memsize += sizeof(yp_forwarding_super_node_t);
1183
+ if (((yp_forwarding_super_node_t *)node)->block != NULL) {
1184
+ yp_node_memsize_node((yp_node_t *)((yp_forwarding_super_node_t *)node)->block, memsize);
1185
+ }
1186
+ break;
1187
+ }
1188
+ #line 120 "node.c.erb"
1189
+ case YP_NODE_GLOBAL_VARIABLE_OPERATOR_AND_WRITE_NODE: {
1190
+ memsize->memsize += sizeof(yp_global_variable_operator_and_write_node_t);
1191
+ yp_node_memsize_node((yp_node_t *)((yp_global_variable_operator_and_write_node_t *)node)->value, memsize);
1192
+ break;
1193
+ }
1194
+ #line 120 "node.c.erb"
1195
+ case YP_NODE_GLOBAL_VARIABLE_OPERATOR_OR_WRITE_NODE: {
1196
+ memsize->memsize += sizeof(yp_global_variable_operator_or_write_node_t);
1197
+ yp_node_memsize_node((yp_node_t *)((yp_global_variable_operator_or_write_node_t *)node)->value, memsize);
1198
+ break;
1199
+ }
1200
+ #line 120 "node.c.erb"
1201
+ case YP_NODE_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
1202
+ memsize->memsize += sizeof(yp_global_variable_operator_write_node_t);
1203
+ yp_node_memsize_node((yp_node_t *)((yp_global_variable_operator_write_node_t *)node)->value, memsize);
1204
+ break;
1205
+ }
1206
+ #line 120 "node.c.erb"
1207
+ case YP_NODE_GLOBAL_VARIABLE_READ_NODE: {
1208
+ memsize->memsize += sizeof(yp_global_variable_read_node_t);
1209
+ break;
1210
+ }
1211
+ #line 120 "node.c.erb"
1212
+ case YP_NODE_GLOBAL_VARIABLE_WRITE_NODE: {
1213
+ memsize->memsize += sizeof(yp_global_variable_write_node_t);
1214
+ if (((yp_global_variable_write_node_t *)node)->value != NULL) {
1215
+ yp_node_memsize_node((yp_node_t *)((yp_global_variable_write_node_t *)node)->value, memsize);
1216
+ }
1217
+ break;
1218
+ }
1219
+ #line 120 "node.c.erb"
1220
+ case YP_NODE_HASH_NODE: {
1221
+ memsize->memsize += sizeof(yp_hash_node_t);
1222
+ yp_node_list_memsize(&((yp_hash_node_t *)node)->elements, memsize);
1223
+ break;
1224
+ }
1225
+ #line 120 "node.c.erb"
1226
+ case YP_NODE_HASH_PATTERN_NODE: {
1227
+ memsize->memsize += sizeof(yp_hash_pattern_node_t);
1228
+ if (((yp_hash_pattern_node_t *)node)->constant != NULL) {
1229
+ yp_node_memsize_node((yp_node_t *)((yp_hash_pattern_node_t *)node)->constant, memsize);
1230
+ }
1231
+ yp_node_list_memsize(&((yp_hash_pattern_node_t *)node)->assocs, memsize);
1232
+ if (((yp_hash_pattern_node_t *)node)->kwrest != NULL) {
1233
+ yp_node_memsize_node((yp_node_t *)((yp_hash_pattern_node_t *)node)->kwrest, memsize);
1234
+ }
1235
+ break;
1236
+ }
1237
+ #line 120 "node.c.erb"
1238
+ case YP_NODE_IF_NODE: {
1239
+ memsize->memsize += sizeof(yp_if_node_t);
1240
+ yp_node_memsize_node((yp_node_t *)((yp_if_node_t *)node)->predicate, memsize);
1241
+ if (((yp_if_node_t *)node)->statements != NULL) {
1242
+ yp_node_memsize_node((yp_node_t *)((yp_if_node_t *)node)->statements, memsize);
1243
+ }
1244
+ if (((yp_if_node_t *)node)->consequent != NULL) {
1245
+ yp_node_memsize_node((yp_node_t *)((yp_if_node_t *)node)->consequent, memsize);
1246
+ }
1247
+ break;
1248
+ }
1249
+ #line 120 "node.c.erb"
1250
+ case YP_NODE_IMAGINARY_NODE: {
1251
+ memsize->memsize += sizeof(yp_imaginary_node_t);
1252
+ yp_node_memsize_node((yp_node_t *)((yp_imaginary_node_t *)node)->numeric, memsize);
1253
+ break;
1254
+ }
1255
+ #line 120 "node.c.erb"
1256
+ case YP_NODE_IN_NODE: {
1257
+ memsize->memsize += sizeof(yp_in_node_t);
1258
+ yp_node_memsize_node((yp_node_t *)((yp_in_node_t *)node)->pattern, memsize);
1259
+ if (((yp_in_node_t *)node)->statements != NULL) {
1260
+ yp_node_memsize_node((yp_node_t *)((yp_in_node_t *)node)->statements, memsize);
1261
+ }
1262
+ break;
1263
+ }
1264
+ #line 120 "node.c.erb"
1265
+ case YP_NODE_INSTANCE_VARIABLE_OPERATOR_AND_WRITE_NODE: {
1266
+ memsize->memsize += sizeof(yp_instance_variable_operator_and_write_node_t);
1267
+ yp_node_memsize_node((yp_node_t *)((yp_instance_variable_operator_and_write_node_t *)node)->value, memsize);
1268
+ break;
1269
+ }
1270
+ #line 120 "node.c.erb"
1271
+ case YP_NODE_INSTANCE_VARIABLE_OPERATOR_OR_WRITE_NODE: {
1272
+ memsize->memsize += sizeof(yp_instance_variable_operator_or_write_node_t);
1273
+ yp_node_memsize_node((yp_node_t *)((yp_instance_variable_operator_or_write_node_t *)node)->value, memsize);
1274
+ break;
1275
+ }
1276
+ #line 120 "node.c.erb"
1277
+ case YP_NODE_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
1278
+ memsize->memsize += sizeof(yp_instance_variable_operator_write_node_t);
1279
+ yp_node_memsize_node((yp_node_t *)((yp_instance_variable_operator_write_node_t *)node)->value, memsize);
1280
+ break;
1281
+ }
1282
+ #line 120 "node.c.erb"
1283
+ case YP_NODE_INSTANCE_VARIABLE_READ_NODE: {
1284
+ memsize->memsize += sizeof(yp_instance_variable_read_node_t);
1285
+ break;
1286
+ }
1287
+ #line 120 "node.c.erb"
1288
+ case YP_NODE_INSTANCE_VARIABLE_WRITE_NODE: {
1289
+ memsize->memsize += sizeof(yp_instance_variable_write_node_t);
1290
+ if (((yp_instance_variable_write_node_t *)node)->value != NULL) {
1291
+ yp_node_memsize_node((yp_node_t *)((yp_instance_variable_write_node_t *)node)->value, memsize);
1292
+ }
1293
+ break;
1294
+ }
1295
+ #line 120 "node.c.erb"
1296
+ case YP_NODE_INTEGER_NODE: {
1297
+ memsize->memsize += sizeof(yp_integer_node_t);
1298
+ break;
1299
+ }
1300
+ #line 120 "node.c.erb"
1301
+ case YP_NODE_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
1302
+ memsize->memsize += sizeof(yp_interpolated_regular_expression_node_t);
1303
+ yp_node_list_memsize(&((yp_interpolated_regular_expression_node_t *)node)->parts, memsize);
1304
+ break;
1305
+ }
1306
+ #line 120 "node.c.erb"
1307
+ case YP_NODE_INTERPOLATED_STRING_NODE: {
1308
+ memsize->memsize += sizeof(yp_interpolated_string_node_t);
1309
+ yp_node_list_memsize(&((yp_interpolated_string_node_t *)node)->parts, memsize);
1310
+ break;
1311
+ }
1312
+ #line 120 "node.c.erb"
1313
+ case YP_NODE_INTERPOLATED_SYMBOL_NODE: {
1314
+ memsize->memsize += sizeof(yp_interpolated_symbol_node_t);
1315
+ yp_node_list_memsize(&((yp_interpolated_symbol_node_t *)node)->parts, memsize);
1316
+ break;
1317
+ }
1318
+ #line 120 "node.c.erb"
1319
+ case YP_NODE_INTERPOLATED_X_STRING_NODE: {
1320
+ memsize->memsize += sizeof(yp_interpolated_x_string_node_t);
1321
+ yp_node_list_memsize(&((yp_interpolated_x_string_node_t *)node)->parts, memsize);
1322
+ break;
1323
+ }
1324
+ #line 120 "node.c.erb"
1325
+ case YP_NODE_KEYWORD_HASH_NODE: {
1326
+ memsize->memsize += sizeof(yp_keyword_hash_node_t);
1327
+ yp_node_list_memsize(&((yp_keyword_hash_node_t *)node)->elements, memsize);
1328
+ break;
1329
+ }
1330
+ #line 120 "node.c.erb"
1331
+ case YP_NODE_KEYWORD_PARAMETER_NODE: {
1332
+ memsize->memsize += sizeof(yp_keyword_parameter_node_t);
1333
+ if (((yp_keyword_parameter_node_t *)node)->value != NULL) {
1334
+ yp_node_memsize_node((yp_node_t *)((yp_keyword_parameter_node_t *)node)->value, memsize);
1335
+ }
1336
+ break;
1337
+ }
1338
+ #line 120 "node.c.erb"
1339
+ case YP_NODE_KEYWORD_REST_PARAMETER_NODE: {
1340
+ memsize->memsize += sizeof(yp_keyword_rest_parameter_node_t);
1341
+ break;
1342
+ }
1343
+ #line 120 "node.c.erb"
1344
+ case YP_NODE_LAMBDA_NODE: {
1345
+ memsize->memsize += sizeof(yp_lambda_node_t);
1346
+ memsize->memsize += yp_constant_id_list_memsize(&((yp_lambda_node_t *)node)->locals);
1347
+ if (((yp_lambda_node_t *)node)->parameters != NULL) {
1348
+ yp_node_memsize_node((yp_node_t *)((yp_lambda_node_t *)node)->parameters, memsize);
1349
+ }
1350
+ if (((yp_lambda_node_t *)node)->statements != NULL) {
1351
+ yp_node_memsize_node((yp_node_t *)((yp_lambda_node_t *)node)->statements, memsize);
1352
+ }
1353
+ break;
1354
+ }
1355
+ #line 120 "node.c.erb"
1356
+ case YP_NODE_LOCAL_VARIABLE_OPERATOR_AND_WRITE_NODE: {
1357
+ memsize->memsize += sizeof(yp_local_variable_operator_and_write_node_t);
1358
+ yp_node_memsize_node((yp_node_t *)((yp_local_variable_operator_and_write_node_t *)node)->value, memsize);
1359
+ break;
1360
+ }
1361
+ #line 120 "node.c.erb"
1362
+ case YP_NODE_LOCAL_VARIABLE_OPERATOR_OR_WRITE_NODE: {
1363
+ memsize->memsize += sizeof(yp_local_variable_operator_or_write_node_t);
1364
+ yp_node_memsize_node((yp_node_t *)((yp_local_variable_operator_or_write_node_t *)node)->value, memsize);
1365
+ break;
1366
+ }
1367
+ #line 120 "node.c.erb"
1368
+ case YP_NODE_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
1369
+ memsize->memsize += sizeof(yp_local_variable_operator_write_node_t);
1370
+ yp_node_memsize_node((yp_node_t *)((yp_local_variable_operator_write_node_t *)node)->value, memsize);
1371
+ break;
1372
+ }
1373
+ #line 120 "node.c.erb"
1374
+ case YP_NODE_LOCAL_VARIABLE_READ_NODE: {
1375
+ memsize->memsize += sizeof(yp_local_variable_read_node_t);
1376
+ break;
1377
+ }
1378
+ #line 120 "node.c.erb"
1379
+ case YP_NODE_LOCAL_VARIABLE_WRITE_NODE: {
1380
+ memsize->memsize += sizeof(yp_local_variable_write_node_t);
1381
+ if (((yp_local_variable_write_node_t *)node)->value != NULL) {
1382
+ yp_node_memsize_node((yp_node_t *)((yp_local_variable_write_node_t *)node)->value, memsize);
1383
+ }
1384
+ break;
1385
+ }
1386
+ #line 120 "node.c.erb"
1387
+ case YP_NODE_MATCH_PREDICATE_NODE: {
1388
+ memsize->memsize += sizeof(yp_match_predicate_node_t);
1389
+ yp_node_memsize_node((yp_node_t *)((yp_match_predicate_node_t *)node)->value, memsize);
1390
+ yp_node_memsize_node((yp_node_t *)((yp_match_predicate_node_t *)node)->pattern, memsize);
1391
+ break;
1392
+ }
1393
+ #line 120 "node.c.erb"
1394
+ case YP_NODE_MATCH_REQUIRED_NODE: {
1395
+ memsize->memsize += sizeof(yp_match_required_node_t);
1396
+ yp_node_memsize_node((yp_node_t *)((yp_match_required_node_t *)node)->value, memsize);
1397
+ yp_node_memsize_node((yp_node_t *)((yp_match_required_node_t *)node)->pattern, memsize);
1398
+ break;
1399
+ }
1400
+ #line 120 "node.c.erb"
1401
+ case YP_NODE_MISSING_NODE: {
1402
+ memsize->memsize += sizeof(yp_missing_node_t);
1403
+ break;
1404
+ }
1405
+ #line 120 "node.c.erb"
1406
+ case YP_NODE_MODULE_NODE: {
1407
+ memsize->memsize += sizeof(yp_module_node_t);
1408
+ memsize->memsize += yp_constant_id_list_memsize(&((yp_module_node_t *)node)->locals);
1409
+ yp_node_memsize_node((yp_node_t *)((yp_module_node_t *)node)->constant_path, memsize);
1410
+ if (((yp_module_node_t *)node)->statements != NULL) {
1411
+ yp_node_memsize_node((yp_node_t *)((yp_module_node_t *)node)->statements, memsize);
1412
+ }
1413
+ break;
1414
+ }
1415
+ #line 120 "node.c.erb"
1416
+ case YP_NODE_MULTI_WRITE_NODE: {
1417
+ memsize->memsize += sizeof(yp_multi_write_node_t);
1418
+ yp_node_list_memsize(&((yp_multi_write_node_t *)node)->targets, memsize);
1419
+ if (((yp_multi_write_node_t *)node)->value != NULL) {
1420
+ yp_node_memsize_node((yp_node_t *)((yp_multi_write_node_t *)node)->value, memsize);
1421
+ }
1422
+ break;
1423
+ }
1424
+ #line 120 "node.c.erb"
1425
+ case YP_NODE_NEXT_NODE: {
1426
+ memsize->memsize += sizeof(yp_next_node_t);
1427
+ if (((yp_next_node_t *)node)->arguments != NULL) {
1428
+ yp_node_memsize_node((yp_node_t *)((yp_next_node_t *)node)->arguments, memsize);
1429
+ }
1430
+ break;
1431
+ }
1432
+ #line 120 "node.c.erb"
1433
+ case YP_NODE_NIL_NODE: {
1434
+ memsize->memsize += sizeof(yp_nil_node_t);
1435
+ break;
1436
+ }
1437
+ #line 120 "node.c.erb"
1438
+ case YP_NODE_NO_KEYWORDS_PARAMETER_NODE: {
1439
+ memsize->memsize += sizeof(yp_no_keywords_parameter_node_t);
1440
+ break;
1441
+ }
1442
+ #line 120 "node.c.erb"
1443
+ case YP_NODE_NUMBERED_REFERENCE_READ_NODE: {
1444
+ memsize->memsize += sizeof(yp_numbered_reference_read_node_t);
1445
+ break;
1446
+ }
1447
+ #line 120 "node.c.erb"
1448
+ case YP_NODE_OPTIONAL_PARAMETER_NODE: {
1449
+ memsize->memsize += sizeof(yp_optional_parameter_node_t);
1450
+ yp_node_memsize_node((yp_node_t *)((yp_optional_parameter_node_t *)node)->value, memsize);
1451
+ break;
1452
+ }
1453
+ #line 120 "node.c.erb"
1454
+ case YP_NODE_OR_NODE: {
1455
+ memsize->memsize += sizeof(yp_or_node_t);
1456
+ yp_node_memsize_node((yp_node_t *)((yp_or_node_t *)node)->left, memsize);
1457
+ yp_node_memsize_node((yp_node_t *)((yp_or_node_t *)node)->right, memsize);
1458
+ break;
1459
+ }
1460
+ #line 120 "node.c.erb"
1461
+ case YP_NODE_PARAMETERS_NODE: {
1462
+ memsize->memsize += sizeof(yp_parameters_node_t);
1463
+ yp_node_list_memsize(&((yp_parameters_node_t *)node)->requireds, memsize);
1464
+ yp_node_list_memsize(&((yp_parameters_node_t *)node)->optionals, memsize);
1465
+ yp_node_list_memsize(&((yp_parameters_node_t *)node)->posts, memsize);
1466
+ if (((yp_parameters_node_t *)node)->rest != NULL) {
1467
+ yp_node_memsize_node((yp_node_t *)((yp_parameters_node_t *)node)->rest, memsize);
1468
+ }
1469
+ yp_node_list_memsize(&((yp_parameters_node_t *)node)->keywords, memsize);
1470
+ if (((yp_parameters_node_t *)node)->keyword_rest != NULL) {
1471
+ yp_node_memsize_node((yp_node_t *)((yp_parameters_node_t *)node)->keyword_rest, memsize);
1472
+ }
1473
+ if (((yp_parameters_node_t *)node)->block != NULL) {
1474
+ yp_node_memsize_node((yp_node_t *)((yp_parameters_node_t *)node)->block, memsize);
1475
+ }
1476
+ break;
1477
+ }
1478
+ #line 120 "node.c.erb"
1479
+ case YP_NODE_PARENTHESES_NODE: {
1480
+ memsize->memsize += sizeof(yp_parentheses_node_t);
1481
+ if (((yp_parentheses_node_t *)node)->statements != NULL) {
1482
+ yp_node_memsize_node((yp_node_t *)((yp_parentheses_node_t *)node)->statements, memsize);
1483
+ }
1484
+ break;
1485
+ }
1486
+ #line 120 "node.c.erb"
1487
+ case YP_NODE_PINNED_EXPRESSION_NODE: {
1488
+ memsize->memsize += sizeof(yp_pinned_expression_node_t);
1489
+ yp_node_memsize_node((yp_node_t *)((yp_pinned_expression_node_t *)node)->expression, memsize);
1490
+ break;
1491
+ }
1492
+ #line 120 "node.c.erb"
1493
+ case YP_NODE_PINNED_VARIABLE_NODE: {
1494
+ memsize->memsize += sizeof(yp_pinned_variable_node_t);
1495
+ yp_node_memsize_node((yp_node_t *)((yp_pinned_variable_node_t *)node)->variable, memsize);
1496
+ break;
1497
+ }
1498
+ #line 120 "node.c.erb"
1499
+ case YP_NODE_POST_EXECUTION_NODE: {
1500
+ memsize->memsize += sizeof(yp_post_execution_node_t);
1501
+ if (((yp_post_execution_node_t *)node)->statements != NULL) {
1502
+ yp_node_memsize_node((yp_node_t *)((yp_post_execution_node_t *)node)->statements, memsize);
1503
+ }
1504
+ break;
1505
+ }
1506
+ #line 120 "node.c.erb"
1507
+ case YP_NODE_PRE_EXECUTION_NODE: {
1508
+ memsize->memsize += sizeof(yp_pre_execution_node_t);
1509
+ if (((yp_pre_execution_node_t *)node)->statements != NULL) {
1510
+ yp_node_memsize_node((yp_node_t *)((yp_pre_execution_node_t *)node)->statements, memsize);
1511
+ }
1512
+ break;
1513
+ }
1514
+ #line 120 "node.c.erb"
1515
+ case YP_NODE_PROGRAM_NODE: {
1516
+ memsize->memsize += sizeof(yp_program_node_t);
1517
+ memsize->memsize += yp_constant_id_list_memsize(&((yp_program_node_t *)node)->locals);
1518
+ yp_node_memsize_node((yp_node_t *)((yp_program_node_t *)node)->statements, memsize);
1519
+ break;
1520
+ }
1521
+ #line 120 "node.c.erb"
1522
+ case YP_NODE_RANGE_NODE: {
1523
+ memsize->memsize += sizeof(yp_range_node_t);
1524
+ if (((yp_range_node_t *)node)->left != NULL) {
1525
+ yp_node_memsize_node((yp_node_t *)((yp_range_node_t *)node)->left, memsize);
1526
+ }
1527
+ if (((yp_range_node_t *)node)->right != NULL) {
1528
+ yp_node_memsize_node((yp_node_t *)((yp_range_node_t *)node)->right, memsize);
1529
+ }
1530
+ break;
1531
+ }
1532
+ #line 120 "node.c.erb"
1533
+ case YP_NODE_RATIONAL_NODE: {
1534
+ memsize->memsize += sizeof(yp_rational_node_t);
1535
+ yp_node_memsize_node((yp_node_t *)((yp_rational_node_t *)node)->numeric, memsize);
1536
+ break;
1537
+ }
1538
+ #line 120 "node.c.erb"
1539
+ case YP_NODE_REDO_NODE: {
1540
+ memsize->memsize += sizeof(yp_redo_node_t);
1541
+ break;
1542
+ }
1543
+ #line 120 "node.c.erb"
1544
+ case YP_NODE_REGULAR_EXPRESSION_NODE: {
1545
+ memsize->memsize += sizeof(yp_regular_expression_node_t);
1546
+ memsize->memsize += yp_string_memsize(&((yp_regular_expression_node_t *)node)->unescaped);
1547
+ break;
1548
+ }
1549
+ #line 120 "node.c.erb"
1550
+ case YP_NODE_REQUIRED_DESTRUCTURED_PARAMETER_NODE: {
1551
+ memsize->memsize += sizeof(yp_required_destructured_parameter_node_t);
1552
+ yp_node_list_memsize(&((yp_required_destructured_parameter_node_t *)node)->parameters, memsize);
1553
+ break;
1554
+ }
1555
+ #line 120 "node.c.erb"
1556
+ case YP_NODE_REQUIRED_PARAMETER_NODE: {
1557
+ memsize->memsize += sizeof(yp_required_parameter_node_t);
1558
+ break;
1559
+ }
1560
+ #line 120 "node.c.erb"
1561
+ case YP_NODE_RESCUE_MODIFIER_NODE: {
1562
+ memsize->memsize += sizeof(yp_rescue_modifier_node_t);
1563
+ yp_node_memsize_node((yp_node_t *)((yp_rescue_modifier_node_t *)node)->expression, memsize);
1564
+ yp_node_memsize_node((yp_node_t *)((yp_rescue_modifier_node_t *)node)->rescue_expression, memsize);
1565
+ break;
1566
+ }
1567
+ #line 120 "node.c.erb"
1568
+ case YP_NODE_RESCUE_NODE: {
1569
+ memsize->memsize += sizeof(yp_rescue_node_t);
1570
+ yp_node_list_memsize(&((yp_rescue_node_t *)node)->exceptions, memsize);
1571
+ if (((yp_rescue_node_t *)node)->reference != NULL) {
1572
+ yp_node_memsize_node((yp_node_t *)((yp_rescue_node_t *)node)->reference, memsize);
1573
+ }
1574
+ if (((yp_rescue_node_t *)node)->statements != NULL) {
1575
+ yp_node_memsize_node((yp_node_t *)((yp_rescue_node_t *)node)->statements, memsize);
1576
+ }
1577
+ if (((yp_rescue_node_t *)node)->consequent != NULL) {
1578
+ yp_node_memsize_node((yp_node_t *)((yp_rescue_node_t *)node)->consequent, memsize);
1579
+ }
1580
+ break;
1581
+ }
1582
+ #line 120 "node.c.erb"
1583
+ case YP_NODE_REST_PARAMETER_NODE: {
1584
+ memsize->memsize += sizeof(yp_rest_parameter_node_t);
1585
+ break;
1586
+ }
1587
+ #line 120 "node.c.erb"
1588
+ case YP_NODE_RETRY_NODE: {
1589
+ memsize->memsize += sizeof(yp_retry_node_t);
1590
+ break;
1591
+ }
1592
+ #line 120 "node.c.erb"
1593
+ case YP_NODE_RETURN_NODE: {
1594
+ memsize->memsize += sizeof(yp_return_node_t);
1595
+ if (((yp_return_node_t *)node)->arguments != NULL) {
1596
+ yp_node_memsize_node((yp_node_t *)((yp_return_node_t *)node)->arguments, memsize);
1597
+ }
1598
+ break;
1599
+ }
1600
+ #line 120 "node.c.erb"
1601
+ case YP_NODE_SELF_NODE: {
1602
+ memsize->memsize += sizeof(yp_self_node_t);
1603
+ break;
1604
+ }
1605
+ #line 120 "node.c.erb"
1606
+ case YP_NODE_SINGLETON_CLASS_NODE: {
1607
+ memsize->memsize += sizeof(yp_singleton_class_node_t);
1608
+ memsize->memsize += yp_constant_id_list_memsize(&((yp_singleton_class_node_t *)node)->locals);
1609
+ yp_node_memsize_node((yp_node_t *)((yp_singleton_class_node_t *)node)->expression, memsize);
1610
+ if (((yp_singleton_class_node_t *)node)->statements != NULL) {
1611
+ yp_node_memsize_node((yp_node_t *)((yp_singleton_class_node_t *)node)->statements, memsize);
1612
+ }
1613
+ break;
1614
+ }
1615
+ #line 120 "node.c.erb"
1616
+ case YP_NODE_SOURCE_ENCODING_NODE: {
1617
+ memsize->memsize += sizeof(yp_source_encoding_node_t);
1618
+ break;
1619
+ }
1620
+ #line 120 "node.c.erb"
1621
+ case YP_NODE_SOURCE_FILE_NODE: {
1622
+ memsize->memsize += sizeof(yp_source_file_node_t);
1623
+ memsize->memsize += yp_string_memsize(&((yp_source_file_node_t *)node)->filepath);
1624
+ break;
1625
+ }
1626
+ #line 120 "node.c.erb"
1627
+ case YP_NODE_SOURCE_LINE_NODE: {
1628
+ memsize->memsize += sizeof(yp_source_line_node_t);
1629
+ break;
1630
+ }
1631
+ #line 120 "node.c.erb"
1632
+ case YP_NODE_SPLAT_NODE: {
1633
+ memsize->memsize += sizeof(yp_splat_node_t);
1634
+ if (((yp_splat_node_t *)node)->expression != NULL) {
1635
+ yp_node_memsize_node((yp_node_t *)((yp_splat_node_t *)node)->expression, memsize);
1636
+ }
1637
+ break;
1638
+ }
1639
+ #line 120 "node.c.erb"
1640
+ case YP_NODE_STATEMENTS_NODE: {
1641
+ memsize->memsize += sizeof(yp_statements_node_t);
1642
+ yp_node_list_memsize(&((yp_statements_node_t *)node)->body, memsize);
1643
+ break;
1644
+ }
1645
+ #line 120 "node.c.erb"
1646
+ case YP_NODE_STRING_CONCAT_NODE: {
1647
+ memsize->memsize += sizeof(yp_string_concat_node_t);
1648
+ yp_node_memsize_node((yp_node_t *)((yp_string_concat_node_t *)node)->left, memsize);
1649
+ yp_node_memsize_node((yp_node_t *)((yp_string_concat_node_t *)node)->right, memsize);
1650
+ break;
1651
+ }
1652
+ #line 120 "node.c.erb"
1653
+ case YP_NODE_STRING_NODE: {
1654
+ memsize->memsize += sizeof(yp_string_node_t);
1655
+ memsize->memsize += yp_string_memsize(&((yp_string_node_t *)node)->unescaped);
1656
+ break;
1657
+ }
1658
+ #line 120 "node.c.erb"
1659
+ case YP_NODE_SUPER_NODE: {
1660
+ memsize->memsize += sizeof(yp_super_node_t);
1661
+ if (((yp_super_node_t *)node)->arguments != NULL) {
1662
+ yp_node_memsize_node((yp_node_t *)((yp_super_node_t *)node)->arguments, memsize);
1663
+ }
1664
+ if (((yp_super_node_t *)node)->block != NULL) {
1665
+ yp_node_memsize_node((yp_node_t *)((yp_super_node_t *)node)->block, memsize);
1666
+ }
1667
+ break;
1668
+ }
1669
+ #line 120 "node.c.erb"
1670
+ case YP_NODE_SYMBOL_NODE: {
1671
+ memsize->memsize += sizeof(yp_symbol_node_t);
1672
+ memsize->memsize += yp_string_memsize(&((yp_symbol_node_t *)node)->unescaped);
1673
+ break;
1674
+ }
1675
+ #line 120 "node.c.erb"
1676
+ case YP_NODE_TRUE_NODE: {
1677
+ memsize->memsize += sizeof(yp_true_node_t);
1678
+ break;
1679
+ }
1680
+ #line 120 "node.c.erb"
1681
+ case YP_NODE_UNDEF_NODE: {
1682
+ memsize->memsize += sizeof(yp_undef_node_t);
1683
+ yp_node_list_memsize(&((yp_undef_node_t *)node)->names, memsize);
1684
+ break;
1685
+ }
1686
+ #line 120 "node.c.erb"
1687
+ case YP_NODE_UNLESS_NODE: {
1688
+ memsize->memsize += sizeof(yp_unless_node_t);
1689
+ yp_node_memsize_node((yp_node_t *)((yp_unless_node_t *)node)->predicate, memsize);
1690
+ if (((yp_unless_node_t *)node)->statements != NULL) {
1691
+ yp_node_memsize_node((yp_node_t *)((yp_unless_node_t *)node)->statements, memsize);
1692
+ }
1693
+ if (((yp_unless_node_t *)node)->consequent != NULL) {
1694
+ yp_node_memsize_node((yp_node_t *)((yp_unless_node_t *)node)->consequent, memsize);
1695
+ }
1696
+ break;
1697
+ }
1698
+ #line 120 "node.c.erb"
1699
+ case YP_NODE_UNTIL_NODE: {
1700
+ memsize->memsize += sizeof(yp_until_node_t);
1701
+ yp_node_memsize_node((yp_node_t *)((yp_until_node_t *)node)->predicate, memsize);
1702
+ if (((yp_until_node_t *)node)->statements != NULL) {
1703
+ yp_node_memsize_node((yp_node_t *)((yp_until_node_t *)node)->statements, memsize);
1704
+ }
1705
+ break;
1706
+ }
1707
+ #line 120 "node.c.erb"
1708
+ case YP_NODE_WHEN_NODE: {
1709
+ memsize->memsize += sizeof(yp_when_node_t);
1710
+ yp_node_list_memsize(&((yp_when_node_t *)node)->conditions, memsize);
1711
+ if (((yp_when_node_t *)node)->statements != NULL) {
1712
+ yp_node_memsize_node((yp_node_t *)((yp_when_node_t *)node)->statements, memsize);
1713
+ }
1714
+ break;
1715
+ }
1716
+ #line 120 "node.c.erb"
1717
+ case YP_NODE_WHILE_NODE: {
1718
+ memsize->memsize += sizeof(yp_while_node_t);
1719
+ yp_node_memsize_node((yp_node_t *)((yp_while_node_t *)node)->predicate, memsize);
1720
+ if (((yp_while_node_t *)node)->statements != NULL) {
1721
+ yp_node_memsize_node((yp_node_t *)((yp_while_node_t *)node)->statements, memsize);
1722
+ }
1723
+ break;
1724
+ }
1725
+ #line 120 "node.c.erb"
1726
+ case YP_NODE_X_STRING_NODE: {
1727
+ memsize->memsize += sizeof(yp_x_string_node_t);
1728
+ memsize->memsize += yp_string_memsize(&((yp_x_string_node_t *)node)->unescaped);
1729
+ break;
1730
+ }
1731
+ #line 120 "node.c.erb"
1732
+ case YP_NODE_YIELD_NODE: {
1733
+ memsize->memsize += sizeof(yp_yield_node_t);
1734
+ if (((yp_yield_node_t *)node)->arguments != NULL) {
1735
+ yp_node_memsize_node((yp_node_t *)((yp_yield_node_t *)node)->arguments, memsize);
1736
+ }
1737
+ break;
1738
+ }
1739
+ #line 147 "node.c.erb"
1740
+ }
1741
+ }
1742
+
1743
+ // Calculates the memory footprint of a given node.
1744
+ YP_EXPORTED_FUNCTION void
1745
+ yp_node_memsize(yp_node_t *node, yp_memsize_t *memsize) {
1746
+ *memsize = (yp_memsize_t) { .memsize = 0, .node_count = 0 };
1747
+ yp_node_memsize_node(node, memsize);
1748
+ }
1749
+
1750
+ // Returns a string representation of the given node type.
1751
+ YP_EXPORTED_FUNCTION const char *
1752
+ yp_node_type_to_str(yp_node_type_t node_type)
1753
+ {
1754
+ switch (node_type) {
1755
+ case YP_NODE_ALIAS_NODE:
1756
+ return "YP_NODE_ALIAS_NODE";
1757
+ case YP_NODE_ALTERNATION_PATTERN_NODE:
1758
+ return "YP_NODE_ALTERNATION_PATTERN_NODE";
1759
+ case YP_NODE_AND_NODE:
1760
+ return "YP_NODE_AND_NODE";
1761
+ case YP_NODE_ARGUMENTS_NODE:
1762
+ return "YP_NODE_ARGUMENTS_NODE";
1763
+ case YP_NODE_ARRAY_NODE:
1764
+ return "YP_NODE_ARRAY_NODE";
1765
+ case YP_NODE_ARRAY_PATTERN_NODE:
1766
+ return "YP_NODE_ARRAY_PATTERN_NODE";
1767
+ case YP_NODE_ASSOC_NODE:
1768
+ return "YP_NODE_ASSOC_NODE";
1769
+ case YP_NODE_ASSOC_SPLAT_NODE:
1770
+ return "YP_NODE_ASSOC_SPLAT_NODE";
1771
+ case YP_NODE_BACK_REFERENCE_READ_NODE:
1772
+ return "YP_NODE_BACK_REFERENCE_READ_NODE";
1773
+ case YP_NODE_BEGIN_NODE:
1774
+ return "YP_NODE_BEGIN_NODE";
1775
+ case YP_NODE_BLOCK_ARGUMENT_NODE:
1776
+ return "YP_NODE_BLOCK_ARGUMENT_NODE";
1777
+ case YP_NODE_BLOCK_NODE:
1778
+ return "YP_NODE_BLOCK_NODE";
1779
+ case YP_NODE_BLOCK_PARAMETER_NODE:
1780
+ return "YP_NODE_BLOCK_PARAMETER_NODE";
1781
+ case YP_NODE_BLOCK_PARAMETERS_NODE:
1782
+ return "YP_NODE_BLOCK_PARAMETERS_NODE";
1783
+ case YP_NODE_BREAK_NODE:
1784
+ return "YP_NODE_BREAK_NODE";
1785
+ case YP_NODE_CALL_NODE:
1786
+ return "YP_NODE_CALL_NODE";
1787
+ case YP_NODE_CALL_OPERATOR_AND_WRITE_NODE:
1788
+ return "YP_NODE_CALL_OPERATOR_AND_WRITE_NODE";
1789
+ case YP_NODE_CALL_OPERATOR_OR_WRITE_NODE:
1790
+ return "YP_NODE_CALL_OPERATOR_OR_WRITE_NODE";
1791
+ case YP_NODE_CALL_OPERATOR_WRITE_NODE:
1792
+ return "YP_NODE_CALL_OPERATOR_WRITE_NODE";
1793
+ case YP_NODE_CAPTURE_PATTERN_NODE:
1794
+ return "YP_NODE_CAPTURE_PATTERN_NODE";
1795
+ case YP_NODE_CASE_NODE:
1796
+ return "YP_NODE_CASE_NODE";
1797
+ case YP_NODE_CLASS_NODE:
1798
+ return "YP_NODE_CLASS_NODE";
1799
+ case YP_NODE_CLASS_VARIABLE_OPERATOR_AND_WRITE_NODE:
1800
+ return "YP_NODE_CLASS_VARIABLE_OPERATOR_AND_WRITE_NODE";
1801
+ case YP_NODE_CLASS_VARIABLE_OPERATOR_OR_WRITE_NODE:
1802
+ return "YP_NODE_CLASS_VARIABLE_OPERATOR_OR_WRITE_NODE";
1803
+ case YP_NODE_CLASS_VARIABLE_OPERATOR_WRITE_NODE:
1804
+ return "YP_NODE_CLASS_VARIABLE_OPERATOR_WRITE_NODE";
1805
+ case YP_NODE_CLASS_VARIABLE_READ_NODE:
1806
+ return "YP_NODE_CLASS_VARIABLE_READ_NODE";
1807
+ case YP_NODE_CLASS_VARIABLE_WRITE_NODE:
1808
+ return "YP_NODE_CLASS_VARIABLE_WRITE_NODE";
1809
+ case YP_NODE_CONSTANT_OPERATOR_AND_WRITE_NODE:
1810
+ return "YP_NODE_CONSTANT_OPERATOR_AND_WRITE_NODE";
1811
+ case YP_NODE_CONSTANT_OPERATOR_OR_WRITE_NODE:
1812
+ return "YP_NODE_CONSTANT_OPERATOR_OR_WRITE_NODE";
1813
+ case YP_NODE_CONSTANT_OPERATOR_WRITE_NODE:
1814
+ return "YP_NODE_CONSTANT_OPERATOR_WRITE_NODE";
1815
+ case YP_NODE_CONSTANT_PATH_NODE:
1816
+ return "YP_NODE_CONSTANT_PATH_NODE";
1817
+ case YP_NODE_CONSTANT_PATH_OPERATOR_AND_WRITE_NODE:
1818
+ return "YP_NODE_CONSTANT_PATH_OPERATOR_AND_WRITE_NODE";
1819
+ case YP_NODE_CONSTANT_PATH_OPERATOR_OR_WRITE_NODE:
1820
+ return "YP_NODE_CONSTANT_PATH_OPERATOR_OR_WRITE_NODE";
1821
+ case YP_NODE_CONSTANT_PATH_OPERATOR_WRITE_NODE:
1822
+ return "YP_NODE_CONSTANT_PATH_OPERATOR_WRITE_NODE";
1823
+ case YP_NODE_CONSTANT_PATH_WRITE_NODE:
1824
+ return "YP_NODE_CONSTANT_PATH_WRITE_NODE";
1825
+ case YP_NODE_CONSTANT_READ_NODE:
1826
+ return "YP_NODE_CONSTANT_READ_NODE";
1827
+ case YP_NODE_CONSTANT_WRITE_NODE:
1828
+ return "YP_NODE_CONSTANT_WRITE_NODE";
1829
+ case YP_NODE_DEF_NODE:
1830
+ return "YP_NODE_DEF_NODE";
1831
+ case YP_NODE_DEFINED_NODE:
1832
+ return "YP_NODE_DEFINED_NODE";
1833
+ case YP_NODE_ELSE_NODE:
1834
+ return "YP_NODE_ELSE_NODE";
1835
+ case YP_NODE_EMBEDDED_STATEMENTS_NODE:
1836
+ return "YP_NODE_EMBEDDED_STATEMENTS_NODE";
1837
+ case YP_NODE_EMBEDDED_VARIABLE_NODE:
1838
+ return "YP_NODE_EMBEDDED_VARIABLE_NODE";
1839
+ case YP_NODE_ENSURE_NODE:
1840
+ return "YP_NODE_ENSURE_NODE";
1841
+ case YP_NODE_FALSE_NODE:
1842
+ return "YP_NODE_FALSE_NODE";
1843
+ case YP_NODE_FIND_PATTERN_NODE:
1844
+ return "YP_NODE_FIND_PATTERN_NODE";
1845
+ case YP_NODE_FLOAT_NODE:
1846
+ return "YP_NODE_FLOAT_NODE";
1847
+ case YP_NODE_FOR_NODE:
1848
+ return "YP_NODE_FOR_NODE";
1849
+ case YP_NODE_FORWARDING_ARGUMENTS_NODE:
1850
+ return "YP_NODE_FORWARDING_ARGUMENTS_NODE";
1851
+ case YP_NODE_FORWARDING_PARAMETER_NODE:
1852
+ return "YP_NODE_FORWARDING_PARAMETER_NODE";
1853
+ case YP_NODE_FORWARDING_SUPER_NODE:
1854
+ return "YP_NODE_FORWARDING_SUPER_NODE";
1855
+ case YP_NODE_GLOBAL_VARIABLE_OPERATOR_AND_WRITE_NODE:
1856
+ return "YP_NODE_GLOBAL_VARIABLE_OPERATOR_AND_WRITE_NODE";
1857
+ case YP_NODE_GLOBAL_VARIABLE_OPERATOR_OR_WRITE_NODE:
1858
+ return "YP_NODE_GLOBAL_VARIABLE_OPERATOR_OR_WRITE_NODE";
1859
+ case YP_NODE_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE:
1860
+ return "YP_NODE_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE";
1861
+ case YP_NODE_GLOBAL_VARIABLE_READ_NODE:
1862
+ return "YP_NODE_GLOBAL_VARIABLE_READ_NODE";
1863
+ case YP_NODE_GLOBAL_VARIABLE_WRITE_NODE:
1864
+ return "YP_NODE_GLOBAL_VARIABLE_WRITE_NODE";
1865
+ case YP_NODE_HASH_NODE:
1866
+ return "YP_NODE_HASH_NODE";
1867
+ case YP_NODE_HASH_PATTERN_NODE:
1868
+ return "YP_NODE_HASH_PATTERN_NODE";
1869
+ case YP_NODE_IF_NODE:
1870
+ return "YP_NODE_IF_NODE";
1871
+ case YP_NODE_IMAGINARY_NODE:
1872
+ return "YP_NODE_IMAGINARY_NODE";
1873
+ case YP_NODE_IN_NODE:
1874
+ return "YP_NODE_IN_NODE";
1875
+ case YP_NODE_INSTANCE_VARIABLE_OPERATOR_AND_WRITE_NODE:
1876
+ return "YP_NODE_INSTANCE_VARIABLE_OPERATOR_AND_WRITE_NODE";
1877
+ case YP_NODE_INSTANCE_VARIABLE_OPERATOR_OR_WRITE_NODE:
1878
+ return "YP_NODE_INSTANCE_VARIABLE_OPERATOR_OR_WRITE_NODE";
1879
+ case YP_NODE_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE:
1880
+ return "YP_NODE_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE";
1881
+ case YP_NODE_INSTANCE_VARIABLE_READ_NODE:
1882
+ return "YP_NODE_INSTANCE_VARIABLE_READ_NODE";
1883
+ case YP_NODE_INSTANCE_VARIABLE_WRITE_NODE:
1884
+ return "YP_NODE_INSTANCE_VARIABLE_WRITE_NODE";
1885
+ case YP_NODE_INTEGER_NODE:
1886
+ return "YP_NODE_INTEGER_NODE";
1887
+ case YP_NODE_INTERPOLATED_REGULAR_EXPRESSION_NODE:
1888
+ return "YP_NODE_INTERPOLATED_REGULAR_EXPRESSION_NODE";
1889
+ case YP_NODE_INTERPOLATED_STRING_NODE:
1890
+ return "YP_NODE_INTERPOLATED_STRING_NODE";
1891
+ case YP_NODE_INTERPOLATED_SYMBOL_NODE:
1892
+ return "YP_NODE_INTERPOLATED_SYMBOL_NODE";
1893
+ case YP_NODE_INTERPOLATED_X_STRING_NODE:
1894
+ return "YP_NODE_INTERPOLATED_X_STRING_NODE";
1895
+ case YP_NODE_KEYWORD_HASH_NODE:
1896
+ return "YP_NODE_KEYWORD_HASH_NODE";
1897
+ case YP_NODE_KEYWORD_PARAMETER_NODE:
1898
+ return "YP_NODE_KEYWORD_PARAMETER_NODE";
1899
+ case YP_NODE_KEYWORD_REST_PARAMETER_NODE:
1900
+ return "YP_NODE_KEYWORD_REST_PARAMETER_NODE";
1901
+ case YP_NODE_LAMBDA_NODE:
1902
+ return "YP_NODE_LAMBDA_NODE";
1903
+ case YP_NODE_LOCAL_VARIABLE_OPERATOR_AND_WRITE_NODE:
1904
+ return "YP_NODE_LOCAL_VARIABLE_OPERATOR_AND_WRITE_NODE";
1905
+ case YP_NODE_LOCAL_VARIABLE_OPERATOR_OR_WRITE_NODE:
1906
+ return "YP_NODE_LOCAL_VARIABLE_OPERATOR_OR_WRITE_NODE";
1907
+ case YP_NODE_LOCAL_VARIABLE_OPERATOR_WRITE_NODE:
1908
+ return "YP_NODE_LOCAL_VARIABLE_OPERATOR_WRITE_NODE";
1909
+ case YP_NODE_LOCAL_VARIABLE_READ_NODE:
1910
+ return "YP_NODE_LOCAL_VARIABLE_READ_NODE";
1911
+ case YP_NODE_LOCAL_VARIABLE_WRITE_NODE:
1912
+ return "YP_NODE_LOCAL_VARIABLE_WRITE_NODE";
1913
+ case YP_NODE_MATCH_PREDICATE_NODE:
1914
+ return "YP_NODE_MATCH_PREDICATE_NODE";
1915
+ case YP_NODE_MATCH_REQUIRED_NODE:
1916
+ return "YP_NODE_MATCH_REQUIRED_NODE";
1917
+ case YP_NODE_MISSING_NODE:
1918
+ return "YP_NODE_MISSING_NODE";
1919
+ case YP_NODE_MODULE_NODE:
1920
+ return "YP_NODE_MODULE_NODE";
1921
+ case YP_NODE_MULTI_WRITE_NODE:
1922
+ return "YP_NODE_MULTI_WRITE_NODE";
1923
+ case YP_NODE_NEXT_NODE:
1924
+ return "YP_NODE_NEXT_NODE";
1925
+ case YP_NODE_NIL_NODE:
1926
+ return "YP_NODE_NIL_NODE";
1927
+ case YP_NODE_NO_KEYWORDS_PARAMETER_NODE:
1928
+ return "YP_NODE_NO_KEYWORDS_PARAMETER_NODE";
1929
+ case YP_NODE_NUMBERED_REFERENCE_READ_NODE:
1930
+ return "YP_NODE_NUMBERED_REFERENCE_READ_NODE";
1931
+ case YP_NODE_OPTIONAL_PARAMETER_NODE:
1932
+ return "YP_NODE_OPTIONAL_PARAMETER_NODE";
1933
+ case YP_NODE_OR_NODE:
1934
+ return "YP_NODE_OR_NODE";
1935
+ case YP_NODE_PARAMETERS_NODE:
1936
+ return "YP_NODE_PARAMETERS_NODE";
1937
+ case YP_NODE_PARENTHESES_NODE:
1938
+ return "YP_NODE_PARENTHESES_NODE";
1939
+ case YP_NODE_PINNED_EXPRESSION_NODE:
1940
+ return "YP_NODE_PINNED_EXPRESSION_NODE";
1941
+ case YP_NODE_PINNED_VARIABLE_NODE:
1942
+ return "YP_NODE_PINNED_VARIABLE_NODE";
1943
+ case YP_NODE_POST_EXECUTION_NODE:
1944
+ return "YP_NODE_POST_EXECUTION_NODE";
1945
+ case YP_NODE_PRE_EXECUTION_NODE:
1946
+ return "YP_NODE_PRE_EXECUTION_NODE";
1947
+ case YP_NODE_PROGRAM_NODE:
1948
+ return "YP_NODE_PROGRAM_NODE";
1949
+ case YP_NODE_RANGE_NODE:
1950
+ return "YP_NODE_RANGE_NODE";
1951
+ case YP_NODE_RATIONAL_NODE:
1952
+ return "YP_NODE_RATIONAL_NODE";
1953
+ case YP_NODE_REDO_NODE:
1954
+ return "YP_NODE_REDO_NODE";
1955
+ case YP_NODE_REGULAR_EXPRESSION_NODE:
1956
+ return "YP_NODE_REGULAR_EXPRESSION_NODE";
1957
+ case YP_NODE_REQUIRED_DESTRUCTURED_PARAMETER_NODE:
1958
+ return "YP_NODE_REQUIRED_DESTRUCTURED_PARAMETER_NODE";
1959
+ case YP_NODE_REQUIRED_PARAMETER_NODE:
1960
+ return "YP_NODE_REQUIRED_PARAMETER_NODE";
1961
+ case YP_NODE_RESCUE_MODIFIER_NODE:
1962
+ return "YP_NODE_RESCUE_MODIFIER_NODE";
1963
+ case YP_NODE_RESCUE_NODE:
1964
+ return "YP_NODE_RESCUE_NODE";
1965
+ case YP_NODE_REST_PARAMETER_NODE:
1966
+ return "YP_NODE_REST_PARAMETER_NODE";
1967
+ case YP_NODE_RETRY_NODE:
1968
+ return "YP_NODE_RETRY_NODE";
1969
+ case YP_NODE_RETURN_NODE:
1970
+ return "YP_NODE_RETURN_NODE";
1971
+ case YP_NODE_SELF_NODE:
1972
+ return "YP_NODE_SELF_NODE";
1973
+ case YP_NODE_SINGLETON_CLASS_NODE:
1974
+ return "YP_NODE_SINGLETON_CLASS_NODE";
1975
+ case YP_NODE_SOURCE_ENCODING_NODE:
1976
+ return "YP_NODE_SOURCE_ENCODING_NODE";
1977
+ case YP_NODE_SOURCE_FILE_NODE:
1978
+ return "YP_NODE_SOURCE_FILE_NODE";
1979
+ case YP_NODE_SOURCE_LINE_NODE:
1980
+ return "YP_NODE_SOURCE_LINE_NODE";
1981
+ case YP_NODE_SPLAT_NODE:
1982
+ return "YP_NODE_SPLAT_NODE";
1983
+ case YP_NODE_STATEMENTS_NODE:
1984
+ return "YP_NODE_STATEMENTS_NODE";
1985
+ case YP_NODE_STRING_CONCAT_NODE:
1986
+ return "YP_NODE_STRING_CONCAT_NODE";
1987
+ case YP_NODE_STRING_NODE:
1988
+ return "YP_NODE_STRING_NODE";
1989
+ case YP_NODE_SUPER_NODE:
1990
+ return "YP_NODE_SUPER_NODE";
1991
+ case YP_NODE_SYMBOL_NODE:
1992
+ return "YP_NODE_SYMBOL_NODE";
1993
+ case YP_NODE_TRUE_NODE:
1994
+ return "YP_NODE_TRUE_NODE";
1995
+ case YP_NODE_UNDEF_NODE:
1996
+ return "YP_NODE_UNDEF_NODE";
1997
+ case YP_NODE_UNLESS_NODE:
1998
+ return "YP_NODE_UNLESS_NODE";
1999
+ case YP_NODE_UNTIL_NODE:
2000
+ return "YP_NODE_UNTIL_NODE";
2001
+ case YP_NODE_WHEN_NODE:
2002
+ return "YP_NODE_WHEN_NODE";
2003
+ case YP_NODE_WHILE_NODE:
2004
+ return "YP_NODE_WHILE_NODE";
2005
+ case YP_NODE_X_STRING_NODE:
2006
+ return "YP_NODE_X_STRING_NODE";
2007
+ case YP_NODE_YIELD_NODE:
2008
+ return "YP_NODE_YIELD_NODE";
2009
+ }
2010
+ return "\0";
2011
+ }