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