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