Ruby: prism/prettyprint.c Source File

Ruby 4.0.5p0 (2026-05-20 revision 64336ffd0ee9e1f4c05891695a3d7b49cb709721)

prettyprint.c
1/* :markup: markdown */
2
3/*----------------------------------------------------------------------------*/
4/* This file is generated by the templates/template.rb script and should not */
5/* be modified manually. See */
6/* templates/src/prettyprint.c.erb */
7/* if you are looking to modify the */
8/* template */
9/*----------------------------------------------------------------------------*/
10
11#include "prism/prettyprint.h"
12
13// We optionally support pretty printing nodes. For systems that don't want or
14// need this functionality, it can be turned off with the
15// PRISM_EXCLUDE_PRETTYPRINT define.
16#ifdef PRISM_EXCLUDE_PRETTYPRINT
17
18void pm_prettyprint(void) {}
19
20#else
21
22static inline void
23prettyprint_location(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm_location_t *location) {
24 pm_line_column_t start = pm_newline_list_line_column(&parser->newline_list, location->start, parser->start_line);
25 pm_line_column_t end = pm_newline_list_line_column(&parser->newline_list, location->end, parser->start_line);
26 pm_buffer_append_format(output_buffer, "(%" PRIi32 ",%" PRIu32 ")-(%" PRIi32 ",%" PRIu32 ")", start.line, start.column, end.line, end.column);
27}
28
29static inline void
30prettyprint_constant(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm_constant_id_t constant_id) {
31 pm_constant_t *constant = pm_constant_pool_id_to_constant(&parser->constant_pool, constant_id);
32 pm_buffer_append_format(output_buffer, ":%.*s", (int) constant->length, constant->start);
33}
34
35static void
36prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm_node_t *node, pm_buffer_t *prefix_buffer) {
37 switch (PM_NODE_TYPE(node)) {
38 case PM_SCOPE_NODE:
39 // We do not need to print a ScopeNode as it's not part of the AST.
40 return;
41 case PM_ALIAS_GLOBAL_VARIABLE_NODE: {
42 pm_alias_global_variable_node_t *cast = (pm_alias_global_variable_node_t *) node;
43 pm_buffer_append_string(output_buffer, "@ AliasGlobalVariableNode (location: ", 37);
44 prettyprint_location(output_buffer, parser, &node->location);
45 pm_buffer_append_string(output_buffer, ")\n", 2);
46
47 // new_name
48 {
49 pm_buffer_concat(output_buffer, prefix_buffer);
50 pm_buffer_append_string(output_buffer, "+-- new_name:", 13);
51 pm_buffer_append_byte(output_buffer, '\n');
52
53 size_t prefix_length = prefix_buffer->length;
54 pm_buffer_append_string(prefix_buffer, "| ", 4);
55 pm_buffer_concat(output_buffer, prefix_buffer);
56 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->new_name, prefix_buffer);
57 prefix_buffer->length = prefix_length;
58 }
59
60 // old_name
61 {
62 pm_buffer_concat(output_buffer, prefix_buffer);
63 pm_buffer_append_string(output_buffer, "+-- old_name:", 13);
64 pm_buffer_append_byte(output_buffer, '\n');
65
66 size_t prefix_length = prefix_buffer->length;
67 pm_buffer_append_string(prefix_buffer, "| ", 4);
68 pm_buffer_concat(output_buffer, prefix_buffer);
69 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->old_name, prefix_buffer);
70 prefix_buffer->length = prefix_length;
71 }
72
73 // keyword_loc
74 {
75 pm_buffer_concat(output_buffer, prefix_buffer);
76 pm_buffer_append_string(output_buffer, "+-- keyword_loc:", 16);
77 pm_location_t *location = &cast->keyword_loc;
78 pm_buffer_append_byte(output_buffer, ' ');
79 prettyprint_location(output_buffer, parser, location);
80 pm_buffer_append_string(output_buffer, " = \"", 4);
81 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
82 pm_buffer_append_string(output_buffer, "\"\n", 2);
83 }
84
85 break;
86 }
87 case PM_ALIAS_METHOD_NODE: {
88 pm_alias_method_node_t *cast = (pm_alias_method_node_t *) node;
89 pm_buffer_append_string(output_buffer, "@ AliasMethodNode (location: ", 29);
90 prettyprint_location(output_buffer, parser, &node->location);
91 pm_buffer_append_string(output_buffer, ")\n", 2);
92
93 // new_name
94 {
95 pm_buffer_concat(output_buffer, prefix_buffer);
96 pm_buffer_append_string(output_buffer, "+-- new_name:", 13);
97 pm_buffer_append_byte(output_buffer, '\n');
98
99 size_t prefix_length = prefix_buffer->length;
100 pm_buffer_append_string(prefix_buffer, "| ", 4);
101 pm_buffer_concat(output_buffer, prefix_buffer);
102 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->new_name, prefix_buffer);
103 prefix_buffer->length = prefix_length;
104 }
105
106 // old_name
107 {
108 pm_buffer_concat(output_buffer, prefix_buffer);
109 pm_buffer_append_string(output_buffer, "+-- old_name:", 13);
110 pm_buffer_append_byte(output_buffer, '\n');
111
112 size_t prefix_length = prefix_buffer->length;
113 pm_buffer_append_string(prefix_buffer, "| ", 4);
114 pm_buffer_concat(output_buffer, prefix_buffer);
115 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->old_name, prefix_buffer);
116 prefix_buffer->length = prefix_length;
117 }
118
119 // keyword_loc
120 {
121 pm_buffer_concat(output_buffer, prefix_buffer);
122 pm_buffer_append_string(output_buffer, "+-- keyword_loc:", 16);
123 pm_location_t *location = &cast->keyword_loc;
124 pm_buffer_append_byte(output_buffer, ' ');
125 prettyprint_location(output_buffer, parser, location);
126 pm_buffer_append_string(output_buffer, " = \"", 4);
127 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
128 pm_buffer_append_string(output_buffer, "\"\n", 2);
129 }
130
131 break;
132 }
133 case PM_ALTERNATION_PATTERN_NODE: {
134 pm_alternation_pattern_node_t *cast = (pm_alternation_pattern_node_t *) node;
135 pm_buffer_append_string(output_buffer, "@ AlternationPatternNode (location: ", 36);
136 prettyprint_location(output_buffer, parser, &node->location);
137 pm_buffer_append_string(output_buffer, ")\n", 2);
138
139 // left
140 {
141 pm_buffer_concat(output_buffer, prefix_buffer);
142 pm_buffer_append_string(output_buffer, "+-- left:", 9);
143 pm_buffer_append_byte(output_buffer, '\n');
144
145 size_t prefix_length = prefix_buffer->length;
146 pm_buffer_append_string(prefix_buffer, "| ", 4);
147 pm_buffer_concat(output_buffer, prefix_buffer);
148 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->left, prefix_buffer);
149 prefix_buffer->length = prefix_length;
150 }
151
152 // right
153 {
154 pm_buffer_concat(output_buffer, prefix_buffer);
155 pm_buffer_append_string(output_buffer, "+-- right:", 10);
156 pm_buffer_append_byte(output_buffer, '\n');
157
158 size_t prefix_length = prefix_buffer->length;
159 pm_buffer_append_string(prefix_buffer, "| ", 4);
160 pm_buffer_concat(output_buffer, prefix_buffer);
161 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->right, prefix_buffer);
162 prefix_buffer->length = prefix_length;
163 }
164
165 // operator_loc
166 {
167 pm_buffer_concat(output_buffer, prefix_buffer);
168 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
169 pm_location_t *location = &cast->operator_loc;
170 pm_buffer_append_byte(output_buffer, ' ');
171 prettyprint_location(output_buffer, parser, location);
172 pm_buffer_append_string(output_buffer, " = \"", 4);
173 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
174 pm_buffer_append_string(output_buffer, "\"\n", 2);
175 }
176
177 break;
178 }
179 case PM_AND_NODE: {
180 pm_and_node_t *cast = (pm_and_node_t *) node;
181 pm_buffer_append_string(output_buffer, "@ AndNode (location: ", 21);
182 prettyprint_location(output_buffer, parser, &node->location);
183 pm_buffer_append_string(output_buffer, ")\n", 2);
184
185 // left
186 {
187 pm_buffer_concat(output_buffer, prefix_buffer);
188 pm_buffer_append_string(output_buffer, "+-- left:", 9);
189 pm_buffer_append_byte(output_buffer, '\n');
190
191 size_t prefix_length = prefix_buffer->length;
192 pm_buffer_append_string(prefix_buffer, "| ", 4);
193 pm_buffer_concat(output_buffer, prefix_buffer);
194 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->left, prefix_buffer);
195 prefix_buffer->length = prefix_length;
196 }
197
198 // right
199 {
200 pm_buffer_concat(output_buffer, prefix_buffer);
201 pm_buffer_append_string(output_buffer, "+-- right:", 10);
202 pm_buffer_append_byte(output_buffer, '\n');
203
204 size_t prefix_length = prefix_buffer->length;
205 pm_buffer_append_string(prefix_buffer, "| ", 4);
206 pm_buffer_concat(output_buffer, prefix_buffer);
207 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->right, prefix_buffer);
208 prefix_buffer->length = prefix_length;
209 }
210
211 // operator_loc
212 {
213 pm_buffer_concat(output_buffer, prefix_buffer);
214 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
215 pm_location_t *location = &cast->operator_loc;
216 pm_buffer_append_byte(output_buffer, ' ');
217 prettyprint_location(output_buffer, parser, location);
218 pm_buffer_append_string(output_buffer, " = \"", 4);
219 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
220 pm_buffer_append_string(output_buffer, "\"\n", 2);
221 }
222
223 break;
224 }
225 case PM_ARGUMENTS_NODE: {
226 pm_arguments_node_t *cast = (pm_arguments_node_t *) node;
227 pm_buffer_append_string(output_buffer, "@ ArgumentsNode (location: ", 27);
228 prettyprint_location(output_buffer, parser, &node->location);
229 pm_buffer_append_string(output_buffer, ")\n", 2);
230
231 // ArgumentsNodeFlags
232 {
233 pm_buffer_concat(output_buffer, prefix_buffer);
234 pm_buffer_append_string(output_buffer, "+-- ArgumentsNodeFlags:", 23);
235 bool found = false;
236 if (cast->base.flags & PM_ARGUMENTS_NODE_FLAGS_CONTAINS_FORWARDING) {
237 if (found) pm_buffer_append_byte(output_buffer, ',');
238 pm_buffer_append_string(output_buffer, " contains_forwarding", 20);
239 found = true;
240 }
241 if (cast->base.flags & PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORDS) {
242 if (found) pm_buffer_append_byte(output_buffer, ',');
243 pm_buffer_append_string(output_buffer, " contains_keywords", 18);
244 found = true;
245 }
246 if (cast->base.flags & PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORD_SPLAT) {
247 if (found) pm_buffer_append_byte(output_buffer, ',');
248 pm_buffer_append_string(output_buffer, " contains_keyword_splat", 23);
249 found = true;
250 }
251 if (cast->base.flags & PM_ARGUMENTS_NODE_FLAGS_CONTAINS_SPLAT) {
252 if (found) pm_buffer_append_byte(output_buffer, ',');
253 pm_buffer_append_string(output_buffer, " contains_splat", 15);
254 found = true;
255 }
256 if (cast->base.flags & PM_ARGUMENTS_NODE_FLAGS_CONTAINS_MULTIPLE_SPLATS) {
257 if (found) pm_buffer_append_byte(output_buffer, ',');
258 pm_buffer_append_string(output_buffer, " contains_multiple_splats", 25);
259 found = true;
260 }
261 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
262 pm_buffer_append_byte(output_buffer, '\n');
263 }
264
265 // arguments
266 {
267 pm_buffer_concat(output_buffer, prefix_buffer);
268 pm_buffer_append_string(output_buffer, "+-- arguments:", 14);
269 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->arguments.size));
270
271 size_t last_index = cast->arguments.size;
272 for (uint32_t index = 0; index < last_index; index++) {
273 size_t prefix_length = prefix_buffer->length;
274 pm_buffer_append_string(prefix_buffer, " ", 4);
275 pm_buffer_concat(output_buffer, prefix_buffer);
276 pm_buffer_append_string(output_buffer, "+-- ", 4);
277 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
278 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->arguments.nodes[index], prefix_buffer);
279 prefix_buffer->length = prefix_length;
280 }
281 }
282
283 break;
284 }
285 case PM_ARRAY_NODE: {
286 pm_array_node_t *cast = (pm_array_node_t *) node;
287 pm_buffer_append_string(output_buffer, "@ ArrayNode (location: ", 23);
288 prettyprint_location(output_buffer, parser, &node->location);
289 pm_buffer_append_string(output_buffer, ")\n", 2);
290
291 // ArrayNodeFlags
292 {
293 pm_buffer_concat(output_buffer, prefix_buffer);
294 pm_buffer_append_string(output_buffer, "+-- ArrayNodeFlags:", 19);
295 bool found = false;
296 if (cast->base.flags & PM_ARRAY_NODE_FLAGS_CONTAINS_SPLAT) {
297 if (found) pm_buffer_append_byte(output_buffer, ',');
298 pm_buffer_append_string(output_buffer, " contains_splat", 15);
299 found = true;
300 }
301 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
302 pm_buffer_append_byte(output_buffer, '\n');
303 }
304
305 // elements
306 {
307 pm_buffer_concat(output_buffer, prefix_buffer);
308 pm_buffer_append_string(output_buffer, "+-- elements:", 13);
309 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->elements.size));
310
311 size_t last_index = cast->elements.size;
312 for (uint32_t index = 0; index < last_index; index++) {
313 size_t prefix_length = prefix_buffer->length;
314 pm_buffer_append_string(prefix_buffer, "| ", 4);
315 pm_buffer_concat(output_buffer, prefix_buffer);
316 pm_buffer_append_string(output_buffer, "+-- ", 4);
317 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
318 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->elements.nodes[index], prefix_buffer);
319 prefix_buffer->length = prefix_length;
320 }
321 }
322
323 // opening_loc
324 {
325 pm_buffer_concat(output_buffer, prefix_buffer);
326 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
327 pm_location_t *location = &cast->opening_loc;
328 if (location->start == NULL) {
329 pm_buffer_append_string(output_buffer, " nil\n", 5);
330 } else {
331 pm_buffer_append_byte(output_buffer, ' ');
332 prettyprint_location(output_buffer, parser, location);
333 pm_buffer_append_string(output_buffer, " = \"", 4);
334 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
335 pm_buffer_append_string(output_buffer, "\"\n", 2);
336 }
337 }
338
339 // closing_loc
340 {
341 pm_buffer_concat(output_buffer, prefix_buffer);
342 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
343 pm_location_t *location = &cast->closing_loc;
344 if (location->start == NULL) {
345 pm_buffer_append_string(output_buffer, " nil\n", 5);
346 } else {
347 pm_buffer_append_byte(output_buffer, ' ');
348 prettyprint_location(output_buffer, parser, location);
349 pm_buffer_append_string(output_buffer, " = \"", 4);
350 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
351 pm_buffer_append_string(output_buffer, "\"\n", 2);
352 }
353 }
354
355 break;
356 }
357 case PM_ARRAY_PATTERN_NODE: {
358 pm_array_pattern_node_t *cast = (pm_array_pattern_node_t *) node;
359 pm_buffer_append_string(output_buffer, "@ ArrayPatternNode (location: ", 30);
360 prettyprint_location(output_buffer, parser, &node->location);
361 pm_buffer_append_string(output_buffer, ")\n", 2);
362
363 // constant
364 {
365 pm_buffer_concat(output_buffer, prefix_buffer);
366 pm_buffer_append_string(output_buffer, "+-- constant:", 13);
367 if (cast->constant == NULL) {
368 pm_buffer_append_string(output_buffer, " nil\n", 5);
369 } else {
370 pm_buffer_append_byte(output_buffer, '\n');
371
372 size_t prefix_length = prefix_buffer->length;
373 pm_buffer_append_string(prefix_buffer, "| ", 4);
374 pm_buffer_concat(output_buffer, prefix_buffer);
375 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->constant, prefix_buffer);
376 prefix_buffer->length = prefix_length;
377 }
378 }
379
380 // requireds
381 {
382 pm_buffer_concat(output_buffer, prefix_buffer);
383 pm_buffer_append_string(output_buffer, "+-- requireds:", 14);
384 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->requireds.size));
385
386 size_t last_index = cast->requireds.size;
387 for (uint32_t index = 0; index < last_index; index++) {
388 size_t prefix_length = prefix_buffer->length;
389 pm_buffer_append_string(prefix_buffer, "| ", 4);
390 pm_buffer_concat(output_buffer, prefix_buffer);
391 pm_buffer_append_string(output_buffer, "+-- ", 4);
392 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
393 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->requireds.nodes[index], prefix_buffer);
394 prefix_buffer->length = prefix_length;
395 }
396 }
397
398 // rest
399 {
400 pm_buffer_concat(output_buffer, prefix_buffer);
401 pm_buffer_append_string(output_buffer, "+-- rest:", 9);
402 if (cast->rest == NULL) {
403 pm_buffer_append_string(output_buffer, " nil\n", 5);
404 } else {
405 pm_buffer_append_byte(output_buffer, '\n');
406
407 size_t prefix_length = prefix_buffer->length;
408 pm_buffer_append_string(prefix_buffer, "| ", 4);
409 pm_buffer_concat(output_buffer, prefix_buffer);
410 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->rest, prefix_buffer);
411 prefix_buffer->length = prefix_length;
412 }
413 }
414
415 // posts
416 {
417 pm_buffer_concat(output_buffer, prefix_buffer);
418 pm_buffer_append_string(output_buffer, "+-- posts:", 10);
419 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->posts.size));
420
421 size_t last_index = cast->posts.size;
422 for (uint32_t index = 0; index < last_index; index++) {
423 size_t prefix_length = prefix_buffer->length;
424 pm_buffer_append_string(prefix_buffer, "| ", 4);
425 pm_buffer_concat(output_buffer, prefix_buffer);
426 pm_buffer_append_string(output_buffer, "+-- ", 4);
427 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
428 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->posts.nodes[index], prefix_buffer);
429 prefix_buffer->length = prefix_length;
430 }
431 }
432
433 // opening_loc
434 {
435 pm_buffer_concat(output_buffer, prefix_buffer);
436 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
437 pm_location_t *location = &cast->opening_loc;
438 if (location->start == NULL) {
439 pm_buffer_append_string(output_buffer, " nil\n", 5);
440 } else {
441 pm_buffer_append_byte(output_buffer, ' ');
442 prettyprint_location(output_buffer, parser, location);
443 pm_buffer_append_string(output_buffer, " = \"", 4);
444 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
445 pm_buffer_append_string(output_buffer, "\"\n", 2);
446 }
447 }
448
449 // closing_loc
450 {
451 pm_buffer_concat(output_buffer, prefix_buffer);
452 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
453 pm_location_t *location = &cast->closing_loc;
454 if (location->start == NULL) {
455 pm_buffer_append_string(output_buffer, " nil\n", 5);
456 } else {
457 pm_buffer_append_byte(output_buffer, ' ');
458 prettyprint_location(output_buffer, parser, location);
459 pm_buffer_append_string(output_buffer, " = \"", 4);
460 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
461 pm_buffer_append_string(output_buffer, "\"\n", 2);
462 }
463 }
464
465 break;
466 }
467 case PM_ASSOC_NODE: {
468 pm_assoc_node_t *cast = (pm_assoc_node_t *) node;
469 pm_buffer_append_string(output_buffer, "@ AssocNode (location: ", 23);
470 prettyprint_location(output_buffer, parser, &node->location);
471 pm_buffer_append_string(output_buffer, ")\n", 2);
472
473 // key
474 {
475 pm_buffer_concat(output_buffer, prefix_buffer);
476 pm_buffer_append_string(output_buffer, "+-- key:", 8);
477 pm_buffer_append_byte(output_buffer, '\n');
478
479 size_t prefix_length = prefix_buffer->length;
480 pm_buffer_append_string(prefix_buffer, "| ", 4);
481 pm_buffer_concat(output_buffer, prefix_buffer);
482 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->key, prefix_buffer);
483 prefix_buffer->length = prefix_length;
484 }
485
486 // value
487 {
488 pm_buffer_concat(output_buffer, prefix_buffer);
489 pm_buffer_append_string(output_buffer, "+-- value:", 10);
490 pm_buffer_append_byte(output_buffer, '\n');
491
492 size_t prefix_length = prefix_buffer->length;
493 pm_buffer_append_string(prefix_buffer, "| ", 4);
494 pm_buffer_concat(output_buffer, prefix_buffer);
495 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
496 prefix_buffer->length = prefix_length;
497 }
498
499 // operator_loc
500 {
501 pm_buffer_concat(output_buffer, prefix_buffer);
502 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
503 pm_location_t *location = &cast->operator_loc;
504 if (location->start == NULL) {
505 pm_buffer_append_string(output_buffer, " nil\n", 5);
506 } else {
507 pm_buffer_append_byte(output_buffer, ' ');
508 prettyprint_location(output_buffer, parser, location);
509 pm_buffer_append_string(output_buffer, " = \"", 4);
510 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
511 pm_buffer_append_string(output_buffer, "\"\n", 2);
512 }
513 }
514
515 break;
516 }
517 case PM_ASSOC_SPLAT_NODE: {
518 pm_assoc_splat_node_t *cast = (pm_assoc_splat_node_t *) node;
519 pm_buffer_append_string(output_buffer, "@ AssocSplatNode (location: ", 28);
520 prettyprint_location(output_buffer, parser, &node->location);
521 pm_buffer_append_string(output_buffer, ")\n", 2);
522
523 // value
524 {
525 pm_buffer_concat(output_buffer, prefix_buffer);
526 pm_buffer_append_string(output_buffer, "+-- value:", 10);
527 if (cast->value == NULL) {
528 pm_buffer_append_string(output_buffer, " nil\n", 5);
529 } else {
530 pm_buffer_append_byte(output_buffer, '\n');
531
532 size_t prefix_length = prefix_buffer->length;
533 pm_buffer_append_string(prefix_buffer, "| ", 4);
534 pm_buffer_concat(output_buffer, prefix_buffer);
535 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
536 prefix_buffer->length = prefix_length;
537 }
538 }
539
540 // operator_loc
541 {
542 pm_buffer_concat(output_buffer, prefix_buffer);
543 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
544 pm_location_t *location = &cast->operator_loc;
545 pm_buffer_append_byte(output_buffer, ' ');
546 prettyprint_location(output_buffer, parser, location);
547 pm_buffer_append_string(output_buffer, " = \"", 4);
548 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
549 pm_buffer_append_string(output_buffer, "\"\n", 2);
550 }
551
552 break;
553 }
554 case PM_BACK_REFERENCE_READ_NODE: {
555 pm_back_reference_read_node_t *cast = (pm_back_reference_read_node_t *) node;
556 pm_buffer_append_string(output_buffer, "@ BackReferenceReadNode (location: ", 35);
557 prettyprint_location(output_buffer, parser, &node->location);
558 pm_buffer_append_string(output_buffer, ")\n", 2);
559
560 // name
561 {
562 pm_buffer_concat(output_buffer, prefix_buffer);
563 pm_buffer_append_string(output_buffer, "+-- name:", 9);
564 pm_buffer_append_byte(output_buffer, ' ');
565 prettyprint_constant(output_buffer, parser, cast->name);
566 pm_buffer_append_byte(output_buffer, '\n');
567 }
568
569 break;
570 }
571 case PM_BEGIN_NODE: {
572 pm_begin_node_t *cast = (pm_begin_node_t *) node;
573 pm_buffer_append_string(output_buffer, "@ BeginNode (location: ", 23);
574 prettyprint_location(output_buffer, parser, &node->location);
575 pm_buffer_append_string(output_buffer, ")\n", 2);
576
577 // begin_keyword_loc
578 {
579 pm_buffer_concat(output_buffer, prefix_buffer);
580 pm_buffer_append_string(output_buffer, "+-- begin_keyword_loc:", 22);
581 pm_location_t *location = &cast->begin_keyword_loc;
582 if (location->start == NULL) {
583 pm_buffer_append_string(output_buffer, " nil\n", 5);
584 } else {
585 pm_buffer_append_byte(output_buffer, ' ');
586 prettyprint_location(output_buffer, parser, location);
587 pm_buffer_append_string(output_buffer, " = \"", 4);
588 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
589 pm_buffer_append_string(output_buffer, "\"\n", 2);
590 }
591 }
592
593 // statements
594 {
595 pm_buffer_concat(output_buffer, prefix_buffer);
596 pm_buffer_append_string(output_buffer, "+-- statements:", 15);
597 if (cast->statements == NULL) {
598 pm_buffer_append_string(output_buffer, " nil\n", 5);
599 } else {
600 pm_buffer_append_byte(output_buffer, '\n');
601
602 size_t prefix_length = prefix_buffer->length;
603 pm_buffer_append_string(prefix_buffer, "| ", 4);
604 pm_buffer_concat(output_buffer, prefix_buffer);
605 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->statements, prefix_buffer);
606 prefix_buffer->length = prefix_length;
607 }
608 }
609
610 // rescue_clause
611 {
612 pm_buffer_concat(output_buffer, prefix_buffer);
613 pm_buffer_append_string(output_buffer, "+-- rescue_clause:", 18);
614 if (cast->rescue_clause == NULL) {
615 pm_buffer_append_string(output_buffer, " nil\n", 5);
616 } else {
617 pm_buffer_append_byte(output_buffer, '\n');
618
619 size_t prefix_length = prefix_buffer->length;
620 pm_buffer_append_string(prefix_buffer, "| ", 4);
621 pm_buffer_concat(output_buffer, prefix_buffer);
622 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->rescue_clause, prefix_buffer);
623 prefix_buffer->length = prefix_length;
624 }
625 }
626
627 // else_clause
628 {
629 pm_buffer_concat(output_buffer, prefix_buffer);
630 pm_buffer_append_string(output_buffer, "+-- else_clause:", 16);
631 if (cast->else_clause == NULL) {
632 pm_buffer_append_string(output_buffer, " nil\n", 5);
633 } else {
634 pm_buffer_append_byte(output_buffer, '\n');
635
636 size_t prefix_length = prefix_buffer->length;
637 pm_buffer_append_string(prefix_buffer, "| ", 4);
638 pm_buffer_concat(output_buffer, prefix_buffer);
639 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->else_clause, prefix_buffer);
640 prefix_buffer->length = prefix_length;
641 }
642 }
643
644 // ensure_clause
645 {
646 pm_buffer_concat(output_buffer, prefix_buffer);
647 pm_buffer_append_string(output_buffer, "+-- ensure_clause:", 18);
648 if (cast->ensure_clause == NULL) {
649 pm_buffer_append_string(output_buffer, " nil\n", 5);
650 } else {
651 pm_buffer_append_byte(output_buffer, '\n');
652
653 size_t prefix_length = prefix_buffer->length;
654 pm_buffer_append_string(prefix_buffer, "| ", 4);
655 pm_buffer_concat(output_buffer, prefix_buffer);
656 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->ensure_clause, prefix_buffer);
657 prefix_buffer->length = prefix_length;
658 }
659 }
660
661 // end_keyword_loc
662 {
663 pm_buffer_concat(output_buffer, prefix_buffer);
664 pm_buffer_append_string(output_buffer, "+-- end_keyword_loc:", 20);
665 pm_location_t *location = &cast->end_keyword_loc;
666 if (location->start == NULL) {
667 pm_buffer_append_string(output_buffer, " nil\n", 5);
668 } else {
669 pm_buffer_append_byte(output_buffer, ' ');
670 prettyprint_location(output_buffer, parser, location);
671 pm_buffer_append_string(output_buffer, " = \"", 4);
672 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
673 pm_buffer_append_string(output_buffer, "\"\n", 2);
674 }
675 }
676
677 break;
678 }
679 case PM_BLOCK_ARGUMENT_NODE: {
680 pm_block_argument_node_t *cast = (pm_block_argument_node_t *) node;
681 pm_buffer_append_string(output_buffer, "@ BlockArgumentNode (location: ", 31);
682 prettyprint_location(output_buffer, parser, &node->location);
683 pm_buffer_append_string(output_buffer, ")\n", 2);
684
685 // expression
686 {
687 pm_buffer_concat(output_buffer, prefix_buffer);
688 pm_buffer_append_string(output_buffer, "+-- expression:", 15);
689 if (cast->expression == NULL) {
690 pm_buffer_append_string(output_buffer, " nil\n", 5);
691 } else {
692 pm_buffer_append_byte(output_buffer, '\n');
693
694 size_t prefix_length = prefix_buffer->length;
695 pm_buffer_append_string(prefix_buffer, "| ", 4);
696 pm_buffer_concat(output_buffer, prefix_buffer);
697 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->expression, prefix_buffer);
698 prefix_buffer->length = prefix_length;
699 }
700 }
701
702 // operator_loc
703 {
704 pm_buffer_concat(output_buffer, prefix_buffer);
705 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
706 pm_location_t *location = &cast->operator_loc;
707 pm_buffer_append_byte(output_buffer, ' ');
708 prettyprint_location(output_buffer, parser, location);
709 pm_buffer_append_string(output_buffer, " = \"", 4);
710 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
711 pm_buffer_append_string(output_buffer, "\"\n", 2);
712 }
713
714 break;
715 }
716 case PM_BLOCK_LOCAL_VARIABLE_NODE: {
717 pm_block_local_variable_node_t *cast = (pm_block_local_variable_node_t *) node;
718 pm_buffer_append_string(output_buffer, "@ BlockLocalVariableNode (location: ", 36);
719 prettyprint_location(output_buffer, parser, &node->location);
720 pm_buffer_append_string(output_buffer, ")\n", 2);
721
722 // ParameterFlags
723 {
724 pm_buffer_concat(output_buffer, prefix_buffer);
725 pm_buffer_append_string(output_buffer, "+-- ParameterFlags:", 19);
726 bool found = false;
727 if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
728 if (found) pm_buffer_append_byte(output_buffer, ',');
729 pm_buffer_append_string(output_buffer, " repeated_parameter", 19);
730 found = true;
731 }
732 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
733 pm_buffer_append_byte(output_buffer, '\n');
734 }
735
736 // name
737 {
738 pm_buffer_concat(output_buffer, prefix_buffer);
739 pm_buffer_append_string(output_buffer, "+-- name:", 9);
740 pm_buffer_append_byte(output_buffer, ' ');
741 prettyprint_constant(output_buffer, parser, cast->name);
742 pm_buffer_append_byte(output_buffer, '\n');
743 }
744
745 break;
746 }
747 case PM_BLOCK_NODE: {
748 pm_block_node_t *cast = (pm_block_node_t *) node;
749 pm_buffer_append_string(output_buffer, "@ BlockNode (location: ", 23);
750 prettyprint_location(output_buffer, parser, &node->location);
751 pm_buffer_append_string(output_buffer, ")\n", 2);
752
753 // locals
754 {
755 pm_buffer_concat(output_buffer, prefix_buffer);
756 pm_buffer_append_string(output_buffer, "+-- locals:", 11);
757 pm_buffer_append_string(output_buffer, " [", 2);
758 for (uint32_t index = 0; index < cast->locals.size; index++) {
759 if (index != 0) pm_buffer_append_string(output_buffer, ", ", 2);
760 prettyprint_constant(output_buffer, parser, cast->locals.ids[index]);
761 }
762 pm_buffer_append_string(output_buffer, "]\n", 2);
763 }
764
765 // parameters
766 {
767 pm_buffer_concat(output_buffer, prefix_buffer);
768 pm_buffer_append_string(output_buffer, "+-- parameters:", 15);
769 if (cast->parameters == NULL) {
770 pm_buffer_append_string(output_buffer, " nil\n", 5);
771 } else {
772 pm_buffer_append_byte(output_buffer, '\n');
773
774 size_t prefix_length = prefix_buffer->length;
775 pm_buffer_append_string(prefix_buffer, "| ", 4);
776 pm_buffer_concat(output_buffer, prefix_buffer);
777 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->parameters, prefix_buffer);
778 prefix_buffer->length = prefix_length;
779 }
780 }
781
782 // body
783 {
784 pm_buffer_concat(output_buffer, prefix_buffer);
785 pm_buffer_append_string(output_buffer, "+-- body:", 9);
786 if (cast->body == NULL) {
787 pm_buffer_append_string(output_buffer, " nil\n", 5);
788 } else {
789 pm_buffer_append_byte(output_buffer, '\n');
790
791 size_t prefix_length = prefix_buffer->length;
792 pm_buffer_append_string(prefix_buffer, "| ", 4);
793 pm_buffer_concat(output_buffer, prefix_buffer);
794 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->body, prefix_buffer);
795 prefix_buffer->length = prefix_length;
796 }
797 }
798
799 // opening_loc
800 {
801 pm_buffer_concat(output_buffer, prefix_buffer);
802 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
803 pm_location_t *location = &cast->opening_loc;
804 pm_buffer_append_byte(output_buffer, ' ');
805 prettyprint_location(output_buffer, parser, location);
806 pm_buffer_append_string(output_buffer, " = \"", 4);
807 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
808 pm_buffer_append_string(output_buffer, "\"\n", 2);
809 }
810
811 // closing_loc
812 {
813 pm_buffer_concat(output_buffer, prefix_buffer);
814 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
815 pm_location_t *location = &cast->closing_loc;
816 pm_buffer_append_byte(output_buffer, ' ');
817 prettyprint_location(output_buffer, parser, location);
818 pm_buffer_append_string(output_buffer, " = \"", 4);
819 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
820 pm_buffer_append_string(output_buffer, "\"\n", 2);
821 }
822
823 break;
824 }
825 case PM_BLOCK_PARAMETER_NODE: {
826 pm_block_parameter_node_t *cast = (pm_block_parameter_node_t *) node;
827 pm_buffer_append_string(output_buffer, "@ BlockParameterNode (location: ", 32);
828 prettyprint_location(output_buffer, parser, &node->location);
829 pm_buffer_append_string(output_buffer, ")\n", 2);
830
831 // ParameterFlags
832 {
833 pm_buffer_concat(output_buffer, prefix_buffer);
834 pm_buffer_append_string(output_buffer, "+-- ParameterFlags:", 19);
835 bool found = false;
836 if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
837 if (found) pm_buffer_append_byte(output_buffer, ',');
838 pm_buffer_append_string(output_buffer, " repeated_parameter", 19);
839 found = true;
840 }
841 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
842 pm_buffer_append_byte(output_buffer, '\n');
843 }
844
845 // name
846 {
847 pm_buffer_concat(output_buffer, prefix_buffer);
848 pm_buffer_append_string(output_buffer, "+-- name:", 9);
849 if (cast->name == 0) {
850 pm_buffer_append_string(output_buffer, " nil\n", 5);
851 } else {
852 pm_buffer_append_byte(output_buffer, ' ');
853 prettyprint_constant(output_buffer, parser, cast->name);
854 pm_buffer_append_byte(output_buffer, '\n');
855 }
856 }
857
858 // name_loc
859 {
860 pm_buffer_concat(output_buffer, prefix_buffer);
861 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
862 pm_location_t *location = &cast->name_loc;
863 if (location->start == NULL) {
864 pm_buffer_append_string(output_buffer, " nil\n", 5);
865 } else {
866 pm_buffer_append_byte(output_buffer, ' ');
867 prettyprint_location(output_buffer, parser, location);
868 pm_buffer_append_string(output_buffer, " = \"", 4);
869 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
870 pm_buffer_append_string(output_buffer, "\"\n", 2);
871 }
872 }
873
874 // operator_loc
875 {
876 pm_buffer_concat(output_buffer, prefix_buffer);
877 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
878 pm_location_t *location = &cast->operator_loc;
879 pm_buffer_append_byte(output_buffer, ' ');
880 prettyprint_location(output_buffer, parser, location);
881 pm_buffer_append_string(output_buffer, " = \"", 4);
882 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
883 pm_buffer_append_string(output_buffer, "\"\n", 2);
884 }
885
886 break;
887 }
888 case PM_BLOCK_PARAMETERS_NODE: {
889 pm_block_parameters_node_t *cast = (pm_block_parameters_node_t *) node;
890 pm_buffer_append_string(output_buffer, "@ BlockParametersNode (location: ", 33);
891 prettyprint_location(output_buffer, parser, &node->location);
892 pm_buffer_append_string(output_buffer, ")\n", 2);
893
894 // parameters
895 {
896 pm_buffer_concat(output_buffer, prefix_buffer);
897 pm_buffer_append_string(output_buffer, "+-- parameters:", 15);
898 if (cast->parameters == NULL) {
899 pm_buffer_append_string(output_buffer, " nil\n", 5);
900 } else {
901 pm_buffer_append_byte(output_buffer, '\n');
902
903 size_t prefix_length = prefix_buffer->length;
904 pm_buffer_append_string(prefix_buffer, "| ", 4);
905 pm_buffer_concat(output_buffer, prefix_buffer);
906 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->parameters, prefix_buffer);
907 prefix_buffer->length = prefix_length;
908 }
909 }
910
911 // locals
912 {
913 pm_buffer_concat(output_buffer, prefix_buffer);
914 pm_buffer_append_string(output_buffer, "+-- locals:", 11);
915 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->locals.size));
916
917 size_t last_index = cast->locals.size;
918 for (uint32_t index = 0; index < last_index; index++) {
919 size_t prefix_length = prefix_buffer->length;
920 pm_buffer_append_string(prefix_buffer, "| ", 4);
921 pm_buffer_concat(output_buffer, prefix_buffer);
922 pm_buffer_append_string(output_buffer, "+-- ", 4);
923 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
924 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->locals.nodes[index], prefix_buffer);
925 prefix_buffer->length = prefix_length;
926 }
927 }
928
929 // opening_loc
930 {
931 pm_buffer_concat(output_buffer, prefix_buffer);
932 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
933 pm_location_t *location = &cast->opening_loc;
934 if (location->start == NULL) {
935 pm_buffer_append_string(output_buffer, " nil\n", 5);
936 } else {
937 pm_buffer_append_byte(output_buffer, ' ');
938 prettyprint_location(output_buffer, parser, location);
939 pm_buffer_append_string(output_buffer, " = \"", 4);
940 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
941 pm_buffer_append_string(output_buffer, "\"\n", 2);
942 }
943 }
944
945 // closing_loc
946 {
947 pm_buffer_concat(output_buffer, prefix_buffer);
948 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
949 pm_location_t *location = &cast->closing_loc;
950 if (location->start == NULL) {
951 pm_buffer_append_string(output_buffer, " nil\n", 5);
952 } else {
953 pm_buffer_append_byte(output_buffer, ' ');
954 prettyprint_location(output_buffer, parser, location);
955 pm_buffer_append_string(output_buffer, " = \"", 4);
956 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
957 pm_buffer_append_string(output_buffer, "\"\n", 2);
958 }
959 }
960
961 break;
962 }
963 case PM_BREAK_NODE: {
964 pm_break_node_t *cast = (pm_break_node_t *) node;
965 pm_buffer_append_string(output_buffer, "@ BreakNode (location: ", 23);
966 prettyprint_location(output_buffer, parser, &node->location);
967 pm_buffer_append_string(output_buffer, ")\n", 2);
968
969 // arguments
970 {
971 pm_buffer_concat(output_buffer, prefix_buffer);
972 pm_buffer_append_string(output_buffer, "+-- arguments:", 14);
973 if (cast->arguments == NULL) {
974 pm_buffer_append_string(output_buffer, " nil\n", 5);
975 } else {
976 pm_buffer_append_byte(output_buffer, '\n');
977
978 size_t prefix_length = prefix_buffer->length;
979 pm_buffer_append_string(prefix_buffer, "| ", 4);
980 pm_buffer_concat(output_buffer, prefix_buffer);
981 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->arguments, prefix_buffer);
982 prefix_buffer->length = prefix_length;
983 }
984 }
985
986 // keyword_loc
987 {
988 pm_buffer_concat(output_buffer, prefix_buffer);
989 pm_buffer_append_string(output_buffer, "+-- keyword_loc:", 16);
990 pm_location_t *location = &cast->keyword_loc;
991 pm_buffer_append_byte(output_buffer, ' ');
992 prettyprint_location(output_buffer, parser, location);
993 pm_buffer_append_string(output_buffer, " = \"", 4);
994 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
995 pm_buffer_append_string(output_buffer, "\"\n", 2);
996 }
997
998 break;
999 }
1000 case PM_CALL_AND_WRITE_NODE: {
1001 pm_call_and_write_node_t *cast = (pm_call_and_write_node_t *) node;
1002 pm_buffer_append_string(output_buffer, "@ CallAndWriteNode (location: ", 30);
1003 prettyprint_location(output_buffer, parser, &node->location);
1004 pm_buffer_append_string(output_buffer, ")\n", 2);
1005
1006 // CallNodeFlags
1007 {
1008 pm_buffer_concat(output_buffer, prefix_buffer);
1009 pm_buffer_append_string(output_buffer, "+-- CallNodeFlags:", 18);
1010 bool found = false;
1011 if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
1012 if (found) pm_buffer_append_byte(output_buffer, ',');
1013 pm_buffer_append_string(output_buffer, " safe_navigation", 16);
1014 found = true;
1015 }
1016 if (cast->base.flags & PM_CALL_NODE_FLAGS_VARIABLE_CALL) {
1017 if (found) pm_buffer_append_byte(output_buffer, ',');
1018 pm_buffer_append_string(output_buffer, " variable_call", 14);
1019 found = true;
1020 }
1021 if (cast->base.flags & PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE) {
1022 if (found) pm_buffer_append_byte(output_buffer, ',');
1023 pm_buffer_append_string(output_buffer, " attribute_write", 16);
1024 found = true;
1025 }
1026 if (cast->base.flags & PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY) {
1027 if (found) pm_buffer_append_byte(output_buffer, ',');
1028 pm_buffer_append_string(output_buffer, " ignore_visibility", 18);
1029 found = true;
1030 }
1031 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
1032 pm_buffer_append_byte(output_buffer, '\n');
1033 }
1034
1035 // receiver
1036 {
1037 pm_buffer_concat(output_buffer, prefix_buffer);
1038 pm_buffer_append_string(output_buffer, "+-- receiver:", 13);
1039 if (cast->receiver == NULL) {
1040 pm_buffer_append_string(output_buffer, " nil\n", 5);
1041 } else {
1042 pm_buffer_append_byte(output_buffer, '\n');
1043
1044 size_t prefix_length = prefix_buffer->length;
1045 pm_buffer_append_string(prefix_buffer, "| ", 4);
1046 pm_buffer_concat(output_buffer, prefix_buffer);
1047 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->receiver, prefix_buffer);
1048 prefix_buffer->length = prefix_length;
1049 }
1050 }
1051
1052 // call_operator_loc
1053 {
1054 pm_buffer_concat(output_buffer, prefix_buffer);
1055 pm_buffer_append_string(output_buffer, "+-- call_operator_loc:", 22);
1056 pm_location_t *location = &cast->call_operator_loc;
1057 if (location->start == NULL) {
1058 pm_buffer_append_string(output_buffer, " nil\n", 5);
1059 } else {
1060 pm_buffer_append_byte(output_buffer, ' ');
1061 prettyprint_location(output_buffer, parser, location);
1062 pm_buffer_append_string(output_buffer, " = \"", 4);
1063 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1064 pm_buffer_append_string(output_buffer, "\"\n", 2);
1065 }
1066 }
1067
1068 // message_loc
1069 {
1070 pm_buffer_concat(output_buffer, prefix_buffer);
1071 pm_buffer_append_string(output_buffer, "+-- message_loc:", 16);
1072 pm_location_t *location = &cast->message_loc;
1073 if (location->start == NULL) {
1074 pm_buffer_append_string(output_buffer, " nil\n", 5);
1075 } else {
1076 pm_buffer_append_byte(output_buffer, ' ');
1077 prettyprint_location(output_buffer, parser, location);
1078 pm_buffer_append_string(output_buffer, " = \"", 4);
1079 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1080 pm_buffer_append_string(output_buffer, "\"\n", 2);
1081 }
1082 }
1083
1084 // read_name
1085 {
1086 pm_buffer_concat(output_buffer, prefix_buffer);
1087 pm_buffer_append_string(output_buffer, "+-- read_name:", 14);
1088 pm_buffer_append_byte(output_buffer, ' ');
1089 prettyprint_constant(output_buffer, parser, cast->read_name);
1090 pm_buffer_append_byte(output_buffer, '\n');
1091 }
1092
1093 // write_name
1094 {
1095 pm_buffer_concat(output_buffer, prefix_buffer);
1096 pm_buffer_append_string(output_buffer, "+-- write_name:", 15);
1097 pm_buffer_append_byte(output_buffer, ' ');
1098 prettyprint_constant(output_buffer, parser, cast->write_name);
1099 pm_buffer_append_byte(output_buffer, '\n');
1100 }
1101
1102 // operator_loc
1103 {
1104 pm_buffer_concat(output_buffer, prefix_buffer);
1105 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
1106 pm_location_t *location = &cast->operator_loc;
1107 pm_buffer_append_byte(output_buffer, ' ');
1108 prettyprint_location(output_buffer, parser, location);
1109 pm_buffer_append_string(output_buffer, " = \"", 4);
1110 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1111 pm_buffer_append_string(output_buffer, "\"\n", 2);
1112 }
1113
1114 // value
1115 {
1116 pm_buffer_concat(output_buffer, prefix_buffer);
1117 pm_buffer_append_string(output_buffer, "+-- value:", 10);
1118 pm_buffer_append_byte(output_buffer, '\n');
1119
1120 size_t prefix_length = prefix_buffer->length;
1121 pm_buffer_append_string(prefix_buffer, " ", 4);
1122 pm_buffer_concat(output_buffer, prefix_buffer);
1123 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
1124 prefix_buffer->length = prefix_length;
1125 }
1126
1127 break;
1128 }
1129 case PM_CALL_NODE: {
1130 pm_call_node_t *cast = (pm_call_node_t *) node;
1131 pm_buffer_append_string(output_buffer, "@ CallNode (location: ", 22);
1132 prettyprint_location(output_buffer, parser, &node->location);
1133 pm_buffer_append_string(output_buffer, ")\n", 2);
1134
1135 // CallNodeFlags
1136 {
1137 pm_buffer_concat(output_buffer, prefix_buffer);
1138 pm_buffer_append_string(output_buffer, "+-- CallNodeFlags:", 18);
1139 bool found = false;
1140 if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
1141 if (found) pm_buffer_append_byte(output_buffer, ',');
1142 pm_buffer_append_string(output_buffer, " safe_navigation", 16);
1143 found = true;
1144 }
1145 if (cast->base.flags & PM_CALL_NODE_FLAGS_VARIABLE_CALL) {
1146 if (found) pm_buffer_append_byte(output_buffer, ',');
1147 pm_buffer_append_string(output_buffer, " variable_call", 14);
1148 found = true;
1149 }
1150 if (cast->base.flags & PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE) {
1151 if (found) pm_buffer_append_byte(output_buffer, ',');
1152 pm_buffer_append_string(output_buffer, " attribute_write", 16);
1153 found = true;
1154 }
1155 if (cast->base.flags & PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY) {
1156 if (found) pm_buffer_append_byte(output_buffer, ',');
1157 pm_buffer_append_string(output_buffer, " ignore_visibility", 18);
1158 found = true;
1159 }
1160 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
1161 pm_buffer_append_byte(output_buffer, '\n');
1162 }
1163
1164 // receiver
1165 {
1166 pm_buffer_concat(output_buffer, prefix_buffer);
1167 pm_buffer_append_string(output_buffer, "+-- receiver:", 13);
1168 if (cast->receiver == NULL) {
1169 pm_buffer_append_string(output_buffer, " nil\n", 5);
1170 } else {
1171 pm_buffer_append_byte(output_buffer, '\n');
1172
1173 size_t prefix_length = prefix_buffer->length;
1174 pm_buffer_append_string(prefix_buffer, "| ", 4);
1175 pm_buffer_concat(output_buffer, prefix_buffer);
1176 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->receiver, prefix_buffer);
1177 prefix_buffer->length = prefix_length;
1178 }
1179 }
1180
1181 // call_operator_loc
1182 {
1183 pm_buffer_concat(output_buffer, prefix_buffer);
1184 pm_buffer_append_string(output_buffer, "+-- call_operator_loc:", 22);
1185 pm_location_t *location = &cast->call_operator_loc;
1186 if (location->start == NULL) {
1187 pm_buffer_append_string(output_buffer, " nil\n", 5);
1188 } else {
1189 pm_buffer_append_byte(output_buffer, ' ');
1190 prettyprint_location(output_buffer, parser, location);
1191 pm_buffer_append_string(output_buffer, " = \"", 4);
1192 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1193 pm_buffer_append_string(output_buffer, "\"\n", 2);
1194 }
1195 }
1196
1197 // name
1198 {
1199 pm_buffer_concat(output_buffer, prefix_buffer);
1200 pm_buffer_append_string(output_buffer, "+-- name:", 9);
1201 pm_buffer_append_byte(output_buffer, ' ');
1202 prettyprint_constant(output_buffer, parser, cast->name);
1203 pm_buffer_append_byte(output_buffer, '\n');
1204 }
1205
1206 // message_loc
1207 {
1208 pm_buffer_concat(output_buffer, prefix_buffer);
1209 pm_buffer_append_string(output_buffer, "+-- message_loc:", 16);
1210 pm_location_t *location = &cast->message_loc;
1211 if (location->start == NULL) {
1212 pm_buffer_append_string(output_buffer, " nil\n", 5);
1213 } else {
1214 pm_buffer_append_byte(output_buffer, ' ');
1215 prettyprint_location(output_buffer, parser, location);
1216 pm_buffer_append_string(output_buffer, " = \"", 4);
1217 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1218 pm_buffer_append_string(output_buffer, "\"\n", 2);
1219 }
1220 }
1221
1222 // opening_loc
1223 {
1224 pm_buffer_concat(output_buffer, prefix_buffer);
1225 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
1226 pm_location_t *location = &cast->opening_loc;
1227 if (location->start == NULL) {
1228 pm_buffer_append_string(output_buffer, " nil\n", 5);
1229 } else {
1230 pm_buffer_append_byte(output_buffer, ' ');
1231 prettyprint_location(output_buffer, parser, location);
1232 pm_buffer_append_string(output_buffer, " = \"", 4);
1233 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1234 pm_buffer_append_string(output_buffer, "\"\n", 2);
1235 }
1236 }
1237
1238 // arguments
1239 {
1240 pm_buffer_concat(output_buffer, prefix_buffer);
1241 pm_buffer_append_string(output_buffer, "+-- arguments:", 14);
1242 if (cast->arguments == NULL) {
1243 pm_buffer_append_string(output_buffer, " nil\n", 5);
1244 } else {
1245 pm_buffer_append_byte(output_buffer, '\n');
1246
1247 size_t prefix_length = prefix_buffer->length;
1248 pm_buffer_append_string(prefix_buffer, "| ", 4);
1249 pm_buffer_concat(output_buffer, prefix_buffer);
1250 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->arguments, prefix_buffer);
1251 prefix_buffer->length = prefix_length;
1252 }
1253 }
1254
1255 // closing_loc
1256 {
1257 pm_buffer_concat(output_buffer, prefix_buffer);
1258 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
1259 pm_location_t *location = &cast->closing_loc;
1260 if (location->start == NULL) {
1261 pm_buffer_append_string(output_buffer, " nil\n", 5);
1262 } else {
1263 pm_buffer_append_byte(output_buffer, ' ');
1264 prettyprint_location(output_buffer, parser, location);
1265 pm_buffer_append_string(output_buffer, " = \"", 4);
1266 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1267 pm_buffer_append_string(output_buffer, "\"\n", 2);
1268 }
1269 }
1270
1271 // equal_loc
1272 {
1273 pm_buffer_concat(output_buffer, prefix_buffer);
1274 pm_buffer_append_string(output_buffer, "+-- equal_loc:", 14);
1275 pm_location_t *location = &cast->equal_loc;
1276 if (location->start == NULL) {
1277 pm_buffer_append_string(output_buffer, " nil\n", 5);
1278 } else {
1279 pm_buffer_append_byte(output_buffer, ' ');
1280 prettyprint_location(output_buffer, parser, location);
1281 pm_buffer_append_string(output_buffer, " = \"", 4);
1282 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1283 pm_buffer_append_string(output_buffer, "\"\n", 2);
1284 }
1285 }
1286
1287 // block
1288 {
1289 pm_buffer_concat(output_buffer, prefix_buffer);
1290 pm_buffer_append_string(output_buffer, "+-- block:", 10);
1291 if (cast->block == NULL) {
1292 pm_buffer_append_string(output_buffer, " nil\n", 5);
1293 } else {
1294 pm_buffer_append_byte(output_buffer, '\n');
1295
1296 size_t prefix_length = prefix_buffer->length;
1297 pm_buffer_append_string(prefix_buffer, " ", 4);
1298 pm_buffer_concat(output_buffer, prefix_buffer);
1299 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->block, prefix_buffer);
1300 prefix_buffer->length = prefix_length;
1301 }
1302 }
1303
1304 break;
1305 }
1306 case PM_CALL_OPERATOR_WRITE_NODE: {
1307 pm_call_operator_write_node_t *cast = (pm_call_operator_write_node_t *) node;
1308 pm_buffer_append_string(output_buffer, "@ CallOperatorWriteNode (location: ", 35);
1309 prettyprint_location(output_buffer, parser, &node->location);
1310 pm_buffer_append_string(output_buffer, ")\n", 2);
1311
1312 // CallNodeFlags
1313 {
1314 pm_buffer_concat(output_buffer, prefix_buffer);
1315 pm_buffer_append_string(output_buffer, "+-- CallNodeFlags:", 18);
1316 bool found = false;
1317 if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
1318 if (found) pm_buffer_append_byte(output_buffer, ',');
1319 pm_buffer_append_string(output_buffer, " safe_navigation", 16);
1320 found = true;
1321 }
1322 if (cast->base.flags & PM_CALL_NODE_FLAGS_VARIABLE_CALL) {
1323 if (found) pm_buffer_append_byte(output_buffer, ',');
1324 pm_buffer_append_string(output_buffer, " variable_call", 14);
1325 found = true;
1326 }
1327 if (cast->base.flags & PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE) {
1328 if (found) pm_buffer_append_byte(output_buffer, ',');
1329 pm_buffer_append_string(output_buffer, " attribute_write", 16);
1330 found = true;
1331 }
1332 if (cast->base.flags & PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY) {
1333 if (found) pm_buffer_append_byte(output_buffer, ',');
1334 pm_buffer_append_string(output_buffer, " ignore_visibility", 18);
1335 found = true;
1336 }
1337 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
1338 pm_buffer_append_byte(output_buffer, '\n');
1339 }
1340
1341 // receiver
1342 {
1343 pm_buffer_concat(output_buffer, prefix_buffer);
1344 pm_buffer_append_string(output_buffer, "+-- receiver:", 13);
1345 if (cast->receiver == NULL) {
1346 pm_buffer_append_string(output_buffer, " nil\n", 5);
1347 } else {
1348 pm_buffer_append_byte(output_buffer, '\n');
1349
1350 size_t prefix_length = prefix_buffer->length;
1351 pm_buffer_append_string(prefix_buffer, "| ", 4);
1352 pm_buffer_concat(output_buffer, prefix_buffer);
1353 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->receiver, prefix_buffer);
1354 prefix_buffer->length = prefix_length;
1355 }
1356 }
1357
1358 // call_operator_loc
1359 {
1360 pm_buffer_concat(output_buffer, prefix_buffer);
1361 pm_buffer_append_string(output_buffer, "+-- call_operator_loc:", 22);
1362 pm_location_t *location = &cast->call_operator_loc;
1363 if (location->start == NULL) {
1364 pm_buffer_append_string(output_buffer, " nil\n", 5);
1365 } else {
1366 pm_buffer_append_byte(output_buffer, ' ');
1367 prettyprint_location(output_buffer, parser, location);
1368 pm_buffer_append_string(output_buffer, " = \"", 4);
1369 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1370 pm_buffer_append_string(output_buffer, "\"\n", 2);
1371 }
1372 }
1373
1374 // message_loc
1375 {
1376 pm_buffer_concat(output_buffer, prefix_buffer);
1377 pm_buffer_append_string(output_buffer, "+-- message_loc:", 16);
1378 pm_location_t *location = &cast->message_loc;
1379 if (location->start == NULL) {
1380 pm_buffer_append_string(output_buffer, " nil\n", 5);
1381 } else {
1382 pm_buffer_append_byte(output_buffer, ' ');
1383 prettyprint_location(output_buffer, parser, location);
1384 pm_buffer_append_string(output_buffer, " = \"", 4);
1385 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1386 pm_buffer_append_string(output_buffer, "\"\n", 2);
1387 }
1388 }
1389
1390 // read_name
1391 {
1392 pm_buffer_concat(output_buffer, prefix_buffer);
1393 pm_buffer_append_string(output_buffer, "+-- read_name:", 14);
1394 pm_buffer_append_byte(output_buffer, ' ');
1395 prettyprint_constant(output_buffer, parser, cast->read_name);
1396 pm_buffer_append_byte(output_buffer, '\n');
1397 }
1398
1399 // write_name
1400 {
1401 pm_buffer_concat(output_buffer, prefix_buffer);
1402 pm_buffer_append_string(output_buffer, "+-- write_name:", 15);
1403 pm_buffer_append_byte(output_buffer, ' ');
1404 prettyprint_constant(output_buffer, parser, cast->write_name);
1405 pm_buffer_append_byte(output_buffer, '\n');
1406 }
1407
1408 // binary_operator
1409 {
1410 pm_buffer_concat(output_buffer, prefix_buffer);
1411 pm_buffer_append_string(output_buffer, "+-- binary_operator:", 20);
1412 pm_buffer_append_byte(output_buffer, ' ');
1413 prettyprint_constant(output_buffer, parser, cast->binary_operator);
1414 pm_buffer_append_byte(output_buffer, '\n');
1415 }
1416
1417 // binary_operator_loc
1418 {
1419 pm_buffer_concat(output_buffer, prefix_buffer);
1420 pm_buffer_append_string(output_buffer, "+-- binary_operator_loc:", 24);
1421 pm_location_t *location = &cast->binary_operator_loc;
1422 pm_buffer_append_byte(output_buffer, ' ');
1423 prettyprint_location(output_buffer, parser, location);
1424 pm_buffer_append_string(output_buffer, " = \"", 4);
1425 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1426 pm_buffer_append_string(output_buffer, "\"\n", 2);
1427 }
1428
1429 // value
1430 {
1431 pm_buffer_concat(output_buffer, prefix_buffer);
1432 pm_buffer_append_string(output_buffer, "+-- value:", 10);
1433 pm_buffer_append_byte(output_buffer, '\n');
1434
1435 size_t prefix_length = prefix_buffer->length;
1436 pm_buffer_append_string(prefix_buffer, " ", 4);
1437 pm_buffer_concat(output_buffer, prefix_buffer);
1438 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
1439 prefix_buffer->length = prefix_length;
1440 }
1441
1442 break;
1443 }
1444 case PM_CALL_OR_WRITE_NODE: {
1445 pm_call_or_write_node_t *cast = (pm_call_or_write_node_t *) node;
1446 pm_buffer_append_string(output_buffer, "@ CallOrWriteNode (location: ", 29);
1447 prettyprint_location(output_buffer, parser, &node->location);
1448 pm_buffer_append_string(output_buffer, ")\n", 2);
1449
1450 // CallNodeFlags
1451 {
1452 pm_buffer_concat(output_buffer, prefix_buffer);
1453 pm_buffer_append_string(output_buffer, "+-- CallNodeFlags:", 18);
1454 bool found = false;
1455 if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
1456 if (found) pm_buffer_append_byte(output_buffer, ',');
1457 pm_buffer_append_string(output_buffer, " safe_navigation", 16);
1458 found = true;
1459 }
1460 if (cast->base.flags & PM_CALL_NODE_FLAGS_VARIABLE_CALL) {
1461 if (found) pm_buffer_append_byte(output_buffer, ',');
1462 pm_buffer_append_string(output_buffer, " variable_call", 14);
1463 found = true;
1464 }
1465 if (cast->base.flags & PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE) {
1466 if (found) pm_buffer_append_byte(output_buffer, ',');
1467 pm_buffer_append_string(output_buffer, " attribute_write", 16);
1468 found = true;
1469 }
1470 if (cast->base.flags & PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY) {
1471 if (found) pm_buffer_append_byte(output_buffer, ',');
1472 pm_buffer_append_string(output_buffer, " ignore_visibility", 18);
1473 found = true;
1474 }
1475 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
1476 pm_buffer_append_byte(output_buffer, '\n');
1477 }
1478
1479 // receiver
1480 {
1481 pm_buffer_concat(output_buffer, prefix_buffer);
1482 pm_buffer_append_string(output_buffer, "+-- receiver:", 13);
1483 if (cast->receiver == NULL) {
1484 pm_buffer_append_string(output_buffer, " nil\n", 5);
1485 } else {
1486 pm_buffer_append_byte(output_buffer, '\n');
1487
1488 size_t prefix_length = prefix_buffer->length;
1489 pm_buffer_append_string(prefix_buffer, "| ", 4);
1490 pm_buffer_concat(output_buffer, prefix_buffer);
1491 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->receiver, prefix_buffer);
1492 prefix_buffer->length = prefix_length;
1493 }
1494 }
1495
1496 // call_operator_loc
1497 {
1498 pm_buffer_concat(output_buffer, prefix_buffer);
1499 pm_buffer_append_string(output_buffer, "+-- call_operator_loc:", 22);
1500 pm_location_t *location = &cast->call_operator_loc;
1501 if (location->start == NULL) {
1502 pm_buffer_append_string(output_buffer, " nil\n", 5);
1503 } else {
1504 pm_buffer_append_byte(output_buffer, ' ');
1505 prettyprint_location(output_buffer, parser, location);
1506 pm_buffer_append_string(output_buffer, " = \"", 4);
1507 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1508 pm_buffer_append_string(output_buffer, "\"\n", 2);
1509 }
1510 }
1511
1512 // message_loc
1513 {
1514 pm_buffer_concat(output_buffer, prefix_buffer);
1515 pm_buffer_append_string(output_buffer, "+-- message_loc:", 16);
1516 pm_location_t *location = &cast->message_loc;
1517 if (location->start == NULL) {
1518 pm_buffer_append_string(output_buffer, " nil\n", 5);
1519 } else {
1520 pm_buffer_append_byte(output_buffer, ' ');
1521 prettyprint_location(output_buffer, parser, location);
1522 pm_buffer_append_string(output_buffer, " = \"", 4);
1523 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1524 pm_buffer_append_string(output_buffer, "\"\n", 2);
1525 }
1526 }
1527
1528 // read_name
1529 {
1530 pm_buffer_concat(output_buffer, prefix_buffer);
1531 pm_buffer_append_string(output_buffer, "+-- read_name:", 14);
1532 pm_buffer_append_byte(output_buffer, ' ');
1533 prettyprint_constant(output_buffer, parser, cast->read_name);
1534 pm_buffer_append_byte(output_buffer, '\n');
1535 }
1536
1537 // write_name
1538 {
1539 pm_buffer_concat(output_buffer, prefix_buffer);
1540 pm_buffer_append_string(output_buffer, "+-- write_name:", 15);
1541 pm_buffer_append_byte(output_buffer, ' ');
1542 prettyprint_constant(output_buffer, parser, cast->write_name);
1543 pm_buffer_append_byte(output_buffer, '\n');
1544 }
1545
1546 // operator_loc
1547 {
1548 pm_buffer_concat(output_buffer, prefix_buffer);
1549 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
1550 pm_location_t *location = &cast->operator_loc;
1551 pm_buffer_append_byte(output_buffer, ' ');
1552 prettyprint_location(output_buffer, parser, location);
1553 pm_buffer_append_string(output_buffer, " = \"", 4);
1554 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1555 pm_buffer_append_string(output_buffer, "\"\n", 2);
1556 }
1557
1558 // value
1559 {
1560 pm_buffer_concat(output_buffer, prefix_buffer);
1561 pm_buffer_append_string(output_buffer, "+-- value:", 10);
1562 pm_buffer_append_byte(output_buffer, '\n');
1563
1564 size_t prefix_length = prefix_buffer->length;
1565 pm_buffer_append_string(prefix_buffer, " ", 4);
1566 pm_buffer_concat(output_buffer, prefix_buffer);
1567 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
1568 prefix_buffer->length = prefix_length;
1569 }
1570
1571 break;
1572 }
1573 case PM_CALL_TARGET_NODE: {
1574 pm_call_target_node_t *cast = (pm_call_target_node_t *) node;
1575 pm_buffer_append_string(output_buffer, "@ CallTargetNode (location: ", 28);
1576 prettyprint_location(output_buffer, parser, &node->location);
1577 pm_buffer_append_string(output_buffer, ")\n", 2);
1578
1579 // CallNodeFlags
1580 {
1581 pm_buffer_concat(output_buffer, prefix_buffer);
1582 pm_buffer_append_string(output_buffer, "+-- CallNodeFlags:", 18);
1583 bool found = false;
1584 if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
1585 if (found) pm_buffer_append_byte(output_buffer, ',');
1586 pm_buffer_append_string(output_buffer, " safe_navigation", 16);
1587 found = true;
1588 }
1589 if (cast->base.flags & PM_CALL_NODE_FLAGS_VARIABLE_CALL) {
1590 if (found) pm_buffer_append_byte(output_buffer, ',');
1591 pm_buffer_append_string(output_buffer, " variable_call", 14);
1592 found = true;
1593 }
1594 if (cast->base.flags & PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE) {
1595 if (found) pm_buffer_append_byte(output_buffer, ',');
1596 pm_buffer_append_string(output_buffer, " attribute_write", 16);
1597 found = true;
1598 }
1599 if (cast->base.flags & PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY) {
1600 if (found) pm_buffer_append_byte(output_buffer, ',');
1601 pm_buffer_append_string(output_buffer, " ignore_visibility", 18);
1602 found = true;
1603 }
1604 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
1605 pm_buffer_append_byte(output_buffer, '\n');
1606 }
1607
1608 // receiver
1609 {
1610 pm_buffer_concat(output_buffer, prefix_buffer);
1611 pm_buffer_append_string(output_buffer, "+-- receiver:", 13);
1612 pm_buffer_append_byte(output_buffer, '\n');
1613
1614 size_t prefix_length = prefix_buffer->length;
1615 pm_buffer_append_string(prefix_buffer, "| ", 4);
1616 pm_buffer_concat(output_buffer, prefix_buffer);
1617 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->receiver, prefix_buffer);
1618 prefix_buffer->length = prefix_length;
1619 }
1620
1621 // call_operator_loc
1622 {
1623 pm_buffer_concat(output_buffer, prefix_buffer);
1624 pm_buffer_append_string(output_buffer, "+-- call_operator_loc:", 22);
1625 pm_location_t *location = &cast->call_operator_loc;
1626 pm_buffer_append_byte(output_buffer, ' ');
1627 prettyprint_location(output_buffer, parser, location);
1628 pm_buffer_append_string(output_buffer, " = \"", 4);
1629 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1630 pm_buffer_append_string(output_buffer, "\"\n", 2);
1631 }
1632
1633 // name
1634 {
1635 pm_buffer_concat(output_buffer, prefix_buffer);
1636 pm_buffer_append_string(output_buffer, "+-- name:", 9);
1637 pm_buffer_append_byte(output_buffer, ' ');
1638 prettyprint_constant(output_buffer, parser, cast->name);
1639 pm_buffer_append_byte(output_buffer, '\n');
1640 }
1641
1642 // message_loc
1643 {
1644 pm_buffer_concat(output_buffer, prefix_buffer);
1645 pm_buffer_append_string(output_buffer, "+-- message_loc:", 16);
1646 pm_location_t *location = &cast->message_loc;
1647 pm_buffer_append_byte(output_buffer, ' ');
1648 prettyprint_location(output_buffer, parser, location);
1649 pm_buffer_append_string(output_buffer, " = \"", 4);
1650 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1651 pm_buffer_append_string(output_buffer, "\"\n", 2);
1652 }
1653
1654 break;
1655 }
1656 case PM_CAPTURE_PATTERN_NODE: {
1657 pm_capture_pattern_node_t *cast = (pm_capture_pattern_node_t *) node;
1658 pm_buffer_append_string(output_buffer, "@ CapturePatternNode (location: ", 32);
1659 prettyprint_location(output_buffer, parser, &node->location);
1660 pm_buffer_append_string(output_buffer, ")\n", 2);
1661
1662 // value
1663 {
1664 pm_buffer_concat(output_buffer, prefix_buffer);
1665 pm_buffer_append_string(output_buffer, "+-- value:", 10);
1666 pm_buffer_append_byte(output_buffer, '\n');
1667
1668 size_t prefix_length = prefix_buffer->length;
1669 pm_buffer_append_string(prefix_buffer, "| ", 4);
1670 pm_buffer_concat(output_buffer, prefix_buffer);
1671 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
1672 prefix_buffer->length = prefix_length;
1673 }
1674
1675 // target
1676 {
1677 pm_buffer_concat(output_buffer, prefix_buffer);
1678 pm_buffer_append_string(output_buffer, "+-- target:", 11);
1679 pm_buffer_append_byte(output_buffer, '\n');
1680
1681 size_t prefix_length = prefix_buffer->length;
1682 pm_buffer_append_string(prefix_buffer, "| ", 4);
1683 pm_buffer_concat(output_buffer, prefix_buffer);
1684 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->target, prefix_buffer);
1685 prefix_buffer->length = prefix_length;
1686 }
1687
1688 // operator_loc
1689 {
1690 pm_buffer_concat(output_buffer, prefix_buffer);
1691 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
1692 pm_location_t *location = &cast->operator_loc;
1693 pm_buffer_append_byte(output_buffer, ' ');
1694 prettyprint_location(output_buffer, parser, location);
1695 pm_buffer_append_string(output_buffer, " = \"", 4);
1696 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1697 pm_buffer_append_string(output_buffer, "\"\n", 2);
1698 }
1699
1700 break;
1701 }
1702 case PM_CASE_MATCH_NODE: {
1703 pm_case_match_node_t *cast = (pm_case_match_node_t *) node;
1704 pm_buffer_append_string(output_buffer, "@ CaseMatchNode (location: ", 27);
1705 prettyprint_location(output_buffer, parser, &node->location);
1706 pm_buffer_append_string(output_buffer, ")\n", 2);
1707
1708 // predicate
1709 {
1710 pm_buffer_concat(output_buffer, prefix_buffer);
1711 pm_buffer_append_string(output_buffer, "+-- predicate:", 14);
1712 if (cast->predicate == NULL) {
1713 pm_buffer_append_string(output_buffer, " nil\n", 5);
1714 } else {
1715 pm_buffer_append_byte(output_buffer, '\n');
1716
1717 size_t prefix_length = prefix_buffer->length;
1718 pm_buffer_append_string(prefix_buffer, "| ", 4);
1719 pm_buffer_concat(output_buffer, prefix_buffer);
1720 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->predicate, prefix_buffer);
1721 prefix_buffer->length = prefix_length;
1722 }
1723 }
1724
1725 // conditions
1726 {
1727 pm_buffer_concat(output_buffer, prefix_buffer);
1728 pm_buffer_append_string(output_buffer, "+-- conditions:", 15);
1729 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->conditions.size));
1730
1731 size_t last_index = cast->conditions.size;
1732 for (uint32_t index = 0; index < last_index; index++) {
1733 size_t prefix_length = prefix_buffer->length;
1734 pm_buffer_append_string(prefix_buffer, "| ", 4);
1735 pm_buffer_concat(output_buffer, prefix_buffer);
1736 pm_buffer_append_string(output_buffer, "+-- ", 4);
1737 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
1738 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->conditions.nodes[index], prefix_buffer);
1739 prefix_buffer->length = prefix_length;
1740 }
1741 }
1742
1743 // else_clause
1744 {
1745 pm_buffer_concat(output_buffer, prefix_buffer);
1746 pm_buffer_append_string(output_buffer, "+-- else_clause:", 16);
1747 if (cast->else_clause == NULL) {
1748 pm_buffer_append_string(output_buffer, " nil\n", 5);
1749 } else {
1750 pm_buffer_append_byte(output_buffer, '\n');
1751
1752 size_t prefix_length = prefix_buffer->length;
1753 pm_buffer_append_string(prefix_buffer, "| ", 4);
1754 pm_buffer_concat(output_buffer, prefix_buffer);
1755 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->else_clause, prefix_buffer);
1756 prefix_buffer->length = prefix_length;
1757 }
1758 }
1759
1760 // case_keyword_loc
1761 {
1762 pm_buffer_concat(output_buffer, prefix_buffer);
1763 pm_buffer_append_string(output_buffer, "+-- case_keyword_loc:", 21);
1764 pm_location_t *location = &cast->case_keyword_loc;
1765 pm_buffer_append_byte(output_buffer, ' ');
1766 prettyprint_location(output_buffer, parser, location);
1767 pm_buffer_append_string(output_buffer, " = \"", 4);
1768 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1769 pm_buffer_append_string(output_buffer, "\"\n", 2);
1770 }
1771
1772 // end_keyword_loc
1773 {
1774 pm_buffer_concat(output_buffer, prefix_buffer);
1775 pm_buffer_append_string(output_buffer, "+-- end_keyword_loc:", 20);
1776 pm_location_t *location = &cast->end_keyword_loc;
1777 pm_buffer_append_byte(output_buffer, ' ');
1778 prettyprint_location(output_buffer, parser, location);
1779 pm_buffer_append_string(output_buffer, " = \"", 4);
1780 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1781 pm_buffer_append_string(output_buffer, "\"\n", 2);
1782 }
1783
1784 break;
1785 }
1786 case PM_CASE_NODE: {
1787 pm_case_node_t *cast = (pm_case_node_t *) node;
1788 pm_buffer_append_string(output_buffer, "@ CaseNode (location: ", 22);
1789 prettyprint_location(output_buffer, parser, &node->location);
1790 pm_buffer_append_string(output_buffer, ")\n", 2);
1791
1792 // predicate
1793 {
1794 pm_buffer_concat(output_buffer, prefix_buffer);
1795 pm_buffer_append_string(output_buffer, "+-- predicate:", 14);
1796 if (cast->predicate == NULL) {
1797 pm_buffer_append_string(output_buffer, " nil\n", 5);
1798 } else {
1799 pm_buffer_append_byte(output_buffer, '\n');
1800
1801 size_t prefix_length = prefix_buffer->length;
1802 pm_buffer_append_string(prefix_buffer, "| ", 4);
1803 pm_buffer_concat(output_buffer, prefix_buffer);
1804 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->predicate, prefix_buffer);
1805 prefix_buffer->length = prefix_length;
1806 }
1807 }
1808
1809 // conditions
1810 {
1811 pm_buffer_concat(output_buffer, prefix_buffer);
1812 pm_buffer_append_string(output_buffer, "+-- conditions:", 15);
1813 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->conditions.size));
1814
1815 size_t last_index = cast->conditions.size;
1816 for (uint32_t index = 0; index < last_index; index++) {
1817 size_t prefix_length = prefix_buffer->length;
1818 pm_buffer_append_string(prefix_buffer, "| ", 4);
1819 pm_buffer_concat(output_buffer, prefix_buffer);
1820 pm_buffer_append_string(output_buffer, "+-- ", 4);
1821 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
1822 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->conditions.nodes[index], prefix_buffer);
1823 prefix_buffer->length = prefix_length;
1824 }
1825 }
1826
1827 // else_clause
1828 {
1829 pm_buffer_concat(output_buffer, prefix_buffer);
1830 pm_buffer_append_string(output_buffer, "+-- else_clause:", 16);
1831 if (cast->else_clause == NULL) {
1832 pm_buffer_append_string(output_buffer, " nil\n", 5);
1833 } else {
1834 pm_buffer_append_byte(output_buffer, '\n');
1835
1836 size_t prefix_length = prefix_buffer->length;
1837 pm_buffer_append_string(prefix_buffer, "| ", 4);
1838 pm_buffer_concat(output_buffer, prefix_buffer);
1839 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->else_clause, prefix_buffer);
1840 prefix_buffer->length = prefix_length;
1841 }
1842 }
1843
1844 // case_keyword_loc
1845 {
1846 pm_buffer_concat(output_buffer, prefix_buffer);
1847 pm_buffer_append_string(output_buffer, "+-- case_keyword_loc:", 21);
1848 pm_location_t *location = &cast->case_keyword_loc;
1849 pm_buffer_append_byte(output_buffer, ' ');
1850 prettyprint_location(output_buffer, parser, location);
1851 pm_buffer_append_string(output_buffer, " = \"", 4);
1852 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1853 pm_buffer_append_string(output_buffer, "\"\n", 2);
1854 }
1855
1856 // end_keyword_loc
1857 {
1858 pm_buffer_concat(output_buffer, prefix_buffer);
1859 pm_buffer_append_string(output_buffer, "+-- end_keyword_loc:", 20);
1860 pm_location_t *location = &cast->end_keyword_loc;
1861 pm_buffer_append_byte(output_buffer, ' ');
1862 prettyprint_location(output_buffer, parser, location);
1863 pm_buffer_append_string(output_buffer, " = \"", 4);
1864 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1865 pm_buffer_append_string(output_buffer, "\"\n", 2);
1866 }
1867
1868 break;
1869 }
1870 case PM_CLASS_NODE: {
1871 pm_class_node_t *cast = (pm_class_node_t *) node;
1872 pm_buffer_append_string(output_buffer, "@ ClassNode (location: ", 23);
1873 prettyprint_location(output_buffer, parser, &node->location);
1874 pm_buffer_append_string(output_buffer, ")\n", 2);
1875
1876 // locals
1877 {
1878 pm_buffer_concat(output_buffer, prefix_buffer);
1879 pm_buffer_append_string(output_buffer, "+-- locals:", 11);
1880 pm_buffer_append_string(output_buffer, " [", 2);
1881 for (uint32_t index = 0; index < cast->locals.size; index++) {
1882 if (index != 0) pm_buffer_append_string(output_buffer, ", ", 2);
1883 prettyprint_constant(output_buffer, parser, cast->locals.ids[index]);
1884 }
1885 pm_buffer_append_string(output_buffer, "]\n", 2);
1886 }
1887
1888 // class_keyword_loc
1889 {
1890 pm_buffer_concat(output_buffer, prefix_buffer);
1891 pm_buffer_append_string(output_buffer, "+-- class_keyword_loc:", 22);
1892 pm_location_t *location = &cast->class_keyword_loc;
1893 pm_buffer_append_byte(output_buffer, ' ');
1894 prettyprint_location(output_buffer, parser, location);
1895 pm_buffer_append_string(output_buffer, " = \"", 4);
1896 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1897 pm_buffer_append_string(output_buffer, "\"\n", 2);
1898 }
1899
1900 // constant_path
1901 {
1902 pm_buffer_concat(output_buffer, prefix_buffer);
1903 pm_buffer_append_string(output_buffer, "+-- constant_path:", 18);
1904 pm_buffer_append_byte(output_buffer, '\n');
1905
1906 size_t prefix_length = prefix_buffer->length;
1907 pm_buffer_append_string(prefix_buffer, "| ", 4);
1908 pm_buffer_concat(output_buffer, prefix_buffer);
1909 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->constant_path, prefix_buffer);
1910 prefix_buffer->length = prefix_length;
1911 }
1912
1913 // inheritance_operator_loc
1914 {
1915 pm_buffer_concat(output_buffer, prefix_buffer);
1916 pm_buffer_append_string(output_buffer, "+-- inheritance_operator_loc:", 29);
1917 pm_location_t *location = &cast->inheritance_operator_loc;
1918 if (location->start == NULL) {
1919 pm_buffer_append_string(output_buffer, " nil\n", 5);
1920 } else {
1921 pm_buffer_append_byte(output_buffer, ' ');
1922 prettyprint_location(output_buffer, parser, location);
1923 pm_buffer_append_string(output_buffer, " = \"", 4);
1924 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1925 pm_buffer_append_string(output_buffer, "\"\n", 2);
1926 }
1927 }
1928
1929 // superclass
1930 {
1931 pm_buffer_concat(output_buffer, prefix_buffer);
1932 pm_buffer_append_string(output_buffer, "+-- superclass:", 15);
1933 if (cast->superclass == NULL) {
1934 pm_buffer_append_string(output_buffer, " nil\n", 5);
1935 } else {
1936 pm_buffer_append_byte(output_buffer, '\n');
1937
1938 size_t prefix_length = prefix_buffer->length;
1939 pm_buffer_append_string(prefix_buffer, "| ", 4);
1940 pm_buffer_concat(output_buffer, prefix_buffer);
1941 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->superclass, prefix_buffer);
1942 prefix_buffer->length = prefix_length;
1943 }
1944 }
1945
1946 // body
1947 {
1948 pm_buffer_concat(output_buffer, prefix_buffer);
1949 pm_buffer_append_string(output_buffer, "+-- body:", 9);
1950 if (cast->body == NULL) {
1951 pm_buffer_append_string(output_buffer, " nil\n", 5);
1952 } else {
1953 pm_buffer_append_byte(output_buffer, '\n');
1954
1955 size_t prefix_length = prefix_buffer->length;
1956 pm_buffer_append_string(prefix_buffer, "| ", 4);
1957 pm_buffer_concat(output_buffer, prefix_buffer);
1958 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->body, prefix_buffer);
1959 prefix_buffer->length = prefix_length;
1960 }
1961 }
1962
1963 // end_keyword_loc
1964 {
1965 pm_buffer_concat(output_buffer, prefix_buffer);
1966 pm_buffer_append_string(output_buffer, "+-- end_keyword_loc:", 20);
1967 pm_location_t *location = &cast->end_keyword_loc;
1968 pm_buffer_append_byte(output_buffer, ' ');
1969 prettyprint_location(output_buffer, parser, location);
1970 pm_buffer_append_string(output_buffer, " = \"", 4);
1971 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
1972 pm_buffer_append_string(output_buffer, "\"\n", 2);
1973 }
1974
1975 // name
1976 {
1977 pm_buffer_concat(output_buffer, prefix_buffer);
1978 pm_buffer_append_string(output_buffer, "+-- name:", 9);
1979 pm_buffer_append_byte(output_buffer, ' ');
1980 prettyprint_constant(output_buffer, parser, cast->name);
1981 pm_buffer_append_byte(output_buffer, '\n');
1982 }
1983
1984 break;
1985 }
1986 case PM_CLASS_VARIABLE_AND_WRITE_NODE: {
1987 pm_class_variable_and_write_node_t *cast = (pm_class_variable_and_write_node_t *) node;
1988 pm_buffer_append_string(output_buffer, "@ ClassVariableAndWriteNode (location: ", 39);
1989 prettyprint_location(output_buffer, parser, &node->location);
1990 pm_buffer_append_string(output_buffer, ")\n", 2);
1991
1992 // name
1993 {
1994 pm_buffer_concat(output_buffer, prefix_buffer);
1995 pm_buffer_append_string(output_buffer, "+-- name:", 9);
1996 pm_buffer_append_byte(output_buffer, ' ');
1997 prettyprint_constant(output_buffer, parser, cast->name);
1998 pm_buffer_append_byte(output_buffer, '\n');
1999 }
2000
2001 // name_loc
2002 {
2003 pm_buffer_concat(output_buffer, prefix_buffer);
2004 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
2005 pm_location_t *location = &cast->name_loc;
2006 pm_buffer_append_byte(output_buffer, ' ');
2007 prettyprint_location(output_buffer, parser, location);
2008 pm_buffer_append_string(output_buffer, " = \"", 4);
2009 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2010 pm_buffer_append_string(output_buffer, "\"\n", 2);
2011 }
2012
2013 // operator_loc
2014 {
2015 pm_buffer_concat(output_buffer, prefix_buffer);
2016 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
2017 pm_location_t *location = &cast->operator_loc;
2018 pm_buffer_append_byte(output_buffer, ' ');
2019 prettyprint_location(output_buffer, parser, location);
2020 pm_buffer_append_string(output_buffer, " = \"", 4);
2021 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2022 pm_buffer_append_string(output_buffer, "\"\n", 2);
2023 }
2024
2025 // value
2026 {
2027 pm_buffer_concat(output_buffer, prefix_buffer);
2028 pm_buffer_append_string(output_buffer, "+-- value:", 10);
2029 pm_buffer_append_byte(output_buffer, '\n');
2030
2031 size_t prefix_length = prefix_buffer->length;
2032 pm_buffer_append_string(prefix_buffer, " ", 4);
2033 pm_buffer_concat(output_buffer, prefix_buffer);
2034 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
2035 prefix_buffer->length = prefix_length;
2036 }
2037
2038 break;
2039 }
2040 case PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
2041 pm_class_variable_operator_write_node_t *cast = (pm_class_variable_operator_write_node_t *) node;
2042 pm_buffer_append_string(output_buffer, "@ ClassVariableOperatorWriteNode (location: ", 44);
2043 prettyprint_location(output_buffer, parser, &node->location);
2044 pm_buffer_append_string(output_buffer, ")\n", 2);
2045
2046 // name
2047 {
2048 pm_buffer_concat(output_buffer, prefix_buffer);
2049 pm_buffer_append_string(output_buffer, "+-- name:", 9);
2050 pm_buffer_append_byte(output_buffer, ' ');
2051 prettyprint_constant(output_buffer, parser, cast->name);
2052 pm_buffer_append_byte(output_buffer, '\n');
2053 }
2054
2055 // name_loc
2056 {
2057 pm_buffer_concat(output_buffer, prefix_buffer);
2058 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
2059 pm_location_t *location = &cast->name_loc;
2060 pm_buffer_append_byte(output_buffer, ' ');
2061 prettyprint_location(output_buffer, parser, location);
2062 pm_buffer_append_string(output_buffer, " = \"", 4);
2063 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2064 pm_buffer_append_string(output_buffer, "\"\n", 2);
2065 }
2066
2067 // binary_operator_loc
2068 {
2069 pm_buffer_concat(output_buffer, prefix_buffer);
2070 pm_buffer_append_string(output_buffer, "+-- binary_operator_loc:", 24);
2071 pm_location_t *location = &cast->binary_operator_loc;
2072 pm_buffer_append_byte(output_buffer, ' ');
2073 prettyprint_location(output_buffer, parser, location);
2074 pm_buffer_append_string(output_buffer, " = \"", 4);
2075 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2076 pm_buffer_append_string(output_buffer, "\"\n", 2);
2077 }
2078
2079 // value
2080 {
2081 pm_buffer_concat(output_buffer, prefix_buffer);
2082 pm_buffer_append_string(output_buffer, "+-- value:", 10);
2083 pm_buffer_append_byte(output_buffer, '\n');
2084
2085 size_t prefix_length = prefix_buffer->length;
2086 pm_buffer_append_string(prefix_buffer, "| ", 4);
2087 pm_buffer_concat(output_buffer, prefix_buffer);
2088 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
2089 prefix_buffer->length = prefix_length;
2090 }
2091
2092 // binary_operator
2093 {
2094 pm_buffer_concat(output_buffer, prefix_buffer);
2095 pm_buffer_append_string(output_buffer, "+-- binary_operator:", 20);
2096 pm_buffer_append_byte(output_buffer, ' ');
2097 prettyprint_constant(output_buffer, parser, cast->binary_operator);
2098 pm_buffer_append_byte(output_buffer, '\n');
2099 }
2100
2101 break;
2102 }
2103 case PM_CLASS_VARIABLE_OR_WRITE_NODE: {
2104 pm_class_variable_or_write_node_t *cast = (pm_class_variable_or_write_node_t *) node;
2105 pm_buffer_append_string(output_buffer, "@ ClassVariableOrWriteNode (location: ", 38);
2106 prettyprint_location(output_buffer, parser, &node->location);
2107 pm_buffer_append_string(output_buffer, ")\n", 2);
2108
2109 // name
2110 {
2111 pm_buffer_concat(output_buffer, prefix_buffer);
2112 pm_buffer_append_string(output_buffer, "+-- name:", 9);
2113 pm_buffer_append_byte(output_buffer, ' ');
2114 prettyprint_constant(output_buffer, parser, cast->name);
2115 pm_buffer_append_byte(output_buffer, '\n');
2116 }
2117
2118 // name_loc
2119 {
2120 pm_buffer_concat(output_buffer, prefix_buffer);
2121 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
2122 pm_location_t *location = &cast->name_loc;
2123 pm_buffer_append_byte(output_buffer, ' ');
2124 prettyprint_location(output_buffer, parser, location);
2125 pm_buffer_append_string(output_buffer, " = \"", 4);
2126 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2127 pm_buffer_append_string(output_buffer, "\"\n", 2);
2128 }
2129
2130 // operator_loc
2131 {
2132 pm_buffer_concat(output_buffer, prefix_buffer);
2133 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
2134 pm_location_t *location = &cast->operator_loc;
2135 pm_buffer_append_byte(output_buffer, ' ');
2136 prettyprint_location(output_buffer, parser, location);
2137 pm_buffer_append_string(output_buffer, " = \"", 4);
2138 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2139 pm_buffer_append_string(output_buffer, "\"\n", 2);
2140 }
2141
2142 // value
2143 {
2144 pm_buffer_concat(output_buffer, prefix_buffer);
2145 pm_buffer_append_string(output_buffer, "+-- value:", 10);
2146 pm_buffer_append_byte(output_buffer, '\n');
2147
2148 size_t prefix_length = prefix_buffer->length;
2149 pm_buffer_append_string(prefix_buffer, " ", 4);
2150 pm_buffer_concat(output_buffer, prefix_buffer);
2151 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
2152 prefix_buffer->length = prefix_length;
2153 }
2154
2155 break;
2156 }
2157 case PM_CLASS_VARIABLE_READ_NODE: {
2158 pm_class_variable_read_node_t *cast = (pm_class_variable_read_node_t *) node;
2159 pm_buffer_append_string(output_buffer, "@ ClassVariableReadNode (location: ", 35);
2160 prettyprint_location(output_buffer, parser, &node->location);
2161 pm_buffer_append_string(output_buffer, ")\n", 2);
2162
2163 // name
2164 {
2165 pm_buffer_concat(output_buffer, prefix_buffer);
2166 pm_buffer_append_string(output_buffer, "+-- name:", 9);
2167 pm_buffer_append_byte(output_buffer, ' ');
2168 prettyprint_constant(output_buffer, parser, cast->name);
2169 pm_buffer_append_byte(output_buffer, '\n');
2170 }
2171
2172 break;
2173 }
2174 case PM_CLASS_VARIABLE_TARGET_NODE: {
2175 pm_class_variable_target_node_t *cast = (pm_class_variable_target_node_t *) node;
2176 pm_buffer_append_string(output_buffer, "@ ClassVariableTargetNode (location: ", 37);
2177 prettyprint_location(output_buffer, parser, &node->location);
2178 pm_buffer_append_string(output_buffer, ")\n", 2);
2179
2180 // name
2181 {
2182 pm_buffer_concat(output_buffer, prefix_buffer);
2183 pm_buffer_append_string(output_buffer, "+-- name:", 9);
2184 pm_buffer_append_byte(output_buffer, ' ');
2185 prettyprint_constant(output_buffer, parser, cast->name);
2186 pm_buffer_append_byte(output_buffer, '\n');
2187 }
2188
2189 break;
2190 }
2191 case PM_CLASS_VARIABLE_WRITE_NODE: {
2192 pm_class_variable_write_node_t *cast = (pm_class_variable_write_node_t *) node;
2193 pm_buffer_append_string(output_buffer, "@ ClassVariableWriteNode (location: ", 36);
2194 prettyprint_location(output_buffer, parser, &node->location);
2195 pm_buffer_append_string(output_buffer, ")\n", 2);
2196
2197 // name
2198 {
2199 pm_buffer_concat(output_buffer, prefix_buffer);
2200 pm_buffer_append_string(output_buffer, "+-- name:", 9);
2201 pm_buffer_append_byte(output_buffer, ' ');
2202 prettyprint_constant(output_buffer, parser, cast->name);
2203 pm_buffer_append_byte(output_buffer, '\n');
2204 }
2205
2206 // name_loc
2207 {
2208 pm_buffer_concat(output_buffer, prefix_buffer);
2209 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
2210 pm_location_t *location = &cast->name_loc;
2211 pm_buffer_append_byte(output_buffer, ' ');
2212 prettyprint_location(output_buffer, parser, location);
2213 pm_buffer_append_string(output_buffer, " = \"", 4);
2214 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2215 pm_buffer_append_string(output_buffer, "\"\n", 2);
2216 }
2217
2218 // value
2219 {
2220 pm_buffer_concat(output_buffer, prefix_buffer);
2221 pm_buffer_append_string(output_buffer, "+-- value:", 10);
2222 pm_buffer_append_byte(output_buffer, '\n');
2223
2224 size_t prefix_length = prefix_buffer->length;
2225 pm_buffer_append_string(prefix_buffer, "| ", 4);
2226 pm_buffer_concat(output_buffer, prefix_buffer);
2227 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
2228 prefix_buffer->length = prefix_length;
2229 }
2230
2231 // operator_loc
2232 {
2233 pm_buffer_concat(output_buffer, prefix_buffer);
2234 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
2235 pm_location_t *location = &cast->operator_loc;
2236 pm_buffer_append_byte(output_buffer, ' ');
2237 prettyprint_location(output_buffer, parser, location);
2238 pm_buffer_append_string(output_buffer, " = \"", 4);
2239 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2240 pm_buffer_append_string(output_buffer, "\"\n", 2);
2241 }
2242
2243 break;
2244 }
2245 case PM_CONSTANT_AND_WRITE_NODE: {
2246 pm_constant_and_write_node_t *cast = (pm_constant_and_write_node_t *) node;
2247 pm_buffer_append_string(output_buffer, "@ ConstantAndWriteNode (location: ", 34);
2248 prettyprint_location(output_buffer, parser, &node->location);
2249 pm_buffer_append_string(output_buffer, ")\n", 2);
2250
2251 // name
2252 {
2253 pm_buffer_concat(output_buffer, prefix_buffer);
2254 pm_buffer_append_string(output_buffer, "+-- name:", 9);
2255 pm_buffer_append_byte(output_buffer, ' ');
2256 prettyprint_constant(output_buffer, parser, cast->name);
2257 pm_buffer_append_byte(output_buffer, '\n');
2258 }
2259
2260 // name_loc
2261 {
2262 pm_buffer_concat(output_buffer, prefix_buffer);
2263 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
2264 pm_location_t *location = &cast->name_loc;
2265 pm_buffer_append_byte(output_buffer, ' ');
2266 prettyprint_location(output_buffer, parser, location);
2267 pm_buffer_append_string(output_buffer, " = \"", 4);
2268 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2269 pm_buffer_append_string(output_buffer, "\"\n", 2);
2270 }
2271
2272 // operator_loc
2273 {
2274 pm_buffer_concat(output_buffer, prefix_buffer);
2275 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
2276 pm_location_t *location = &cast->operator_loc;
2277 pm_buffer_append_byte(output_buffer, ' ');
2278 prettyprint_location(output_buffer, parser, location);
2279 pm_buffer_append_string(output_buffer, " = \"", 4);
2280 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2281 pm_buffer_append_string(output_buffer, "\"\n", 2);
2282 }
2283
2284 // value
2285 {
2286 pm_buffer_concat(output_buffer, prefix_buffer);
2287 pm_buffer_append_string(output_buffer, "+-- value:", 10);
2288 pm_buffer_append_byte(output_buffer, '\n');
2289
2290 size_t prefix_length = prefix_buffer->length;
2291 pm_buffer_append_string(prefix_buffer, " ", 4);
2292 pm_buffer_concat(output_buffer, prefix_buffer);
2293 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
2294 prefix_buffer->length = prefix_length;
2295 }
2296
2297 break;
2298 }
2299 case PM_CONSTANT_OPERATOR_WRITE_NODE: {
2300 pm_constant_operator_write_node_t *cast = (pm_constant_operator_write_node_t *) node;
2301 pm_buffer_append_string(output_buffer, "@ ConstantOperatorWriteNode (location: ", 39);
2302 prettyprint_location(output_buffer, parser, &node->location);
2303 pm_buffer_append_string(output_buffer, ")\n", 2);
2304
2305 // name
2306 {
2307 pm_buffer_concat(output_buffer, prefix_buffer);
2308 pm_buffer_append_string(output_buffer, "+-- name:", 9);
2309 pm_buffer_append_byte(output_buffer, ' ');
2310 prettyprint_constant(output_buffer, parser, cast->name);
2311 pm_buffer_append_byte(output_buffer, '\n');
2312 }
2313
2314 // name_loc
2315 {
2316 pm_buffer_concat(output_buffer, prefix_buffer);
2317 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
2318 pm_location_t *location = &cast->name_loc;
2319 pm_buffer_append_byte(output_buffer, ' ');
2320 prettyprint_location(output_buffer, parser, location);
2321 pm_buffer_append_string(output_buffer, " = \"", 4);
2322 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2323 pm_buffer_append_string(output_buffer, "\"\n", 2);
2324 }
2325
2326 // binary_operator_loc
2327 {
2328 pm_buffer_concat(output_buffer, prefix_buffer);
2329 pm_buffer_append_string(output_buffer, "+-- binary_operator_loc:", 24);
2330 pm_location_t *location = &cast->binary_operator_loc;
2331 pm_buffer_append_byte(output_buffer, ' ');
2332 prettyprint_location(output_buffer, parser, location);
2333 pm_buffer_append_string(output_buffer, " = \"", 4);
2334 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2335 pm_buffer_append_string(output_buffer, "\"\n", 2);
2336 }
2337
2338 // value
2339 {
2340 pm_buffer_concat(output_buffer, prefix_buffer);
2341 pm_buffer_append_string(output_buffer, "+-- value:", 10);
2342 pm_buffer_append_byte(output_buffer, '\n');
2343
2344 size_t prefix_length = prefix_buffer->length;
2345 pm_buffer_append_string(prefix_buffer, "| ", 4);
2346 pm_buffer_concat(output_buffer, prefix_buffer);
2347 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
2348 prefix_buffer->length = prefix_length;
2349 }
2350
2351 // binary_operator
2352 {
2353 pm_buffer_concat(output_buffer, prefix_buffer);
2354 pm_buffer_append_string(output_buffer, "+-- binary_operator:", 20);
2355 pm_buffer_append_byte(output_buffer, ' ');
2356 prettyprint_constant(output_buffer, parser, cast->binary_operator);
2357 pm_buffer_append_byte(output_buffer, '\n');
2358 }
2359
2360 break;
2361 }
2362 case PM_CONSTANT_OR_WRITE_NODE: {
2363 pm_constant_or_write_node_t *cast = (pm_constant_or_write_node_t *) node;
2364 pm_buffer_append_string(output_buffer, "@ ConstantOrWriteNode (location: ", 33);
2365 prettyprint_location(output_buffer, parser, &node->location);
2366 pm_buffer_append_string(output_buffer, ")\n", 2);
2367
2368 // name
2369 {
2370 pm_buffer_concat(output_buffer, prefix_buffer);
2371 pm_buffer_append_string(output_buffer, "+-- name:", 9);
2372 pm_buffer_append_byte(output_buffer, ' ');
2373 prettyprint_constant(output_buffer, parser, cast->name);
2374 pm_buffer_append_byte(output_buffer, '\n');
2375 }
2376
2377 // name_loc
2378 {
2379 pm_buffer_concat(output_buffer, prefix_buffer);
2380 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
2381 pm_location_t *location = &cast->name_loc;
2382 pm_buffer_append_byte(output_buffer, ' ');
2383 prettyprint_location(output_buffer, parser, location);
2384 pm_buffer_append_string(output_buffer, " = \"", 4);
2385 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2386 pm_buffer_append_string(output_buffer, "\"\n", 2);
2387 }
2388
2389 // operator_loc
2390 {
2391 pm_buffer_concat(output_buffer, prefix_buffer);
2392 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
2393 pm_location_t *location = &cast->operator_loc;
2394 pm_buffer_append_byte(output_buffer, ' ');
2395 prettyprint_location(output_buffer, parser, location);
2396 pm_buffer_append_string(output_buffer, " = \"", 4);
2397 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2398 pm_buffer_append_string(output_buffer, "\"\n", 2);
2399 }
2400
2401 // value
2402 {
2403 pm_buffer_concat(output_buffer, prefix_buffer);
2404 pm_buffer_append_string(output_buffer, "+-- value:", 10);
2405 pm_buffer_append_byte(output_buffer, '\n');
2406
2407 size_t prefix_length = prefix_buffer->length;
2408 pm_buffer_append_string(prefix_buffer, " ", 4);
2409 pm_buffer_concat(output_buffer, prefix_buffer);
2410 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
2411 prefix_buffer->length = prefix_length;
2412 }
2413
2414 break;
2415 }
2416 case PM_CONSTANT_PATH_AND_WRITE_NODE: {
2417 pm_constant_path_and_write_node_t *cast = (pm_constant_path_and_write_node_t *) node;
2418 pm_buffer_append_string(output_buffer, "@ ConstantPathAndWriteNode (location: ", 38);
2419 prettyprint_location(output_buffer, parser, &node->location);
2420 pm_buffer_append_string(output_buffer, ")\n", 2);
2421
2422 // target
2423 {
2424 pm_buffer_concat(output_buffer, prefix_buffer);
2425 pm_buffer_append_string(output_buffer, "+-- target:", 11);
2426 pm_buffer_append_byte(output_buffer, '\n');
2427
2428 size_t prefix_length = prefix_buffer->length;
2429 pm_buffer_append_string(prefix_buffer, "| ", 4);
2430 pm_buffer_concat(output_buffer, prefix_buffer);
2431 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->target, prefix_buffer);
2432 prefix_buffer->length = prefix_length;
2433 }
2434
2435 // operator_loc
2436 {
2437 pm_buffer_concat(output_buffer, prefix_buffer);
2438 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
2439 pm_location_t *location = &cast->operator_loc;
2440 pm_buffer_append_byte(output_buffer, ' ');
2441 prettyprint_location(output_buffer, parser, location);
2442 pm_buffer_append_string(output_buffer, " = \"", 4);
2443 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2444 pm_buffer_append_string(output_buffer, "\"\n", 2);
2445 }
2446
2447 // value
2448 {
2449 pm_buffer_concat(output_buffer, prefix_buffer);
2450 pm_buffer_append_string(output_buffer, "+-- value:", 10);
2451 pm_buffer_append_byte(output_buffer, '\n');
2452
2453 size_t prefix_length = prefix_buffer->length;
2454 pm_buffer_append_string(prefix_buffer, " ", 4);
2455 pm_buffer_concat(output_buffer, prefix_buffer);
2456 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
2457 prefix_buffer->length = prefix_length;
2458 }
2459
2460 break;
2461 }
2462 case PM_CONSTANT_PATH_NODE: {
2463 pm_constant_path_node_t *cast = (pm_constant_path_node_t *) node;
2464 pm_buffer_append_string(output_buffer, "@ ConstantPathNode (location: ", 30);
2465 prettyprint_location(output_buffer, parser, &node->location);
2466 pm_buffer_append_string(output_buffer, ")\n", 2);
2467
2468 // parent
2469 {
2470 pm_buffer_concat(output_buffer, prefix_buffer);
2471 pm_buffer_append_string(output_buffer, "+-- parent:", 11);
2472 if (cast->parent == NULL) {
2473 pm_buffer_append_string(output_buffer, " nil\n", 5);
2474 } else {
2475 pm_buffer_append_byte(output_buffer, '\n');
2476
2477 size_t prefix_length = prefix_buffer->length;
2478 pm_buffer_append_string(prefix_buffer, "| ", 4);
2479 pm_buffer_concat(output_buffer, prefix_buffer);
2480 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->parent, prefix_buffer);
2481 prefix_buffer->length = prefix_length;
2482 }
2483 }
2484
2485 // name
2486 {
2487 pm_buffer_concat(output_buffer, prefix_buffer);
2488 pm_buffer_append_string(output_buffer, "+-- name:", 9);
2489 if (cast->name == 0) {
2490 pm_buffer_append_string(output_buffer, " nil\n", 5);
2491 } else {
2492 pm_buffer_append_byte(output_buffer, ' ');
2493 prettyprint_constant(output_buffer, parser, cast->name);
2494 pm_buffer_append_byte(output_buffer, '\n');
2495 }
2496 }
2497
2498 // delimiter_loc
2499 {
2500 pm_buffer_concat(output_buffer, prefix_buffer);
2501 pm_buffer_append_string(output_buffer, "+-- delimiter_loc:", 18);
2502 pm_location_t *location = &cast->delimiter_loc;
2503 pm_buffer_append_byte(output_buffer, ' ');
2504 prettyprint_location(output_buffer, parser, location);
2505 pm_buffer_append_string(output_buffer, " = \"", 4);
2506 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2507 pm_buffer_append_string(output_buffer, "\"\n", 2);
2508 }
2509
2510 // name_loc
2511 {
2512 pm_buffer_concat(output_buffer, prefix_buffer);
2513 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
2514 pm_location_t *location = &cast->name_loc;
2515 pm_buffer_append_byte(output_buffer, ' ');
2516 prettyprint_location(output_buffer, parser, location);
2517 pm_buffer_append_string(output_buffer, " = \"", 4);
2518 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2519 pm_buffer_append_string(output_buffer, "\"\n", 2);
2520 }
2521
2522 break;
2523 }
2524 case PM_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
2525 pm_constant_path_operator_write_node_t *cast = (pm_constant_path_operator_write_node_t *) node;
2526 pm_buffer_append_string(output_buffer, "@ ConstantPathOperatorWriteNode (location: ", 43);
2527 prettyprint_location(output_buffer, parser, &node->location);
2528 pm_buffer_append_string(output_buffer, ")\n", 2);
2529
2530 // target
2531 {
2532 pm_buffer_concat(output_buffer, prefix_buffer);
2533 pm_buffer_append_string(output_buffer, "+-- target:", 11);
2534 pm_buffer_append_byte(output_buffer, '\n');
2535
2536 size_t prefix_length = prefix_buffer->length;
2537 pm_buffer_append_string(prefix_buffer, "| ", 4);
2538 pm_buffer_concat(output_buffer, prefix_buffer);
2539 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->target, prefix_buffer);
2540 prefix_buffer->length = prefix_length;
2541 }
2542
2543 // binary_operator_loc
2544 {
2545 pm_buffer_concat(output_buffer, prefix_buffer);
2546 pm_buffer_append_string(output_buffer, "+-- binary_operator_loc:", 24);
2547 pm_location_t *location = &cast->binary_operator_loc;
2548 pm_buffer_append_byte(output_buffer, ' ');
2549 prettyprint_location(output_buffer, parser, location);
2550 pm_buffer_append_string(output_buffer, " = \"", 4);
2551 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2552 pm_buffer_append_string(output_buffer, "\"\n", 2);
2553 }
2554
2555 // value
2556 {
2557 pm_buffer_concat(output_buffer, prefix_buffer);
2558 pm_buffer_append_string(output_buffer, "+-- value:", 10);
2559 pm_buffer_append_byte(output_buffer, '\n');
2560
2561 size_t prefix_length = prefix_buffer->length;
2562 pm_buffer_append_string(prefix_buffer, "| ", 4);
2563 pm_buffer_concat(output_buffer, prefix_buffer);
2564 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
2565 prefix_buffer->length = prefix_length;
2566 }
2567
2568 // binary_operator
2569 {
2570 pm_buffer_concat(output_buffer, prefix_buffer);
2571 pm_buffer_append_string(output_buffer, "+-- binary_operator:", 20);
2572 pm_buffer_append_byte(output_buffer, ' ');
2573 prettyprint_constant(output_buffer, parser, cast->binary_operator);
2574 pm_buffer_append_byte(output_buffer, '\n');
2575 }
2576
2577 break;
2578 }
2579 case PM_CONSTANT_PATH_OR_WRITE_NODE: {
2580 pm_constant_path_or_write_node_t *cast = (pm_constant_path_or_write_node_t *) node;
2581 pm_buffer_append_string(output_buffer, "@ ConstantPathOrWriteNode (location: ", 37);
2582 prettyprint_location(output_buffer, parser, &node->location);
2583 pm_buffer_append_string(output_buffer, ")\n", 2);
2584
2585 // target
2586 {
2587 pm_buffer_concat(output_buffer, prefix_buffer);
2588 pm_buffer_append_string(output_buffer, "+-- target:", 11);
2589 pm_buffer_append_byte(output_buffer, '\n');
2590
2591 size_t prefix_length = prefix_buffer->length;
2592 pm_buffer_append_string(prefix_buffer, "| ", 4);
2593 pm_buffer_concat(output_buffer, prefix_buffer);
2594 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->target, prefix_buffer);
2595 prefix_buffer->length = prefix_length;
2596 }
2597
2598 // operator_loc
2599 {
2600 pm_buffer_concat(output_buffer, prefix_buffer);
2601 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
2602 pm_location_t *location = &cast->operator_loc;
2603 pm_buffer_append_byte(output_buffer, ' ');
2604 prettyprint_location(output_buffer, parser, location);
2605 pm_buffer_append_string(output_buffer, " = \"", 4);
2606 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2607 pm_buffer_append_string(output_buffer, "\"\n", 2);
2608 }
2609
2610 // value
2611 {
2612 pm_buffer_concat(output_buffer, prefix_buffer);
2613 pm_buffer_append_string(output_buffer, "+-- value:", 10);
2614 pm_buffer_append_byte(output_buffer, '\n');
2615
2616 size_t prefix_length = prefix_buffer->length;
2617 pm_buffer_append_string(prefix_buffer, " ", 4);
2618 pm_buffer_concat(output_buffer, prefix_buffer);
2619 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
2620 prefix_buffer->length = prefix_length;
2621 }
2622
2623 break;
2624 }
2625 case PM_CONSTANT_PATH_TARGET_NODE: {
2626 pm_constant_path_target_node_t *cast = (pm_constant_path_target_node_t *) node;
2627 pm_buffer_append_string(output_buffer, "@ ConstantPathTargetNode (location: ", 36);
2628 prettyprint_location(output_buffer, parser, &node->location);
2629 pm_buffer_append_string(output_buffer, ")\n", 2);
2630
2631 // parent
2632 {
2633 pm_buffer_concat(output_buffer, prefix_buffer);
2634 pm_buffer_append_string(output_buffer, "+-- parent:", 11);
2635 if (cast->parent == NULL) {
2636 pm_buffer_append_string(output_buffer, " nil\n", 5);
2637 } else {
2638 pm_buffer_append_byte(output_buffer, '\n');
2639
2640 size_t prefix_length = prefix_buffer->length;
2641 pm_buffer_append_string(prefix_buffer, "| ", 4);
2642 pm_buffer_concat(output_buffer, prefix_buffer);
2643 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->parent, prefix_buffer);
2644 prefix_buffer->length = prefix_length;
2645 }
2646 }
2647
2648 // name
2649 {
2650 pm_buffer_concat(output_buffer, prefix_buffer);
2651 pm_buffer_append_string(output_buffer, "+-- name:", 9);
2652 if (cast->name == 0) {
2653 pm_buffer_append_string(output_buffer, " nil\n", 5);
2654 } else {
2655 pm_buffer_append_byte(output_buffer, ' ');
2656 prettyprint_constant(output_buffer, parser, cast->name);
2657 pm_buffer_append_byte(output_buffer, '\n');
2658 }
2659 }
2660
2661 // delimiter_loc
2662 {
2663 pm_buffer_concat(output_buffer, prefix_buffer);
2664 pm_buffer_append_string(output_buffer, "+-- delimiter_loc:", 18);
2665 pm_location_t *location = &cast->delimiter_loc;
2666 pm_buffer_append_byte(output_buffer, ' ');
2667 prettyprint_location(output_buffer, parser, location);
2668 pm_buffer_append_string(output_buffer, " = \"", 4);
2669 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2670 pm_buffer_append_string(output_buffer, "\"\n", 2);
2671 }
2672
2673 // name_loc
2674 {
2675 pm_buffer_concat(output_buffer, prefix_buffer);
2676 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
2677 pm_location_t *location = &cast->name_loc;
2678 pm_buffer_append_byte(output_buffer, ' ');
2679 prettyprint_location(output_buffer, parser, location);
2680 pm_buffer_append_string(output_buffer, " = \"", 4);
2681 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2682 pm_buffer_append_string(output_buffer, "\"\n", 2);
2683 }
2684
2685 break;
2686 }
2687 case PM_CONSTANT_PATH_WRITE_NODE: {
2688 pm_constant_path_write_node_t *cast = (pm_constant_path_write_node_t *) node;
2689 pm_buffer_append_string(output_buffer, "@ ConstantPathWriteNode (location: ", 35);
2690 prettyprint_location(output_buffer, parser, &node->location);
2691 pm_buffer_append_string(output_buffer, ")\n", 2);
2692
2693 // target
2694 {
2695 pm_buffer_concat(output_buffer, prefix_buffer);
2696 pm_buffer_append_string(output_buffer, "+-- target:", 11);
2697 pm_buffer_append_byte(output_buffer, '\n');
2698
2699 size_t prefix_length = prefix_buffer->length;
2700 pm_buffer_append_string(prefix_buffer, "| ", 4);
2701 pm_buffer_concat(output_buffer, prefix_buffer);
2702 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->target, prefix_buffer);
2703 prefix_buffer->length = prefix_length;
2704 }
2705
2706 // operator_loc
2707 {
2708 pm_buffer_concat(output_buffer, prefix_buffer);
2709 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
2710 pm_location_t *location = &cast->operator_loc;
2711 pm_buffer_append_byte(output_buffer, ' ');
2712 prettyprint_location(output_buffer, parser, location);
2713 pm_buffer_append_string(output_buffer, " = \"", 4);
2714 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2715 pm_buffer_append_string(output_buffer, "\"\n", 2);
2716 }
2717
2718 // value
2719 {
2720 pm_buffer_concat(output_buffer, prefix_buffer);
2721 pm_buffer_append_string(output_buffer, "+-- value:", 10);
2722 pm_buffer_append_byte(output_buffer, '\n');
2723
2724 size_t prefix_length = prefix_buffer->length;
2725 pm_buffer_append_string(prefix_buffer, " ", 4);
2726 pm_buffer_concat(output_buffer, prefix_buffer);
2727 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
2728 prefix_buffer->length = prefix_length;
2729 }
2730
2731 break;
2732 }
2733 case PM_CONSTANT_READ_NODE: {
2734 pm_constant_read_node_t *cast = (pm_constant_read_node_t *) node;
2735 pm_buffer_append_string(output_buffer, "@ ConstantReadNode (location: ", 30);
2736 prettyprint_location(output_buffer, parser, &node->location);
2737 pm_buffer_append_string(output_buffer, ")\n", 2);
2738
2739 // name
2740 {
2741 pm_buffer_concat(output_buffer, prefix_buffer);
2742 pm_buffer_append_string(output_buffer, "+-- name:", 9);
2743 pm_buffer_append_byte(output_buffer, ' ');
2744 prettyprint_constant(output_buffer, parser, cast->name);
2745 pm_buffer_append_byte(output_buffer, '\n');
2746 }
2747
2748 break;
2749 }
2750 case PM_CONSTANT_TARGET_NODE: {
2751 pm_constant_target_node_t *cast = (pm_constant_target_node_t *) node;
2752 pm_buffer_append_string(output_buffer, "@ ConstantTargetNode (location: ", 32);
2753 prettyprint_location(output_buffer, parser, &node->location);
2754 pm_buffer_append_string(output_buffer, ")\n", 2);
2755
2756 // name
2757 {
2758 pm_buffer_concat(output_buffer, prefix_buffer);
2759 pm_buffer_append_string(output_buffer, "+-- name:", 9);
2760 pm_buffer_append_byte(output_buffer, ' ');
2761 prettyprint_constant(output_buffer, parser, cast->name);
2762 pm_buffer_append_byte(output_buffer, '\n');
2763 }
2764
2765 break;
2766 }
2767 case PM_CONSTANT_WRITE_NODE: {
2768 pm_constant_write_node_t *cast = (pm_constant_write_node_t *) node;
2769 pm_buffer_append_string(output_buffer, "@ ConstantWriteNode (location: ", 31);
2770 prettyprint_location(output_buffer, parser, &node->location);
2771 pm_buffer_append_string(output_buffer, ")\n", 2);
2772
2773 // name
2774 {
2775 pm_buffer_concat(output_buffer, prefix_buffer);
2776 pm_buffer_append_string(output_buffer, "+-- name:", 9);
2777 pm_buffer_append_byte(output_buffer, ' ');
2778 prettyprint_constant(output_buffer, parser, cast->name);
2779 pm_buffer_append_byte(output_buffer, '\n');
2780 }
2781
2782 // name_loc
2783 {
2784 pm_buffer_concat(output_buffer, prefix_buffer);
2785 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
2786 pm_location_t *location = &cast->name_loc;
2787 pm_buffer_append_byte(output_buffer, ' ');
2788 prettyprint_location(output_buffer, parser, location);
2789 pm_buffer_append_string(output_buffer, " = \"", 4);
2790 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2791 pm_buffer_append_string(output_buffer, "\"\n", 2);
2792 }
2793
2794 // value
2795 {
2796 pm_buffer_concat(output_buffer, prefix_buffer);
2797 pm_buffer_append_string(output_buffer, "+-- value:", 10);
2798 pm_buffer_append_byte(output_buffer, '\n');
2799
2800 size_t prefix_length = prefix_buffer->length;
2801 pm_buffer_append_string(prefix_buffer, "| ", 4);
2802 pm_buffer_concat(output_buffer, prefix_buffer);
2803 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
2804 prefix_buffer->length = prefix_length;
2805 }
2806
2807 // operator_loc
2808 {
2809 pm_buffer_concat(output_buffer, prefix_buffer);
2810 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
2811 pm_location_t *location = &cast->operator_loc;
2812 pm_buffer_append_byte(output_buffer, ' ');
2813 prettyprint_location(output_buffer, parser, location);
2814 pm_buffer_append_string(output_buffer, " = \"", 4);
2815 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2816 pm_buffer_append_string(output_buffer, "\"\n", 2);
2817 }
2818
2819 break;
2820 }
2821 case PM_DEF_NODE: {
2822 pm_def_node_t *cast = (pm_def_node_t *) node;
2823 pm_buffer_append_string(output_buffer, "@ DefNode (location: ", 21);
2824 prettyprint_location(output_buffer, parser, &node->location);
2825 pm_buffer_append_string(output_buffer, ")\n", 2);
2826
2827 // name
2828 {
2829 pm_buffer_concat(output_buffer, prefix_buffer);
2830 pm_buffer_append_string(output_buffer, "+-- name:", 9);
2831 pm_buffer_append_byte(output_buffer, ' ');
2832 prettyprint_constant(output_buffer, parser, cast->name);
2833 pm_buffer_append_byte(output_buffer, '\n');
2834 }
2835
2836 // name_loc
2837 {
2838 pm_buffer_concat(output_buffer, prefix_buffer);
2839 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
2840 pm_location_t *location = &cast->name_loc;
2841 pm_buffer_append_byte(output_buffer, ' ');
2842 prettyprint_location(output_buffer, parser, location);
2843 pm_buffer_append_string(output_buffer, " = \"", 4);
2844 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2845 pm_buffer_append_string(output_buffer, "\"\n", 2);
2846 }
2847
2848 // receiver
2849 {
2850 pm_buffer_concat(output_buffer, prefix_buffer);
2851 pm_buffer_append_string(output_buffer, "+-- receiver:", 13);
2852 if (cast->receiver == NULL) {
2853 pm_buffer_append_string(output_buffer, " nil\n", 5);
2854 } else {
2855 pm_buffer_append_byte(output_buffer, '\n');
2856
2857 size_t prefix_length = prefix_buffer->length;
2858 pm_buffer_append_string(prefix_buffer, "| ", 4);
2859 pm_buffer_concat(output_buffer, prefix_buffer);
2860 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->receiver, prefix_buffer);
2861 prefix_buffer->length = prefix_length;
2862 }
2863 }
2864
2865 // parameters
2866 {
2867 pm_buffer_concat(output_buffer, prefix_buffer);
2868 pm_buffer_append_string(output_buffer, "+-- parameters:", 15);
2869 if (cast->parameters == NULL) {
2870 pm_buffer_append_string(output_buffer, " nil\n", 5);
2871 } else {
2872 pm_buffer_append_byte(output_buffer, '\n');
2873
2874 size_t prefix_length = prefix_buffer->length;
2875 pm_buffer_append_string(prefix_buffer, "| ", 4);
2876 pm_buffer_concat(output_buffer, prefix_buffer);
2877 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->parameters, prefix_buffer);
2878 prefix_buffer->length = prefix_length;
2879 }
2880 }
2881
2882 // body
2883 {
2884 pm_buffer_concat(output_buffer, prefix_buffer);
2885 pm_buffer_append_string(output_buffer, "+-- body:", 9);
2886 if (cast->body == NULL) {
2887 pm_buffer_append_string(output_buffer, " nil\n", 5);
2888 } else {
2889 pm_buffer_append_byte(output_buffer, '\n');
2890
2891 size_t prefix_length = prefix_buffer->length;
2892 pm_buffer_append_string(prefix_buffer, "| ", 4);
2893 pm_buffer_concat(output_buffer, prefix_buffer);
2894 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->body, prefix_buffer);
2895 prefix_buffer->length = prefix_length;
2896 }
2897 }
2898
2899 // locals
2900 {
2901 pm_buffer_concat(output_buffer, prefix_buffer);
2902 pm_buffer_append_string(output_buffer, "+-- locals:", 11);
2903 pm_buffer_append_string(output_buffer, " [", 2);
2904 for (uint32_t index = 0; index < cast->locals.size; index++) {
2905 if (index != 0) pm_buffer_append_string(output_buffer, ", ", 2);
2906 prettyprint_constant(output_buffer, parser, cast->locals.ids[index]);
2907 }
2908 pm_buffer_append_string(output_buffer, "]\n", 2);
2909 }
2910
2911 // def_keyword_loc
2912 {
2913 pm_buffer_concat(output_buffer, prefix_buffer);
2914 pm_buffer_append_string(output_buffer, "+-- def_keyword_loc:", 20);
2915 pm_location_t *location = &cast->def_keyword_loc;
2916 pm_buffer_append_byte(output_buffer, ' ');
2917 prettyprint_location(output_buffer, parser, location);
2918 pm_buffer_append_string(output_buffer, " = \"", 4);
2919 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2920 pm_buffer_append_string(output_buffer, "\"\n", 2);
2921 }
2922
2923 // operator_loc
2924 {
2925 pm_buffer_concat(output_buffer, prefix_buffer);
2926 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
2927 pm_location_t *location = &cast->operator_loc;
2928 if (location->start == NULL) {
2929 pm_buffer_append_string(output_buffer, " nil\n", 5);
2930 } else {
2931 pm_buffer_append_byte(output_buffer, ' ');
2932 prettyprint_location(output_buffer, parser, location);
2933 pm_buffer_append_string(output_buffer, " = \"", 4);
2934 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2935 pm_buffer_append_string(output_buffer, "\"\n", 2);
2936 }
2937 }
2938
2939 // lparen_loc
2940 {
2941 pm_buffer_concat(output_buffer, prefix_buffer);
2942 pm_buffer_append_string(output_buffer, "+-- lparen_loc:", 15);
2943 pm_location_t *location = &cast->lparen_loc;
2944 if (location->start == NULL) {
2945 pm_buffer_append_string(output_buffer, " nil\n", 5);
2946 } else {
2947 pm_buffer_append_byte(output_buffer, ' ');
2948 prettyprint_location(output_buffer, parser, location);
2949 pm_buffer_append_string(output_buffer, " = \"", 4);
2950 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2951 pm_buffer_append_string(output_buffer, "\"\n", 2);
2952 }
2953 }
2954
2955 // rparen_loc
2956 {
2957 pm_buffer_concat(output_buffer, prefix_buffer);
2958 pm_buffer_append_string(output_buffer, "+-- rparen_loc:", 15);
2959 pm_location_t *location = &cast->rparen_loc;
2960 if (location->start == NULL) {
2961 pm_buffer_append_string(output_buffer, " nil\n", 5);
2962 } else {
2963 pm_buffer_append_byte(output_buffer, ' ');
2964 prettyprint_location(output_buffer, parser, location);
2965 pm_buffer_append_string(output_buffer, " = \"", 4);
2966 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2967 pm_buffer_append_string(output_buffer, "\"\n", 2);
2968 }
2969 }
2970
2971 // equal_loc
2972 {
2973 pm_buffer_concat(output_buffer, prefix_buffer);
2974 pm_buffer_append_string(output_buffer, "+-- equal_loc:", 14);
2975 pm_location_t *location = &cast->equal_loc;
2976 if (location->start == NULL) {
2977 pm_buffer_append_string(output_buffer, " nil\n", 5);
2978 } else {
2979 pm_buffer_append_byte(output_buffer, ' ');
2980 prettyprint_location(output_buffer, parser, location);
2981 pm_buffer_append_string(output_buffer, " = \"", 4);
2982 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2983 pm_buffer_append_string(output_buffer, "\"\n", 2);
2984 }
2985 }
2986
2987 // end_keyword_loc
2988 {
2989 pm_buffer_concat(output_buffer, prefix_buffer);
2990 pm_buffer_append_string(output_buffer, "+-- end_keyword_loc:", 20);
2991 pm_location_t *location = &cast->end_keyword_loc;
2992 if (location->start == NULL) {
2993 pm_buffer_append_string(output_buffer, " nil\n", 5);
2994 } else {
2995 pm_buffer_append_byte(output_buffer, ' ');
2996 prettyprint_location(output_buffer, parser, location);
2997 pm_buffer_append_string(output_buffer, " = \"", 4);
2998 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
2999 pm_buffer_append_string(output_buffer, "\"\n", 2);
3000 }
3001 }
3002
3003 break;
3004 }
3005 case PM_DEFINED_NODE: {
3006 pm_defined_node_t *cast = (pm_defined_node_t *) node;
3007 pm_buffer_append_string(output_buffer, "@ DefinedNode (location: ", 25);
3008 prettyprint_location(output_buffer, parser, &node->location);
3009 pm_buffer_append_string(output_buffer, ")\n", 2);
3010
3011 // lparen_loc
3012 {
3013 pm_buffer_concat(output_buffer, prefix_buffer);
3014 pm_buffer_append_string(output_buffer, "+-- lparen_loc:", 15);
3015 pm_location_t *location = &cast->lparen_loc;
3016 if (location->start == NULL) {
3017 pm_buffer_append_string(output_buffer, " nil\n", 5);
3018 } else {
3019 pm_buffer_append_byte(output_buffer, ' ');
3020 prettyprint_location(output_buffer, parser, location);
3021 pm_buffer_append_string(output_buffer, " = \"", 4);
3022 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3023 pm_buffer_append_string(output_buffer, "\"\n", 2);
3024 }
3025 }
3026
3027 // value
3028 {
3029 pm_buffer_concat(output_buffer, prefix_buffer);
3030 pm_buffer_append_string(output_buffer, "+-- value:", 10);
3031 pm_buffer_append_byte(output_buffer, '\n');
3032
3033 size_t prefix_length = prefix_buffer->length;
3034 pm_buffer_append_string(prefix_buffer, "| ", 4);
3035 pm_buffer_concat(output_buffer, prefix_buffer);
3036 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
3037 prefix_buffer->length = prefix_length;
3038 }
3039
3040 // rparen_loc
3041 {
3042 pm_buffer_concat(output_buffer, prefix_buffer);
3043 pm_buffer_append_string(output_buffer, "+-- rparen_loc:", 15);
3044 pm_location_t *location = &cast->rparen_loc;
3045 if (location->start == NULL) {
3046 pm_buffer_append_string(output_buffer, " nil\n", 5);
3047 } else {
3048 pm_buffer_append_byte(output_buffer, ' ');
3049 prettyprint_location(output_buffer, parser, location);
3050 pm_buffer_append_string(output_buffer, " = \"", 4);
3051 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3052 pm_buffer_append_string(output_buffer, "\"\n", 2);
3053 }
3054 }
3055
3056 // keyword_loc
3057 {
3058 pm_buffer_concat(output_buffer, prefix_buffer);
3059 pm_buffer_append_string(output_buffer, "+-- keyword_loc:", 16);
3060 pm_location_t *location = &cast->keyword_loc;
3061 pm_buffer_append_byte(output_buffer, ' ');
3062 prettyprint_location(output_buffer, parser, location);
3063 pm_buffer_append_string(output_buffer, " = \"", 4);
3064 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3065 pm_buffer_append_string(output_buffer, "\"\n", 2);
3066 }
3067
3068 break;
3069 }
3070 case PM_ELSE_NODE: {
3071 pm_else_node_t *cast = (pm_else_node_t *) node;
3072 pm_buffer_append_string(output_buffer, "@ ElseNode (location: ", 22);
3073 prettyprint_location(output_buffer, parser, &node->location);
3074 pm_buffer_append_string(output_buffer, ")\n", 2);
3075
3076 // else_keyword_loc
3077 {
3078 pm_buffer_concat(output_buffer, prefix_buffer);
3079 pm_buffer_append_string(output_buffer, "+-- else_keyword_loc:", 21);
3080 pm_location_t *location = &cast->else_keyword_loc;
3081 pm_buffer_append_byte(output_buffer, ' ');
3082 prettyprint_location(output_buffer, parser, location);
3083 pm_buffer_append_string(output_buffer, " = \"", 4);
3084 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3085 pm_buffer_append_string(output_buffer, "\"\n", 2);
3086 }
3087
3088 // statements
3089 {
3090 pm_buffer_concat(output_buffer, prefix_buffer);
3091 pm_buffer_append_string(output_buffer, "+-- statements:", 15);
3092 if (cast->statements == NULL) {
3093 pm_buffer_append_string(output_buffer, " nil\n", 5);
3094 } else {
3095 pm_buffer_append_byte(output_buffer, '\n');
3096
3097 size_t prefix_length = prefix_buffer->length;
3098 pm_buffer_append_string(prefix_buffer, "| ", 4);
3099 pm_buffer_concat(output_buffer, prefix_buffer);
3100 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->statements, prefix_buffer);
3101 prefix_buffer->length = prefix_length;
3102 }
3103 }
3104
3105 // end_keyword_loc
3106 {
3107 pm_buffer_concat(output_buffer, prefix_buffer);
3108 pm_buffer_append_string(output_buffer, "+-- end_keyword_loc:", 20);
3109 pm_location_t *location = &cast->end_keyword_loc;
3110 if (location->start == NULL) {
3111 pm_buffer_append_string(output_buffer, " nil\n", 5);
3112 } else {
3113 pm_buffer_append_byte(output_buffer, ' ');
3114 prettyprint_location(output_buffer, parser, location);
3115 pm_buffer_append_string(output_buffer, " = \"", 4);
3116 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3117 pm_buffer_append_string(output_buffer, "\"\n", 2);
3118 }
3119 }
3120
3121 break;
3122 }
3123 case PM_EMBEDDED_STATEMENTS_NODE: {
3124 pm_embedded_statements_node_t *cast = (pm_embedded_statements_node_t *) node;
3125 pm_buffer_append_string(output_buffer, "@ EmbeddedStatementsNode (location: ", 36);
3126 prettyprint_location(output_buffer, parser, &node->location);
3127 pm_buffer_append_string(output_buffer, ")\n", 2);
3128
3129 // opening_loc
3130 {
3131 pm_buffer_concat(output_buffer, prefix_buffer);
3132 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
3133 pm_location_t *location = &cast->opening_loc;
3134 pm_buffer_append_byte(output_buffer, ' ');
3135 prettyprint_location(output_buffer, parser, location);
3136 pm_buffer_append_string(output_buffer, " = \"", 4);
3137 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3138 pm_buffer_append_string(output_buffer, "\"\n", 2);
3139 }
3140
3141 // statements
3142 {
3143 pm_buffer_concat(output_buffer, prefix_buffer);
3144 pm_buffer_append_string(output_buffer, "+-- statements:", 15);
3145 if (cast->statements == NULL) {
3146 pm_buffer_append_string(output_buffer, " nil\n", 5);
3147 } else {
3148 pm_buffer_append_byte(output_buffer, '\n');
3149
3150 size_t prefix_length = prefix_buffer->length;
3151 pm_buffer_append_string(prefix_buffer, "| ", 4);
3152 pm_buffer_concat(output_buffer, prefix_buffer);
3153 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->statements, prefix_buffer);
3154 prefix_buffer->length = prefix_length;
3155 }
3156 }
3157
3158 // closing_loc
3159 {
3160 pm_buffer_concat(output_buffer, prefix_buffer);
3161 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
3162 pm_location_t *location = &cast->closing_loc;
3163 pm_buffer_append_byte(output_buffer, ' ');
3164 prettyprint_location(output_buffer, parser, location);
3165 pm_buffer_append_string(output_buffer, " = \"", 4);
3166 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3167 pm_buffer_append_string(output_buffer, "\"\n", 2);
3168 }
3169
3170 break;
3171 }
3172 case PM_EMBEDDED_VARIABLE_NODE: {
3173 pm_embedded_variable_node_t *cast = (pm_embedded_variable_node_t *) node;
3174 pm_buffer_append_string(output_buffer, "@ EmbeddedVariableNode (location: ", 34);
3175 prettyprint_location(output_buffer, parser, &node->location);
3176 pm_buffer_append_string(output_buffer, ")\n", 2);
3177
3178 // operator_loc
3179 {
3180 pm_buffer_concat(output_buffer, prefix_buffer);
3181 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
3182 pm_location_t *location = &cast->operator_loc;
3183 pm_buffer_append_byte(output_buffer, ' ');
3184 prettyprint_location(output_buffer, parser, location);
3185 pm_buffer_append_string(output_buffer, " = \"", 4);
3186 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3187 pm_buffer_append_string(output_buffer, "\"\n", 2);
3188 }
3189
3190 // variable
3191 {
3192 pm_buffer_concat(output_buffer, prefix_buffer);
3193 pm_buffer_append_string(output_buffer, "+-- variable:", 13);
3194 pm_buffer_append_byte(output_buffer, '\n');
3195
3196 size_t prefix_length = prefix_buffer->length;
3197 pm_buffer_append_string(prefix_buffer, " ", 4);
3198 pm_buffer_concat(output_buffer, prefix_buffer);
3199 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->variable, prefix_buffer);
3200 prefix_buffer->length = prefix_length;
3201 }
3202
3203 break;
3204 }
3205 case PM_ENSURE_NODE: {
3206 pm_ensure_node_t *cast = (pm_ensure_node_t *) node;
3207 pm_buffer_append_string(output_buffer, "@ EnsureNode (location: ", 24);
3208 prettyprint_location(output_buffer, parser, &node->location);
3209 pm_buffer_append_string(output_buffer, ")\n", 2);
3210
3211 // ensure_keyword_loc
3212 {
3213 pm_buffer_concat(output_buffer, prefix_buffer);
3214 pm_buffer_append_string(output_buffer, "+-- ensure_keyword_loc:", 23);
3215 pm_location_t *location = &cast->ensure_keyword_loc;
3216 pm_buffer_append_byte(output_buffer, ' ');
3217 prettyprint_location(output_buffer, parser, location);
3218 pm_buffer_append_string(output_buffer, " = \"", 4);
3219 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3220 pm_buffer_append_string(output_buffer, "\"\n", 2);
3221 }
3222
3223 // statements
3224 {
3225 pm_buffer_concat(output_buffer, prefix_buffer);
3226 pm_buffer_append_string(output_buffer, "+-- statements:", 15);
3227 if (cast->statements == NULL) {
3228 pm_buffer_append_string(output_buffer, " nil\n", 5);
3229 } else {
3230 pm_buffer_append_byte(output_buffer, '\n');
3231
3232 size_t prefix_length = prefix_buffer->length;
3233 pm_buffer_append_string(prefix_buffer, "| ", 4);
3234 pm_buffer_concat(output_buffer, prefix_buffer);
3235 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->statements, prefix_buffer);
3236 prefix_buffer->length = prefix_length;
3237 }
3238 }
3239
3240 // end_keyword_loc
3241 {
3242 pm_buffer_concat(output_buffer, prefix_buffer);
3243 pm_buffer_append_string(output_buffer, "+-- end_keyword_loc:", 20);
3244 pm_location_t *location = &cast->end_keyword_loc;
3245 pm_buffer_append_byte(output_buffer, ' ');
3246 prettyprint_location(output_buffer, parser, location);
3247 pm_buffer_append_string(output_buffer, " = \"", 4);
3248 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3249 pm_buffer_append_string(output_buffer, "\"\n", 2);
3250 }
3251
3252 break;
3253 }
3254 case PM_FALSE_NODE: {
3255 pm_buffer_append_string(output_buffer, "@ FalseNode (location: ", 23);
3256 prettyprint_location(output_buffer, parser, &node->location);
3257 pm_buffer_append_string(output_buffer, ")\n", 2);
3258
3259 break;
3260 }
3261 case PM_FIND_PATTERN_NODE: {
3262 pm_find_pattern_node_t *cast = (pm_find_pattern_node_t *) node;
3263 pm_buffer_append_string(output_buffer, "@ FindPatternNode (location: ", 29);
3264 prettyprint_location(output_buffer, parser, &node->location);
3265 pm_buffer_append_string(output_buffer, ")\n", 2);
3266
3267 // constant
3268 {
3269 pm_buffer_concat(output_buffer, prefix_buffer);
3270 pm_buffer_append_string(output_buffer, "+-- constant:", 13);
3271 if (cast->constant == NULL) {
3272 pm_buffer_append_string(output_buffer, " nil\n", 5);
3273 } else {
3274 pm_buffer_append_byte(output_buffer, '\n');
3275
3276 size_t prefix_length = prefix_buffer->length;
3277 pm_buffer_append_string(prefix_buffer, "| ", 4);
3278 pm_buffer_concat(output_buffer, prefix_buffer);
3279 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->constant, prefix_buffer);
3280 prefix_buffer->length = prefix_length;
3281 }
3282 }
3283
3284 // left
3285 {
3286 pm_buffer_concat(output_buffer, prefix_buffer);
3287 pm_buffer_append_string(output_buffer, "+-- left:", 9);
3288 pm_buffer_append_byte(output_buffer, '\n');
3289
3290 size_t prefix_length = prefix_buffer->length;
3291 pm_buffer_append_string(prefix_buffer, "| ", 4);
3292 pm_buffer_concat(output_buffer, prefix_buffer);
3293 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->left, prefix_buffer);
3294 prefix_buffer->length = prefix_length;
3295 }
3296
3297 // requireds
3298 {
3299 pm_buffer_concat(output_buffer, prefix_buffer);
3300 pm_buffer_append_string(output_buffer, "+-- requireds:", 14);
3301 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->requireds.size));
3302
3303 size_t last_index = cast->requireds.size;
3304 for (uint32_t index = 0; index < last_index; index++) {
3305 size_t prefix_length = prefix_buffer->length;
3306 pm_buffer_append_string(prefix_buffer, "| ", 4);
3307 pm_buffer_concat(output_buffer, prefix_buffer);
3308 pm_buffer_append_string(output_buffer, "+-- ", 4);
3309 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
3310 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->requireds.nodes[index], prefix_buffer);
3311 prefix_buffer->length = prefix_length;
3312 }
3313 }
3314
3315 // right
3316 {
3317 pm_buffer_concat(output_buffer, prefix_buffer);
3318 pm_buffer_append_string(output_buffer, "+-- right:", 10);
3319 pm_buffer_append_byte(output_buffer, '\n');
3320
3321 size_t prefix_length = prefix_buffer->length;
3322 pm_buffer_append_string(prefix_buffer, "| ", 4);
3323 pm_buffer_concat(output_buffer, prefix_buffer);
3324 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->right, prefix_buffer);
3325 prefix_buffer->length = prefix_length;
3326 }
3327
3328 // opening_loc
3329 {
3330 pm_buffer_concat(output_buffer, prefix_buffer);
3331 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
3332 pm_location_t *location = &cast->opening_loc;
3333 if (location->start == NULL) {
3334 pm_buffer_append_string(output_buffer, " nil\n", 5);
3335 } else {
3336 pm_buffer_append_byte(output_buffer, ' ');
3337 prettyprint_location(output_buffer, parser, location);
3338 pm_buffer_append_string(output_buffer, " = \"", 4);
3339 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3340 pm_buffer_append_string(output_buffer, "\"\n", 2);
3341 }
3342 }
3343
3344 // closing_loc
3345 {
3346 pm_buffer_concat(output_buffer, prefix_buffer);
3347 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
3348 pm_location_t *location = &cast->closing_loc;
3349 if (location->start == NULL) {
3350 pm_buffer_append_string(output_buffer, " nil\n", 5);
3351 } else {
3352 pm_buffer_append_byte(output_buffer, ' ');
3353 prettyprint_location(output_buffer, parser, location);
3354 pm_buffer_append_string(output_buffer, " = \"", 4);
3355 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3356 pm_buffer_append_string(output_buffer, "\"\n", 2);
3357 }
3358 }
3359
3360 break;
3361 }
3362 case PM_FLIP_FLOP_NODE: {
3363 pm_flip_flop_node_t *cast = (pm_flip_flop_node_t *) node;
3364 pm_buffer_append_string(output_buffer, "@ FlipFlopNode (location: ", 26);
3365 prettyprint_location(output_buffer, parser, &node->location);
3366 pm_buffer_append_string(output_buffer, ")\n", 2);
3367
3368 // RangeFlags
3369 {
3370 pm_buffer_concat(output_buffer, prefix_buffer);
3371 pm_buffer_append_string(output_buffer, "+-- RangeFlags:", 15);
3372 bool found = false;
3373 if (cast->base.flags & PM_RANGE_FLAGS_EXCLUDE_END) {
3374 if (found) pm_buffer_append_byte(output_buffer, ',');
3375 pm_buffer_append_string(output_buffer, " exclude_end", 12);
3376 found = true;
3377 }
3378 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
3379 pm_buffer_append_byte(output_buffer, '\n');
3380 }
3381
3382 // left
3383 {
3384 pm_buffer_concat(output_buffer, prefix_buffer);
3385 pm_buffer_append_string(output_buffer, "+-- left:", 9);
3386 if (cast->left == NULL) {
3387 pm_buffer_append_string(output_buffer, " nil\n", 5);
3388 } else {
3389 pm_buffer_append_byte(output_buffer, '\n');
3390
3391 size_t prefix_length = prefix_buffer->length;
3392 pm_buffer_append_string(prefix_buffer, "| ", 4);
3393 pm_buffer_concat(output_buffer, prefix_buffer);
3394 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->left, prefix_buffer);
3395 prefix_buffer->length = prefix_length;
3396 }
3397 }
3398
3399 // right
3400 {
3401 pm_buffer_concat(output_buffer, prefix_buffer);
3402 pm_buffer_append_string(output_buffer, "+-- right:", 10);
3403 if (cast->right == NULL) {
3404 pm_buffer_append_string(output_buffer, " nil\n", 5);
3405 } else {
3406 pm_buffer_append_byte(output_buffer, '\n');
3407
3408 size_t prefix_length = prefix_buffer->length;
3409 pm_buffer_append_string(prefix_buffer, "| ", 4);
3410 pm_buffer_concat(output_buffer, prefix_buffer);
3411 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->right, prefix_buffer);
3412 prefix_buffer->length = prefix_length;
3413 }
3414 }
3415
3416 // operator_loc
3417 {
3418 pm_buffer_concat(output_buffer, prefix_buffer);
3419 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
3420 pm_location_t *location = &cast->operator_loc;
3421 pm_buffer_append_byte(output_buffer, ' ');
3422 prettyprint_location(output_buffer, parser, location);
3423 pm_buffer_append_string(output_buffer, " = \"", 4);
3424 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3425 pm_buffer_append_string(output_buffer, "\"\n", 2);
3426 }
3427
3428 break;
3429 }
3430 case PM_FLOAT_NODE: {
3431 pm_float_node_t *cast = (pm_float_node_t *) node;
3432 pm_buffer_append_string(output_buffer, "@ FloatNode (location: ", 23);
3433 prettyprint_location(output_buffer, parser, &node->location);
3434 pm_buffer_append_string(output_buffer, ")\n", 2);
3435
3436 // value
3437 {
3438 pm_buffer_concat(output_buffer, prefix_buffer);
3439 pm_buffer_append_string(output_buffer, "+-- value:", 10);
3440 pm_buffer_append_format(output_buffer, " %f\n", cast->value);
3441 }
3442
3443 break;
3444 }
3445 case PM_FOR_NODE: {
3446 pm_for_node_t *cast = (pm_for_node_t *) node;
3447 pm_buffer_append_string(output_buffer, "@ ForNode (location: ", 21);
3448 prettyprint_location(output_buffer, parser, &node->location);
3449 pm_buffer_append_string(output_buffer, ")\n", 2);
3450
3451 // index
3452 {
3453 pm_buffer_concat(output_buffer, prefix_buffer);
3454 pm_buffer_append_string(output_buffer, "+-- index:", 10);
3455 pm_buffer_append_byte(output_buffer, '\n');
3456
3457 size_t prefix_length = prefix_buffer->length;
3458 pm_buffer_append_string(prefix_buffer, "| ", 4);
3459 pm_buffer_concat(output_buffer, prefix_buffer);
3460 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->index, prefix_buffer);
3461 prefix_buffer->length = prefix_length;
3462 }
3463
3464 // collection
3465 {
3466 pm_buffer_concat(output_buffer, prefix_buffer);
3467 pm_buffer_append_string(output_buffer, "+-- collection:", 15);
3468 pm_buffer_append_byte(output_buffer, '\n');
3469
3470 size_t prefix_length = prefix_buffer->length;
3471 pm_buffer_append_string(prefix_buffer, "| ", 4);
3472 pm_buffer_concat(output_buffer, prefix_buffer);
3473 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->collection, prefix_buffer);
3474 prefix_buffer->length = prefix_length;
3475 }
3476
3477 // statements
3478 {
3479 pm_buffer_concat(output_buffer, prefix_buffer);
3480 pm_buffer_append_string(output_buffer, "+-- statements:", 15);
3481 if (cast->statements == NULL) {
3482 pm_buffer_append_string(output_buffer, " nil\n", 5);
3483 } else {
3484 pm_buffer_append_byte(output_buffer, '\n');
3485
3486 size_t prefix_length = prefix_buffer->length;
3487 pm_buffer_append_string(prefix_buffer, "| ", 4);
3488 pm_buffer_concat(output_buffer, prefix_buffer);
3489 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->statements, prefix_buffer);
3490 prefix_buffer->length = prefix_length;
3491 }
3492 }
3493
3494 // for_keyword_loc
3495 {
3496 pm_buffer_concat(output_buffer, prefix_buffer);
3497 pm_buffer_append_string(output_buffer, "+-- for_keyword_loc:", 20);
3498 pm_location_t *location = &cast->for_keyword_loc;
3499 pm_buffer_append_byte(output_buffer, ' ');
3500 prettyprint_location(output_buffer, parser, location);
3501 pm_buffer_append_string(output_buffer, " = \"", 4);
3502 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3503 pm_buffer_append_string(output_buffer, "\"\n", 2);
3504 }
3505
3506 // in_keyword_loc
3507 {
3508 pm_buffer_concat(output_buffer, prefix_buffer);
3509 pm_buffer_append_string(output_buffer, "+-- in_keyword_loc:", 19);
3510 pm_location_t *location = &cast->in_keyword_loc;
3511 pm_buffer_append_byte(output_buffer, ' ');
3512 prettyprint_location(output_buffer, parser, location);
3513 pm_buffer_append_string(output_buffer, " = \"", 4);
3514 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3515 pm_buffer_append_string(output_buffer, "\"\n", 2);
3516 }
3517
3518 // do_keyword_loc
3519 {
3520 pm_buffer_concat(output_buffer, prefix_buffer);
3521 pm_buffer_append_string(output_buffer, "+-- do_keyword_loc:", 19);
3522 pm_location_t *location = &cast->do_keyword_loc;
3523 if (location->start == NULL) {
3524 pm_buffer_append_string(output_buffer, " nil\n", 5);
3525 } else {
3526 pm_buffer_append_byte(output_buffer, ' ');
3527 prettyprint_location(output_buffer, parser, location);
3528 pm_buffer_append_string(output_buffer, " = \"", 4);
3529 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3530 pm_buffer_append_string(output_buffer, "\"\n", 2);
3531 }
3532 }
3533
3534 // end_keyword_loc
3535 {
3536 pm_buffer_concat(output_buffer, prefix_buffer);
3537 pm_buffer_append_string(output_buffer, "+-- end_keyword_loc:", 20);
3538 pm_location_t *location = &cast->end_keyword_loc;
3539 pm_buffer_append_byte(output_buffer, ' ');
3540 prettyprint_location(output_buffer, parser, location);
3541 pm_buffer_append_string(output_buffer, " = \"", 4);
3542 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3543 pm_buffer_append_string(output_buffer, "\"\n", 2);
3544 }
3545
3546 break;
3547 }
3548 case PM_FORWARDING_ARGUMENTS_NODE: {
3549 pm_buffer_append_string(output_buffer, "@ ForwardingArgumentsNode (location: ", 37);
3550 prettyprint_location(output_buffer, parser, &node->location);
3551 pm_buffer_append_string(output_buffer, ")\n", 2);
3552
3553 break;
3554 }
3555 case PM_FORWARDING_PARAMETER_NODE: {
3556 pm_buffer_append_string(output_buffer, "@ ForwardingParameterNode (location: ", 37);
3557 prettyprint_location(output_buffer, parser, &node->location);
3558 pm_buffer_append_string(output_buffer, ")\n", 2);
3559
3560 break;
3561 }
3562 case PM_FORWARDING_SUPER_NODE: {
3563 pm_forwarding_super_node_t *cast = (pm_forwarding_super_node_t *) node;
3564 pm_buffer_append_string(output_buffer, "@ ForwardingSuperNode (location: ", 33);
3565 prettyprint_location(output_buffer, parser, &node->location);
3566 pm_buffer_append_string(output_buffer, ")\n", 2);
3567
3568 // block
3569 {
3570 pm_buffer_concat(output_buffer, prefix_buffer);
3571 pm_buffer_append_string(output_buffer, "+-- block:", 10);
3572 if (cast->block == NULL) {
3573 pm_buffer_append_string(output_buffer, " nil\n", 5);
3574 } else {
3575 pm_buffer_append_byte(output_buffer, '\n');
3576
3577 size_t prefix_length = prefix_buffer->length;
3578 pm_buffer_append_string(prefix_buffer, " ", 4);
3579 pm_buffer_concat(output_buffer, prefix_buffer);
3580 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->block, prefix_buffer);
3581 prefix_buffer->length = prefix_length;
3582 }
3583 }
3584
3585 break;
3586 }
3587 case PM_GLOBAL_VARIABLE_AND_WRITE_NODE: {
3588 pm_global_variable_and_write_node_t *cast = (pm_global_variable_and_write_node_t *) node;
3589 pm_buffer_append_string(output_buffer, "@ GlobalVariableAndWriteNode (location: ", 40);
3590 prettyprint_location(output_buffer, parser, &node->location);
3591 pm_buffer_append_string(output_buffer, ")\n", 2);
3592
3593 // name
3594 {
3595 pm_buffer_concat(output_buffer, prefix_buffer);
3596 pm_buffer_append_string(output_buffer, "+-- name:", 9);
3597 pm_buffer_append_byte(output_buffer, ' ');
3598 prettyprint_constant(output_buffer, parser, cast->name);
3599 pm_buffer_append_byte(output_buffer, '\n');
3600 }
3601
3602 // name_loc
3603 {
3604 pm_buffer_concat(output_buffer, prefix_buffer);
3605 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
3606 pm_location_t *location = &cast->name_loc;
3607 pm_buffer_append_byte(output_buffer, ' ');
3608 prettyprint_location(output_buffer, parser, location);
3609 pm_buffer_append_string(output_buffer, " = \"", 4);
3610 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3611 pm_buffer_append_string(output_buffer, "\"\n", 2);
3612 }
3613
3614 // operator_loc
3615 {
3616 pm_buffer_concat(output_buffer, prefix_buffer);
3617 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
3618 pm_location_t *location = &cast->operator_loc;
3619 pm_buffer_append_byte(output_buffer, ' ');
3620 prettyprint_location(output_buffer, parser, location);
3621 pm_buffer_append_string(output_buffer, " = \"", 4);
3622 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3623 pm_buffer_append_string(output_buffer, "\"\n", 2);
3624 }
3625
3626 // value
3627 {
3628 pm_buffer_concat(output_buffer, prefix_buffer);
3629 pm_buffer_append_string(output_buffer, "+-- value:", 10);
3630 pm_buffer_append_byte(output_buffer, '\n');
3631
3632 size_t prefix_length = prefix_buffer->length;
3633 pm_buffer_append_string(prefix_buffer, " ", 4);
3634 pm_buffer_concat(output_buffer, prefix_buffer);
3635 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
3636 prefix_buffer->length = prefix_length;
3637 }
3638
3639 break;
3640 }
3641 case PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
3642 pm_global_variable_operator_write_node_t *cast = (pm_global_variable_operator_write_node_t *) node;
3643 pm_buffer_append_string(output_buffer, "@ GlobalVariableOperatorWriteNode (location: ", 45);
3644 prettyprint_location(output_buffer, parser, &node->location);
3645 pm_buffer_append_string(output_buffer, ")\n", 2);
3646
3647 // name
3648 {
3649 pm_buffer_concat(output_buffer, prefix_buffer);
3650 pm_buffer_append_string(output_buffer, "+-- name:", 9);
3651 pm_buffer_append_byte(output_buffer, ' ');
3652 prettyprint_constant(output_buffer, parser, cast->name);
3653 pm_buffer_append_byte(output_buffer, '\n');
3654 }
3655
3656 // name_loc
3657 {
3658 pm_buffer_concat(output_buffer, prefix_buffer);
3659 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
3660 pm_location_t *location = &cast->name_loc;
3661 pm_buffer_append_byte(output_buffer, ' ');
3662 prettyprint_location(output_buffer, parser, location);
3663 pm_buffer_append_string(output_buffer, " = \"", 4);
3664 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3665 pm_buffer_append_string(output_buffer, "\"\n", 2);
3666 }
3667
3668 // binary_operator_loc
3669 {
3670 pm_buffer_concat(output_buffer, prefix_buffer);
3671 pm_buffer_append_string(output_buffer, "+-- binary_operator_loc:", 24);
3672 pm_location_t *location = &cast->binary_operator_loc;
3673 pm_buffer_append_byte(output_buffer, ' ');
3674 prettyprint_location(output_buffer, parser, location);
3675 pm_buffer_append_string(output_buffer, " = \"", 4);
3676 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3677 pm_buffer_append_string(output_buffer, "\"\n", 2);
3678 }
3679
3680 // value
3681 {
3682 pm_buffer_concat(output_buffer, prefix_buffer);
3683 pm_buffer_append_string(output_buffer, "+-- value:", 10);
3684 pm_buffer_append_byte(output_buffer, '\n');
3685
3686 size_t prefix_length = prefix_buffer->length;
3687 pm_buffer_append_string(prefix_buffer, "| ", 4);
3688 pm_buffer_concat(output_buffer, prefix_buffer);
3689 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
3690 prefix_buffer->length = prefix_length;
3691 }
3692
3693 // binary_operator
3694 {
3695 pm_buffer_concat(output_buffer, prefix_buffer);
3696 pm_buffer_append_string(output_buffer, "+-- binary_operator:", 20);
3697 pm_buffer_append_byte(output_buffer, ' ');
3698 prettyprint_constant(output_buffer, parser, cast->binary_operator);
3699 pm_buffer_append_byte(output_buffer, '\n');
3700 }
3701
3702 break;
3703 }
3704 case PM_GLOBAL_VARIABLE_OR_WRITE_NODE: {
3705 pm_global_variable_or_write_node_t *cast = (pm_global_variable_or_write_node_t *) node;
3706 pm_buffer_append_string(output_buffer, "@ GlobalVariableOrWriteNode (location: ", 39);
3707 prettyprint_location(output_buffer, parser, &node->location);
3708 pm_buffer_append_string(output_buffer, ")\n", 2);
3709
3710 // name
3711 {
3712 pm_buffer_concat(output_buffer, prefix_buffer);
3713 pm_buffer_append_string(output_buffer, "+-- name:", 9);
3714 pm_buffer_append_byte(output_buffer, ' ');
3715 prettyprint_constant(output_buffer, parser, cast->name);
3716 pm_buffer_append_byte(output_buffer, '\n');
3717 }
3718
3719 // name_loc
3720 {
3721 pm_buffer_concat(output_buffer, prefix_buffer);
3722 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
3723 pm_location_t *location = &cast->name_loc;
3724 pm_buffer_append_byte(output_buffer, ' ');
3725 prettyprint_location(output_buffer, parser, location);
3726 pm_buffer_append_string(output_buffer, " = \"", 4);
3727 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3728 pm_buffer_append_string(output_buffer, "\"\n", 2);
3729 }
3730
3731 // operator_loc
3732 {
3733 pm_buffer_concat(output_buffer, prefix_buffer);
3734 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
3735 pm_location_t *location = &cast->operator_loc;
3736 pm_buffer_append_byte(output_buffer, ' ');
3737 prettyprint_location(output_buffer, parser, location);
3738 pm_buffer_append_string(output_buffer, " = \"", 4);
3739 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3740 pm_buffer_append_string(output_buffer, "\"\n", 2);
3741 }
3742
3743 // value
3744 {
3745 pm_buffer_concat(output_buffer, prefix_buffer);
3746 pm_buffer_append_string(output_buffer, "+-- value:", 10);
3747 pm_buffer_append_byte(output_buffer, '\n');
3748
3749 size_t prefix_length = prefix_buffer->length;
3750 pm_buffer_append_string(prefix_buffer, " ", 4);
3751 pm_buffer_concat(output_buffer, prefix_buffer);
3752 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
3753 prefix_buffer->length = prefix_length;
3754 }
3755
3756 break;
3757 }
3758 case PM_GLOBAL_VARIABLE_READ_NODE: {
3759 pm_global_variable_read_node_t *cast = (pm_global_variable_read_node_t *) node;
3760 pm_buffer_append_string(output_buffer, "@ GlobalVariableReadNode (location: ", 36);
3761 prettyprint_location(output_buffer, parser, &node->location);
3762 pm_buffer_append_string(output_buffer, ")\n", 2);
3763
3764 // name
3765 {
3766 pm_buffer_concat(output_buffer, prefix_buffer);
3767 pm_buffer_append_string(output_buffer, "+-- name:", 9);
3768 pm_buffer_append_byte(output_buffer, ' ');
3769 prettyprint_constant(output_buffer, parser, cast->name);
3770 pm_buffer_append_byte(output_buffer, '\n');
3771 }
3772
3773 break;
3774 }
3775 case PM_GLOBAL_VARIABLE_TARGET_NODE: {
3776 pm_global_variable_target_node_t *cast = (pm_global_variable_target_node_t *) node;
3777 pm_buffer_append_string(output_buffer, "@ GlobalVariableTargetNode (location: ", 38);
3778 prettyprint_location(output_buffer, parser, &node->location);
3779 pm_buffer_append_string(output_buffer, ")\n", 2);
3780
3781 // name
3782 {
3783 pm_buffer_concat(output_buffer, prefix_buffer);
3784 pm_buffer_append_string(output_buffer, "+-- name:", 9);
3785 pm_buffer_append_byte(output_buffer, ' ');
3786 prettyprint_constant(output_buffer, parser, cast->name);
3787 pm_buffer_append_byte(output_buffer, '\n');
3788 }
3789
3790 break;
3791 }
3792 case PM_GLOBAL_VARIABLE_WRITE_NODE: {
3793 pm_global_variable_write_node_t *cast = (pm_global_variable_write_node_t *) node;
3794 pm_buffer_append_string(output_buffer, "@ GlobalVariableWriteNode (location: ", 37);
3795 prettyprint_location(output_buffer, parser, &node->location);
3796 pm_buffer_append_string(output_buffer, ")\n", 2);
3797
3798 // name
3799 {
3800 pm_buffer_concat(output_buffer, prefix_buffer);
3801 pm_buffer_append_string(output_buffer, "+-- name:", 9);
3802 pm_buffer_append_byte(output_buffer, ' ');
3803 prettyprint_constant(output_buffer, parser, cast->name);
3804 pm_buffer_append_byte(output_buffer, '\n');
3805 }
3806
3807 // name_loc
3808 {
3809 pm_buffer_concat(output_buffer, prefix_buffer);
3810 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
3811 pm_location_t *location = &cast->name_loc;
3812 pm_buffer_append_byte(output_buffer, ' ');
3813 prettyprint_location(output_buffer, parser, location);
3814 pm_buffer_append_string(output_buffer, " = \"", 4);
3815 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3816 pm_buffer_append_string(output_buffer, "\"\n", 2);
3817 }
3818
3819 // value
3820 {
3821 pm_buffer_concat(output_buffer, prefix_buffer);
3822 pm_buffer_append_string(output_buffer, "+-- value:", 10);
3823 pm_buffer_append_byte(output_buffer, '\n');
3824
3825 size_t prefix_length = prefix_buffer->length;
3826 pm_buffer_append_string(prefix_buffer, "| ", 4);
3827 pm_buffer_concat(output_buffer, prefix_buffer);
3828 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
3829 prefix_buffer->length = prefix_length;
3830 }
3831
3832 // operator_loc
3833 {
3834 pm_buffer_concat(output_buffer, prefix_buffer);
3835 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
3836 pm_location_t *location = &cast->operator_loc;
3837 pm_buffer_append_byte(output_buffer, ' ');
3838 prettyprint_location(output_buffer, parser, location);
3839 pm_buffer_append_string(output_buffer, " = \"", 4);
3840 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3841 pm_buffer_append_string(output_buffer, "\"\n", 2);
3842 }
3843
3844 break;
3845 }
3846 case PM_HASH_NODE: {
3847 pm_hash_node_t *cast = (pm_hash_node_t *) node;
3848 pm_buffer_append_string(output_buffer, "@ HashNode (location: ", 22);
3849 prettyprint_location(output_buffer, parser, &node->location);
3850 pm_buffer_append_string(output_buffer, ")\n", 2);
3851
3852 // opening_loc
3853 {
3854 pm_buffer_concat(output_buffer, prefix_buffer);
3855 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
3856 pm_location_t *location = &cast->opening_loc;
3857 pm_buffer_append_byte(output_buffer, ' ');
3858 prettyprint_location(output_buffer, parser, location);
3859 pm_buffer_append_string(output_buffer, " = \"", 4);
3860 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3861 pm_buffer_append_string(output_buffer, "\"\n", 2);
3862 }
3863
3864 // elements
3865 {
3866 pm_buffer_concat(output_buffer, prefix_buffer);
3867 pm_buffer_append_string(output_buffer, "+-- elements:", 13);
3868 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->elements.size));
3869
3870 size_t last_index = cast->elements.size;
3871 for (uint32_t index = 0; index < last_index; index++) {
3872 size_t prefix_length = prefix_buffer->length;
3873 pm_buffer_append_string(prefix_buffer, "| ", 4);
3874 pm_buffer_concat(output_buffer, prefix_buffer);
3875 pm_buffer_append_string(output_buffer, "+-- ", 4);
3876 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
3877 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->elements.nodes[index], prefix_buffer);
3878 prefix_buffer->length = prefix_length;
3879 }
3880 }
3881
3882 // closing_loc
3883 {
3884 pm_buffer_concat(output_buffer, prefix_buffer);
3885 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
3886 pm_location_t *location = &cast->closing_loc;
3887 pm_buffer_append_byte(output_buffer, ' ');
3888 prettyprint_location(output_buffer, parser, location);
3889 pm_buffer_append_string(output_buffer, " = \"", 4);
3890 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3891 pm_buffer_append_string(output_buffer, "\"\n", 2);
3892 }
3893
3894 break;
3895 }
3896 case PM_HASH_PATTERN_NODE: {
3897 pm_hash_pattern_node_t *cast = (pm_hash_pattern_node_t *) node;
3898 pm_buffer_append_string(output_buffer, "@ HashPatternNode (location: ", 29);
3899 prettyprint_location(output_buffer, parser, &node->location);
3900 pm_buffer_append_string(output_buffer, ")\n", 2);
3901
3902 // constant
3903 {
3904 pm_buffer_concat(output_buffer, prefix_buffer);
3905 pm_buffer_append_string(output_buffer, "+-- constant:", 13);
3906 if (cast->constant == NULL) {
3907 pm_buffer_append_string(output_buffer, " nil\n", 5);
3908 } else {
3909 pm_buffer_append_byte(output_buffer, '\n');
3910
3911 size_t prefix_length = prefix_buffer->length;
3912 pm_buffer_append_string(prefix_buffer, "| ", 4);
3913 pm_buffer_concat(output_buffer, prefix_buffer);
3914 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->constant, prefix_buffer);
3915 prefix_buffer->length = prefix_length;
3916 }
3917 }
3918
3919 // elements
3920 {
3921 pm_buffer_concat(output_buffer, prefix_buffer);
3922 pm_buffer_append_string(output_buffer, "+-- elements:", 13);
3923 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->elements.size));
3924
3925 size_t last_index = cast->elements.size;
3926 for (uint32_t index = 0; index < last_index; index++) {
3927 size_t prefix_length = prefix_buffer->length;
3928 pm_buffer_append_string(prefix_buffer, "| ", 4);
3929 pm_buffer_concat(output_buffer, prefix_buffer);
3930 pm_buffer_append_string(output_buffer, "+-- ", 4);
3931 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
3932 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->elements.nodes[index], prefix_buffer);
3933 prefix_buffer->length = prefix_length;
3934 }
3935 }
3936
3937 // rest
3938 {
3939 pm_buffer_concat(output_buffer, prefix_buffer);
3940 pm_buffer_append_string(output_buffer, "+-- rest:", 9);
3941 if (cast->rest == NULL) {
3942 pm_buffer_append_string(output_buffer, " nil\n", 5);
3943 } else {
3944 pm_buffer_append_byte(output_buffer, '\n');
3945
3946 size_t prefix_length = prefix_buffer->length;
3947 pm_buffer_append_string(prefix_buffer, "| ", 4);
3948 pm_buffer_concat(output_buffer, prefix_buffer);
3949 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->rest, prefix_buffer);
3950 prefix_buffer->length = prefix_length;
3951 }
3952 }
3953
3954 // opening_loc
3955 {
3956 pm_buffer_concat(output_buffer, prefix_buffer);
3957 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
3958 pm_location_t *location = &cast->opening_loc;
3959 if (location->start == NULL) {
3960 pm_buffer_append_string(output_buffer, " nil\n", 5);
3961 } else {
3962 pm_buffer_append_byte(output_buffer, ' ');
3963 prettyprint_location(output_buffer, parser, location);
3964 pm_buffer_append_string(output_buffer, " = \"", 4);
3965 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3966 pm_buffer_append_string(output_buffer, "\"\n", 2);
3967 }
3968 }
3969
3970 // closing_loc
3971 {
3972 pm_buffer_concat(output_buffer, prefix_buffer);
3973 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
3974 pm_location_t *location = &cast->closing_loc;
3975 if (location->start == NULL) {
3976 pm_buffer_append_string(output_buffer, " nil\n", 5);
3977 } else {
3978 pm_buffer_append_byte(output_buffer, ' ');
3979 prettyprint_location(output_buffer, parser, location);
3980 pm_buffer_append_string(output_buffer, " = \"", 4);
3981 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
3982 pm_buffer_append_string(output_buffer, "\"\n", 2);
3983 }
3984 }
3985
3986 break;
3987 }
3988 case PM_IF_NODE: {
3989 pm_if_node_t *cast = (pm_if_node_t *) node;
3990 pm_buffer_append_string(output_buffer, "@ IfNode (location: ", 20);
3991 prettyprint_location(output_buffer, parser, &node->location);
3992 pm_buffer_append_string(output_buffer, ")\n", 2);
3993
3994 // if_keyword_loc
3995 {
3996 pm_buffer_concat(output_buffer, prefix_buffer);
3997 pm_buffer_append_string(output_buffer, "+-- if_keyword_loc:", 19);
3998 pm_location_t *location = &cast->if_keyword_loc;
3999 if (location->start == NULL) {
4000 pm_buffer_append_string(output_buffer, " nil\n", 5);
4001 } else {
4002 pm_buffer_append_byte(output_buffer, ' ');
4003 prettyprint_location(output_buffer, parser, location);
4004 pm_buffer_append_string(output_buffer, " = \"", 4);
4005 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4006 pm_buffer_append_string(output_buffer, "\"\n", 2);
4007 }
4008 }
4009
4010 // predicate
4011 {
4012 pm_buffer_concat(output_buffer, prefix_buffer);
4013 pm_buffer_append_string(output_buffer, "+-- predicate:", 14);
4014 pm_buffer_append_byte(output_buffer, '\n');
4015
4016 size_t prefix_length = prefix_buffer->length;
4017 pm_buffer_append_string(prefix_buffer, "| ", 4);
4018 pm_buffer_concat(output_buffer, prefix_buffer);
4019 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->predicate, prefix_buffer);
4020 prefix_buffer->length = prefix_length;
4021 }
4022
4023 // then_keyword_loc
4024 {
4025 pm_buffer_concat(output_buffer, prefix_buffer);
4026 pm_buffer_append_string(output_buffer, "+-- then_keyword_loc:", 21);
4027 pm_location_t *location = &cast->then_keyword_loc;
4028 if (location->start == NULL) {
4029 pm_buffer_append_string(output_buffer, " nil\n", 5);
4030 } else {
4031 pm_buffer_append_byte(output_buffer, ' ');
4032 prettyprint_location(output_buffer, parser, location);
4033 pm_buffer_append_string(output_buffer, " = \"", 4);
4034 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4035 pm_buffer_append_string(output_buffer, "\"\n", 2);
4036 }
4037 }
4038
4039 // statements
4040 {
4041 pm_buffer_concat(output_buffer, prefix_buffer);
4042 pm_buffer_append_string(output_buffer, "+-- statements:", 15);
4043 if (cast->statements == NULL) {
4044 pm_buffer_append_string(output_buffer, " nil\n", 5);
4045 } else {
4046 pm_buffer_append_byte(output_buffer, '\n');
4047
4048 size_t prefix_length = prefix_buffer->length;
4049 pm_buffer_append_string(prefix_buffer, "| ", 4);
4050 pm_buffer_concat(output_buffer, prefix_buffer);
4051 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->statements, prefix_buffer);
4052 prefix_buffer->length = prefix_length;
4053 }
4054 }
4055
4056 // subsequent
4057 {
4058 pm_buffer_concat(output_buffer, prefix_buffer);
4059 pm_buffer_append_string(output_buffer, "+-- subsequent:", 15);
4060 if (cast->subsequent == NULL) {
4061 pm_buffer_append_string(output_buffer, " nil\n", 5);
4062 } else {
4063 pm_buffer_append_byte(output_buffer, '\n');
4064
4065 size_t prefix_length = prefix_buffer->length;
4066 pm_buffer_append_string(prefix_buffer, "| ", 4);
4067 pm_buffer_concat(output_buffer, prefix_buffer);
4068 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->subsequent, prefix_buffer);
4069 prefix_buffer->length = prefix_length;
4070 }
4071 }
4072
4073 // end_keyword_loc
4074 {
4075 pm_buffer_concat(output_buffer, prefix_buffer);
4076 pm_buffer_append_string(output_buffer, "+-- end_keyword_loc:", 20);
4077 pm_location_t *location = &cast->end_keyword_loc;
4078 if (location->start == NULL) {
4079 pm_buffer_append_string(output_buffer, " nil\n", 5);
4080 } else {
4081 pm_buffer_append_byte(output_buffer, ' ');
4082 prettyprint_location(output_buffer, parser, location);
4083 pm_buffer_append_string(output_buffer, " = \"", 4);
4084 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4085 pm_buffer_append_string(output_buffer, "\"\n", 2);
4086 }
4087 }
4088
4089 break;
4090 }
4091 case PM_IMAGINARY_NODE: {
4092 pm_imaginary_node_t *cast = (pm_imaginary_node_t *) node;
4093 pm_buffer_append_string(output_buffer, "@ ImaginaryNode (location: ", 27);
4094 prettyprint_location(output_buffer, parser, &node->location);
4095 pm_buffer_append_string(output_buffer, ")\n", 2);
4096
4097 // numeric
4098 {
4099 pm_buffer_concat(output_buffer, prefix_buffer);
4100 pm_buffer_append_string(output_buffer, "+-- numeric:", 12);
4101 pm_buffer_append_byte(output_buffer, '\n');
4102
4103 size_t prefix_length = prefix_buffer->length;
4104 pm_buffer_append_string(prefix_buffer, " ", 4);
4105 pm_buffer_concat(output_buffer, prefix_buffer);
4106 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->numeric, prefix_buffer);
4107 prefix_buffer->length = prefix_length;
4108 }
4109
4110 break;
4111 }
4112 case PM_IMPLICIT_NODE: {
4113 pm_implicit_node_t *cast = (pm_implicit_node_t *) node;
4114 pm_buffer_append_string(output_buffer, "@ ImplicitNode (location: ", 26);
4115 prettyprint_location(output_buffer, parser, &node->location);
4116 pm_buffer_append_string(output_buffer, ")\n", 2);
4117
4118 // value
4119 {
4120 pm_buffer_concat(output_buffer, prefix_buffer);
4121 pm_buffer_append_string(output_buffer, "+-- value:", 10);
4122 pm_buffer_append_byte(output_buffer, '\n');
4123
4124 size_t prefix_length = prefix_buffer->length;
4125 pm_buffer_append_string(prefix_buffer, " ", 4);
4126 pm_buffer_concat(output_buffer, prefix_buffer);
4127 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
4128 prefix_buffer->length = prefix_length;
4129 }
4130
4131 break;
4132 }
4133 case PM_IMPLICIT_REST_NODE: {
4134 pm_buffer_append_string(output_buffer, "@ ImplicitRestNode (location: ", 30);
4135 prettyprint_location(output_buffer, parser, &node->location);
4136 pm_buffer_append_string(output_buffer, ")\n", 2);
4137
4138 break;
4139 }
4140 case PM_IN_NODE: {
4141 pm_in_node_t *cast = (pm_in_node_t *) node;
4142 pm_buffer_append_string(output_buffer, "@ InNode (location: ", 20);
4143 prettyprint_location(output_buffer, parser, &node->location);
4144 pm_buffer_append_string(output_buffer, ")\n", 2);
4145
4146 // pattern
4147 {
4148 pm_buffer_concat(output_buffer, prefix_buffer);
4149 pm_buffer_append_string(output_buffer, "+-- pattern:", 12);
4150 pm_buffer_append_byte(output_buffer, '\n');
4151
4152 size_t prefix_length = prefix_buffer->length;
4153 pm_buffer_append_string(prefix_buffer, "| ", 4);
4154 pm_buffer_concat(output_buffer, prefix_buffer);
4155 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->pattern, prefix_buffer);
4156 prefix_buffer->length = prefix_length;
4157 }
4158
4159 // statements
4160 {
4161 pm_buffer_concat(output_buffer, prefix_buffer);
4162 pm_buffer_append_string(output_buffer, "+-- statements:", 15);
4163 if (cast->statements == NULL) {
4164 pm_buffer_append_string(output_buffer, " nil\n", 5);
4165 } else {
4166 pm_buffer_append_byte(output_buffer, '\n');
4167
4168 size_t prefix_length = prefix_buffer->length;
4169 pm_buffer_append_string(prefix_buffer, "| ", 4);
4170 pm_buffer_concat(output_buffer, prefix_buffer);
4171 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->statements, prefix_buffer);
4172 prefix_buffer->length = prefix_length;
4173 }
4174 }
4175
4176 // in_loc
4177 {
4178 pm_buffer_concat(output_buffer, prefix_buffer);
4179 pm_buffer_append_string(output_buffer, "+-- in_loc:", 11);
4180 pm_location_t *location = &cast->in_loc;
4181 pm_buffer_append_byte(output_buffer, ' ');
4182 prettyprint_location(output_buffer, parser, location);
4183 pm_buffer_append_string(output_buffer, " = \"", 4);
4184 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4185 pm_buffer_append_string(output_buffer, "\"\n", 2);
4186 }
4187
4188 // then_loc
4189 {
4190 pm_buffer_concat(output_buffer, prefix_buffer);
4191 pm_buffer_append_string(output_buffer, "+-- then_loc:", 13);
4192 pm_location_t *location = &cast->then_loc;
4193 if (location->start == NULL) {
4194 pm_buffer_append_string(output_buffer, " nil\n", 5);
4195 } else {
4196 pm_buffer_append_byte(output_buffer, ' ');
4197 prettyprint_location(output_buffer, parser, location);
4198 pm_buffer_append_string(output_buffer, " = \"", 4);
4199 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4200 pm_buffer_append_string(output_buffer, "\"\n", 2);
4201 }
4202 }
4203
4204 break;
4205 }
4206 case PM_INDEX_AND_WRITE_NODE: {
4207 pm_index_and_write_node_t *cast = (pm_index_and_write_node_t *) node;
4208 pm_buffer_append_string(output_buffer, "@ IndexAndWriteNode (location: ", 31);
4209 prettyprint_location(output_buffer, parser, &node->location);
4210 pm_buffer_append_string(output_buffer, ")\n", 2);
4211
4212 // CallNodeFlags
4213 {
4214 pm_buffer_concat(output_buffer, prefix_buffer);
4215 pm_buffer_append_string(output_buffer, "+-- CallNodeFlags:", 18);
4216 bool found = false;
4217 if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
4218 if (found) pm_buffer_append_byte(output_buffer, ',');
4219 pm_buffer_append_string(output_buffer, " safe_navigation", 16);
4220 found = true;
4221 }
4222 if (cast->base.flags & PM_CALL_NODE_FLAGS_VARIABLE_CALL) {
4223 if (found) pm_buffer_append_byte(output_buffer, ',');
4224 pm_buffer_append_string(output_buffer, " variable_call", 14);
4225 found = true;
4226 }
4227 if (cast->base.flags & PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE) {
4228 if (found) pm_buffer_append_byte(output_buffer, ',');
4229 pm_buffer_append_string(output_buffer, " attribute_write", 16);
4230 found = true;
4231 }
4232 if (cast->base.flags & PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY) {
4233 if (found) pm_buffer_append_byte(output_buffer, ',');
4234 pm_buffer_append_string(output_buffer, " ignore_visibility", 18);
4235 found = true;
4236 }
4237 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
4238 pm_buffer_append_byte(output_buffer, '\n');
4239 }
4240
4241 // receiver
4242 {
4243 pm_buffer_concat(output_buffer, prefix_buffer);
4244 pm_buffer_append_string(output_buffer, "+-- receiver:", 13);
4245 if (cast->receiver == NULL) {
4246 pm_buffer_append_string(output_buffer, " nil\n", 5);
4247 } else {
4248 pm_buffer_append_byte(output_buffer, '\n');
4249
4250 size_t prefix_length = prefix_buffer->length;
4251 pm_buffer_append_string(prefix_buffer, "| ", 4);
4252 pm_buffer_concat(output_buffer, prefix_buffer);
4253 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->receiver, prefix_buffer);
4254 prefix_buffer->length = prefix_length;
4255 }
4256 }
4257
4258 // call_operator_loc
4259 {
4260 pm_buffer_concat(output_buffer, prefix_buffer);
4261 pm_buffer_append_string(output_buffer, "+-- call_operator_loc:", 22);
4262 pm_location_t *location = &cast->call_operator_loc;
4263 if (location->start == NULL) {
4264 pm_buffer_append_string(output_buffer, " nil\n", 5);
4265 } else {
4266 pm_buffer_append_byte(output_buffer, ' ');
4267 prettyprint_location(output_buffer, parser, location);
4268 pm_buffer_append_string(output_buffer, " = \"", 4);
4269 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4270 pm_buffer_append_string(output_buffer, "\"\n", 2);
4271 }
4272 }
4273
4274 // opening_loc
4275 {
4276 pm_buffer_concat(output_buffer, prefix_buffer);
4277 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
4278 pm_location_t *location = &cast->opening_loc;
4279 pm_buffer_append_byte(output_buffer, ' ');
4280 prettyprint_location(output_buffer, parser, location);
4281 pm_buffer_append_string(output_buffer, " = \"", 4);
4282 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4283 pm_buffer_append_string(output_buffer, "\"\n", 2);
4284 }
4285
4286 // arguments
4287 {
4288 pm_buffer_concat(output_buffer, prefix_buffer);
4289 pm_buffer_append_string(output_buffer, "+-- arguments:", 14);
4290 if (cast->arguments == NULL) {
4291 pm_buffer_append_string(output_buffer, " nil\n", 5);
4292 } else {
4293 pm_buffer_append_byte(output_buffer, '\n');
4294
4295 size_t prefix_length = prefix_buffer->length;
4296 pm_buffer_append_string(prefix_buffer, "| ", 4);
4297 pm_buffer_concat(output_buffer, prefix_buffer);
4298 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->arguments, prefix_buffer);
4299 prefix_buffer->length = prefix_length;
4300 }
4301 }
4302
4303 // closing_loc
4304 {
4305 pm_buffer_concat(output_buffer, prefix_buffer);
4306 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
4307 pm_location_t *location = &cast->closing_loc;
4308 pm_buffer_append_byte(output_buffer, ' ');
4309 prettyprint_location(output_buffer, parser, location);
4310 pm_buffer_append_string(output_buffer, " = \"", 4);
4311 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4312 pm_buffer_append_string(output_buffer, "\"\n", 2);
4313 }
4314
4315 // block
4316 {
4317 pm_buffer_concat(output_buffer, prefix_buffer);
4318 pm_buffer_append_string(output_buffer, "+-- block:", 10);
4319 if (cast->block == NULL) {
4320 pm_buffer_append_string(output_buffer, " nil\n", 5);
4321 } else {
4322 pm_buffer_append_byte(output_buffer, '\n');
4323
4324 size_t prefix_length = prefix_buffer->length;
4325 pm_buffer_append_string(prefix_buffer, "| ", 4);
4326 pm_buffer_concat(output_buffer, prefix_buffer);
4327 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->block, prefix_buffer);
4328 prefix_buffer->length = prefix_length;
4329 }
4330 }
4331
4332 // operator_loc
4333 {
4334 pm_buffer_concat(output_buffer, prefix_buffer);
4335 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
4336 pm_location_t *location = &cast->operator_loc;
4337 pm_buffer_append_byte(output_buffer, ' ');
4338 prettyprint_location(output_buffer, parser, location);
4339 pm_buffer_append_string(output_buffer, " = \"", 4);
4340 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4341 pm_buffer_append_string(output_buffer, "\"\n", 2);
4342 }
4343
4344 // value
4345 {
4346 pm_buffer_concat(output_buffer, prefix_buffer);
4347 pm_buffer_append_string(output_buffer, "+-- value:", 10);
4348 pm_buffer_append_byte(output_buffer, '\n');
4349
4350 size_t prefix_length = prefix_buffer->length;
4351 pm_buffer_append_string(prefix_buffer, " ", 4);
4352 pm_buffer_concat(output_buffer, prefix_buffer);
4353 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
4354 prefix_buffer->length = prefix_length;
4355 }
4356
4357 break;
4358 }
4359 case PM_INDEX_OPERATOR_WRITE_NODE: {
4360 pm_index_operator_write_node_t *cast = (pm_index_operator_write_node_t *) node;
4361 pm_buffer_append_string(output_buffer, "@ IndexOperatorWriteNode (location: ", 36);
4362 prettyprint_location(output_buffer, parser, &node->location);
4363 pm_buffer_append_string(output_buffer, ")\n", 2);
4364
4365 // CallNodeFlags
4366 {
4367 pm_buffer_concat(output_buffer, prefix_buffer);
4368 pm_buffer_append_string(output_buffer, "+-- CallNodeFlags:", 18);
4369 bool found = false;
4370 if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
4371 if (found) pm_buffer_append_byte(output_buffer, ',');
4372 pm_buffer_append_string(output_buffer, " safe_navigation", 16);
4373 found = true;
4374 }
4375 if (cast->base.flags & PM_CALL_NODE_FLAGS_VARIABLE_CALL) {
4376 if (found) pm_buffer_append_byte(output_buffer, ',');
4377 pm_buffer_append_string(output_buffer, " variable_call", 14);
4378 found = true;
4379 }
4380 if (cast->base.flags & PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE) {
4381 if (found) pm_buffer_append_byte(output_buffer, ',');
4382 pm_buffer_append_string(output_buffer, " attribute_write", 16);
4383 found = true;
4384 }
4385 if (cast->base.flags & PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY) {
4386 if (found) pm_buffer_append_byte(output_buffer, ',');
4387 pm_buffer_append_string(output_buffer, " ignore_visibility", 18);
4388 found = true;
4389 }
4390 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
4391 pm_buffer_append_byte(output_buffer, '\n');
4392 }
4393
4394 // receiver
4395 {
4396 pm_buffer_concat(output_buffer, prefix_buffer);
4397 pm_buffer_append_string(output_buffer, "+-- receiver:", 13);
4398 if (cast->receiver == NULL) {
4399 pm_buffer_append_string(output_buffer, " nil\n", 5);
4400 } else {
4401 pm_buffer_append_byte(output_buffer, '\n');
4402
4403 size_t prefix_length = prefix_buffer->length;
4404 pm_buffer_append_string(prefix_buffer, "| ", 4);
4405 pm_buffer_concat(output_buffer, prefix_buffer);
4406 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->receiver, prefix_buffer);
4407 prefix_buffer->length = prefix_length;
4408 }
4409 }
4410
4411 // call_operator_loc
4412 {
4413 pm_buffer_concat(output_buffer, prefix_buffer);
4414 pm_buffer_append_string(output_buffer, "+-- call_operator_loc:", 22);
4415 pm_location_t *location = &cast->call_operator_loc;
4416 if (location->start == NULL) {
4417 pm_buffer_append_string(output_buffer, " nil\n", 5);
4418 } else {
4419 pm_buffer_append_byte(output_buffer, ' ');
4420 prettyprint_location(output_buffer, parser, location);
4421 pm_buffer_append_string(output_buffer, " = \"", 4);
4422 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4423 pm_buffer_append_string(output_buffer, "\"\n", 2);
4424 }
4425 }
4426
4427 // opening_loc
4428 {
4429 pm_buffer_concat(output_buffer, prefix_buffer);
4430 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
4431 pm_location_t *location = &cast->opening_loc;
4432 pm_buffer_append_byte(output_buffer, ' ');
4433 prettyprint_location(output_buffer, parser, location);
4434 pm_buffer_append_string(output_buffer, " = \"", 4);
4435 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4436 pm_buffer_append_string(output_buffer, "\"\n", 2);
4437 }
4438
4439 // arguments
4440 {
4441 pm_buffer_concat(output_buffer, prefix_buffer);
4442 pm_buffer_append_string(output_buffer, "+-- arguments:", 14);
4443 if (cast->arguments == NULL) {
4444 pm_buffer_append_string(output_buffer, " nil\n", 5);
4445 } else {
4446 pm_buffer_append_byte(output_buffer, '\n');
4447
4448 size_t prefix_length = prefix_buffer->length;
4449 pm_buffer_append_string(prefix_buffer, "| ", 4);
4450 pm_buffer_concat(output_buffer, prefix_buffer);
4451 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->arguments, prefix_buffer);
4452 prefix_buffer->length = prefix_length;
4453 }
4454 }
4455
4456 // closing_loc
4457 {
4458 pm_buffer_concat(output_buffer, prefix_buffer);
4459 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
4460 pm_location_t *location = &cast->closing_loc;
4461 pm_buffer_append_byte(output_buffer, ' ');
4462 prettyprint_location(output_buffer, parser, location);
4463 pm_buffer_append_string(output_buffer, " = \"", 4);
4464 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4465 pm_buffer_append_string(output_buffer, "\"\n", 2);
4466 }
4467
4468 // block
4469 {
4470 pm_buffer_concat(output_buffer, prefix_buffer);
4471 pm_buffer_append_string(output_buffer, "+-- block:", 10);
4472 if (cast->block == NULL) {
4473 pm_buffer_append_string(output_buffer, " nil\n", 5);
4474 } else {
4475 pm_buffer_append_byte(output_buffer, '\n');
4476
4477 size_t prefix_length = prefix_buffer->length;
4478 pm_buffer_append_string(prefix_buffer, "| ", 4);
4479 pm_buffer_concat(output_buffer, prefix_buffer);
4480 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->block, prefix_buffer);
4481 prefix_buffer->length = prefix_length;
4482 }
4483 }
4484
4485 // binary_operator
4486 {
4487 pm_buffer_concat(output_buffer, prefix_buffer);
4488 pm_buffer_append_string(output_buffer, "+-- binary_operator:", 20);
4489 pm_buffer_append_byte(output_buffer, ' ');
4490 prettyprint_constant(output_buffer, parser, cast->binary_operator);
4491 pm_buffer_append_byte(output_buffer, '\n');
4492 }
4493
4494 // binary_operator_loc
4495 {
4496 pm_buffer_concat(output_buffer, prefix_buffer);
4497 pm_buffer_append_string(output_buffer, "+-- binary_operator_loc:", 24);
4498 pm_location_t *location = &cast->binary_operator_loc;
4499 pm_buffer_append_byte(output_buffer, ' ');
4500 prettyprint_location(output_buffer, parser, location);
4501 pm_buffer_append_string(output_buffer, " = \"", 4);
4502 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4503 pm_buffer_append_string(output_buffer, "\"\n", 2);
4504 }
4505
4506 // value
4507 {
4508 pm_buffer_concat(output_buffer, prefix_buffer);
4509 pm_buffer_append_string(output_buffer, "+-- value:", 10);
4510 pm_buffer_append_byte(output_buffer, '\n');
4511
4512 size_t prefix_length = prefix_buffer->length;
4513 pm_buffer_append_string(prefix_buffer, " ", 4);
4514 pm_buffer_concat(output_buffer, prefix_buffer);
4515 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
4516 prefix_buffer->length = prefix_length;
4517 }
4518
4519 break;
4520 }
4521 case PM_INDEX_OR_WRITE_NODE: {
4522 pm_index_or_write_node_t *cast = (pm_index_or_write_node_t *) node;
4523 pm_buffer_append_string(output_buffer, "@ IndexOrWriteNode (location: ", 30);
4524 prettyprint_location(output_buffer, parser, &node->location);
4525 pm_buffer_append_string(output_buffer, ")\n", 2);
4526
4527 // CallNodeFlags
4528 {
4529 pm_buffer_concat(output_buffer, prefix_buffer);
4530 pm_buffer_append_string(output_buffer, "+-- CallNodeFlags:", 18);
4531 bool found = false;
4532 if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
4533 if (found) pm_buffer_append_byte(output_buffer, ',');
4534 pm_buffer_append_string(output_buffer, " safe_navigation", 16);
4535 found = true;
4536 }
4537 if (cast->base.flags & PM_CALL_NODE_FLAGS_VARIABLE_CALL) {
4538 if (found) pm_buffer_append_byte(output_buffer, ',');
4539 pm_buffer_append_string(output_buffer, " variable_call", 14);
4540 found = true;
4541 }
4542 if (cast->base.flags & PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE) {
4543 if (found) pm_buffer_append_byte(output_buffer, ',');
4544 pm_buffer_append_string(output_buffer, " attribute_write", 16);
4545 found = true;
4546 }
4547 if (cast->base.flags & PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY) {
4548 if (found) pm_buffer_append_byte(output_buffer, ',');
4549 pm_buffer_append_string(output_buffer, " ignore_visibility", 18);
4550 found = true;
4551 }
4552 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
4553 pm_buffer_append_byte(output_buffer, '\n');
4554 }
4555
4556 // receiver
4557 {
4558 pm_buffer_concat(output_buffer, prefix_buffer);
4559 pm_buffer_append_string(output_buffer, "+-- receiver:", 13);
4560 if (cast->receiver == NULL) {
4561 pm_buffer_append_string(output_buffer, " nil\n", 5);
4562 } else {
4563 pm_buffer_append_byte(output_buffer, '\n');
4564
4565 size_t prefix_length = prefix_buffer->length;
4566 pm_buffer_append_string(prefix_buffer, "| ", 4);
4567 pm_buffer_concat(output_buffer, prefix_buffer);
4568 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->receiver, prefix_buffer);
4569 prefix_buffer->length = prefix_length;
4570 }
4571 }
4572
4573 // call_operator_loc
4574 {
4575 pm_buffer_concat(output_buffer, prefix_buffer);
4576 pm_buffer_append_string(output_buffer, "+-- call_operator_loc:", 22);
4577 pm_location_t *location = &cast->call_operator_loc;
4578 if (location->start == NULL) {
4579 pm_buffer_append_string(output_buffer, " nil\n", 5);
4580 } else {
4581 pm_buffer_append_byte(output_buffer, ' ');
4582 prettyprint_location(output_buffer, parser, location);
4583 pm_buffer_append_string(output_buffer, " = \"", 4);
4584 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4585 pm_buffer_append_string(output_buffer, "\"\n", 2);
4586 }
4587 }
4588
4589 // opening_loc
4590 {
4591 pm_buffer_concat(output_buffer, prefix_buffer);
4592 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
4593 pm_location_t *location = &cast->opening_loc;
4594 pm_buffer_append_byte(output_buffer, ' ');
4595 prettyprint_location(output_buffer, parser, location);
4596 pm_buffer_append_string(output_buffer, " = \"", 4);
4597 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4598 pm_buffer_append_string(output_buffer, "\"\n", 2);
4599 }
4600
4601 // arguments
4602 {
4603 pm_buffer_concat(output_buffer, prefix_buffer);
4604 pm_buffer_append_string(output_buffer, "+-- arguments:", 14);
4605 if (cast->arguments == NULL) {
4606 pm_buffer_append_string(output_buffer, " nil\n", 5);
4607 } else {
4608 pm_buffer_append_byte(output_buffer, '\n');
4609
4610 size_t prefix_length = prefix_buffer->length;
4611 pm_buffer_append_string(prefix_buffer, "| ", 4);
4612 pm_buffer_concat(output_buffer, prefix_buffer);
4613 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->arguments, prefix_buffer);
4614 prefix_buffer->length = prefix_length;
4615 }
4616 }
4617
4618 // closing_loc
4619 {
4620 pm_buffer_concat(output_buffer, prefix_buffer);
4621 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
4622 pm_location_t *location = &cast->closing_loc;
4623 pm_buffer_append_byte(output_buffer, ' ');
4624 prettyprint_location(output_buffer, parser, location);
4625 pm_buffer_append_string(output_buffer, " = \"", 4);
4626 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4627 pm_buffer_append_string(output_buffer, "\"\n", 2);
4628 }
4629
4630 // block
4631 {
4632 pm_buffer_concat(output_buffer, prefix_buffer);
4633 pm_buffer_append_string(output_buffer, "+-- block:", 10);
4634 if (cast->block == NULL) {
4635 pm_buffer_append_string(output_buffer, " nil\n", 5);
4636 } else {
4637 pm_buffer_append_byte(output_buffer, '\n');
4638
4639 size_t prefix_length = prefix_buffer->length;
4640 pm_buffer_append_string(prefix_buffer, "| ", 4);
4641 pm_buffer_concat(output_buffer, prefix_buffer);
4642 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->block, prefix_buffer);
4643 prefix_buffer->length = prefix_length;
4644 }
4645 }
4646
4647 // operator_loc
4648 {
4649 pm_buffer_concat(output_buffer, prefix_buffer);
4650 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
4651 pm_location_t *location = &cast->operator_loc;
4652 pm_buffer_append_byte(output_buffer, ' ');
4653 prettyprint_location(output_buffer, parser, location);
4654 pm_buffer_append_string(output_buffer, " = \"", 4);
4655 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4656 pm_buffer_append_string(output_buffer, "\"\n", 2);
4657 }
4658
4659 // value
4660 {
4661 pm_buffer_concat(output_buffer, prefix_buffer);
4662 pm_buffer_append_string(output_buffer, "+-- value:", 10);
4663 pm_buffer_append_byte(output_buffer, '\n');
4664
4665 size_t prefix_length = prefix_buffer->length;
4666 pm_buffer_append_string(prefix_buffer, " ", 4);
4667 pm_buffer_concat(output_buffer, prefix_buffer);
4668 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
4669 prefix_buffer->length = prefix_length;
4670 }
4671
4672 break;
4673 }
4674 case PM_INDEX_TARGET_NODE: {
4675 pm_index_target_node_t *cast = (pm_index_target_node_t *) node;
4676 pm_buffer_append_string(output_buffer, "@ IndexTargetNode (location: ", 29);
4677 prettyprint_location(output_buffer, parser, &node->location);
4678 pm_buffer_append_string(output_buffer, ")\n", 2);
4679
4680 // CallNodeFlags
4681 {
4682 pm_buffer_concat(output_buffer, prefix_buffer);
4683 pm_buffer_append_string(output_buffer, "+-- CallNodeFlags:", 18);
4684 bool found = false;
4685 if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
4686 if (found) pm_buffer_append_byte(output_buffer, ',');
4687 pm_buffer_append_string(output_buffer, " safe_navigation", 16);
4688 found = true;
4689 }
4690 if (cast->base.flags & PM_CALL_NODE_FLAGS_VARIABLE_CALL) {
4691 if (found) pm_buffer_append_byte(output_buffer, ',');
4692 pm_buffer_append_string(output_buffer, " variable_call", 14);
4693 found = true;
4694 }
4695 if (cast->base.flags & PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE) {
4696 if (found) pm_buffer_append_byte(output_buffer, ',');
4697 pm_buffer_append_string(output_buffer, " attribute_write", 16);
4698 found = true;
4699 }
4700 if (cast->base.flags & PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY) {
4701 if (found) pm_buffer_append_byte(output_buffer, ',');
4702 pm_buffer_append_string(output_buffer, " ignore_visibility", 18);
4703 found = true;
4704 }
4705 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
4706 pm_buffer_append_byte(output_buffer, '\n');
4707 }
4708
4709 // receiver
4710 {
4711 pm_buffer_concat(output_buffer, prefix_buffer);
4712 pm_buffer_append_string(output_buffer, "+-- receiver:", 13);
4713 pm_buffer_append_byte(output_buffer, '\n');
4714
4715 size_t prefix_length = prefix_buffer->length;
4716 pm_buffer_append_string(prefix_buffer, "| ", 4);
4717 pm_buffer_concat(output_buffer, prefix_buffer);
4718 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->receiver, prefix_buffer);
4719 prefix_buffer->length = prefix_length;
4720 }
4721
4722 // opening_loc
4723 {
4724 pm_buffer_concat(output_buffer, prefix_buffer);
4725 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
4726 pm_location_t *location = &cast->opening_loc;
4727 pm_buffer_append_byte(output_buffer, ' ');
4728 prettyprint_location(output_buffer, parser, location);
4729 pm_buffer_append_string(output_buffer, " = \"", 4);
4730 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4731 pm_buffer_append_string(output_buffer, "\"\n", 2);
4732 }
4733
4734 // arguments
4735 {
4736 pm_buffer_concat(output_buffer, prefix_buffer);
4737 pm_buffer_append_string(output_buffer, "+-- arguments:", 14);
4738 if (cast->arguments == NULL) {
4739 pm_buffer_append_string(output_buffer, " nil\n", 5);
4740 } else {
4741 pm_buffer_append_byte(output_buffer, '\n');
4742
4743 size_t prefix_length = prefix_buffer->length;
4744 pm_buffer_append_string(prefix_buffer, "| ", 4);
4745 pm_buffer_concat(output_buffer, prefix_buffer);
4746 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->arguments, prefix_buffer);
4747 prefix_buffer->length = prefix_length;
4748 }
4749 }
4750
4751 // closing_loc
4752 {
4753 pm_buffer_concat(output_buffer, prefix_buffer);
4754 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
4755 pm_location_t *location = &cast->closing_loc;
4756 pm_buffer_append_byte(output_buffer, ' ');
4757 prettyprint_location(output_buffer, parser, location);
4758 pm_buffer_append_string(output_buffer, " = \"", 4);
4759 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4760 pm_buffer_append_string(output_buffer, "\"\n", 2);
4761 }
4762
4763 // block
4764 {
4765 pm_buffer_concat(output_buffer, prefix_buffer);
4766 pm_buffer_append_string(output_buffer, "+-- block:", 10);
4767 if (cast->block == NULL) {
4768 pm_buffer_append_string(output_buffer, " nil\n", 5);
4769 } else {
4770 pm_buffer_append_byte(output_buffer, '\n');
4771
4772 size_t prefix_length = prefix_buffer->length;
4773 pm_buffer_append_string(prefix_buffer, " ", 4);
4774 pm_buffer_concat(output_buffer, prefix_buffer);
4775 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->block, prefix_buffer);
4776 prefix_buffer->length = prefix_length;
4777 }
4778 }
4779
4780 break;
4781 }
4782 case PM_INSTANCE_VARIABLE_AND_WRITE_NODE: {
4783 pm_instance_variable_and_write_node_t *cast = (pm_instance_variable_and_write_node_t *) node;
4784 pm_buffer_append_string(output_buffer, "@ InstanceVariableAndWriteNode (location: ", 42);
4785 prettyprint_location(output_buffer, parser, &node->location);
4786 pm_buffer_append_string(output_buffer, ")\n", 2);
4787
4788 // name
4789 {
4790 pm_buffer_concat(output_buffer, prefix_buffer);
4791 pm_buffer_append_string(output_buffer, "+-- name:", 9);
4792 pm_buffer_append_byte(output_buffer, ' ');
4793 prettyprint_constant(output_buffer, parser, cast->name);
4794 pm_buffer_append_byte(output_buffer, '\n');
4795 }
4796
4797 // name_loc
4798 {
4799 pm_buffer_concat(output_buffer, prefix_buffer);
4800 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
4801 pm_location_t *location = &cast->name_loc;
4802 pm_buffer_append_byte(output_buffer, ' ');
4803 prettyprint_location(output_buffer, parser, location);
4804 pm_buffer_append_string(output_buffer, " = \"", 4);
4805 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4806 pm_buffer_append_string(output_buffer, "\"\n", 2);
4807 }
4808
4809 // operator_loc
4810 {
4811 pm_buffer_concat(output_buffer, prefix_buffer);
4812 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
4813 pm_location_t *location = &cast->operator_loc;
4814 pm_buffer_append_byte(output_buffer, ' ');
4815 prettyprint_location(output_buffer, parser, location);
4816 pm_buffer_append_string(output_buffer, " = \"", 4);
4817 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4818 pm_buffer_append_string(output_buffer, "\"\n", 2);
4819 }
4820
4821 // value
4822 {
4823 pm_buffer_concat(output_buffer, prefix_buffer);
4824 pm_buffer_append_string(output_buffer, "+-- value:", 10);
4825 pm_buffer_append_byte(output_buffer, '\n');
4826
4827 size_t prefix_length = prefix_buffer->length;
4828 pm_buffer_append_string(prefix_buffer, " ", 4);
4829 pm_buffer_concat(output_buffer, prefix_buffer);
4830 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
4831 prefix_buffer->length = prefix_length;
4832 }
4833
4834 break;
4835 }
4836 case PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
4837 pm_instance_variable_operator_write_node_t *cast = (pm_instance_variable_operator_write_node_t *) node;
4838 pm_buffer_append_string(output_buffer, "@ InstanceVariableOperatorWriteNode (location: ", 47);
4839 prettyprint_location(output_buffer, parser, &node->location);
4840 pm_buffer_append_string(output_buffer, ")\n", 2);
4841
4842 // name
4843 {
4844 pm_buffer_concat(output_buffer, prefix_buffer);
4845 pm_buffer_append_string(output_buffer, "+-- name:", 9);
4846 pm_buffer_append_byte(output_buffer, ' ');
4847 prettyprint_constant(output_buffer, parser, cast->name);
4848 pm_buffer_append_byte(output_buffer, '\n');
4849 }
4850
4851 // name_loc
4852 {
4853 pm_buffer_concat(output_buffer, prefix_buffer);
4854 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
4855 pm_location_t *location = &cast->name_loc;
4856 pm_buffer_append_byte(output_buffer, ' ');
4857 prettyprint_location(output_buffer, parser, location);
4858 pm_buffer_append_string(output_buffer, " = \"", 4);
4859 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4860 pm_buffer_append_string(output_buffer, "\"\n", 2);
4861 }
4862
4863 // binary_operator_loc
4864 {
4865 pm_buffer_concat(output_buffer, prefix_buffer);
4866 pm_buffer_append_string(output_buffer, "+-- binary_operator_loc:", 24);
4867 pm_location_t *location = &cast->binary_operator_loc;
4868 pm_buffer_append_byte(output_buffer, ' ');
4869 prettyprint_location(output_buffer, parser, location);
4870 pm_buffer_append_string(output_buffer, " = \"", 4);
4871 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4872 pm_buffer_append_string(output_buffer, "\"\n", 2);
4873 }
4874
4875 // value
4876 {
4877 pm_buffer_concat(output_buffer, prefix_buffer);
4878 pm_buffer_append_string(output_buffer, "+-- value:", 10);
4879 pm_buffer_append_byte(output_buffer, '\n');
4880
4881 size_t prefix_length = prefix_buffer->length;
4882 pm_buffer_append_string(prefix_buffer, "| ", 4);
4883 pm_buffer_concat(output_buffer, prefix_buffer);
4884 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
4885 prefix_buffer->length = prefix_length;
4886 }
4887
4888 // binary_operator
4889 {
4890 pm_buffer_concat(output_buffer, prefix_buffer);
4891 pm_buffer_append_string(output_buffer, "+-- binary_operator:", 20);
4892 pm_buffer_append_byte(output_buffer, ' ');
4893 prettyprint_constant(output_buffer, parser, cast->binary_operator);
4894 pm_buffer_append_byte(output_buffer, '\n');
4895 }
4896
4897 break;
4898 }
4899 case PM_INSTANCE_VARIABLE_OR_WRITE_NODE: {
4900 pm_instance_variable_or_write_node_t *cast = (pm_instance_variable_or_write_node_t *) node;
4901 pm_buffer_append_string(output_buffer, "@ InstanceVariableOrWriteNode (location: ", 41);
4902 prettyprint_location(output_buffer, parser, &node->location);
4903 pm_buffer_append_string(output_buffer, ")\n", 2);
4904
4905 // name
4906 {
4907 pm_buffer_concat(output_buffer, prefix_buffer);
4908 pm_buffer_append_string(output_buffer, "+-- name:", 9);
4909 pm_buffer_append_byte(output_buffer, ' ');
4910 prettyprint_constant(output_buffer, parser, cast->name);
4911 pm_buffer_append_byte(output_buffer, '\n');
4912 }
4913
4914 // name_loc
4915 {
4916 pm_buffer_concat(output_buffer, prefix_buffer);
4917 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
4918 pm_location_t *location = &cast->name_loc;
4919 pm_buffer_append_byte(output_buffer, ' ');
4920 prettyprint_location(output_buffer, parser, location);
4921 pm_buffer_append_string(output_buffer, " = \"", 4);
4922 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4923 pm_buffer_append_string(output_buffer, "\"\n", 2);
4924 }
4925
4926 // operator_loc
4927 {
4928 pm_buffer_concat(output_buffer, prefix_buffer);
4929 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
4930 pm_location_t *location = &cast->operator_loc;
4931 pm_buffer_append_byte(output_buffer, ' ');
4932 prettyprint_location(output_buffer, parser, location);
4933 pm_buffer_append_string(output_buffer, " = \"", 4);
4934 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
4935 pm_buffer_append_string(output_buffer, "\"\n", 2);
4936 }
4937
4938 // value
4939 {
4940 pm_buffer_concat(output_buffer, prefix_buffer);
4941 pm_buffer_append_string(output_buffer, "+-- value:", 10);
4942 pm_buffer_append_byte(output_buffer, '\n');
4943
4944 size_t prefix_length = prefix_buffer->length;
4945 pm_buffer_append_string(prefix_buffer, " ", 4);
4946 pm_buffer_concat(output_buffer, prefix_buffer);
4947 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
4948 prefix_buffer->length = prefix_length;
4949 }
4950
4951 break;
4952 }
4953 case PM_INSTANCE_VARIABLE_READ_NODE: {
4954 pm_instance_variable_read_node_t *cast = (pm_instance_variable_read_node_t *) node;
4955 pm_buffer_append_string(output_buffer, "@ InstanceVariableReadNode (location: ", 38);
4956 prettyprint_location(output_buffer, parser, &node->location);
4957 pm_buffer_append_string(output_buffer, ")\n", 2);
4958
4959 // name
4960 {
4961 pm_buffer_concat(output_buffer, prefix_buffer);
4962 pm_buffer_append_string(output_buffer, "+-- name:", 9);
4963 pm_buffer_append_byte(output_buffer, ' ');
4964 prettyprint_constant(output_buffer, parser, cast->name);
4965 pm_buffer_append_byte(output_buffer, '\n');
4966 }
4967
4968 break;
4969 }
4970 case PM_INSTANCE_VARIABLE_TARGET_NODE: {
4971 pm_instance_variable_target_node_t *cast = (pm_instance_variable_target_node_t *) node;
4972 pm_buffer_append_string(output_buffer, "@ InstanceVariableTargetNode (location: ", 40);
4973 prettyprint_location(output_buffer, parser, &node->location);
4974 pm_buffer_append_string(output_buffer, ")\n", 2);
4975
4976 // name
4977 {
4978 pm_buffer_concat(output_buffer, prefix_buffer);
4979 pm_buffer_append_string(output_buffer, "+-- name:", 9);
4980 pm_buffer_append_byte(output_buffer, ' ');
4981 prettyprint_constant(output_buffer, parser, cast->name);
4982 pm_buffer_append_byte(output_buffer, '\n');
4983 }
4984
4985 break;
4986 }
4987 case PM_INSTANCE_VARIABLE_WRITE_NODE: {
4988 pm_instance_variable_write_node_t *cast = (pm_instance_variable_write_node_t *) node;
4989 pm_buffer_append_string(output_buffer, "@ InstanceVariableWriteNode (location: ", 39);
4990 prettyprint_location(output_buffer, parser, &node->location);
4991 pm_buffer_append_string(output_buffer, ")\n", 2);
4992
4993 // name
4994 {
4995 pm_buffer_concat(output_buffer, prefix_buffer);
4996 pm_buffer_append_string(output_buffer, "+-- name:", 9);
4997 pm_buffer_append_byte(output_buffer, ' ');
4998 prettyprint_constant(output_buffer, parser, cast->name);
4999 pm_buffer_append_byte(output_buffer, '\n');
5000 }
5001
5002 // name_loc
5003 {
5004 pm_buffer_concat(output_buffer, prefix_buffer);
5005 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
5006 pm_location_t *location = &cast->name_loc;
5007 pm_buffer_append_byte(output_buffer, ' ');
5008 prettyprint_location(output_buffer, parser, location);
5009 pm_buffer_append_string(output_buffer, " = \"", 4);
5010 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5011 pm_buffer_append_string(output_buffer, "\"\n", 2);
5012 }
5013
5014 // value
5015 {
5016 pm_buffer_concat(output_buffer, prefix_buffer);
5017 pm_buffer_append_string(output_buffer, "+-- value:", 10);
5018 pm_buffer_append_byte(output_buffer, '\n');
5019
5020 size_t prefix_length = prefix_buffer->length;
5021 pm_buffer_append_string(prefix_buffer, "| ", 4);
5022 pm_buffer_concat(output_buffer, prefix_buffer);
5023 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
5024 prefix_buffer->length = prefix_length;
5025 }
5026
5027 // operator_loc
5028 {
5029 pm_buffer_concat(output_buffer, prefix_buffer);
5030 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
5031 pm_location_t *location = &cast->operator_loc;
5032 pm_buffer_append_byte(output_buffer, ' ');
5033 prettyprint_location(output_buffer, parser, location);
5034 pm_buffer_append_string(output_buffer, " = \"", 4);
5035 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5036 pm_buffer_append_string(output_buffer, "\"\n", 2);
5037 }
5038
5039 break;
5040 }
5041 case PM_INTEGER_NODE: {
5042 pm_integer_node_t *cast = (pm_integer_node_t *) node;
5043 pm_buffer_append_string(output_buffer, "@ IntegerNode (location: ", 25);
5044 prettyprint_location(output_buffer, parser, &node->location);
5045 pm_buffer_append_string(output_buffer, ")\n", 2);
5046
5047 // IntegerBaseFlags
5048 {
5049 pm_buffer_concat(output_buffer, prefix_buffer);
5050 pm_buffer_append_string(output_buffer, "+-- IntegerBaseFlags:", 21);
5051 bool found = false;
5052 if (cast->base.flags & PM_INTEGER_BASE_FLAGS_BINARY) {
5053 if (found) pm_buffer_append_byte(output_buffer, ',');
5054 pm_buffer_append_string(output_buffer, " binary", 7);
5055 found = true;
5056 }
5057 if (cast->base.flags & PM_INTEGER_BASE_FLAGS_DECIMAL) {
5058 if (found) pm_buffer_append_byte(output_buffer, ',');
5059 pm_buffer_append_string(output_buffer, " decimal", 8);
5060 found = true;
5061 }
5062 if (cast->base.flags & PM_INTEGER_BASE_FLAGS_OCTAL) {
5063 if (found) pm_buffer_append_byte(output_buffer, ',');
5064 pm_buffer_append_string(output_buffer, " octal", 6);
5065 found = true;
5066 }
5067 if (cast->base.flags & PM_INTEGER_BASE_FLAGS_HEXADECIMAL) {
5068 if (found) pm_buffer_append_byte(output_buffer, ',');
5069 pm_buffer_append_string(output_buffer, " hexadecimal", 12);
5070 found = true;
5071 }
5072 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
5073 pm_buffer_append_byte(output_buffer, '\n');
5074 }
5075
5076 // value
5077 {
5078 pm_buffer_concat(output_buffer, prefix_buffer);
5079 pm_buffer_append_string(output_buffer, "+-- value:", 10);
5080 const pm_integer_t *integer = &cast->value;
5081 pm_buffer_append_byte(output_buffer, ' ');
5082 pm_integer_string(output_buffer, integer);
5083 pm_buffer_append_byte(output_buffer, '\n');
5084 }
5085
5086 break;
5087 }
5088 case PM_INTERPOLATED_MATCH_LAST_LINE_NODE: {
5089 pm_interpolated_match_last_line_node_t *cast = (pm_interpolated_match_last_line_node_t *) node;
5090 pm_buffer_append_string(output_buffer, "@ InterpolatedMatchLastLineNode (location: ", 43);
5091 prettyprint_location(output_buffer, parser, &node->location);
5092 pm_buffer_append_string(output_buffer, ")\n", 2);
5093
5094 // RegularExpressionFlags
5095 {
5096 pm_buffer_concat(output_buffer, prefix_buffer);
5097 pm_buffer_append_string(output_buffer, "+-- RegularExpressionFlags:", 27);
5098 bool found = false;
5099 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE) {
5100 if (found) pm_buffer_append_byte(output_buffer, ',');
5101 pm_buffer_append_string(output_buffer, " ignore_case", 12);
5102 found = true;
5103 }
5104 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_EXTENDED) {
5105 if (found) pm_buffer_append_byte(output_buffer, ',');
5106 pm_buffer_append_string(output_buffer, " extended", 9);
5107 found = true;
5108 }
5109 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE) {
5110 if (found) pm_buffer_append_byte(output_buffer, ',');
5111 pm_buffer_append_string(output_buffer, " multi_line", 11);
5112 found = true;
5113 }
5114 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_ONCE) {
5115 if (found) pm_buffer_append_byte(output_buffer, ',');
5116 pm_buffer_append_string(output_buffer, " once", 5);
5117 found = true;
5118 }
5119 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_EUC_JP) {
5120 if (found) pm_buffer_append_byte(output_buffer, ',');
5121 pm_buffer_append_string(output_buffer, " euc_jp", 7);
5122 found = true;
5123 }
5124 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT) {
5125 if (found) pm_buffer_append_byte(output_buffer, ',');
5126 pm_buffer_append_string(output_buffer, " ascii_8bit", 11);
5127 found = true;
5128 }
5129 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J) {
5130 if (found) pm_buffer_append_byte(output_buffer, ',');
5131 pm_buffer_append_string(output_buffer, " windows_31j", 12);
5132 found = true;
5133 }
5134 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_UTF_8) {
5135 if (found) pm_buffer_append_byte(output_buffer, ',');
5136 pm_buffer_append_string(output_buffer, " utf_8", 6);
5137 found = true;
5138 }
5139 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING) {
5140 if (found) pm_buffer_append_byte(output_buffer, ',');
5141 pm_buffer_append_string(output_buffer, " forced_utf8_encoding", 21);
5142 found = true;
5143 }
5144 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING) {
5145 if (found) pm_buffer_append_byte(output_buffer, ',');
5146 pm_buffer_append_string(output_buffer, " forced_binary_encoding", 23);
5147 found = true;
5148 }
5149 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING) {
5150 if (found) pm_buffer_append_byte(output_buffer, ',');
5151 pm_buffer_append_string(output_buffer, " forced_us_ascii_encoding", 25);
5152 found = true;
5153 }
5154 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
5155 pm_buffer_append_byte(output_buffer, '\n');
5156 }
5157
5158 // opening_loc
5159 {
5160 pm_buffer_concat(output_buffer, prefix_buffer);
5161 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
5162 pm_location_t *location = &cast->opening_loc;
5163 pm_buffer_append_byte(output_buffer, ' ');
5164 prettyprint_location(output_buffer, parser, location);
5165 pm_buffer_append_string(output_buffer, " = \"", 4);
5166 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5167 pm_buffer_append_string(output_buffer, "\"\n", 2);
5168 }
5169
5170 // parts
5171 {
5172 pm_buffer_concat(output_buffer, prefix_buffer);
5173 pm_buffer_append_string(output_buffer, "+-- parts:", 10);
5174 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->parts.size));
5175
5176 size_t last_index = cast->parts.size;
5177 for (uint32_t index = 0; index < last_index; index++) {
5178 size_t prefix_length = prefix_buffer->length;
5179 pm_buffer_append_string(prefix_buffer, "| ", 4);
5180 pm_buffer_concat(output_buffer, prefix_buffer);
5181 pm_buffer_append_string(output_buffer, "+-- ", 4);
5182 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
5183 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->parts.nodes[index], prefix_buffer);
5184 prefix_buffer->length = prefix_length;
5185 }
5186 }
5187
5188 // closing_loc
5189 {
5190 pm_buffer_concat(output_buffer, prefix_buffer);
5191 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
5192 pm_location_t *location = &cast->closing_loc;
5193 pm_buffer_append_byte(output_buffer, ' ');
5194 prettyprint_location(output_buffer, parser, location);
5195 pm_buffer_append_string(output_buffer, " = \"", 4);
5196 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5197 pm_buffer_append_string(output_buffer, "\"\n", 2);
5198 }
5199
5200 break;
5201 }
5202 case PM_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
5203 pm_interpolated_regular_expression_node_t *cast = (pm_interpolated_regular_expression_node_t *) node;
5204 pm_buffer_append_string(output_buffer, "@ InterpolatedRegularExpressionNode (location: ", 47);
5205 prettyprint_location(output_buffer, parser, &node->location);
5206 pm_buffer_append_string(output_buffer, ")\n", 2);
5207
5208 // RegularExpressionFlags
5209 {
5210 pm_buffer_concat(output_buffer, prefix_buffer);
5211 pm_buffer_append_string(output_buffer, "+-- RegularExpressionFlags:", 27);
5212 bool found = false;
5213 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE) {
5214 if (found) pm_buffer_append_byte(output_buffer, ',');
5215 pm_buffer_append_string(output_buffer, " ignore_case", 12);
5216 found = true;
5217 }
5218 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_EXTENDED) {
5219 if (found) pm_buffer_append_byte(output_buffer, ',');
5220 pm_buffer_append_string(output_buffer, " extended", 9);
5221 found = true;
5222 }
5223 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE) {
5224 if (found) pm_buffer_append_byte(output_buffer, ',');
5225 pm_buffer_append_string(output_buffer, " multi_line", 11);
5226 found = true;
5227 }
5228 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_ONCE) {
5229 if (found) pm_buffer_append_byte(output_buffer, ',');
5230 pm_buffer_append_string(output_buffer, " once", 5);
5231 found = true;
5232 }
5233 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_EUC_JP) {
5234 if (found) pm_buffer_append_byte(output_buffer, ',');
5235 pm_buffer_append_string(output_buffer, " euc_jp", 7);
5236 found = true;
5237 }
5238 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT) {
5239 if (found) pm_buffer_append_byte(output_buffer, ',');
5240 pm_buffer_append_string(output_buffer, " ascii_8bit", 11);
5241 found = true;
5242 }
5243 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J) {
5244 if (found) pm_buffer_append_byte(output_buffer, ',');
5245 pm_buffer_append_string(output_buffer, " windows_31j", 12);
5246 found = true;
5247 }
5248 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_UTF_8) {
5249 if (found) pm_buffer_append_byte(output_buffer, ',');
5250 pm_buffer_append_string(output_buffer, " utf_8", 6);
5251 found = true;
5252 }
5253 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING) {
5254 if (found) pm_buffer_append_byte(output_buffer, ',');
5255 pm_buffer_append_string(output_buffer, " forced_utf8_encoding", 21);
5256 found = true;
5257 }
5258 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING) {
5259 if (found) pm_buffer_append_byte(output_buffer, ',');
5260 pm_buffer_append_string(output_buffer, " forced_binary_encoding", 23);
5261 found = true;
5262 }
5263 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING) {
5264 if (found) pm_buffer_append_byte(output_buffer, ',');
5265 pm_buffer_append_string(output_buffer, " forced_us_ascii_encoding", 25);
5266 found = true;
5267 }
5268 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
5269 pm_buffer_append_byte(output_buffer, '\n');
5270 }
5271
5272 // opening_loc
5273 {
5274 pm_buffer_concat(output_buffer, prefix_buffer);
5275 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
5276 pm_location_t *location = &cast->opening_loc;
5277 pm_buffer_append_byte(output_buffer, ' ');
5278 prettyprint_location(output_buffer, parser, location);
5279 pm_buffer_append_string(output_buffer, " = \"", 4);
5280 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5281 pm_buffer_append_string(output_buffer, "\"\n", 2);
5282 }
5283
5284 // parts
5285 {
5286 pm_buffer_concat(output_buffer, prefix_buffer);
5287 pm_buffer_append_string(output_buffer, "+-- parts:", 10);
5288 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->parts.size));
5289
5290 size_t last_index = cast->parts.size;
5291 for (uint32_t index = 0; index < last_index; index++) {
5292 size_t prefix_length = prefix_buffer->length;
5293 pm_buffer_append_string(prefix_buffer, "| ", 4);
5294 pm_buffer_concat(output_buffer, prefix_buffer);
5295 pm_buffer_append_string(output_buffer, "+-- ", 4);
5296 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
5297 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->parts.nodes[index], prefix_buffer);
5298 prefix_buffer->length = prefix_length;
5299 }
5300 }
5301
5302 // closing_loc
5303 {
5304 pm_buffer_concat(output_buffer, prefix_buffer);
5305 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
5306 pm_location_t *location = &cast->closing_loc;
5307 pm_buffer_append_byte(output_buffer, ' ');
5308 prettyprint_location(output_buffer, parser, location);
5309 pm_buffer_append_string(output_buffer, " = \"", 4);
5310 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5311 pm_buffer_append_string(output_buffer, "\"\n", 2);
5312 }
5313
5314 break;
5315 }
5316 case PM_INTERPOLATED_STRING_NODE: {
5317 pm_interpolated_string_node_t *cast = (pm_interpolated_string_node_t *) node;
5318 pm_buffer_append_string(output_buffer, "@ InterpolatedStringNode (location: ", 36);
5319 prettyprint_location(output_buffer, parser, &node->location);
5320 pm_buffer_append_string(output_buffer, ")\n", 2);
5321
5322 // InterpolatedStringNodeFlags
5323 {
5324 pm_buffer_concat(output_buffer, prefix_buffer);
5325 pm_buffer_append_string(output_buffer, "+-- InterpolatedStringNodeFlags:", 32);
5326 bool found = false;
5327 if (cast->base.flags & PM_INTERPOLATED_STRING_NODE_FLAGS_FROZEN) {
5328 if (found) pm_buffer_append_byte(output_buffer, ',');
5329 pm_buffer_append_string(output_buffer, " frozen", 7);
5330 found = true;
5331 }
5332 if (cast->base.flags & PM_INTERPOLATED_STRING_NODE_FLAGS_MUTABLE) {
5333 if (found) pm_buffer_append_byte(output_buffer, ',');
5334 pm_buffer_append_string(output_buffer, " mutable", 8);
5335 found = true;
5336 }
5337 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
5338 pm_buffer_append_byte(output_buffer, '\n');
5339 }
5340
5341 // opening_loc
5342 {
5343 pm_buffer_concat(output_buffer, prefix_buffer);
5344 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
5345 pm_location_t *location = &cast->opening_loc;
5346 if (location->start == NULL) {
5347 pm_buffer_append_string(output_buffer, " nil\n", 5);
5348 } else {
5349 pm_buffer_append_byte(output_buffer, ' ');
5350 prettyprint_location(output_buffer, parser, location);
5351 pm_buffer_append_string(output_buffer, " = \"", 4);
5352 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5353 pm_buffer_append_string(output_buffer, "\"\n", 2);
5354 }
5355 }
5356
5357 // parts
5358 {
5359 pm_buffer_concat(output_buffer, prefix_buffer);
5360 pm_buffer_append_string(output_buffer, "+-- parts:", 10);
5361 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->parts.size));
5362
5363 size_t last_index = cast->parts.size;
5364 for (uint32_t index = 0; index < last_index; index++) {
5365 size_t prefix_length = prefix_buffer->length;
5366 pm_buffer_append_string(prefix_buffer, "| ", 4);
5367 pm_buffer_concat(output_buffer, prefix_buffer);
5368 pm_buffer_append_string(output_buffer, "+-- ", 4);
5369 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
5370 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->parts.nodes[index], prefix_buffer);
5371 prefix_buffer->length = prefix_length;
5372 }
5373 }
5374
5375 // closing_loc
5376 {
5377 pm_buffer_concat(output_buffer, prefix_buffer);
5378 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
5379 pm_location_t *location = &cast->closing_loc;
5380 if (location->start == NULL) {
5381 pm_buffer_append_string(output_buffer, " nil\n", 5);
5382 } else {
5383 pm_buffer_append_byte(output_buffer, ' ');
5384 prettyprint_location(output_buffer, parser, location);
5385 pm_buffer_append_string(output_buffer, " = \"", 4);
5386 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5387 pm_buffer_append_string(output_buffer, "\"\n", 2);
5388 }
5389 }
5390
5391 break;
5392 }
5393 case PM_INTERPOLATED_SYMBOL_NODE: {
5394 pm_interpolated_symbol_node_t *cast = (pm_interpolated_symbol_node_t *) node;
5395 pm_buffer_append_string(output_buffer, "@ InterpolatedSymbolNode (location: ", 36);
5396 prettyprint_location(output_buffer, parser, &node->location);
5397 pm_buffer_append_string(output_buffer, ")\n", 2);
5398
5399 // opening_loc
5400 {
5401 pm_buffer_concat(output_buffer, prefix_buffer);
5402 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
5403 pm_location_t *location = &cast->opening_loc;
5404 if (location->start == NULL) {
5405 pm_buffer_append_string(output_buffer, " nil\n", 5);
5406 } else {
5407 pm_buffer_append_byte(output_buffer, ' ');
5408 prettyprint_location(output_buffer, parser, location);
5409 pm_buffer_append_string(output_buffer, " = \"", 4);
5410 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5411 pm_buffer_append_string(output_buffer, "\"\n", 2);
5412 }
5413 }
5414
5415 // parts
5416 {
5417 pm_buffer_concat(output_buffer, prefix_buffer);
5418 pm_buffer_append_string(output_buffer, "+-- parts:", 10);
5419 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->parts.size));
5420
5421 size_t last_index = cast->parts.size;
5422 for (uint32_t index = 0; index < last_index; index++) {
5423 size_t prefix_length = prefix_buffer->length;
5424 pm_buffer_append_string(prefix_buffer, "| ", 4);
5425 pm_buffer_concat(output_buffer, prefix_buffer);
5426 pm_buffer_append_string(output_buffer, "+-- ", 4);
5427 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
5428 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->parts.nodes[index], prefix_buffer);
5429 prefix_buffer->length = prefix_length;
5430 }
5431 }
5432
5433 // closing_loc
5434 {
5435 pm_buffer_concat(output_buffer, prefix_buffer);
5436 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
5437 pm_location_t *location = &cast->closing_loc;
5438 if (location->start == NULL) {
5439 pm_buffer_append_string(output_buffer, " nil\n", 5);
5440 } else {
5441 pm_buffer_append_byte(output_buffer, ' ');
5442 prettyprint_location(output_buffer, parser, location);
5443 pm_buffer_append_string(output_buffer, " = \"", 4);
5444 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5445 pm_buffer_append_string(output_buffer, "\"\n", 2);
5446 }
5447 }
5448
5449 break;
5450 }
5451 case PM_INTERPOLATED_X_STRING_NODE: {
5452 pm_interpolated_x_string_node_t *cast = (pm_interpolated_x_string_node_t *) node;
5453 pm_buffer_append_string(output_buffer, "@ InterpolatedXStringNode (location: ", 37);
5454 prettyprint_location(output_buffer, parser, &node->location);
5455 pm_buffer_append_string(output_buffer, ")\n", 2);
5456
5457 // opening_loc
5458 {
5459 pm_buffer_concat(output_buffer, prefix_buffer);
5460 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
5461 pm_location_t *location = &cast->opening_loc;
5462 pm_buffer_append_byte(output_buffer, ' ');
5463 prettyprint_location(output_buffer, parser, location);
5464 pm_buffer_append_string(output_buffer, " = \"", 4);
5465 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5466 pm_buffer_append_string(output_buffer, "\"\n", 2);
5467 }
5468
5469 // parts
5470 {
5471 pm_buffer_concat(output_buffer, prefix_buffer);
5472 pm_buffer_append_string(output_buffer, "+-- parts:", 10);
5473 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->parts.size));
5474
5475 size_t last_index = cast->parts.size;
5476 for (uint32_t index = 0; index < last_index; index++) {
5477 size_t prefix_length = prefix_buffer->length;
5478 pm_buffer_append_string(prefix_buffer, "| ", 4);
5479 pm_buffer_concat(output_buffer, prefix_buffer);
5480 pm_buffer_append_string(output_buffer, "+-- ", 4);
5481 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
5482 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->parts.nodes[index], prefix_buffer);
5483 prefix_buffer->length = prefix_length;
5484 }
5485 }
5486
5487 // closing_loc
5488 {
5489 pm_buffer_concat(output_buffer, prefix_buffer);
5490 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
5491 pm_location_t *location = &cast->closing_loc;
5492 pm_buffer_append_byte(output_buffer, ' ');
5493 prettyprint_location(output_buffer, parser, location);
5494 pm_buffer_append_string(output_buffer, " = \"", 4);
5495 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5496 pm_buffer_append_string(output_buffer, "\"\n", 2);
5497 }
5498
5499 break;
5500 }
5501 case PM_IT_LOCAL_VARIABLE_READ_NODE: {
5502 pm_buffer_append_string(output_buffer, "@ ItLocalVariableReadNode (location: ", 37);
5503 prettyprint_location(output_buffer, parser, &node->location);
5504 pm_buffer_append_string(output_buffer, ")\n", 2);
5505
5506 break;
5507 }
5508 case PM_IT_PARAMETERS_NODE: {
5509 pm_buffer_append_string(output_buffer, "@ ItParametersNode (location: ", 30);
5510 prettyprint_location(output_buffer, parser, &node->location);
5511 pm_buffer_append_string(output_buffer, ")\n", 2);
5512
5513 break;
5514 }
5515 case PM_KEYWORD_HASH_NODE: {
5516 pm_keyword_hash_node_t *cast = (pm_keyword_hash_node_t *) node;
5517 pm_buffer_append_string(output_buffer, "@ KeywordHashNode (location: ", 29);
5518 prettyprint_location(output_buffer, parser, &node->location);
5519 pm_buffer_append_string(output_buffer, ")\n", 2);
5520
5521 // KeywordHashNodeFlags
5522 {
5523 pm_buffer_concat(output_buffer, prefix_buffer);
5524 pm_buffer_append_string(output_buffer, "+-- KeywordHashNodeFlags:", 25);
5525 bool found = false;
5526 if (cast->base.flags & PM_KEYWORD_HASH_NODE_FLAGS_SYMBOL_KEYS) {
5527 if (found) pm_buffer_append_byte(output_buffer, ',');
5528 pm_buffer_append_string(output_buffer, " symbol_keys", 12);
5529 found = true;
5530 }
5531 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
5532 pm_buffer_append_byte(output_buffer, '\n');
5533 }
5534
5535 // elements
5536 {
5537 pm_buffer_concat(output_buffer, prefix_buffer);
5538 pm_buffer_append_string(output_buffer, "+-- elements:", 13);
5539 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->elements.size));
5540
5541 size_t last_index = cast->elements.size;
5542 for (uint32_t index = 0; index < last_index; index++) {
5543 size_t prefix_length = prefix_buffer->length;
5544 pm_buffer_append_string(prefix_buffer, " ", 4);
5545 pm_buffer_concat(output_buffer, prefix_buffer);
5546 pm_buffer_append_string(output_buffer, "+-- ", 4);
5547 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
5548 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->elements.nodes[index], prefix_buffer);
5549 prefix_buffer->length = prefix_length;
5550 }
5551 }
5552
5553 break;
5554 }
5555 case PM_KEYWORD_REST_PARAMETER_NODE: {
5556 pm_keyword_rest_parameter_node_t *cast = (pm_keyword_rest_parameter_node_t *) node;
5557 pm_buffer_append_string(output_buffer, "@ KeywordRestParameterNode (location: ", 38);
5558 prettyprint_location(output_buffer, parser, &node->location);
5559 pm_buffer_append_string(output_buffer, ")\n", 2);
5560
5561 // ParameterFlags
5562 {
5563 pm_buffer_concat(output_buffer, prefix_buffer);
5564 pm_buffer_append_string(output_buffer, "+-- ParameterFlags:", 19);
5565 bool found = false;
5566 if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
5567 if (found) pm_buffer_append_byte(output_buffer, ',');
5568 pm_buffer_append_string(output_buffer, " repeated_parameter", 19);
5569 found = true;
5570 }
5571 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
5572 pm_buffer_append_byte(output_buffer, '\n');
5573 }
5574
5575 // name
5576 {
5577 pm_buffer_concat(output_buffer, prefix_buffer);
5578 pm_buffer_append_string(output_buffer, "+-- name:", 9);
5579 if (cast->name == 0) {
5580 pm_buffer_append_string(output_buffer, " nil\n", 5);
5581 } else {
5582 pm_buffer_append_byte(output_buffer, ' ');
5583 prettyprint_constant(output_buffer, parser, cast->name);
5584 pm_buffer_append_byte(output_buffer, '\n');
5585 }
5586 }
5587
5588 // name_loc
5589 {
5590 pm_buffer_concat(output_buffer, prefix_buffer);
5591 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
5592 pm_location_t *location = &cast->name_loc;
5593 if (location->start == NULL) {
5594 pm_buffer_append_string(output_buffer, " nil\n", 5);
5595 } else {
5596 pm_buffer_append_byte(output_buffer, ' ');
5597 prettyprint_location(output_buffer, parser, location);
5598 pm_buffer_append_string(output_buffer, " = \"", 4);
5599 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5600 pm_buffer_append_string(output_buffer, "\"\n", 2);
5601 }
5602 }
5603
5604 // operator_loc
5605 {
5606 pm_buffer_concat(output_buffer, prefix_buffer);
5607 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
5608 pm_location_t *location = &cast->operator_loc;
5609 pm_buffer_append_byte(output_buffer, ' ');
5610 prettyprint_location(output_buffer, parser, location);
5611 pm_buffer_append_string(output_buffer, " = \"", 4);
5612 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5613 pm_buffer_append_string(output_buffer, "\"\n", 2);
5614 }
5615
5616 break;
5617 }
5618 case PM_LAMBDA_NODE: {
5619 pm_lambda_node_t *cast = (pm_lambda_node_t *) node;
5620 pm_buffer_append_string(output_buffer, "@ LambdaNode (location: ", 24);
5621 prettyprint_location(output_buffer, parser, &node->location);
5622 pm_buffer_append_string(output_buffer, ")\n", 2);
5623
5624 // locals
5625 {
5626 pm_buffer_concat(output_buffer, prefix_buffer);
5627 pm_buffer_append_string(output_buffer, "+-- locals:", 11);
5628 pm_buffer_append_string(output_buffer, " [", 2);
5629 for (uint32_t index = 0; index < cast->locals.size; index++) {
5630 if (index != 0) pm_buffer_append_string(output_buffer, ", ", 2);
5631 prettyprint_constant(output_buffer, parser, cast->locals.ids[index]);
5632 }
5633 pm_buffer_append_string(output_buffer, "]\n", 2);
5634 }
5635
5636 // operator_loc
5637 {
5638 pm_buffer_concat(output_buffer, prefix_buffer);
5639 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
5640 pm_location_t *location = &cast->operator_loc;
5641 pm_buffer_append_byte(output_buffer, ' ');
5642 prettyprint_location(output_buffer, parser, location);
5643 pm_buffer_append_string(output_buffer, " = \"", 4);
5644 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5645 pm_buffer_append_string(output_buffer, "\"\n", 2);
5646 }
5647
5648 // opening_loc
5649 {
5650 pm_buffer_concat(output_buffer, prefix_buffer);
5651 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
5652 pm_location_t *location = &cast->opening_loc;
5653 pm_buffer_append_byte(output_buffer, ' ');
5654 prettyprint_location(output_buffer, parser, location);
5655 pm_buffer_append_string(output_buffer, " = \"", 4);
5656 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5657 pm_buffer_append_string(output_buffer, "\"\n", 2);
5658 }
5659
5660 // closing_loc
5661 {
5662 pm_buffer_concat(output_buffer, prefix_buffer);
5663 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
5664 pm_location_t *location = &cast->closing_loc;
5665 pm_buffer_append_byte(output_buffer, ' ');
5666 prettyprint_location(output_buffer, parser, location);
5667 pm_buffer_append_string(output_buffer, " = \"", 4);
5668 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5669 pm_buffer_append_string(output_buffer, "\"\n", 2);
5670 }
5671
5672 // parameters
5673 {
5674 pm_buffer_concat(output_buffer, prefix_buffer);
5675 pm_buffer_append_string(output_buffer, "+-- parameters:", 15);
5676 if (cast->parameters == NULL) {
5677 pm_buffer_append_string(output_buffer, " nil\n", 5);
5678 } else {
5679 pm_buffer_append_byte(output_buffer, '\n');
5680
5681 size_t prefix_length = prefix_buffer->length;
5682 pm_buffer_append_string(prefix_buffer, "| ", 4);
5683 pm_buffer_concat(output_buffer, prefix_buffer);
5684 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->parameters, prefix_buffer);
5685 prefix_buffer->length = prefix_length;
5686 }
5687 }
5688
5689 // body
5690 {
5691 pm_buffer_concat(output_buffer, prefix_buffer);
5692 pm_buffer_append_string(output_buffer, "+-- body:", 9);
5693 if (cast->body == NULL) {
5694 pm_buffer_append_string(output_buffer, " nil\n", 5);
5695 } else {
5696 pm_buffer_append_byte(output_buffer, '\n');
5697
5698 size_t prefix_length = prefix_buffer->length;
5699 pm_buffer_append_string(prefix_buffer, " ", 4);
5700 pm_buffer_concat(output_buffer, prefix_buffer);
5701 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->body, prefix_buffer);
5702 prefix_buffer->length = prefix_length;
5703 }
5704 }
5705
5706 break;
5707 }
5708 case PM_LOCAL_VARIABLE_AND_WRITE_NODE: {
5709 pm_local_variable_and_write_node_t *cast = (pm_local_variable_and_write_node_t *) node;
5710 pm_buffer_append_string(output_buffer, "@ LocalVariableAndWriteNode (location: ", 39);
5711 prettyprint_location(output_buffer, parser, &node->location);
5712 pm_buffer_append_string(output_buffer, ")\n", 2);
5713
5714 // name_loc
5715 {
5716 pm_buffer_concat(output_buffer, prefix_buffer);
5717 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
5718 pm_location_t *location = &cast->name_loc;
5719 pm_buffer_append_byte(output_buffer, ' ');
5720 prettyprint_location(output_buffer, parser, location);
5721 pm_buffer_append_string(output_buffer, " = \"", 4);
5722 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5723 pm_buffer_append_string(output_buffer, "\"\n", 2);
5724 }
5725
5726 // operator_loc
5727 {
5728 pm_buffer_concat(output_buffer, prefix_buffer);
5729 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
5730 pm_location_t *location = &cast->operator_loc;
5731 pm_buffer_append_byte(output_buffer, ' ');
5732 prettyprint_location(output_buffer, parser, location);
5733 pm_buffer_append_string(output_buffer, " = \"", 4);
5734 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5735 pm_buffer_append_string(output_buffer, "\"\n", 2);
5736 }
5737
5738 // value
5739 {
5740 pm_buffer_concat(output_buffer, prefix_buffer);
5741 pm_buffer_append_string(output_buffer, "+-- value:", 10);
5742 pm_buffer_append_byte(output_buffer, '\n');
5743
5744 size_t prefix_length = prefix_buffer->length;
5745 pm_buffer_append_string(prefix_buffer, "| ", 4);
5746 pm_buffer_concat(output_buffer, prefix_buffer);
5747 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
5748 prefix_buffer->length = prefix_length;
5749 }
5750
5751 // name
5752 {
5753 pm_buffer_concat(output_buffer, prefix_buffer);
5754 pm_buffer_append_string(output_buffer, "+-- name:", 9);
5755 pm_buffer_append_byte(output_buffer, ' ');
5756 prettyprint_constant(output_buffer, parser, cast->name);
5757 pm_buffer_append_byte(output_buffer, '\n');
5758 }
5759
5760 // depth
5761 {
5762 pm_buffer_concat(output_buffer, prefix_buffer);
5763 pm_buffer_append_string(output_buffer, "+-- depth:", 10);
5764 pm_buffer_append_format(output_buffer, " %" PRIu32 "\n", cast->depth);
5765 }
5766
5767 break;
5768 }
5769 case PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
5770 pm_local_variable_operator_write_node_t *cast = (pm_local_variable_operator_write_node_t *) node;
5771 pm_buffer_append_string(output_buffer, "@ LocalVariableOperatorWriteNode (location: ", 44);
5772 prettyprint_location(output_buffer, parser, &node->location);
5773 pm_buffer_append_string(output_buffer, ")\n", 2);
5774
5775 // name_loc
5776 {
5777 pm_buffer_concat(output_buffer, prefix_buffer);
5778 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
5779 pm_location_t *location = &cast->name_loc;
5780 pm_buffer_append_byte(output_buffer, ' ');
5781 prettyprint_location(output_buffer, parser, location);
5782 pm_buffer_append_string(output_buffer, " = \"", 4);
5783 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5784 pm_buffer_append_string(output_buffer, "\"\n", 2);
5785 }
5786
5787 // binary_operator_loc
5788 {
5789 pm_buffer_concat(output_buffer, prefix_buffer);
5790 pm_buffer_append_string(output_buffer, "+-- binary_operator_loc:", 24);
5791 pm_location_t *location = &cast->binary_operator_loc;
5792 pm_buffer_append_byte(output_buffer, ' ');
5793 prettyprint_location(output_buffer, parser, location);
5794 pm_buffer_append_string(output_buffer, " = \"", 4);
5795 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5796 pm_buffer_append_string(output_buffer, "\"\n", 2);
5797 }
5798
5799 // value
5800 {
5801 pm_buffer_concat(output_buffer, prefix_buffer);
5802 pm_buffer_append_string(output_buffer, "+-- value:", 10);
5803 pm_buffer_append_byte(output_buffer, '\n');
5804
5805 size_t prefix_length = prefix_buffer->length;
5806 pm_buffer_append_string(prefix_buffer, "| ", 4);
5807 pm_buffer_concat(output_buffer, prefix_buffer);
5808 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
5809 prefix_buffer->length = prefix_length;
5810 }
5811
5812 // name
5813 {
5814 pm_buffer_concat(output_buffer, prefix_buffer);
5815 pm_buffer_append_string(output_buffer, "+-- name:", 9);
5816 pm_buffer_append_byte(output_buffer, ' ');
5817 prettyprint_constant(output_buffer, parser, cast->name);
5818 pm_buffer_append_byte(output_buffer, '\n');
5819 }
5820
5821 // binary_operator
5822 {
5823 pm_buffer_concat(output_buffer, prefix_buffer);
5824 pm_buffer_append_string(output_buffer, "+-- binary_operator:", 20);
5825 pm_buffer_append_byte(output_buffer, ' ');
5826 prettyprint_constant(output_buffer, parser, cast->binary_operator);
5827 pm_buffer_append_byte(output_buffer, '\n');
5828 }
5829
5830 // depth
5831 {
5832 pm_buffer_concat(output_buffer, prefix_buffer);
5833 pm_buffer_append_string(output_buffer, "+-- depth:", 10);
5834 pm_buffer_append_format(output_buffer, " %" PRIu32 "\n", cast->depth);
5835 }
5836
5837 break;
5838 }
5839 case PM_LOCAL_VARIABLE_OR_WRITE_NODE: {
5840 pm_local_variable_or_write_node_t *cast = (pm_local_variable_or_write_node_t *) node;
5841 pm_buffer_append_string(output_buffer, "@ LocalVariableOrWriteNode (location: ", 38);
5842 prettyprint_location(output_buffer, parser, &node->location);
5843 pm_buffer_append_string(output_buffer, ")\n", 2);
5844
5845 // name_loc
5846 {
5847 pm_buffer_concat(output_buffer, prefix_buffer);
5848 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
5849 pm_location_t *location = &cast->name_loc;
5850 pm_buffer_append_byte(output_buffer, ' ');
5851 prettyprint_location(output_buffer, parser, location);
5852 pm_buffer_append_string(output_buffer, " = \"", 4);
5853 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5854 pm_buffer_append_string(output_buffer, "\"\n", 2);
5855 }
5856
5857 // operator_loc
5858 {
5859 pm_buffer_concat(output_buffer, prefix_buffer);
5860 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
5861 pm_location_t *location = &cast->operator_loc;
5862 pm_buffer_append_byte(output_buffer, ' ');
5863 prettyprint_location(output_buffer, parser, location);
5864 pm_buffer_append_string(output_buffer, " = \"", 4);
5865 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5866 pm_buffer_append_string(output_buffer, "\"\n", 2);
5867 }
5868
5869 // value
5870 {
5871 pm_buffer_concat(output_buffer, prefix_buffer);
5872 pm_buffer_append_string(output_buffer, "+-- value:", 10);
5873 pm_buffer_append_byte(output_buffer, '\n');
5874
5875 size_t prefix_length = prefix_buffer->length;
5876 pm_buffer_append_string(prefix_buffer, "| ", 4);
5877 pm_buffer_concat(output_buffer, prefix_buffer);
5878 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
5879 prefix_buffer->length = prefix_length;
5880 }
5881
5882 // name
5883 {
5884 pm_buffer_concat(output_buffer, prefix_buffer);
5885 pm_buffer_append_string(output_buffer, "+-- name:", 9);
5886 pm_buffer_append_byte(output_buffer, ' ');
5887 prettyprint_constant(output_buffer, parser, cast->name);
5888 pm_buffer_append_byte(output_buffer, '\n');
5889 }
5890
5891 // depth
5892 {
5893 pm_buffer_concat(output_buffer, prefix_buffer);
5894 pm_buffer_append_string(output_buffer, "+-- depth:", 10);
5895 pm_buffer_append_format(output_buffer, " %" PRIu32 "\n", cast->depth);
5896 }
5897
5898 break;
5899 }
5900 case PM_LOCAL_VARIABLE_READ_NODE: {
5901 pm_local_variable_read_node_t *cast = (pm_local_variable_read_node_t *) node;
5902 pm_buffer_append_string(output_buffer, "@ LocalVariableReadNode (location: ", 35);
5903 prettyprint_location(output_buffer, parser, &node->location);
5904 pm_buffer_append_string(output_buffer, ")\n", 2);
5905
5906 // name
5907 {
5908 pm_buffer_concat(output_buffer, prefix_buffer);
5909 pm_buffer_append_string(output_buffer, "+-- name:", 9);
5910 pm_buffer_append_byte(output_buffer, ' ');
5911 prettyprint_constant(output_buffer, parser, cast->name);
5912 pm_buffer_append_byte(output_buffer, '\n');
5913 }
5914
5915 // depth
5916 {
5917 pm_buffer_concat(output_buffer, prefix_buffer);
5918 pm_buffer_append_string(output_buffer, "+-- depth:", 10);
5919 pm_buffer_append_format(output_buffer, " %" PRIu32 "\n", cast->depth);
5920 }
5921
5922 break;
5923 }
5924 case PM_LOCAL_VARIABLE_TARGET_NODE: {
5925 pm_local_variable_target_node_t *cast = (pm_local_variable_target_node_t *) node;
5926 pm_buffer_append_string(output_buffer, "@ LocalVariableTargetNode (location: ", 37);
5927 prettyprint_location(output_buffer, parser, &node->location);
5928 pm_buffer_append_string(output_buffer, ")\n", 2);
5929
5930 // name
5931 {
5932 pm_buffer_concat(output_buffer, prefix_buffer);
5933 pm_buffer_append_string(output_buffer, "+-- name:", 9);
5934 pm_buffer_append_byte(output_buffer, ' ');
5935 prettyprint_constant(output_buffer, parser, cast->name);
5936 pm_buffer_append_byte(output_buffer, '\n');
5937 }
5938
5939 // depth
5940 {
5941 pm_buffer_concat(output_buffer, prefix_buffer);
5942 pm_buffer_append_string(output_buffer, "+-- depth:", 10);
5943 pm_buffer_append_format(output_buffer, " %" PRIu32 "\n", cast->depth);
5944 }
5945
5946 break;
5947 }
5948 case PM_LOCAL_VARIABLE_WRITE_NODE: {
5949 pm_local_variable_write_node_t *cast = (pm_local_variable_write_node_t *) node;
5950 pm_buffer_append_string(output_buffer, "@ LocalVariableWriteNode (location: ", 36);
5951 prettyprint_location(output_buffer, parser, &node->location);
5952 pm_buffer_append_string(output_buffer, ")\n", 2);
5953
5954 // name
5955 {
5956 pm_buffer_concat(output_buffer, prefix_buffer);
5957 pm_buffer_append_string(output_buffer, "+-- name:", 9);
5958 pm_buffer_append_byte(output_buffer, ' ');
5959 prettyprint_constant(output_buffer, parser, cast->name);
5960 pm_buffer_append_byte(output_buffer, '\n');
5961 }
5962
5963 // depth
5964 {
5965 pm_buffer_concat(output_buffer, prefix_buffer);
5966 pm_buffer_append_string(output_buffer, "+-- depth:", 10);
5967 pm_buffer_append_format(output_buffer, " %" PRIu32 "\n", cast->depth);
5968 }
5969
5970 // name_loc
5971 {
5972 pm_buffer_concat(output_buffer, prefix_buffer);
5973 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
5974 pm_location_t *location = &cast->name_loc;
5975 pm_buffer_append_byte(output_buffer, ' ');
5976 prettyprint_location(output_buffer, parser, location);
5977 pm_buffer_append_string(output_buffer, " = \"", 4);
5978 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
5979 pm_buffer_append_string(output_buffer, "\"\n", 2);
5980 }
5981
5982 // value
5983 {
5984 pm_buffer_concat(output_buffer, prefix_buffer);
5985 pm_buffer_append_string(output_buffer, "+-- value:", 10);
5986 pm_buffer_append_byte(output_buffer, '\n');
5987
5988 size_t prefix_length = prefix_buffer->length;
5989 pm_buffer_append_string(prefix_buffer, "| ", 4);
5990 pm_buffer_concat(output_buffer, prefix_buffer);
5991 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
5992 prefix_buffer->length = prefix_length;
5993 }
5994
5995 // operator_loc
5996 {
5997 pm_buffer_concat(output_buffer, prefix_buffer);
5998 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
5999 pm_location_t *location = &cast->operator_loc;
6000 pm_buffer_append_byte(output_buffer, ' ');
6001 prettyprint_location(output_buffer, parser, location);
6002 pm_buffer_append_string(output_buffer, " = \"", 4);
6003 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
6004 pm_buffer_append_string(output_buffer, "\"\n", 2);
6005 }
6006
6007 break;
6008 }
6009 case PM_MATCH_LAST_LINE_NODE: {
6010 pm_match_last_line_node_t *cast = (pm_match_last_line_node_t *) node;
6011 pm_buffer_append_string(output_buffer, "@ MatchLastLineNode (location: ", 31);
6012 prettyprint_location(output_buffer, parser, &node->location);
6013 pm_buffer_append_string(output_buffer, ")\n", 2);
6014
6015 // RegularExpressionFlags
6016 {
6017 pm_buffer_concat(output_buffer, prefix_buffer);
6018 pm_buffer_append_string(output_buffer, "+-- RegularExpressionFlags:", 27);
6019 bool found = false;
6020 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE) {
6021 if (found) pm_buffer_append_byte(output_buffer, ',');
6022 pm_buffer_append_string(output_buffer, " ignore_case", 12);
6023 found = true;
6024 }
6025 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_EXTENDED) {
6026 if (found) pm_buffer_append_byte(output_buffer, ',');
6027 pm_buffer_append_string(output_buffer, " extended", 9);
6028 found = true;
6029 }
6030 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE) {
6031 if (found) pm_buffer_append_byte(output_buffer, ',');
6032 pm_buffer_append_string(output_buffer, " multi_line", 11);
6033 found = true;
6034 }
6035 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_ONCE) {
6036 if (found) pm_buffer_append_byte(output_buffer, ',');
6037 pm_buffer_append_string(output_buffer, " once", 5);
6038 found = true;
6039 }
6040 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_EUC_JP) {
6041 if (found) pm_buffer_append_byte(output_buffer, ',');
6042 pm_buffer_append_string(output_buffer, " euc_jp", 7);
6043 found = true;
6044 }
6045 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT) {
6046 if (found) pm_buffer_append_byte(output_buffer, ',');
6047 pm_buffer_append_string(output_buffer, " ascii_8bit", 11);
6048 found = true;
6049 }
6050 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J) {
6051 if (found) pm_buffer_append_byte(output_buffer, ',');
6052 pm_buffer_append_string(output_buffer, " windows_31j", 12);
6053 found = true;
6054 }
6055 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_UTF_8) {
6056 if (found) pm_buffer_append_byte(output_buffer, ',');
6057 pm_buffer_append_string(output_buffer, " utf_8", 6);
6058 found = true;
6059 }
6060 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING) {
6061 if (found) pm_buffer_append_byte(output_buffer, ',');
6062 pm_buffer_append_string(output_buffer, " forced_utf8_encoding", 21);
6063 found = true;
6064 }
6065 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING) {
6066 if (found) pm_buffer_append_byte(output_buffer, ',');
6067 pm_buffer_append_string(output_buffer, " forced_binary_encoding", 23);
6068 found = true;
6069 }
6070 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING) {
6071 if (found) pm_buffer_append_byte(output_buffer, ',');
6072 pm_buffer_append_string(output_buffer, " forced_us_ascii_encoding", 25);
6073 found = true;
6074 }
6075 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
6076 pm_buffer_append_byte(output_buffer, '\n');
6077 }
6078
6079 // opening_loc
6080 {
6081 pm_buffer_concat(output_buffer, prefix_buffer);
6082 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
6083 pm_location_t *location = &cast->opening_loc;
6084 pm_buffer_append_byte(output_buffer, ' ');
6085 prettyprint_location(output_buffer, parser, location);
6086 pm_buffer_append_string(output_buffer, " = \"", 4);
6087 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
6088 pm_buffer_append_string(output_buffer, "\"\n", 2);
6089 }
6090
6091 // content_loc
6092 {
6093 pm_buffer_concat(output_buffer, prefix_buffer);
6094 pm_buffer_append_string(output_buffer, "+-- content_loc:", 16);
6095 pm_location_t *location = &cast->content_loc;
6096 pm_buffer_append_byte(output_buffer, ' ');
6097 prettyprint_location(output_buffer, parser, location);
6098 pm_buffer_append_string(output_buffer, " = \"", 4);
6099 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
6100 pm_buffer_append_string(output_buffer, "\"\n", 2);
6101 }
6102
6103 // closing_loc
6104 {
6105 pm_buffer_concat(output_buffer, prefix_buffer);
6106 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
6107 pm_location_t *location = &cast->closing_loc;
6108 pm_buffer_append_byte(output_buffer, ' ');
6109 prettyprint_location(output_buffer, parser, location);
6110 pm_buffer_append_string(output_buffer, " = \"", 4);
6111 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
6112 pm_buffer_append_string(output_buffer, "\"\n", 2);
6113 }
6114
6115 // unescaped
6116 {
6117 pm_buffer_concat(output_buffer, prefix_buffer);
6118 pm_buffer_append_string(output_buffer, "+-- unescaped:", 14);
6119 pm_buffer_append_string(output_buffer, " \"", 2);
6120 pm_buffer_append_source(output_buffer, pm_string_source(&cast->unescaped), pm_string_length(&cast->unescaped), PM_BUFFER_ESCAPING_RUBY);
6121 pm_buffer_append_string(output_buffer, "\"\n", 2);
6122 }
6123
6124 break;
6125 }
6126 case PM_MATCH_PREDICATE_NODE: {
6127 pm_match_predicate_node_t *cast = (pm_match_predicate_node_t *) node;
6128 pm_buffer_append_string(output_buffer, "@ MatchPredicateNode (location: ", 32);
6129 prettyprint_location(output_buffer, parser, &node->location);
6130 pm_buffer_append_string(output_buffer, ")\n", 2);
6131
6132 // value
6133 {
6134 pm_buffer_concat(output_buffer, prefix_buffer);
6135 pm_buffer_append_string(output_buffer, "+-- value:", 10);
6136 pm_buffer_append_byte(output_buffer, '\n');
6137
6138 size_t prefix_length = prefix_buffer->length;
6139 pm_buffer_append_string(prefix_buffer, "| ", 4);
6140 pm_buffer_concat(output_buffer, prefix_buffer);
6141 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
6142 prefix_buffer->length = prefix_length;
6143 }
6144
6145 // pattern
6146 {
6147 pm_buffer_concat(output_buffer, prefix_buffer);
6148 pm_buffer_append_string(output_buffer, "+-- pattern:", 12);
6149 pm_buffer_append_byte(output_buffer, '\n');
6150
6151 size_t prefix_length = prefix_buffer->length;
6152 pm_buffer_append_string(prefix_buffer, "| ", 4);
6153 pm_buffer_concat(output_buffer, prefix_buffer);
6154 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->pattern, prefix_buffer);
6155 prefix_buffer->length = prefix_length;
6156 }
6157
6158 // operator_loc
6159 {
6160 pm_buffer_concat(output_buffer, prefix_buffer);
6161 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
6162 pm_location_t *location = &cast->operator_loc;
6163 pm_buffer_append_byte(output_buffer, ' ');
6164 prettyprint_location(output_buffer, parser, location);
6165 pm_buffer_append_string(output_buffer, " = \"", 4);
6166 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
6167 pm_buffer_append_string(output_buffer, "\"\n", 2);
6168 }
6169
6170 break;
6171 }
6172 case PM_MATCH_REQUIRED_NODE: {
6173 pm_match_required_node_t *cast = (pm_match_required_node_t *) node;
6174 pm_buffer_append_string(output_buffer, "@ MatchRequiredNode (location: ", 31);
6175 prettyprint_location(output_buffer, parser, &node->location);
6176 pm_buffer_append_string(output_buffer, ")\n", 2);
6177
6178 // value
6179 {
6180 pm_buffer_concat(output_buffer, prefix_buffer);
6181 pm_buffer_append_string(output_buffer, "+-- value:", 10);
6182 pm_buffer_append_byte(output_buffer, '\n');
6183
6184 size_t prefix_length = prefix_buffer->length;
6185 pm_buffer_append_string(prefix_buffer, "| ", 4);
6186 pm_buffer_concat(output_buffer, prefix_buffer);
6187 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
6188 prefix_buffer->length = prefix_length;
6189 }
6190
6191 // pattern
6192 {
6193 pm_buffer_concat(output_buffer, prefix_buffer);
6194 pm_buffer_append_string(output_buffer, "+-- pattern:", 12);
6195 pm_buffer_append_byte(output_buffer, '\n');
6196
6197 size_t prefix_length = prefix_buffer->length;
6198 pm_buffer_append_string(prefix_buffer, "| ", 4);
6199 pm_buffer_concat(output_buffer, prefix_buffer);
6200 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->pattern, prefix_buffer);
6201 prefix_buffer->length = prefix_length;
6202 }
6203
6204 // operator_loc
6205 {
6206 pm_buffer_concat(output_buffer, prefix_buffer);
6207 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
6208 pm_location_t *location = &cast->operator_loc;
6209 pm_buffer_append_byte(output_buffer, ' ');
6210 prettyprint_location(output_buffer, parser, location);
6211 pm_buffer_append_string(output_buffer, " = \"", 4);
6212 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
6213 pm_buffer_append_string(output_buffer, "\"\n", 2);
6214 }
6215
6216 break;
6217 }
6218 case PM_MATCH_WRITE_NODE: {
6219 pm_match_write_node_t *cast = (pm_match_write_node_t *) node;
6220 pm_buffer_append_string(output_buffer, "@ MatchWriteNode (location: ", 28);
6221 prettyprint_location(output_buffer, parser, &node->location);
6222 pm_buffer_append_string(output_buffer, ")\n", 2);
6223
6224 // call
6225 {
6226 pm_buffer_concat(output_buffer, prefix_buffer);
6227 pm_buffer_append_string(output_buffer, "+-- call:", 9);
6228 pm_buffer_append_byte(output_buffer, '\n');
6229
6230 size_t prefix_length = prefix_buffer->length;
6231 pm_buffer_append_string(prefix_buffer, "| ", 4);
6232 pm_buffer_concat(output_buffer, prefix_buffer);
6233 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->call, prefix_buffer);
6234 prefix_buffer->length = prefix_length;
6235 }
6236
6237 // targets
6238 {
6239 pm_buffer_concat(output_buffer, prefix_buffer);
6240 pm_buffer_append_string(output_buffer, "+-- targets:", 12);
6241 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->targets.size));
6242
6243 size_t last_index = cast->targets.size;
6244 for (uint32_t index = 0; index < last_index; index++) {
6245 size_t prefix_length = prefix_buffer->length;
6246 pm_buffer_append_string(prefix_buffer, " ", 4);
6247 pm_buffer_concat(output_buffer, prefix_buffer);
6248 pm_buffer_append_string(output_buffer, "+-- ", 4);
6249 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
6250 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->targets.nodes[index], prefix_buffer);
6251 prefix_buffer->length = prefix_length;
6252 }
6253 }
6254
6255 break;
6256 }
6257 case PM_MISSING_NODE: {
6258 pm_buffer_append_string(output_buffer, "@ MissingNode (location: ", 25);
6259 prettyprint_location(output_buffer, parser, &node->location);
6260 pm_buffer_append_string(output_buffer, ")\n", 2);
6261
6262 break;
6263 }
6264 case PM_MODULE_NODE: {
6265 pm_module_node_t *cast = (pm_module_node_t *) node;
6266 pm_buffer_append_string(output_buffer, "@ ModuleNode (location: ", 24);
6267 prettyprint_location(output_buffer, parser, &node->location);
6268 pm_buffer_append_string(output_buffer, ")\n", 2);
6269
6270 // locals
6271 {
6272 pm_buffer_concat(output_buffer, prefix_buffer);
6273 pm_buffer_append_string(output_buffer, "+-- locals:", 11);
6274 pm_buffer_append_string(output_buffer, " [", 2);
6275 for (uint32_t index = 0; index < cast->locals.size; index++) {
6276 if (index != 0) pm_buffer_append_string(output_buffer, ", ", 2);
6277 prettyprint_constant(output_buffer, parser, cast->locals.ids[index]);
6278 }
6279 pm_buffer_append_string(output_buffer, "]\n", 2);
6280 }
6281
6282 // module_keyword_loc
6283 {
6284 pm_buffer_concat(output_buffer, prefix_buffer);
6285 pm_buffer_append_string(output_buffer, "+-- module_keyword_loc:", 23);
6286 pm_location_t *location = &cast->module_keyword_loc;
6287 pm_buffer_append_byte(output_buffer, ' ');
6288 prettyprint_location(output_buffer, parser, location);
6289 pm_buffer_append_string(output_buffer, " = \"", 4);
6290 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
6291 pm_buffer_append_string(output_buffer, "\"\n", 2);
6292 }
6293
6294 // constant_path
6295 {
6296 pm_buffer_concat(output_buffer, prefix_buffer);
6297 pm_buffer_append_string(output_buffer, "+-- constant_path:", 18);
6298 pm_buffer_append_byte(output_buffer, '\n');
6299
6300 size_t prefix_length = prefix_buffer->length;
6301 pm_buffer_append_string(prefix_buffer, "| ", 4);
6302 pm_buffer_concat(output_buffer, prefix_buffer);
6303 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->constant_path, prefix_buffer);
6304 prefix_buffer->length = prefix_length;
6305 }
6306
6307 // body
6308 {
6309 pm_buffer_concat(output_buffer, prefix_buffer);
6310 pm_buffer_append_string(output_buffer, "+-- body:", 9);
6311 if (cast->body == NULL) {
6312 pm_buffer_append_string(output_buffer, " nil\n", 5);
6313 } else {
6314 pm_buffer_append_byte(output_buffer, '\n');
6315
6316 size_t prefix_length = prefix_buffer->length;
6317 pm_buffer_append_string(prefix_buffer, "| ", 4);
6318 pm_buffer_concat(output_buffer, prefix_buffer);
6319 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->body, prefix_buffer);
6320 prefix_buffer->length = prefix_length;
6321 }
6322 }
6323
6324 // end_keyword_loc
6325 {
6326 pm_buffer_concat(output_buffer, prefix_buffer);
6327 pm_buffer_append_string(output_buffer, "+-- end_keyword_loc:", 20);
6328 pm_location_t *location = &cast->end_keyword_loc;
6329 pm_buffer_append_byte(output_buffer, ' ');
6330 prettyprint_location(output_buffer, parser, location);
6331 pm_buffer_append_string(output_buffer, " = \"", 4);
6332 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
6333 pm_buffer_append_string(output_buffer, "\"\n", 2);
6334 }
6335
6336 // name
6337 {
6338 pm_buffer_concat(output_buffer, prefix_buffer);
6339 pm_buffer_append_string(output_buffer, "+-- name:", 9);
6340 pm_buffer_append_byte(output_buffer, ' ');
6341 prettyprint_constant(output_buffer, parser, cast->name);
6342 pm_buffer_append_byte(output_buffer, '\n');
6343 }
6344
6345 break;
6346 }
6347 case PM_MULTI_TARGET_NODE: {
6348 pm_multi_target_node_t *cast = (pm_multi_target_node_t *) node;
6349 pm_buffer_append_string(output_buffer, "@ MultiTargetNode (location: ", 29);
6350 prettyprint_location(output_buffer, parser, &node->location);
6351 pm_buffer_append_string(output_buffer, ")\n", 2);
6352
6353 // lefts
6354 {
6355 pm_buffer_concat(output_buffer, prefix_buffer);
6356 pm_buffer_append_string(output_buffer, "+-- lefts:", 10);
6357 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->lefts.size));
6358
6359 size_t last_index = cast->lefts.size;
6360 for (uint32_t index = 0; index < last_index; index++) {
6361 size_t prefix_length = prefix_buffer->length;
6362 pm_buffer_append_string(prefix_buffer, "| ", 4);
6363 pm_buffer_concat(output_buffer, prefix_buffer);
6364 pm_buffer_append_string(output_buffer, "+-- ", 4);
6365 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
6366 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->lefts.nodes[index], prefix_buffer);
6367 prefix_buffer->length = prefix_length;
6368 }
6369 }
6370
6371 // rest
6372 {
6373 pm_buffer_concat(output_buffer, prefix_buffer);
6374 pm_buffer_append_string(output_buffer, "+-- rest:", 9);
6375 if (cast->rest == NULL) {
6376 pm_buffer_append_string(output_buffer, " nil\n", 5);
6377 } else {
6378 pm_buffer_append_byte(output_buffer, '\n');
6379
6380 size_t prefix_length = prefix_buffer->length;
6381 pm_buffer_append_string(prefix_buffer, "| ", 4);
6382 pm_buffer_concat(output_buffer, prefix_buffer);
6383 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->rest, prefix_buffer);
6384 prefix_buffer->length = prefix_length;
6385 }
6386 }
6387
6388 // rights
6389 {
6390 pm_buffer_concat(output_buffer, prefix_buffer);
6391 pm_buffer_append_string(output_buffer, "+-- rights:", 11);
6392 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->rights.size));
6393
6394 size_t last_index = cast->rights.size;
6395 for (uint32_t index = 0; index < last_index; index++) {
6396 size_t prefix_length = prefix_buffer->length;
6397 pm_buffer_append_string(prefix_buffer, "| ", 4);
6398 pm_buffer_concat(output_buffer, prefix_buffer);
6399 pm_buffer_append_string(output_buffer, "+-- ", 4);
6400 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
6401 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->rights.nodes[index], prefix_buffer);
6402 prefix_buffer->length = prefix_length;
6403 }
6404 }
6405
6406 // lparen_loc
6407 {
6408 pm_buffer_concat(output_buffer, prefix_buffer);
6409 pm_buffer_append_string(output_buffer, "+-- lparen_loc:", 15);
6410 pm_location_t *location = &cast->lparen_loc;
6411 if (location->start == NULL) {
6412 pm_buffer_append_string(output_buffer, " nil\n", 5);
6413 } else {
6414 pm_buffer_append_byte(output_buffer, ' ');
6415 prettyprint_location(output_buffer, parser, location);
6416 pm_buffer_append_string(output_buffer, " = \"", 4);
6417 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
6418 pm_buffer_append_string(output_buffer, "\"\n", 2);
6419 }
6420 }
6421
6422 // rparen_loc
6423 {
6424 pm_buffer_concat(output_buffer, prefix_buffer);
6425 pm_buffer_append_string(output_buffer, "+-- rparen_loc:", 15);
6426 pm_location_t *location = &cast->rparen_loc;
6427 if (location->start == NULL) {
6428 pm_buffer_append_string(output_buffer, " nil\n", 5);
6429 } else {
6430 pm_buffer_append_byte(output_buffer, ' ');
6431 prettyprint_location(output_buffer, parser, location);
6432 pm_buffer_append_string(output_buffer, " = \"", 4);
6433 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
6434 pm_buffer_append_string(output_buffer, "\"\n", 2);
6435 }
6436 }
6437
6438 break;
6439 }
6440 case PM_MULTI_WRITE_NODE: {
6441 pm_multi_write_node_t *cast = (pm_multi_write_node_t *) node;
6442 pm_buffer_append_string(output_buffer, "@ MultiWriteNode (location: ", 28);
6443 prettyprint_location(output_buffer, parser, &node->location);
6444 pm_buffer_append_string(output_buffer, ")\n", 2);
6445
6446 // lefts
6447 {
6448 pm_buffer_concat(output_buffer, prefix_buffer);
6449 pm_buffer_append_string(output_buffer, "+-- lefts:", 10);
6450 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->lefts.size));
6451
6452 size_t last_index = cast->lefts.size;
6453 for (uint32_t index = 0; index < last_index; index++) {
6454 size_t prefix_length = prefix_buffer->length;
6455 pm_buffer_append_string(prefix_buffer, "| ", 4);
6456 pm_buffer_concat(output_buffer, prefix_buffer);
6457 pm_buffer_append_string(output_buffer, "+-- ", 4);
6458 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
6459 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->lefts.nodes[index], prefix_buffer);
6460 prefix_buffer->length = prefix_length;
6461 }
6462 }
6463
6464 // rest
6465 {
6466 pm_buffer_concat(output_buffer, prefix_buffer);
6467 pm_buffer_append_string(output_buffer, "+-- rest:", 9);
6468 if (cast->rest == NULL) {
6469 pm_buffer_append_string(output_buffer, " nil\n", 5);
6470 } else {
6471 pm_buffer_append_byte(output_buffer, '\n');
6472
6473 size_t prefix_length = prefix_buffer->length;
6474 pm_buffer_append_string(prefix_buffer, "| ", 4);
6475 pm_buffer_concat(output_buffer, prefix_buffer);
6476 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->rest, prefix_buffer);
6477 prefix_buffer->length = prefix_length;
6478 }
6479 }
6480
6481 // rights
6482 {
6483 pm_buffer_concat(output_buffer, prefix_buffer);
6484 pm_buffer_append_string(output_buffer, "+-- rights:", 11);
6485 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->rights.size));
6486
6487 size_t last_index = cast->rights.size;
6488 for (uint32_t index = 0; index < last_index; index++) {
6489 size_t prefix_length = prefix_buffer->length;
6490 pm_buffer_append_string(prefix_buffer, "| ", 4);
6491 pm_buffer_concat(output_buffer, prefix_buffer);
6492 pm_buffer_append_string(output_buffer, "+-- ", 4);
6493 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
6494 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->rights.nodes[index], prefix_buffer);
6495 prefix_buffer->length = prefix_length;
6496 }
6497 }
6498
6499 // lparen_loc
6500 {
6501 pm_buffer_concat(output_buffer, prefix_buffer);
6502 pm_buffer_append_string(output_buffer, "+-- lparen_loc:", 15);
6503 pm_location_t *location = &cast->lparen_loc;
6504 if (location->start == NULL) {
6505 pm_buffer_append_string(output_buffer, " nil\n", 5);
6506 } else {
6507 pm_buffer_append_byte(output_buffer, ' ');
6508 prettyprint_location(output_buffer, parser, location);
6509 pm_buffer_append_string(output_buffer, " = \"", 4);
6510 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
6511 pm_buffer_append_string(output_buffer, "\"\n", 2);
6512 }
6513 }
6514
6515 // rparen_loc
6516 {
6517 pm_buffer_concat(output_buffer, prefix_buffer);
6518 pm_buffer_append_string(output_buffer, "+-- rparen_loc:", 15);
6519 pm_location_t *location = &cast->rparen_loc;
6520 if (location->start == NULL) {
6521 pm_buffer_append_string(output_buffer, " nil\n", 5);
6522 } else {
6523 pm_buffer_append_byte(output_buffer, ' ');
6524 prettyprint_location(output_buffer, parser, location);
6525 pm_buffer_append_string(output_buffer, " = \"", 4);
6526 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
6527 pm_buffer_append_string(output_buffer, "\"\n", 2);
6528 }
6529 }
6530
6531 // operator_loc
6532 {
6533 pm_buffer_concat(output_buffer, prefix_buffer);
6534 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
6535 pm_location_t *location = &cast->operator_loc;
6536 pm_buffer_append_byte(output_buffer, ' ');
6537 prettyprint_location(output_buffer, parser, location);
6538 pm_buffer_append_string(output_buffer, " = \"", 4);
6539 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
6540 pm_buffer_append_string(output_buffer, "\"\n", 2);
6541 }
6542
6543 // value
6544 {
6545 pm_buffer_concat(output_buffer, prefix_buffer);
6546 pm_buffer_append_string(output_buffer, "+-- value:", 10);
6547 pm_buffer_append_byte(output_buffer, '\n');
6548
6549 size_t prefix_length = prefix_buffer->length;
6550 pm_buffer_append_string(prefix_buffer, " ", 4);
6551 pm_buffer_concat(output_buffer, prefix_buffer);
6552 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
6553 prefix_buffer->length = prefix_length;
6554 }
6555
6556 break;
6557 }
6558 case PM_NEXT_NODE: {
6559 pm_next_node_t *cast = (pm_next_node_t *) node;
6560 pm_buffer_append_string(output_buffer, "@ NextNode (location: ", 22);
6561 prettyprint_location(output_buffer, parser, &node->location);
6562 pm_buffer_append_string(output_buffer, ")\n", 2);
6563
6564 // arguments
6565 {
6566 pm_buffer_concat(output_buffer, prefix_buffer);
6567 pm_buffer_append_string(output_buffer, "+-- arguments:", 14);
6568 if (cast->arguments == NULL) {
6569 pm_buffer_append_string(output_buffer, " nil\n", 5);
6570 } else {
6571 pm_buffer_append_byte(output_buffer, '\n');
6572
6573 size_t prefix_length = prefix_buffer->length;
6574 pm_buffer_append_string(prefix_buffer, "| ", 4);
6575 pm_buffer_concat(output_buffer, prefix_buffer);
6576 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->arguments, prefix_buffer);
6577 prefix_buffer->length = prefix_length;
6578 }
6579 }
6580
6581 // keyword_loc
6582 {
6583 pm_buffer_concat(output_buffer, prefix_buffer);
6584 pm_buffer_append_string(output_buffer, "+-- keyword_loc:", 16);
6585 pm_location_t *location = &cast->keyword_loc;
6586 pm_buffer_append_byte(output_buffer, ' ');
6587 prettyprint_location(output_buffer, parser, location);
6588 pm_buffer_append_string(output_buffer, " = \"", 4);
6589 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
6590 pm_buffer_append_string(output_buffer, "\"\n", 2);
6591 }
6592
6593 break;
6594 }
6595 case PM_NIL_NODE: {
6596 pm_buffer_append_string(output_buffer, "@ NilNode (location: ", 21);
6597 prettyprint_location(output_buffer, parser, &node->location);
6598 pm_buffer_append_string(output_buffer, ")\n", 2);
6599
6600 break;
6601 }
6602 case PM_NO_KEYWORDS_PARAMETER_NODE: {
6603 pm_no_keywords_parameter_node_t *cast = (pm_no_keywords_parameter_node_t *) node;
6604 pm_buffer_append_string(output_buffer, "@ NoKeywordsParameterNode (location: ", 37);
6605 prettyprint_location(output_buffer, parser, &node->location);
6606 pm_buffer_append_string(output_buffer, ")\n", 2);
6607
6608 // operator_loc
6609 {
6610 pm_buffer_concat(output_buffer, prefix_buffer);
6611 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
6612 pm_location_t *location = &cast->operator_loc;
6613 pm_buffer_append_byte(output_buffer, ' ');
6614 prettyprint_location(output_buffer, parser, location);
6615 pm_buffer_append_string(output_buffer, " = \"", 4);
6616 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
6617 pm_buffer_append_string(output_buffer, "\"\n", 2);
6618 }
6619
6620 // keyword_loc
6621 {
6622 pm_buffer_concat(output_buffer, prefix_buffer);
6623 pm_buffer_append_string(output_buffer, "+-- keyword_loc:", 16);
6624 pm_location_t *location = &cast->keyword_loc;
6625 pm_buffer_append_byte(output_buffer, ' ');
6626 prettyprint_location(output_buffer, parser, location);
6627 pm_buffer_append_string(output_buffer, " = \"", 4);
6628 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
6629 pm_buffer_append_string(output_buffer, "\"\n", 2);
6630 }
6631
6632 break;
6633 }
6634 case PM_NUMBERED_PARAMETERS_NODE: {
6635 pm_numbered_parameters_node_t *cast = (pm_numbered_parameters_node_t *) node;
6636 pm_buffer_append_string(output_buffer, "@ NumberedParametersNode (location: ", 36);
6637 prettyprint_location(output_buffer, parser, &node->location);
6638 pm_buffer_append_string(output_buffer, ")\n", 2);
6639
6640 // maximum
6641 {
6642 pm_buffer_concat(output_buffer, prefix_buffer);
6643 pm_buffer_append_string(output_buffer, "+-- maximum:", 12);
6644 pm_buffer_append_format(output_buffer, " %" PRIu8 "\n", cast->maximum);
6645 }
6646
6647 break;
6648 }
6649 case PM_NUMBERED_REFERENCE_READ_NODE: {
6650 pm_numbered_reference_read_node_t *cast = (pm_numbered_reference_read_node_t *) node;
6651 pm_buffer_append_string(output_buffer, "@ NumberedReferenceReadNode (location: ", 39);
6652 prettyprint_location(output_buffer, parser, &node->location);
6653 pm_buffer_append_string(output_buffer, ")\n", 2);
6654
6655 // number
6656 {
6657 pm_buffer_concat(output_buffer, prefix_buffer);
6658 pm_buffer_append_string(output_buffer, "+-- number:", 11);
6659 pm_buffer_append_format(output_buffer, " %" PRIu32 "\n", cast->number);
6660 }
6661
6662 break;
6663 }
6664 case PM_OPTIONAL_KEYWORD_PARAMETER_NODE: {
6665 pm_optional_keyword_parameter_node_t *cast = (pm_optional_keyword_parameter_node_t *) node;
6666 pm_buffer_append_string(output_buffer, "@ OptionalKeywordParameterNode (location: ", 42);
6667 prettyprint_location(output_buffer, parser, &node->location);
6668 pm_buffer_append_string(output_buffer, ")\n", 2);
6669
6670 // ParameterFlags
6671 {
6672 pm_buffer_concat(output_buffer, prefix_buffer);
6673 pm_buffer_append_string(output_buffer, "+-- ParameterFlags:", 19);
6674 bool found = false;
6675 if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
6676 if (found) pm_buffer_append_byte(output_buffer, ',');
6677 pm_buffer_append_string(output_buffer, " repeated_parameter", 19);
6678 found = true;
6679 }
6680 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
6681 pm_buffer_append_byte(output_buffer, '\n');
6682 }
6683
6684 // name
6685 {
6686 pm_buffer_concat(output_buffer, prefix_buffer);
6687 pm_buffer_append_string(output_buffer, "+-- name:", 9);
6688 pm_buffer_append_byte(output_buffer, ' ');
6689 prettyprint_constant(output_buffer, parser, cast->name);
6690 pm_buffer_append_byte(output_buffer, '\n');
6691 }
6692
6693 // name_loc
6694 {
6695 pm_buffer_concat(output_buffer, prefix_buffer);
6696 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
6697 pm_location_t *location = &cast->name_loc;
6698 pm_buffer_append_byte(output_buffer, ' ');
6699 prettyprint_location(output_buffer, parser, location);
6700 pm_buffer_append_string(output_buffer, " = \"", 4);
6701 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
6702 pm_buffer_append_string(output_buffer, "\"\n", 2);
6703 }
6704
6705 // value
6706 {
6707 pm_buffer_concat(output_buffer, prefix_buffer);
6708 pm_buffer_append_string(output_buffer, "+-- value:", 10);
6709 pm_buffer_append_byte(output_buffer, '\n');
6710
6711 size_t prefix_length = prefix_buffer->length;
6712 pm_buffer_append_string(prefix_buffer, " ", 4);
6713 pm_buffer_concat(output_buffer, prefix_buffer);
6714 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
6715 prefix_buffer->length = prefix_length;
6716 }
6717
6718 break;
6719 }
6720 case PM_OPTIONAL_PARAMETER_NODE: {
6721 pm_optional_parameter_node_t *cast = (pm_optional_parameter_node_t *) node;
6722 pm_buffer_append_string(output_buffer, "@ OptionalParameterNode (location: ", 35);
6723 prettyprint_location(output_buffer, parser, &node->location);
6724 pm_buffer_append_string(output_buffer, ")\n", 2);
6725
6726 // ParameterFlags
6727 {
6728 pm_buffer_concat(output_buffer, prefix_buffer);
6729 pm_buffer_append_string(output_buffer, "+-- ParameterFlags:", 19);
6730 bool found = false;
6731 if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
6732 if (found) pm_buffer_append_byte(output_buffer, ',');
6733 pm_buffer_append_string(output_buffer, " repeated_parameter", 19);
6734 found = true;
6735 }
6736 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
6737 pm_buffer_append_byte(output_buffer, '\n');
6738 }
6739
6740 // name
6741 {
6742 pm_buffer_concat(output_buffer, prefix_buffer);
6743 pm_buffer_append_string(output_buffer, "+-- name:", 9);
6744 pm_buffer_append_byte(output_buffer, ' ');
6745 prettyprint_constant(output_buffer, parser, cast->name);
6746 pm_buffer_append_byte(output_buffer, '\n');
6747 }
6748
6749 // name_loc
6750 {
6751 pm_buffer_concat(output_buffer, prefix_buffer);
6752 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
6753 pm_location_t *location = &cast->name_loc;
6754 pm_buffer_append_byte(output_buffer, ' ');
6755 prettyprint_location(output_buffer, parser, location);
6756 pm_buffer_append_string(output_buffer, " = \"", 4);
6757 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
6758 pm_buffer_append_string(output_buffer, "\"\n", 2);
6759 }
6760
6761 // operator_loc
6762 {
6763 pm_buffer_concat(output_buffer, prefix_buffer);
6764 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
6765 pm_location_t *location = &cast->operator_loc;
6766 pm_buffer_append_byte(output_buffer, ' ');
6767 prettyprint_location(output_buffer, parser, location);
6768 pm_buffer_append_string(output_buffer, " = \"", 4);
6769 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
6770 pm_buffer_append_string(output_buffer, "\"\n", 2);
6771 }
6772
6773 // value
6774 {
6775 pm_buffer_concat(output_buffer, prefix_buffer);
6776 pm_buffer_append_string(output_buffer, "+-- value:", 10);
6777 pm_buffer_append_byte(output_buffer, '\n');
6778
6779 size_t prefix_length = prefix_buffer->length;
6780 pm_buffer_append_string(prefix_buffer, " ", 4);
6781 pm_buffer_concat(output_buffer, prefix_buffer);
6782 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
6783 prefix_buffer->length = prefix_length;
6784 }
6785
6786 break;
6787 }
6788 case PM_OR_NODE: {
6789 pm_or_node_t *cast = (pm_or_node_t *) node;
6790 pm_buffer_append_string(output_buffer, "@ OrNode (location: ", 20);
6791 prettyprint_location(output_buffer, parser, &node->location);
6792 pm_buffer_append_string(output_buffer, ")\n", 2);
6793
6794 // left
6795 {
6796 pm_buffer_concat(output_buffer, prefix_buffer);
6797 pm_buffer_append_string(output_buffer, "+-- left:", 9);
6798 pm_buffer_append_byte(output_buffer, '\n');
6799
6800 size_t prefix_length = prefix_buffer->length;
6801 pm_buffer_append_string(prefix_buffer, "| ", 4);
6802 pm_buffer_concat(output_buffer, prefix_buffer);
6803 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->left, prefix_buffer);
6804 prefix_buffer->length = prefix_length;
6805 }
6806
6807 // right
6808 {
6809 pm_buffer_concat(output_buffer, prefix_buffer);
6810 pm_buffer_append_string(output_buffer, "+-- right:", 10);
6811 pm_buffer_append_byte(output_buffer, '\n');
6812
6813 size_t prefix_length = prefix_buffer->length;
6814 pm_buffer_append_string(prefix_buffer, "| ", 4);
6815 pm_buffer_concat(output_buffer, prefix_buffer);
6816 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->right, prefix_buffer);
6817 prefix_buffer->length = prefix_length;
6818 }
6819
6820 // operator_loc
6821 {
6822 pm_buffer_concat(output_buffer, prefix_buffer);
6823 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
6824 pm_location_t *location = &cast->operator_loc;
6825 pm_buffer_append_byte(output_buffer, ' ');
6826 prettyprint_location(output_buffer, parser, location);
6827 pm_buffer_append_string(output_buffer, " = \"", 4);
6828 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
6829 pm_buffer_append_string(output_buffer, "\"\n", 2);
6830 }
6831
6832 break;
6833 }
6834 case PM_PARAMETERS_NODE: {
6835 pm_parameters_node_t *cast = (pm_parameters_node_t *) node;
6836 pm_buffer_append_string(output_buffer, "@ ParametersNode (location: ", 28);
6837 prettyprint_location(output_buffer, parser, &node->location);
6838 pm_buffer_append_string(output_buffer, ")\n", 2);
6839
6840 // requireds
6841 {
6842 pm_buffer_concat(output_buffer, prefix_buffer);
6843 pm_buffer_append_string(output_buffer, "+-- requireds:", 14);
6844 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->requireds.size));
6845
6846 size_t last_index = cast->requireds.size;
6847 for (uint32_t index = 0; index < last_index; index++) {
6848 size_t prefix_length = prefix_buffer->length;
6849 pm_buffer_append_string(prefix_buffer, "| ", 4);
6850 pm_buffer_concat(output_buffer, prefix_buffer);
6851 pm_buffer_append_string(output_buffer, "+-- ", 4);
6852 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
6853 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->requireds.nodes[index], prefix_buffer);
6854 prefix_buffer->length = prefix_length;
6855 }
6856 }
6857
6858 // optionals
6859 {
6860 pm_buffer_concat(output_buffer, prefix_buffer);
6861 pm_buffer_append_string(output_buffer, "+-- optionals:", 14);
6862 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->optionals.size));
6863
6864 size_t last_index = cast->optionals.size;
6865 for (uint32_t index = 0; index < last_index; index++) {
6866 size_t prefix_length = prefix_buffer->length;
6867 pm_buffer_append_string(prefix_buffer, "| ", 4);
6868 pm_buffer_concat(output_buffer, prefix_buffer);
6869 pm_buffer_append_string(output_buffer, "+-- ", 4);
6870 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
6871 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->optionals.nodes[index], prefix_buffer);
6872 prefix_buffer->length = prefix_length;
6873 }
6874 }
6875
6876 // rest
6877 {
6878 pm_buffer_concat(output_buffer, prefix_buffer);
6879 pm_buffer_append_string(output_buffer, "+-- rest:", 9);
6880 if (cast->rest == NULL) {
6881 pm_buffer_append_string(output_buffer, " nil\n", 5);
6882 } else {
6883 pm_buffer_append_byte(output_buffer, '\n');
6884
6885 size_t prefix_length = prefix_buffer->length;
6886 pm_buffer_append_string(prefix_buffer, "| ", 4);
6887 pm_buffer_concat(output_buffer, prefix_buffer);
6888 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->rest, prefix_buffer);
6889 prefix_buffer->length = prefix_length;
6890 }
6891 }
6892
6893 // posts
6894 {
6895 pm_buffer_concat(output_buffer, prefix_buffer);
6896 pm_buffer_append_string(output_buffer, "+-- posts:", 10);
6897 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->posts.size));
6898
6899 size_t last_index = cast->posts.size;
6900 for (uint32_t index = 0; index < last_index; index++) {
6901 size_t prefix_length = prefix_buffer->length;
6902 pm_buffer_append_string(prefix_buffer, "| ", 4);
6903 pm_buffer_concat(output_buffer, prefix_buffer);
6904 pm_buffer_append_string(output_buffer, "+-- ", 4);
6905 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
6906 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->posts.nodes[index], prefix_buffer);
6907 prefix_buffer->length = prefix_length;
6908 }
6909 }
6910
6911 // keywords
6912 {
6913 pm_buffer_concat(output_buffer, prefix_buffer);
6914 pm_buffer_append_string(output_buffer, "+-- keywords:", 13);
6915 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->keywords.size));
6916
6917 size_t last_index = cast->keywords.size;
6918 for (uint32_t index = 0; index < last_index; index++) {
6919 size_t prefix_length = prefix_buffer->length;
6920 pm_buffer_append_string(prefix_buffer, "| ", 4);
6921 pm_buffer_concat(output_buffer, prefix_buffer);
6922 pm_buffer_append_string(output_buffer, "+-- ", 4);
6923 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
6924 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->keywords.nodes[index], prefix_buffer);
6925 prefix_buffer->length = prefix_length;
6926 }
6927 }
6928
6929 // keyword_rest
6930 {
6931 pm_buffer_concat(output_buffer, prefix_buffer);
6932 pm_buffer_append_string(output_buffer, "+-- keyword_rest:", 17);
6933 if (cast->keyword_rest == NULL) {
6934 pm_buffer_append_string(output_buffer, " nil\n", 5);
6935 } else {
6936 pm_buffer_append_byte(output_buffer, '\n');
6937
6938 size_t prefix_length = prefix_buffer->length;
6939 pm_buffer_append_string(prefix_buffer, "| ", 4);
6940 pm_buffer_concat(output_buffer, prefix_buffer);
6941 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->keyword_rest, prefix_buffer);
6942 prefix_buffer->length = prefix_length;
6943 }
6944 }
6945
6946 // block
6947 {
6948 pm_buffer_concat(output_buffer, prefix_buffer);
6949 pm_buffer_append_string(output_buffer, "+-- block:", 10);
6950 if (cast->block == NULL) {
6951 pm_buffer_append_string(output_buffer, " nil\n", 5);
6952 } else {
6953 pm_buffer_append_byte(output_buffer, '\n');
6954
6955 size_t prefix_length = prefix_buffer->length;
6956 pm_buffer_append_string(prefix_buffer, " ", 4);
6957 pm_buffer_concat(output_buffer, prefix_buffer);
6958 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->block, prefix_buffer);
6959 prefix_buffer->length = prefix_length;
6960 }
6961 }
6962
6963 break;
6964 }
6965 case PM_PARENTHESES_NODE: {
6966 pm_parentheses_node_t *cast = (pm_parentheses_node_t *) node;
6967 pm_buffer_append_string(output_buffer, "@ ParenthesesNode (location: ", 29);
6968 prettyprint_location(output_buffer, parser, &node->location);
6969 pm_buffer_append_string(output_buffer, ")\n", 2);
6970
6971 // ParenthesesNodeFlags
6972 {
6973 pm_buffer_concat(output_buffer, prefix_buffer);
6974 pm_buffer_append_string(output_buffer, "+-- ParenthesesNodeFlags:", 25);
6975 bool found = false;
6976 if (cast->base.flags & PM_PARENTHESES_NODE_FLAGS_MULTIPLE_STATEMENTS) {
6977 if (found) pm_buffer_append_byte(output_buffer, ',');
6978 pm_buffer_append_string(output_buffer, " multiple_statements", 20);
6979 found = true;
6980 }
6981 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
6982 pm_buffer_append_byte(output_buffer, '\n');
6983 }
6984
6985 // body
6986 {
6987 pm_buffer_concat(output_buffer, prefix_buffer);
6988 pm_buffer_append_string(output_buffer, "+-- body:", 9);
6989 if (cast->body == NULL) {
6990 pm_buffer_append_string(output_buffer, " nil\n", 5);
6991 } else {
6992 pm_buffer_append_byte(output_buffer, '\n');
6993
6994 size_t prefix_length = prefix_buffer->length;
6995 pm_buffer_append_string(prefix_buffer, "| ", 4);
6996 pm_buffer_concat(output_buffer, prefix_buffer);
6997 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->body, prefix_buffer);
6998 prefix_buffer->length = prefix_length;
6999 }
7000 }
7001
7002 // opening_loc
7003 {
7004 pm_buffer_concat(output_buffer, prefix_buffer);
7005 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
7006 pm_location_t *location = &cast->opening_loc;
7007 pm_buffer_append_byte(output_buffer, ' ');
7008 prettyprint_location(output_buffer, parser, location);
7009 pm_buffer_append_string(output_buffer, " = \"", 4);
7010 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7011 pm_buffer_append_string(output_buffer, "\"\n", 2);
7012 }
7013
7014 // closing_loc
7015 {
7016 pm_buffer_concat(output_buffer, prefix_buffer);
7017 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
7018 pm_location_t *location = &cast->closing_loc;
7019 pm_buffer_append_byte(output_buffer, ' ');
7020 prettyprint_location(output_buffer, parser, location);
7021 pm_buffer_append_string(output_buffer, " = \"", 4);
7022 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7023 pm_buffer_append_string(output_buffer, "\"\n", 2);
7024 }
7025
7026 break;
7027 }
7028 case PM_PINNED_EXPRESSION_NODE: {
7029 pm_pinned_expression_node_t *cast = (pm_pinned_expression_node_t *) node;
7030 pm_buffer_append_string(output_buffer, "@ PinnedExpressionNode (location: ", 34);
7031 prettyprint_location(output_buffer, parser, &node->location);
7032 pm_buffer_append_string(output_buffer, ")\n", 2);
7033
7034 // expression
7035 {
7036 pm_buffer_concat(output_buffer, prefix_buffer);
7037 pm_buffer_append_string(output_buffer, "+-- expression:", 15);
7038 pm_buffer_append_byte(output_buffer, '\n');
7039
7040 size_t prefix_length = prefix_buffer->length;
7041 pm_buffer_append_string(prefix_buffer, "| ", 4);
7042 pm_buffer_concat(output_buffer, prefix_buffer);
7043 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->expression, prefix_buffer);
7044 prefix_buffer->length = prefix_length;
7045 }
7046
7047 // operator_loc
7048 {
7049 pm_buffer_concat(output_buffer, prefix_buffer);
7050 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
7051 pm_location_t *location = &cast->operator_loc;
7052 pm_buffer_append_byte(output_buffer, ' ');
7053 prettyprint_location(output_buffer, parser, location);
7054 pm_buffer_append_string(output_buffer, " = \"", 4);
7055 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7056 pm_buffer_append_string(output_buffer, "\"\n", 2);
7057 }
7058
7059 // lparen_loc
7060 {
7061 pm_buffer_concat(output_buffer, prefix_buffer);
7062 pm_buffer_append_string(output_buffer, "+-- lparen_loc:", 15);
7063 pm_location_t *location = &cast->lparen_loc;
7064 pm_buffer_append_byte(output_buffer, ' ');
7065 prettyprint_location(output_buffer, parser, location);
7066 pm_buffer_append_string(output_buffer, " = \"", 4);
7067 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7068 pm_buffer_append_string(output_buffer, "\"\n", 2);
7069 }
7070
7071 // rparen_loc
7072 {
7073 pm_buffer_concat(output_buffer, prefix_buffer);
7074 pm_buffer_append_string(output_buffer, "+-- rparen_loc:", 15);
7075 pm_location_t *location = &cast->rparen_loc;
7076 pm_buffer_append_byte(output_buffer, ' ');
7077 prettyprint_location(output_buffer, parser, location);
7078 pm_buffer_append_string(output_buffer, " = \"", 4);
7079 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7080 pm_buffer_append_string(output_buffer, "\"\n", 2);
7081 }
7082
7083 break;
7084 }
7085 case PM_PINNED_VARIABLE_NODE: {
7086 pm_pinned_variable_node_t *cast = (pm_pinned_variable_node_t *) node;
7087 pm_buffer_append_string(output_buffer, "@ PinnedVariableNode (location: ", 32);
7088 prettyprint_location(output_buffer, parser, &node->location);
7089 pm_buffer_append_string(output_buffer, ")\n", 2);
7090
7091 // variable
7092 {
7093 pm_buffer_concat(output_buffer, prefix_buffer);
7094 pm_buffer_append_string(output_buffer, "+-- variable:", 13);
7095 pm_buffer_append_byte(output_buffer, '\n');
7096
7097 size_t prefix_length = prefix_buffer->length;
7098 pm_buffer_append_string(prefix_buffer, "| ", 4);
7099 pm_buffer_concat(output_buffer, prefix_buffer);
7100 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->variable, prefix_buffer);
7101 prefix_buffer->length = prefix_length;
7102 }
7103
7104 // operator_loc
7105 {
7106 pm_buffer_concat(output_buffer, prefix_buffer);
7107 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
7108 pm_location_t *location = &cast->operator_loc;
7109 pm_buffer_append_byte(output_buffer, ' ');
7110 prettyprint_location(output_buffer, parser, location);
7111 pm_buffer_append_string(output_buffer, " = \"", 4);
7112 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7113 pm_buffer_append_string(output_buffer, "\"\n", 2);
7114 }
7115
7116 break;
7117 }
7118 case PM_POST_EXECUTION_NODE: {
7119 pm_post_execution_node_t *cast = (pm_post_execution_node_t *) node;
7120 pm_buffer_append_string(output_buffer, "@ PostExecutionNode (location: ", 31);
7121 prettyprint_location(output_buffer, parser, &node->location);
7122 pm_buffer_append_string(output_buffer, ")\n", 2);
7123
7124 // statements
7125 {
7126 pm_buffer_concat(output_buffer, prefix_buffer);
7127 pm_buffer_append_string(output_buffer, "+-- statements:", 15);
7128 if (cast->statements == NULL) {
7129 pm_buffer_append_string(output_buffer, " nil\n", 5);
7130 } else {
7131 pm_buffer_append_byte(output_buffer, '\n');
7132
7133 size_t prefix_length = prefix_buffer->length;
7134 pm_buffer_append_string(prefix_buffer, "| ", 4);
7135 pm_buffer_concat(output_buffer, prefix_buffer);
7136 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->statements, prefix_buffer);
7137 prefix_buffer->length = prefix_length;
7138 }
7139 }
7140
7141 // keyword_loc
7142 {
7143 pm_buffer_concat(output_buffer, prefix_buffer);
7144 pm_buffer_append_string(output_buffer, "+-- keyword_loc:", 16);
7145 pm_location_t *location = &cast->keyword_loc;
7146 pm_buffer_append_byte(output_buffer, ' ');
7147 prettyprint_location(output_buffer, parser, location);
7148 pm_buffer_append_string(output_buffer, " = \"", 4);
7149 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7150 pm_buffer_append_string(output_buffer, "\"\n", 2);
7151 }
7152
7153 // opening_loc
7154 {
7155 pm_buffer_concat(output_buffer, prefix_buffer);
7156 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
7157 pm_location_t *location = &cast->opening_loc;
7158 pm_buffer_append_byte(output_buffer, ' ');
7159 prettyprint_location(output_buffer, parser, location);
7160 pm_buffer_append_string(output_buffer, " = \"", 4);
7161 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7162 pm_buffer_append_string(output_buffer, "\"\n", 2);
7163 }
7164
7165 // closing_loc
7166 {
7167 pm_buffer_concat(output_buffer, prefix_buffer);
7168 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
7169 pm_location_t *location = &cast->closing_loc;
7170 pm_buffer_append_byte(output_buffer, ' ');
7171 prettyprint_location(output_buffer, parser, location);
7172 pm_buffer_append_string(output_buffer, " = \"", 4);
7173 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7174 pm_buffer_append_string(output_buffer, "\"\n", 2);
7175 }
7176
7177 break;
7178 }
7179 case PM_PRE_EXECUTION_NODE: {
7180 pm_pre_execution_node_t *cast = (pm_pre_execution_node_t *) node;
7181 pm_buffer_append_string(output_buffer, "@ PreExecutionNode (location: ", 30);
7182 prettyprint_location(output_buffer, parser, &node->location);
7183 pm_buffer_append_string(output_buffer, ")\n", 2);
7184
7185 // statements
7186 {
7187 pm_buffer_concat(output_buffer, prefix_buffer);
7188 pm_buffer_append_string(output_buffer, "+-- statements:", 15);
7189 if (cast->statements == NULL) {
7190 pm_buffer_append_string(output_buffer, " nil\n", 5);
7191 } else {
7192 pm_buffer_append_byte(output_buffer, '\n');
7193
7194 size_t prefix_length = prefix_buffer->length;
7195 pm_buffer_append_string(prefix_buffer, "| ", 4);
7196 pm_buffer_concat(output_buffer, prefix_buffer);
7197 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->statements, prefix_buffer);
7198 prefix_buffer->length = prefix_length;
7199 }
7200 }
7201
7202 // keyword_loc
7203 {
7204 pm_buffer_concat(output_buffer, prefix_buffer);
7205 pm_buffer_append_string(output_buffer, "+-- keyword_loc:", 16);
7206 pm_location_t *location = &cast->keyword_loc;
7207 pm_buffer_append_byte(output_buffer, ' ');
7208 prettyprint_location(output_buffer, parser, location);
7209 pm_buffer_append_string(output_buffer, " = \"", 4);
7210 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7211 pm_buffer_append_string(output_buffer, "\"\n", 2);
7212 }
7213
7214 // opening_loc
7215 {
7216 pm_buffer_concat(output_buffer, prefix_buffer);
7217 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
7218 pm_location_t *location = &cast->opening_loc;
7219 pm_buffer_append_byte(output_buffer, ' ');
7220 prettyprint_location(output_buffer, parser, location);
7221 pm_buffer_append_string(output_buffer, " = \"", 4);
7222 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7223 pm_buffer_append_string(output_buffer, "\"\n", 2);
7224 }
7225
7226 // closing_loc
7227 {
7228 pm_buffer_concat(output_buffer, prefix_buffer);
7229 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
7230 pm_location_t *location = &cast->closing_loc;
7231 pm_buffer_append_byte(output_buffer, ' ');
7232 prettyprint_location(output_buffer, parser, location);
7233 pm_buffer_append_string(output_buffer, " = \"", 4);
7234 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7235 pm_buffer_append_string(output_buffer, "\"\n", 2);
7236 }
7237
7238 break;
7239 }
7240 case PM_PROGRAM_NODE: {
7241 pm_program_node_t *cast = (pm_program_node_t *) node;
7242 pm_buffer_append_string(output_buffer, "@ ProgramNode (location: ", 25);
7243 prettyprint_location(output_buffer, parser, &node->location);
7244 pm_buffer_append_string(output_buffer, ")\n", 2);
7245
7246 // locals
7247 {
7248 pm_buffer_concat(output_buffer, prefix_buffer);
7249 pm_buffer_append_string(output_buffer, "+-- locals:", 11);
7250 pm_buffer_append_string(output_buffer, " [", 2);
7251 for (uint32_t index = 0; index < cast->locals.size; index++) {
7252 if (index != 0) pm_buffer_append_string(output_buffer, ", ", 2);
7253 prettyprint_constant(output_buffer, parser, cast->locals.ids[index]);
7254 }
7255 pm_buffer_append_string(output_buffer, "]\n", 2);
7256 }
7257
7258 // statements
7259 {
7260 pm_buffer_concat(output_buffer, prefix_buffer);
7261 pm_buffer_append_string(output_buffer, "+-- statements:", 15);
7262 pm_buffer_append_byte(output_buffer, '\n');
7263
7264 size_t prefix_length = prefix_buffer->length;
7265 pm_buffer_append_string(prefix_buffer, " ", 4);
7266 pm_buffer_concat(output_buffer, prefix_buffer);
7267 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->statements, prefix_buffer);
7268 prefix_buffer->length = prefix_length;
7269 }
7270
7271 break;
7272 }
7273 case PM_RANGE_NODE: {
7274 pm_range_node_t *cast = (pm_range_node_t *) node;
7275 pm_buffer_append_string(output_buffer, "@ RangeNode (location: ", 23);
7276 prettyprint_location(output_buffer, parser, &node->location);
7277 pm_buffer_append_string(output_buffer, ")\n", 2);
7278
7279 // RangeFlags
7280 {
7281 pm_buffer_concat(output_buffer, prefix_buffer);
7282 pm_buffer_append_string(output_buffer, "+-- RangeFlags:", 15);
7283 bool found = false;
7284 if (cast->base.flags & PM_RANGE_FLAGS_EXCLUDE_END) {
7285 if (found) pm_buffer_append_byte(output_buffer, ',');
7286 pm_buffer_append_string(output_buffer, " exclude_end", 12);
7287 found = true;
7288 }
7289 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
7290 pm_buffer_append_byte(output_buffer, '\n');
7291 }
7292
7293 // left
7294 {
7295 pm_buffer_concat(output_buffer, prefix_buffer);
7296 pm_buffer_append_string(output_buffer, "+-- left:", 9);
7297 if (cast->left == NULL) {
7298 pm_buffer_append_string(output_buffer, " nil\n", 5);
7299 } else {
7300 pm_buffer_append_byte(output_buffer, '\n');
7301
7302 size_t prefix_length = prefix_buffer->length;
7303 pm_buffer_append_string(prefix_buffer, "| ", 4);
7304 pm_buffer_concat(output_buffer, prefix_buffer);
7305 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->left, prefix_buffer);
7306 prefix_buffer->length = prefix_length;
7307 }
7308 }
7309
7310 // right
7311 {
7312 pm_buffer_concat(output_buffer, prefix_buffer);
7313 pm_buffer_append_string(output_buffer, "+-- right:", 10);
7314 if (cast->right == NULL) {
7315 pm_buffer_append_string(output_buffer, " nil\n", 5);
7316 } else {
7317 pm_buffer_append_byte(output_buffer, '\n');
7318
7319 size_t prefix_length = prefix_buffer->length;
7320 pm_buffer_append_string(prefix_buffer, "| ", 4);
7321 pm_buffer_concat(output_buffer, prefix_buffer);
7322 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->right, prefix_buffer);
7323 prefix_buffer->length = prefix_length;
7324 }
7325 }
7326
7327 // operator_loc
7328 {
7329 pm_buffer_concat(output_buffer, prefix_buffer);
7330 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
7331 pm_location_t *location = &cast->operator_loc;
7332 pm_buffer_append_byte(output_buffer, ' ');
7333 prettyprint_location(output_buffer, parser, location);
7334 pm_buffer_append_string(output_buffer, " = \"", 4);
7335 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7336 pm_buffer_append_string(output_buffer, "\"\n", 2);
7337 }
7338
7339 break;
7340 }
7341 case PM_RATIONAL_NODE: {
7342 pm_rational_node_t *cast = (pm_rational_node_t *) node;
7343 pm_buffer_append_string(output_buffer, "@ RationalNode (location: ", 26);
7344 prettyprint_location(output_buffer, parser, &node->location);
7345 pm_buffer_append_string(output_buffer, ")\n", 2);
7346
7347 // IntegerBaseFlags
7348 {
7349 pm_buffer_concat(output_buffer, prefix_buffer);
7350 pm_buffer_append_string(output_buffer, "+-- IntegerBaseFlags:", 21);
7351 bool found = false;
7352 if (cast->base.flags & PM_INTEGER_BASE_FLAGS_BINARY) {
7353 if (found) pm_buffer_append_byte(output_buffer, ',');
7354 pm_buffer_append_string(output_buffer, " binary", 7);
7355 found = true;
7356 }
7357 if (cast->base.flags & PM_INTEGER_BASE_FLAGS_DECIMAL) {
7358 if (found) pm_buffer_append_byte(output_buffer, ',');
7359 pm_buffer_append_string(output_buffer, " decimal", 8);
7360 found = true;
7361 }
7362 if (cast->base.flags & PM_INTEGER_BASE_FLAGS_OCTAL) {
7363 if (found) pm_buffer_append_byte(output_buffer, ',');
7364 pm_buffer_append_string(output_buffer, " octal", 6);
7365 found = true;
7366 }
7367 if (cast->base.flags & PM_INTEGER_BASE_FLAGS_HEXADECIMAL) {
7368 if (found) pm_buffer_append_byte(output_buffer, ',');
7369 pm_buffer_append_string(output_buffer, " hexadecimal", 12);
7370 found = true;
7371 }
7372 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
7373 pm_buffer_append_byte(output_buffer, '\n');
7374 }
7375
7376 // numerator
7377 {
7378 pm_buffer_concat(output_buffer, prefix_buffer);
7379 pm_buffer_append_string(output_buffer, "+-- numerator:", 14);
7380 const pm_integer_t *integer = &cast->numerator;
7381 pm_buffer_append_byte(output_buffer, ' ');
7382 pm_integer_string(output_buffer, integer);
7383 pm_buffer_append_byte(output_buffer, '\n');
7384 }
7385
7386 // denominator
7387 {
7388 pm_buffer_concat(output_buffer, prefix_buffer);
7389 pm_buffer_append_string(output_buffer, "+-- denominator:", 16);
7390 const pm_integer_t *integer = &cast->denominator;
7391 pm_buffer_append_byte(output_buffer, ' ');
7392 pm_integer_string(output_buffer, integer);
7393 pm_buffer_append_byte(output_buffer, '\n');
7394 }
7395
7396 break;
7397 }
7398 case PM_REDO_NODE: {
7399 pm_buffer_append_string(output_buffer, "@ RedoNode (location: ", 22);
7400 prettyprint_location(output_buffer, parser, &node->location);
7401 pm_buffer_append_string(output_buffer, ")\n", 2);
7402
7403 break;
7404 }
7405 case PM_REGULAR_EXPRESSION_NODE: {
7406 pm_regular_expression_node_t *cast = (pm_regular_expression_node_t *) node;
7407 pm_buffer_append_string(output_buffer, "@ RegularExpressionNode (location: ", 35);
7408 prettyprint_location(output_buffer, parser, &node->location);
7409 pm_buffer_append_string(output_buffer, ")\n", 2);
7410
7411 // RegularExpressionFlags
7412 {
7413 pm_buffer_concat(output_buffer, prefix_buffer);
7414 pm_buffer_append_string(output_buffer, "+-- RegularExpressionFlags:", 27);
7415 bool found = false;
7416 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE) {
7417 if (found) pm_buffer_append_byte(output_buffer, ',');
7418 pm_buffer_append_string(output_buffer, " ignore_case", 12);
7419 found = true;
7420 }
7421 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_EXTENDED) {
7422 if (found) pm_buffer_append_byte(output_buffer, ',');
7423 pm_buffer_append_string(output_buffer, " extended", 9);
7424 found = true;
7425 }
7426 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE) {
7427 if (found) pm_buffer_append_byte(output_buffer, ',');
7428 pm_buffer_append_string(output_buffer, " multi_line", 11);
7429 found = true;
7430 }
7431 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_ONCE) {
7432 if (found) pm_buffer_append_byte(output_buffer, ',');
7433 pm_buffer_append_string(output_buffer, " once", 5);
7434 found = true;
7435 }
7436 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_EUC_JP) {
7437 if (found) pm_buffer_append_byte(output_buffer, ',');
7438 pm_buffer_append_string(output_buffer, " euc_jp", 7);
7439 found = true;
7440 }
7441 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT) {
7442 if (found) pm_buffer_append_byte(output_buffer, ',');
7443 pm_buffer_append_string(output_buffer, " ascii_8bit", 11);
7444 found = true;
7445 }
7446 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J) {
7447 if (found) pm_buffer_append_byte(output_buffer, ',');
7448 pm_buffer_append_string(output_buffer, " windows_31j", 12);
7449 found = true;
7450 }
7451 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_UTF_8) {
7452 if (found) pm_buffer_append_byte(output_buffer, ',');
7453 pm_buffer_append_string(output_buffer, " utf_8", 6);
7454 found = true;
7455 }
7456 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING) {
7457 if (found) pm_buffer_append_byte(output_buffer, ',');
7458 pm_buffer_append_string(output_buffer, " forced_utf8_encoding", 21);
7459 found = true;
7460 }
7461 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING) {
7462 if (found) pm_buffer_append_byte(output_buffer, ',');
7463 pm_buffer_append_string(output_buffer, " forced_binary_encoding", 23);
7464 found = true;
7465 }
7466 if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING) {
7467 if (found) pm_buffer_append_byte(output_buffer, ',');
7468 pm_buffer_append_string(output_buffer, " forced_us_ascii_encoding", 25);
7469 found = true;
7470 }
7471 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
7472 pm_buffer_append_byte(output_buffer, '\n');
7473 }
7474
7475 // opening_loc
7476 {
7477 pm_buffer_concat(output_buffer, prefix_buffer);
7478 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
7479 pm_location_t *location = &cast->opening_loc;
7480 pm_buffer_append_byte(output_buffer, ' ');
7481 prettyprint_location(output_buffer, parser, location);
7482 pm_buffer_append_string(output_buffer, " = \"", 4);
7483 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7484 pm_buffer_append_string(output_buffer, "\"\n", 2);
7485 }
7486
7487 // content_loc
7488 {
7489 pm_buffer_concat(output_buffer, prefix_buffer);
7490 pm_buffer_append_string(output_buffer, "+-- content_loc:", 16);
7491 pm_location_t *location = &cast->content_loc;
7492 pm_buffer_append_byte(output_buffer, ' ');
7493 prettyprint_location(output_buffer, parser, location);
7494 pm_buffer_append_string(output_buffer, " = \"", 4);
7495 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7496 pm_buffer_append_string(output_buffer, "\"\n", 2);
7497 }
7498
7499 // closing_loc
7500 {
7501 pm_buffer_concat(output_buffer, prefix_buffer);
7502 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
7503 pm_location_t *location = &cast->closing_loc;
7504 pm_buffer_append_byte(output_buffer, ' ');
7505 prettyprint_location(output_buffer, parser, location);
7506 pm_buffer_append_string(output_buffer, " = \"", 4);
7507 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7508 pm_buffer_append_string(output_buffer, "\"\n", 2);
7509 }
7510
7511 // unescaped
7512 {
7513 pm_buffer_concat(output_buffer, prefix_buffer);
7514 pm_buffer_append_string(output_buffer, "+-- unescaped:", 14);
7515 pm_buffer_append_string(output_buffer, " \"", 2);
7516 pm_buffer_append_source(output_buffer, pm_string_source(&cast->unescaped), pm_string_length(&cast->unescaped), PM_BUFFER_ESCAPING_RUBY);
7517 pm_buffer_append_string(output_buffer, "\"\n", 2);
7518 }
7519
7520 break;
7521 }
7522 case PM_REQUIRED_KEYWORD_PARAMETER_NODE: {
7523 pm_required_keyword_parameter_node_t *cast = (pm_required_keyword_parameter_node_t *) node;
7524 pm_buffer_append_string(output_buffer, "@ RequiredKeywordParameterNode (location: ", 42);
7525 prettyprint_location(output_buffer, parser, &node->location);
7526 pm_buffer_append_string(output_buffer, ")\n", 2);
7527
7528 // ParameterFlags
7529 {
7530 pm_buffer_concat(output_buffer, prefix_buffer);
7531 pm_buffer_append_string(output_buffer, "+-- ParameterFlags:", 19);
7532 bool found = false;
7533 if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
7534 if (found) pm_buffer_append_byte(output_buffer, ',');
7535 pm_buffer_append_string(output_buffer, " repeated_parameter", 19);
7536 found = true;
7537 }
7538 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
7539 pm_buffer_append_byte(output_buffer, '\n');
7540 }
7541
7542 // name
7543 {
7544 pm_buffer_concat(output_buffer, prefix_buffer);
7545 pm_buffer_append_string(output_buffer, "+-- name:", 9);
7546 pm_buffer_append_byte(output_buffer, ' ');
7547 prettyprint_constant(output_buffer, parser, cast->name);
7548 pm_buffer_append_byte(output_buffer, '\n');
7549 }
7550
7551 // name_loc
7552 {
7553 pm_buffer_concat(output_buffer, prefix_buffer);
7554 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
7555 pm_location_t *location = &cast->name_loc;
7556 pm_buffer_append_byte(output_buffer, ' ');
7557 prettyprint_location(output_buffer, parser, location);
7558 pm_buffer_append_string(output_buffer, " = \"", 4);
7559 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7560 pm_buffer_append_string(output_buffer, "\"\n", 2);
7561 }
7562
7563 break;
7564 }
7565 case PM_REQUIRED_PARAMETER_NODE: {
7566 pm_required_parameter_node_t *cast = (pm_required_parameter_node_t *) node;
7567 pm_buffer_append_string(output_buffer, "@ RequiredParameterNode (location: ", 35);
7568 prettyprint_location(output_buffer, parser, &node->location);
7569 pm_buffer_append_string(output_buffer, ")\n", 2);
7570
7571 // ParameterFlags
7572 {
7573 pm_buffer_concat(output_buffer, prefix_buffer);
7574 pm_buffer_append_string(output_buffer, "+-- ParameterFlags:", 19);
7575 bool found = false;
7576 if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
7577 if (found) pm_buffer_append_byte(output_buffer, ',');
7578 pm_buffer_append_string(output_buffer, " repeated_parameter", 19);
7579 found = true;
7580 }
7581 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
7582 pm_buffer_append_byte(output_buffer, '\n');
7583 }
7584
7585 // name
7586 {
7587 pm_buffer_concat(output_buffer, prefix_buffer);
7588 pm_buffer_append_string(output_buffer, "+-- name:", 9);
7589 pm_buffer_append_byte(output_buffer, ' ');
7590 prettyprint_constant(output_buffer, parser, cast->name);
7591 pm_buffer_append_byte(output_buffer, '\n');
7592 }
7593
7594 break;
7595 }
7596 case PM_RESCUE_MODIFIER_NODE: {
7597 pm_rescue_modifier_node_t *cast = (pm_rescue_modifier_node_t *) node;
7598 pm_buffer_append_string(output_buffer, "@ RescueModifierNode (location: ", 32);
7599 prettyprint_location(output_buffer, parser, &node->location);
7600 pm_buffer_append_string(output_buffer, ")\n", 2);
7601
7602 // expression
7603 {
7604 pm_buffer_concat(output_buffer, prefix_buffer);
7605 pm_buffer_append_string(output_buffer, "+-- expression:", 15);
7606 pm_buffer_append_byte(output_buffer, '\n');
7607
7608 size_t prefix_length = prefix_buffer->length;
7609 pm_buffer_append_string(prefix_buffer, "| ", 4);
7610 pm_buffer_concat(output_buffer, prefix_buffer);
7611 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->expression, prefix_buffer);
7612 prefix_buffer->length = prefix_length;
7613 }
7614
7615 // keyword_loc
7616 {
7617 pm_buffer_concat(output_buffer, prefix_buffer);
7618 pm_buffer_append_string(output_buffer, "+-- keyword_loc:", 16);
7619 pm_location_t *location = &cast->keyword_loc;
7620 pm_buffer_append_byte(output_buffer, ' ');
7621 prettyprint_location(output_buffer, parser, location);
7622 pm_buffer_append_string(output_buffer, " = \"", 4);
7623 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7624 pm_buffer_append_string(output_buffer, "\"\n", 2);
7625 }
7626
7627 // rescue_expression
7628 {
7629 pm_buffer_concat(output_buffer, prefix_buffer);
7630 pm_buffer_append_string(output_buffer, "+-- rescue_expression:", 22);
7631 pm_buffer_append_byte(output_buffer, '\n');
7632
7633 size_t prefix_length = prefix_buffer->length;
7634 pm_buffer_append_string(prefix_buffer, " ", 4);
7635 pm_buffer_concat(output_buffer, prefix_buffer);
7636 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->rescue_expression, prefix_buffer);
7637 prefix_buffer->length = prefix_length;
7638 }
7639
7640 break;
7641 }
7642 case PM_RESCUE_NODE: {
7643 pm_rescue_node_t *cast = (pm_rescue_node_t *) node;
7644 pm_buffer_append_string(output_buffer, "@ RescueNode (location: ", 24);
7645 prettyprint_location(output_buffer, parser, &node->location);
7646 pm_buffer_append_string(output_buffer, ")\n", 2);
7647
7648 // keyword_loc
7649 {
7650 pm_buffer_concat(output_buffer, prefix_buffer);
7651 pm_buffer_append_string(output_buffer, "+-- keyword_loc:", 16);
7652 pm_location_t *location = &cast->keyword_loc;
7653 pm_buffer_append_byte(output_buffer, ' ');
7654 prettyprint_location(output_buffer, parser, location);
7655 pm_buffer_append_string(output_buffer, " = \"", 4);
7656 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7657 pm_buffer_append_string(output_buffer, "\"\n", 2);
7658 }
7659
7660 // exceptions
7661 {
7662 pm_buffer_concat(output_buffer, prefix_buffer);
7663 pm_buffer_append_string(output_buffer, "+-- exceptions:", 15);
7664 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->exceptions.size));
7665
7666 size_t last_index = cast->exceptions.size;
7667 for (uint32_t index = 0; index < last_index; index++) {
7668 size_t prefix_length = prefix_buffer->length;
7669 pm_buffer_append_string(prefix_buffer, "| ", 4);
7670 pm_buffer_concat(output_buffer, prefix_buffer);
7671 pm_buffer_append_string(output_buffer, "+-- ", 4);
7672 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
7673 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->exceptions.nodes[index], prefix_buffer);
7674 prefix_buffer->length = prefix_length;
7675 }
7676 }
7677
7678 // operator_loc
7679 {
7680 pm_buffer_concat(output_buffer, prefix_buffer);
7681 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
7682 pm_location_t *location = &cast->operator_loc;
7683 if (location->start == NULL) {
7684 pm_buffer_append_string(output_buffer, " nil\n", 5);
7685 } else {
7686 pm_buffer_append_byte(output_buffer, ' ');
7687 prettyprint_location(output_buffer, parser, location);
7688 pm_buffer_append_string(output_buffer, " = \"", 4);
7689 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7690 pm_buffer_append_string(output_buffer, "\"\n", 2);
7691 }
7692 }
7693
7694 // reference
7695 {
7696 pm_buffer_concat(output_buffer, prefix_buffer);
7697 pm_buffer_append_string(output_buffer, "+-- reference:", 14);
7698 if (cast->reference == NULL) {
7699 pm_buffer_append_string(output_buffer, " nil\n", 5);
7700 } else {
7701 pm_buffer_append_byte(output_buffer, '\n');
7702
7703 size_t prefix_length = prefix_buffer->length;
7704 pm_buffer_append_string(prefix_buffer, "| ", 4);
7705 pm_buffer_concat(output_buffer, prefix_buffer);
7706 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->reference, prefix_buffer);
7707 prefix_buffer->length = prefix_length;
7708 }
7709 }
7710
7711 // then_keyword_loc
7712 {
7713 pm_buffer_concat(output_buffer, prefix_buffer);
7714 pm_buffer_append_string(output_buffer, "+-- then_keyword_loc:", 21);
7715 pm_location_t *location = &cast->then_keyword_loc;
7716 if (location->start == NULL) {
7717 pm_buffer_append_string(output_buffer, " nil\n", 5);
7718 } else {
7719 pm_buffer_append_byte(output_buffer, ' ');
7720 prettyprint_location(output_buffer, parser, location);
7721 pm_buffer_append_string(output_buffer, " = \"", 4);
7722 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7723 pm_buffer_append_string(output_buffer, "\"\n", 2);
7724 }
7725 }
7726
7727 // statements
7728 {
7729 pm_buffer_concat(output_buffer, prefix_buffer);
7730 pm_buffer_append_string(output_buffer, "+-- statements:", 15);
7731 if (cast->statements == NULL) {
7732 pm_buffer_append_string(output_buffer, " nil\n", 5);
7733 } else {
7734 pm_buffer_append_byte(output_buffer, '\n');
7735
7736 size_t prefix_length = prefix_buffer->length;
7737 pm_buffer_append_string(prefix_buffer, "| ", 4);
7738 pm_buffer_concat(output_buffer, prefix_buffer);
7739 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->statements, prefix_buffer);
7740 prefix_buffer->length = prefix_length;
7741 }
7742 }
7743
7744 // subsequent
7745 {
7746 pm_buffer_concat(output_buffer, prefix_buffer);
7747 pm_buffer_append_string(output_buffer, "+-- subsequent:", 15);
7748 if (cast->subsequent == NULL) {
7749 pm_buffer_append_string(output_buffer, " nil\n", 5);
7750 } else {
7751 pm_buffer_append_byte(output_buffer, '\n');
7752
7753 size_t prefix_length = prefix_buffer->length;
7754 pm_buffer_append_string(prefix_buffer, " ", 4);
7755 pm_buffer_concat(output_buffer, prefix_buffer);
7756 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->subsequent, prefix_buffer);
7757 prefix_buffer->length = prefix_length;
7758 }
7759 }
7760
7761 break;
7762 }
7763 case PM_REST_PARAMETER_NODE: {
7764 pm_rest_parameter_node_t *cast = (pm_rest_parameter_node_t *) node;
7765 pm_buffer_append_string(output_buffer, "@ RestParameterNode (location: ", 31);
7766 prettyprint_location(output_buffer, parser, &node->location);
7767 pm_buffer_append_string(output_buffer, ")\n", 2);
7768
7769 // ParameterFlags
7770 {
7771 pm_buffer_concat(output_buffer, prefix_buffer);
7772 pm_buffer_append_string(output_buffer, "+-- ParameterFlags:", 19);
7773 bool found = false;
7774 if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
7775 if (found) pm_buffer_append_byte(output_buffer, ',');
7776 pm_buffer_append_string(output_buffer, " repeated_parameter", 19);
7777 found = true;
7778 }
7779 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
7780 pm_buffer_append_byte(output_buffer, '\n');
7781 }
7782
7783 // name
7784 {
7785 pm_buffer_concat(output_buffer, prefix_buffer);
7786 pm_buffer_append_string(output_buffer, "+-- name:", 9);
7787 if (cast->name == 0) {
7788 pm_buffer_append_string(output_buffer, " nil\n", 5);
7789 } else {
7790 pm_buffer_append_byte(output_buffer, ' ');
7791 prettyprint_constant(output_buffer, parser, cast->name);
7792 pm_buffer_append_byte(output_buffer, '\n');
7793 }
7794 }
7795
7796 // name_loc
7797 {
7798 pm_buffer_concat(output_buffer, prefix_buffer);
7799 pm_buffer_append_string(output_buffer, "+-- name_loc:", 13);
7800 pm_location_t *location = &cast->name_loc;
7801 if (location->start == NULL) {
7802 pm_buffer_append_string(output_buffer, " nil\n", 5);
7803 } else {
7804 pm_buffer_append_byte(output_buffer, ' ');
7805 prettyprint_location(output_buffer, parser, location);
7806 pm_buffer_append_string(output_buffer, " = \"", 4);
7807 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7808 pm_buffer_append_string(output_buffer, "\"\n", 2);
7809 }
7810 }
7811
7812 // operator_loc
7813 {
7814 pm_buffer_concat(output_buffer, prefix_buffer);
7815 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
7816 pm_location_t *location = &cast->operator_loc;
7817 pm_buffer_append_byte(output_buffer, ' ');
7818 prettyprint_location(output_buffer, parser, location);
7819 pm_buffer_append_string(output_buffer, " = \"", 4);
7820 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7821 pm_buffer_append_string(output_buffer, "\"\n", 2);
7822 }
7823
7824 break;
7825 }
7826 case PM_RETRY_NODE: {
7827 pm_buffer_append_string(output_buffer, "@ RetryNode (location: ", 23);
7828 prettyprint_location(output_buffer, parser, &node->location);
7829 pm_buffer_append_string(output_buffer, ")\n", 2);
7830
7831 break;
7832 }
7833 case PM_RETURN_NODE: {
7834 pm_return_node_t *cast = (pm_return_node_t *) node;
7835 pm_buffer_append_string(output_buffer, "@ ReturnNode (location: ", 24);
7836 prettyprint_location(output_buffer, parser, &node->location);
7837 pm_buffer_append_string(output_buffer, ")\n", 2);
7838
7839 // keyword_loc
7840 {
7841 pm_buffer_concat(output_buffer, prefix_buffer);
7842 pm_buffer_append_string(output_buffer, "+-- keyword_loc:", 16);
7843 pm_location_t *location = &cast->keyword_loc;
7844 pm_buffer_append_byte(output_buffer, ' ');
7845 prettyprint_location(output_buffer, parser, location);
7846 pm_buffer_append_string(output_buffer, " = \"", 4);
7847 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7848 pm_buffer_append_string(output_buffer, "\"\n", 2);
7849 }
7850
7851 // arguments
7852 {
7853 pm_buffer_concat(output_buffer, prefix_buffer);
7854 pm_buffer_append_string(output_buffer, "+-- arguments:", 14);
7855 if (cast->arguments == NULL) {
7856 pm_buffer_append_string(output_buffer, " nil\n", 5);
7857 } else {
7858 pm_buffer_append_byte(output_buffer, '\n');
7859
7860 size_t prefix_length = prefix_buffer->length;
7861 pm_buffer_append_string(prefix_buffer, " ", 4);
7862 pm_buffer_concat(output_buffer, prefix_buffer);
7863 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->arguments, prefix_buffer);
7864 prefix_buffer->length = prefix_length;
7865 }
7866 }
7867
7868 break;
7869 }
7870 case PM_SELF_NODE: {
7871 pm_buffer_append_string(output_buffer, "@ SelfNode (location: ", 22);
7872 prettyprint_location(output_buffer, parser, &node->location);
7873 pm_buffer_append_string(output_buffer, ")\n", 2);
7874
7875 break;
7876 }
7877 case PM_SHAREABLE_CONSTANT_NODE: {
7878 pm_shareable_constant_node_t *cast = (pm_shareable_constant_node_t *) node;
7879 pm_buffer_append_string(output_buffer, "@ ShareableConstantNode (location: ", 35);
7880 prettyprint_location(output_buffer, parser, &node->location);
7881 pm_buffer_append_string(output_buffer, ")\n", 2);
7882
7883 // ShareableConstantNodeFlags
7884 {
7885 pm_buffer_concat(output_buffer, prefix_buffer);
7886 pm_buffer_append_string(output_buffer, "+-- ShareableConstantNodeFlags:", 31);
7887 bool found = false;
7888 if (cast->base.flags & PM_SHAREABLE_CONSTANT_NODE_FLAGS_LITERAL) {
7889 if (found) pm_buffer_append_byte(output_buffer, ',');
7890 pm_buffer_append_string(output_buffer, " literal", 8);
7891 found = true;
7892 }
7893 if (cast->base.flags & PM_SHAREABLE_CONSTANT_NODE_FLAGS_EXPERIMENTAL_EVERYTHING) {
7894 if (found) pm_buffer_append_byte(output_buffer, ',');
7895 pm_buffer_append_string(output_buffer, " experimental_everything", 24);
7896 found = true;
7897 }
7898 if (cast->base.flags & PM_SHAREABLE_CONSTANT_NODE_FLAGS_EXPERIMENTAL_COPY) {
7899 if (found) pm_buffer_append_byte(output_buffer, ',');
7900 pm_buffer_append_string(output_buffer, " experimental_copy", 18);
7901 found = true;
7902 }
7903 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
7904 pm_buffer_append_byte(output_buffer, '\n');
7905 }
7906
7907 // write
7908 {
7909 pm_buffer_concat(output_buffer, prefix_buffer);
7910 pm_buffer_append_string(output_buffer, "+-- write:", 10);
7911 pm_buffer_append_byte(output_buffer, '\n');
7912
7913 size_t prefix_length = prefix_buffer->length;
7914 pm_buffer_append_string(prefix_buffer, " ", 4);
7915 pm_buffer_concat(output_buffer, prefix_buffer);
7916 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->write, prefix_buffer);
7917 prefix_buffer->length = prefix_length;
7918 }
7919
7920 break;
7921 }
7922 case PM_SINGLETON_CLASS_NODE: {
7923 pm_singleton_class_node_t *cast = (pm_singleton_class_node_t *) node;
7924 pm_buffer_append_string(output_buffer, "@ SingletonClassNode (location: ", 32);
7925 prettyprint_location(output_buffer, parser, &node->location);
7926 pm_buffer_append_string(output_buffer, ")\n", 2);
7927
7928 // locals
7929 {
7930 pm_buffer_concat(output_buffer, prefix_buffer);
7931 pm_buffer_append_string(output_buffer, "+-- locals:", 11);
7932 pm_buffer_append_string(output_buffer, " [", 2);
7933 for (uint32_t index = 0; index < cast->locals.size; index++) {
7934 if (index != 0) pm_buffer_append_string(output_buffer, ", ", 2);
7935 prettyprint_constant(output_buffer, parser, cast->locals.ids[index]);
7936 }
7937 pm_buffer_append_string(output_buffer, "]\n", 2);
7938 }
7939
7940 // class_keyword_loc
7941 {
7942 pm_buffer_concat(output_buffer, prefix_buffer);
7943 pm_buffer_append_string(output_buffer, "+-- class_keyword_loc:", 22);
7944 pm_location_t *location = &cast->class_keyword_loc;
7945 pm_buffer_append_byte(output_buffer, ' ');
7946 prettyprint_location(output_buffer, parser, location);
7947 pm_buffer_append_string(output_buffer, " = \"", 4);
7948 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7949 pm_buffer_append_string(output_buffer, "\"\n", 2);
7950 }
7951
7952 // operator_loc
7953 {
7954 pm_buffer_concat(output_buffer, prefix_buffer);
7955 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
7956 pm_location_t *location = &cast->operator_loc;
7957 pm_buffer_append_byte(output_buffer, ' ');
7958 prettyprint_location(output_buffer, parser, location);
7959 pm_buffer_append_string(output_buffer, " = \"", 4);
7960 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
7961 pm_buffer_append_string(output_buffer, "\"\n", 2);
7962 }
7963
7964 // expression
7965 {
7966 pm_buffer_concat(output_buffer, prefix_buffer);
7967 pm_buffer_append_string(output_buffer, "+-- expression:", 15);
7968 pm_buffer_append_byte(output_buffer, '\n');
7969
7970 size_t prefix_length = prefix_buffer->length;
7971 pm_buffer_append_string(prefix_buffer, "| ", 4);
7972 pm_buffer_concat(output_buffer, prefix_buffer);
7973 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->expression, prefix_buffer);
7974 prefix_buffer->length = prefix_length;
7975 }
7976
7977 // body
7978 {
7979 pm_buffer_concat(output_buffer, prefix_buffer);
7980 pm_buffer_append_string(output_buffer, "+-- body:", 9);
7981 if (cast->body == NULL) {
7982 pm_buffer_append_string(output_buffer, " nil\n", 5);
7983 } else {
7984 pm_buffer_append_byte(output_buffer, '\n');
7985
7986 size_t prefix_length = prefix_buffer->length;
7987 pm_buffer_append_string(prefix_buffer, "| ", 4);
7988 pm_buffer_concat(output_buffer, prefix_buffer);
7989 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->body, prefix_buffer);
7990 prefix_buffer->length = prefix_length;
7991 }
7992 }
7993
7994 // end_keyword_loc
7995 {
7996 pm_buffer_concat(output_buffer, prefix_buffer);
7997 pm_buffer_append_string(output_buffer, "+-- end_keyword_loc:", 20);
7998 pm_location_t *location = &cast->end_keyword_loc;
7999 pm_buffer_append_byte(output_buffer, ' ');
8000 prettyprint_location(output_buffer, parser, location);
8001 pm_buffer_append_string(output_buffer, " = \"", 4);
8002 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8003 pm_buffer_append_string(output_buffer, "\"\n", 2);
8004 }
8005
8006 break;
8007 }
8008 case PM_SOURCE_ENCODING_NODE: {
8009 pm_buffer_append_string(output_buffer, "@ SourceEncodingNode (location: ", 32);
8010 prettyprint_location(output_buffer, parser, &node->location);
8011 pm_buffer_append_string(output_buffer, ")\n", 2);
8012
8013 break;
8014 }
8015 case PM_SOURCE_FILE_NODE: {
8016 pm_source_file_node_t *cast = (pm_source_file_node_t *) node;
8017 pm_buffer_append_string(output_buffer, "@ SourceFileNode (location: ", 28);
8018 prettyprint_location(output_buffer, parser, &node->location);
8019 pm_buffer_append_string(output_buffer, ")\n", 2);
8020
8021 // StringFlags
8022 {
8023 pm_buffer_concat(output_buffer, prefix_buffer);
8024 pm_buffer_append_string(output_buffer, "+-- StringFlags:", 16);
8025 bool found = false;
8026 if (cast->base.flags & PM_STRING_FLAGS_FORCED_UTF8_ENCODING) {
8027 if (found) pm_buffer_append_byte(output_buffer, ',');
8028 pm_buffer_append_string(output_buffer, " forced_utf8_encoding", 21);
8029 found = true;
8030 }
8031 if (cast->base.flags & PM_STRING_FLAGS_FORCED_BINARY_ENCODING) {
8032 if (found) pm_buffer_append_byte(output_buffer, ',');
8033 pm_buffer_append_string(output_buffer, " forced_binary_encoding", 23);
8034 found = true;
8035 }
8036 if (cast->base.flags & PM_STRING_FLAGS_FROZEN) {
8037 if (found) pm_buffer_append_byte(output_buffer, ',');
8038 pm_buffer_append_string(output_buffer, " frozen", 7);
8039 found = true;
8040 }
8041 if (cast->base.flags & PM_STRING_FLAGS_MUTABLE) {
8042 if (found) pm_buffer_append_byte(output_buffer, ',');
8043 pm_buffer_append_string(output_buffer, " mutable", 8);
8044 found = true;
8045 }
8046 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
8047 pm_buffer_append_byte(output_buffer, '\n');
8048 }
8049
8050 // filepath
8051 {
8052 pm_buffer_concat(output_buffer, prefix_buffer);
8053 pm_buffer_append_string(output_buffer, "+-- filepath:", 13);
8054 pm_buffer_append_string(output_buffer, " \"", 2);
8055 pm_buffer_append_source(output_buffer, pm_string_source(&cast->filepath), pm_string_length(&cast->filepath), PM_BUFFER_ESCAPING_RUBY);
8056 pm_buffer_append_string(output_buffer, "\"\n", 2);
8057 }
8058
8059 break;
8060 }
8061 case PM_SOURCE_LINE_NODE: {
8062 pm_buffer_append_string(output_buffer, "@ SourceLineNode (location: ", 28);
8063 prettyprint_location(output_buffer, parser, &node->location);
8064 pm_buffer_append_string(output_buffer, ")\n", 2);
8065
8066 break;
8067 }
8068 case PM_SPLAT_NODE: {
8069 pm_splat_node_t *cast = (pm_splat_node_t *) node;
8070 pm_buffer_append_string(output_buffer, "@ SplatNode (location: ", 23);
8071 prettyprint_location(output_buffer, parser, &node->location);
8072 pm_buffer_append_string(output_buffer, ")\n", 2);
8073
8074 // operator_loc
8075 {
8076 pm_buffer_concat(output_buffer, prefix_buffer);
8077 pm_buffer_append_string(output_buffer, "+-- operator_loc:", 17);
8078 pm_location_t *location = &cast->operator_loc;
8079 pm_buffer_append_byte(output_buffer, ' ');
8080 prettyprint_location(output_buffer, parser, location);
8081 pm_buffer_append_string(output_buffer, " = \"", 4);
8082 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8083 pm_buffer_append_string(output_buffer, "\"\n", 2);
8084 }
8085
8086 // expression
8087 {
8088 pm_buffer_concat(output_buffer, prefix_buffer);
8089 pm_buffer_append_string(output_buffer, "+-- expression:", 15);
8090 if (cast->expression == NULL) {
8091 pm_buffer_append_string(output_buffer, " nil\n", 5);
8092 } else {
8093 pm_buffer_append_byte(output_buffer, '\n');
8094
8095 size_t prefix_length = prefix_buffer->length;
8096 pm_buffer_append_string(prefix_buffer, " ", 4);
8097 pm_buffer_concat(output_buffer, prefix_buffer);
8098 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->expression, prefix_buffer);
8099 prefix_buffer->length = prefix_length;
8100 }
8101 }
8102
8103 break;
8104 }
8105 case PM_STATEMENTS_NODE: {
8106 pm_statements_node_t *cast = (pm_statements_node_t *) node;
8107 pm_buffer_append_string(output_buffer, "@ StatementsNode (location: ", 28);
8108 prettyprint_location(output_buffer, parser, &node->location);
8109 pm_buffer_append_string(output_buffer, ")\n", 2);
8110
8111 // body
8112 {
8113 pm_buffer_concat(output_buffer, prefix_buffer);
8114 pm_buffer_append_string(output_buffer, "+-- body:", 9);
8115 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->body.size));
8116
8117 size_t last_index = cast->body.size;
8118 for (uint32_t index = 0; index < last_index; index++) {
8119 size_t prefix_length = prefix_buffer->length;
8120 pm_buffer_append_string(prefix_buffer, " ", 4);
8121 pm_buffer_concat(output_buffer, prefix_buffer);
8122 pm_buffer_append_string(output_buffer, "+-- ", 4);
8123 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
8124 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->body.nodes[index], prefix_buffer);
8125 prefix_buffer->length = prefix_length;
8126 }
8127 }
8128
8129 break;
8130 }
8131 case PM_STRING_NODE: {
8132 pm_string_node_t *cast = (pm_string_node_t *) node;
8133 pm_buffer_append_string(output_buffer, "@ StringNode (location: ", 24);
8134 prettyprint_location(output_buffer, parser, &node->location);
8135 pm_buffer_append_string(output_buffer, ")\n", 2);
8136
8137 // StringFlags
8138 {
8139 pm_buffer_concat(output_buffer, prefix_buffer);
8140 pm_buffer_append_string(output_buffer, "+-- StringFlags:", 16);
8141 bool found = false;
8142 if (cast->base.flags & PM_STRING_FLAGS_FORCED_UTF8_ENCODING) {
8143 if (found) pm_buffer_append_byte(output_buffer, ',');
8144 pm_buffer_append_string(output_buffer, " forced_utf8_encoding", 21);
8145 found = true;
8146 }
8147 if (cast->base.flags & PM_STRING_FLAGS_FORCED_BINARY_ENCODING) {
8148 if (found) pm_buffer_append_byte(output_buffer, ',');
8149 pm_buffer_append_string(output_buffer, " forced_binary_encoding", 23);
8150 found = true;
8151 }
8152 if (cast->base.flags & PM_STRING_FLAGS_FROZEN) {
8153 if (found) pm_buffer_append_byte(output_buffer, ',');
8154 pm_buffer_append_string(output_buffer, " frozen", 7);
8155 found = true;
8156 }
8157 if (cast->base.flags & PM_STRING_FLAGS_MUTABLE) {
8158 if (found) pm_buffer_append_byte(output_buffer, ',');
8159 pm_buffer_append_string(output_buffer, " mutable", 8);
8160 found = true;
8161 }
8162 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
8163 pm_buffer_append_byte(output_buffer, '\n');
8164 }
8165
8166 // opening_loc
8167 {
8168 pm_buffer_concat(output_buffer, prefix_buffer);
8169 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
8170 pm_location_t *location = &cast->opening_loc;
8171 if (location->start == NULL) {
8172 pm_buffer_append_string(output_buffer, " nil\n", 5);
8173 } else {
8174 pm_buffer_append_byte(output_buffer, ' ');
8175 prettyprint_location(output_buffer, parser, location);
8176 pm_buffer_append_string(output_buffer, " = \"", 4);
8177 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8178 pm_buffer_append_string(output_buffer, "\"\n", 2);
8179 }
8180 }
8181
8182 // content_loc
8183 {
8184 pm_buffer_concat(output_buffer, prefix_buffer);
8185 pm_buffer_append_string(output_buffer, "+-- content_loc:", 16);
8186 pm_location_t *location = &cast->content_loc;
8187 pm_buffer_append_byte(output_buffer, ' ');
8188 prettyprint_location(output_buffer, parser, location);
8189 pm_buffer_append_string(output_buffer, " = \"", 4);
8190 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8191 pm_buffer_append_string(output_buffer, "\"\n", 2);
8192 }
8193
8194 // closing_loc
8195 {
8196 pm_buffer_concat(output_buffer, prefix_buffer);
8197 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
8198 pm_location_t *location = &cast->closing_loc;
8199 if (location->start == NULL) {
8200 pm_buffer_append_string(output_buffer, " nil\n", 5);
8201 } else {
8202 pm_buffer_append_byte(output_buffer, ' ');
8203 prettyprint_location(output_buffer, parser, location);
8204 pm_buffer_append_string(output_buffer, " = \"", 4);
8205 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8206 pm_buffer_append_string(output_buffer, "\"\n", 2);
8207 }
8208 }
8209
8210 // unescaped
8211 {
8212 pm_buffer_concat(output_buffer, prefix_buffer);
8213 pm_buffer_append_string(output_buffer, "+-- unescaped:", 14);
8214 pm_buffer_append_string(output_buffer, " \"", 2);
8215 pm_buffer_append_source(output_buffer, pm_string_source(&cast->unescaped), pm_string_length(&cast->unescaped), PM_BUFFER_ESCAPING_RUBY);
8216 pm_buffer_append_string(output_buffer, "\"\n", 2);
8217 }
8218
8219 break;
8220 }
8221 case PM_SUPER_NODE: {
8222 pm_super_node_t *cast = (pm_super_node_t *) node;
8223 pm_buffer_append_string(output_buffer, "@ SuperNode (location: ", 23);
8224 prettyprint_location(output_buffer, parser, &node->location);
8225 pm_buffer_append_string(output_buffer, ")\n", 2);
8226
8227 // keyword_loc
8228 {
8229 pm_buffer_concat(output_buffer, prefix_buffer);
8230 pm_buffer_append_string(output_buffer, "+-- keyword_loc:", 16);
8231 pm_location_t *location = &cast->keyword_loc;
8232 pm_buffer_append_byte(output_buffer, ' ');
8233 prettyprint_location(output_buffer, parser, location);
8234 pm_buffer_append_string(output_buffer, " = \"", 4);
8235 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8236 pm_buffer_append_string(output_buffer, "\"\n", 2);
8237 }
8238
8239 // lparen_loc
8240 {
8241 pm_buffer_concat(output_buffer, prefix_buffer);
8242 pm_buffer_append_string(output_buffer, "+-- lparen_loc:", 15);
8243 pm_location_t *location = &cast->lparen_loc;
8244 if (location->start == NULL) {
8245 pm_buffer_append_string(output_buffer, " nil\n", 5);
8246 } else {
8247 pm_buffer_append_byte(output_buffer, ' ');
8248 prettyprint_location(output_buffer, parser, location);
8249 pm_buffer_append_string(output_buffer, " = \"", 4);
8250 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8251 pm_buffer_append_string(output_buffer, "\"\n", 2);
8252 }
8253 }
8254
8255 // arguments
8256 {
8257 pm_buffer_concat(output_buffer, prefix_buffer);
8258 pm_buffer_append_string(output_buffer, "+-- arguments:", 14);
8259 if (cast->arguments == NULL) {
8260 pm_buffer_append_string(output_buffer, " nil\n", 5);
8261 } else {
8262 pm_buffer_append_byte(output_buffer, '\n');
8263
8264 size_t prefix_length = prefix_buffer->length;
8265 pm_buffer_append_string(prefix_buffer, "| ", 4);
8266 pm_buffer_concat(output_buffer, prefix_buffer);
8267 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->arguments, prefix_buffer);
8268 prefix_buffer->length = prefix_length;
8269 }
8270 }
8271
8272 // rparen_loc
8273 {
8274 pm_buffer_concat(output_buffer, prefix_buffer);
8275 pm_buffer_append_string(output_buffer, "+-- rparen_loc:", 15);
8276 pm_location_t *location = &cast->rparen_loc;
8277 if (location->start == NULL) {
8278 pm_buffer_append_string(output_buffer, " nil\n", 5);
8279 } else {
8280 pm_buffer_append_byte(output_buffer, ' ');
8281 prettyprint_location(output_buffer, parser, location);
8282 pm_buffer_append_string(output_buffer, " = \"", 4);
8283 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8284 pm_buffer_append_string(output_buffer, "\"\n", 2);
8285 }
8286 }
8287
8288 // block
8289 {
8290 pm_buffer_concat(output_buffer, prefix_buffer);
8291 pm_buffer_append_string(output_buffer, "+-- block:", 10);
8292 if (cast->block == NULL) {
8293 pm_buffer_append_string(output_buffer, " nil\n", 5);
8294 } else {
8295 pm_buffer_append_byte(output_buffer, '\n');
8296
8297 size_t prefix_length = prefix_buffer->length;
8298 pm_buffer_append_string(prefix_buffer, " ", 4);
8299 pm_buffer_concat(output_buffer, prefix_buffer);
8300 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->block, prefix_buffer);
8301 prefix_buffer->length = prefix_length;
8302 }
8303 }
8304
8305 break;
8306 }
8307 case PM_SYMBOL_NODE: {
8308 pm_symbol_node_t *cast = (pm_symbol_node_t *) node;
8309 pm_buffer_append_string(output_buffer, "@ SymbolNode (location: ", 24);
8310 prettyprint_location(output_buffer, parser, &node->location);
8311 pm_buffer_append_string(output_buffer, ")\n", 2);
8312
8313 // SymbolFlags
8314 {
8315 pm_buffer_concat(output_buffer, prefix_buffer);
8316 pm_buffer_append_string(output_buffer, "+-- SymbolFlags:", 16);
8317 bool found = false;
8318 if (cast->base.flags & PM_SYMBOL_FLAGS_FORCED_UTF8_ENCODING) {
8319 if (found) pm_buffer_append_byte(output_buffer, ',');
8320 pm_buffer_append_string(output_buffer, " forced_utf8_encoding", 21);
8321 found = true;
8322 }
8323 if (cast->base.flags & PM_SYMBOL_FLAGS_FORCED_BINARY_ENCODING) {
8324 if (found) pm_buffer_append_byte(output_buffer, ',');
8325 pm_buffer_append_string(output_buffer, " forced_binary_encoding", 23);
8326 found = true;
8327 }
8328 if (cast->base.flags & PM_SYMBOL_FLAGS_FORCED_US_ASCII_ENCODING) {
8329 if (found) pm_buffer_append_byte(output_buffer, ',');
8330 pm_buffer_append_string(output_buffer, " forced_us_ascii_encoding", 25);
8331 found = true;
8332 }
8333 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
8334 pm_buffer_append_byte(output_buffer, '\n');
8335 }
8336
8337 // opening_loc
8338 {
8339 pm_buffer_concat(output_buffer, prefix_buffer);
8340 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
8341 pm_location_t *location = &cast->opening_loc;
8342 if (location->start == NULL) {
8343 pm_buffer_append_string(output_buffer, " nil\n", 5);
8344 } else {
8345 pm_buffer_append_byte(output_buffer, ' ');
8346 prettyprint_location(output_buffer, parser, location);
8347 pm_buffer_append_string(output_buffer, " = \"", 4);
8348 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8349 pm_buffer_append_string(output_buffer, "\"\n", 2);
8350 }
8351 }
8352
8353 // value_loc
8354 {
8355 pm_buffer_concat(output_buffer, prefix_buffer);
8356 pm_buffer_append_string(output_buffer, "+-- value_loc:", 14);
8357 pm_location_t *location = &cast->value_loc;
8358 if (location->start == NULL) {
8359 pm_buffer_append_string(output_buffer, " nil\n", 5);
8360 } else {
8361 pm_buffer_append_byte(output_buffer, ' ');
8362 prettyprint_location(output_buffer, parser, location);
8363 pm_buffer_append_string(output_buffer, " = \"", 4);
8364 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8365 pm_buffer_append_string(output_buffer, "\"\n", 2);
8366 }
8367 }
8368
8369 // closing_loc
8370 {
8371 pm_buffer_concat(output_buffer, prefix_buffer);
8372 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
8373 pm_location_t *location = &cast->closing_loc;
8374 if (location->start == NULL) {
8375 pm_buffer_append_string(output_buffer, " nil\n", 5);
8376 } else {
8377 pm_buffer_append_byte(output_buffer, ' ');
8378 prettyprint_location(output_buffer, parser, location);
8379 pm_buffer_append_string(output_buffer, " = \"", 4);
8380 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8381 pm_buffer_append_string(output_buffer, "\"\n", 2);
8382 }
8383 }
8384
8385 // unescaped
8386 {
8387 pm_buffer_concat(output_buffer, prefix_buffer);
8388 pm_buffer_append_string(output_buffer, "+-- unescaped:", 14);
8389 pm_buffer_append_string(output_buffer, " \"", 2);
8390 pm_buffer_append_source(output_buffer, pm_string_source(&cast->unescaped), pm_string_length(&cast->unescaped), PM_BUFFER_ESCAPING_RUBY);
8391 pm_buffer_append_string(output_buffer, "\"\n", 2);
8392 }
8393
8394 break;
8395 }
8396 case PM_TRUE_NODE: {
8397 pm_buffer_append_string(output_buffer, "@ TrueNode (location: ", 22);
8398 prettyprint_location(output_buffer, parser, &node->location);
8399 pm_buffer_append_string(output_buffer, ")\n", 2);
8400
8401 break;
8402 }
8403 case PM_UNDEF_NODE: {
8404 pm_undef_node_t *cast = (pm_undef_node_t *) node;
8405 pm_buffer_append_string(output_buffer, "@ UndefNode (location: ", 23);
8406 prettyprint_location(output_buffer, parser, &node->location);
8407 pm_buffer_append_string(output_buffer, ")\n", 2);
8408
8409 // names
8410 {
8411 pm_buffer_concat(output_buffer, prefix_buffer);
8412 pm_buffer_append_string(output_buffer, "+-- names:", 10);
8413 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->names.size));
8414
8415 size_t last_index = cast->names.size;
8416 for (uint32_t index = 0; index < last_index; index++) {
8417 size_t prefix_length = prefix_buffer->length;
8418 pm_buffer_append_string(prefix_buffer, "| ", 4);
8419 pm_buffer_concat(output_buffer, prefix_buffer);
8420 pm_buffer_append_string(output_buffer, "+-- ", 4);
8421 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
8422 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->names.nodes[index], prefix_buffer);
8423 prefix_buffer->length = prefix_length;
8424 }
8425 }
8426
8427 // keyword_loc
8428 {
8429 pm_buffer_concat(output_buffer, prefix_buffer);
8430 pm_buffer_append_string(output_buffer, "+-- keyword_loc:", 16);
8431 pm_location_t *location = &cast->keyword_loc;
8432 pm_buffer_append_byte(output_buffer, ' ');
8433 prettyprint_location(output_buffer, parser, location);
8434 pm_buffer_append_string(output_buffer, " = \"", 4);
8435 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8436 pm_buffer_append_string(output_buffer, "\"\n", 2);
8437 }
8438
8439 break;
8440 }
8441 case PM_UNLESS_NODE: {
8442 pm_unless_node_t *cast = (pm_unless_node_t *) node;
8443 pm_buffer_append_string(output_buffer, "@ UnlessNode (location: ", 24);
8444 prettyprint_location(output_buffer, parser, &node->location);
8445 pm_buffer_append_string(output_buffer, ")\n", 2);
8446
8447 // keyword_loc
8448 {
8449 pm_buffer_concat(output_buffer, prefix_buffer);
8450 pm_buffer_append_string(output_buffer, "+-- keyword_loc:", 16);
8451 pm_location_t *location = &cast->keyword_loc;
8452 pm_buffer_append_byte(output_buffer, ' ');
8453 prettyprint_location(output_buffer, parser, location);
8454 pm_buffer_append_string(output_buffer, " = \"", 4);
8455 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8456 pm_buffer_append_string(output_buffer, "\"\n", 2);
8457 }
8458
8459 // predicate
8460 {
8461 pm_buffer_concat(output_buffer, prefix_buffer);
8462 pm_buffer_append_string(output_buffer, "+-- predicate:", 14);
8463 pm_buffer_append_byte(output_buffer, '\n');
8464
8465 size_t prefix_length = prefix_buffer->length;
8466 pm_buffer_append_string(prefix_buffer, "| ", 4);
8467 pm_buffer_concat(output_buffer, prefix_buffer);
8468 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->predicate, prefix_buffer);
8469 prefix_buffer->length = prefix_length;
8470 }
8471
8472 // then_keyword_loc
8473 {
8474 pm_buffer_concat(output_buffer, prefix_buffer);
8475 pm_buffer_append_string(output_buffer, "+-- then_keyword_loc:", 21);
8476 pm_location_t *location = &cast->then_keyword_loc;
8477 if (location->start == NULL) {
8478 pm_buffer_append_string(output_buffer, " nil\n", 5);
8479 } else {
8480 pm_buffer_append_byte(output_buffer, ' ');
8481 prettyprint_location(output_buffer, parser, location);
8482 pm_buffer_append_string(output_buffer, " = \"", 4);
8483 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8484 pm_buffer_append_string(output_buffer, "\"\n", 2);
8485 }
8486 }
8487
8488 // statements
8489 {
8490 pm_buffer_concat(output_buffer, prefix_buffer);
8491 pm_buffer_append_string(output_buffer, "+-- statements:", 15);
8492 if (cast->statements == NULL) {
8493 pm_buffer_append_string(output_buffer, " nil\n", 5);
8494 } else {
8495 pm_buffer_append_byte(output_buffer, '\n');
8496
8497 size_t prefix_length = prefix_buffer->length;
8498 pm_buffer_append_string(prefix_buffer, "| ", 4);
8499 pm_buffer_concat(output_buffer, prefix_buffer);
8500 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->statements, prefix_buffer);
8501 prefix_buffer->length = prefix_length;
8502 }
8503 }
8504
8505 // else_clause
8506 {
8507 pm_buffer_concat(output_buffer, prefix_buffer);
8508 pm_buffer_append_string(output_buffer, "+-- else_clause:", 16);
8509 if (cast->else_clause == NULL) {
8510 pm_buffer_append_string(output_buffer, " nil\n", 5);
8511 } else {
8512 pm_buffer_append_byte(output_buffer, '\n');
8513
8514 size_t prefix_length = prefix_buffer->length;
8515 pm_buffer_append_string(prefix_buffer, "| ", 4);
8516 pm_buffer_concat(output_buffer, prefix_buffer);
8517 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->else_clause, prefix_buffer);
8518 prefix_buffer->length = prefix_length;
8519 }
8520 }
8521
8522 // end_keyword_loc
8523 {
8524 pm_buffer_concat(output_buffer, prefix_buffer);
8525 pm_buffer_append_string(output_buffer, "+-- end_keyword_loc:", 20);
8526 pm_location_t *location = &cast->end_keyword_loc;
8527 if (location->start == NULL) {
8528 pm_buffer_append_string(output_buffer, " nil\n", 5);
8529 } else {
8530 pm_buffer_append_byte(output_buffer, ' ');
8531 prettyprint_location(output_buffer, parser, location);
8532 pm_buffer_append_string(output_buffer, " = \"", 4);
8533 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8534 pm_buffer_append_string(output_buffer, "\"\n", 2);
8535 }
8536 }
8537
8538 break;
8539 }
8540 case PM_UNTIL_NODE: {
8541 pm_until_node_t *cast = (pm_until_node_t *) node;
8542 pm_buffer_append_string(output_buffer, "@ UntilNode (location: ", 23);
8543 prettyprint_location(output_buffer, parser, &node->location);
8544 pm_buffer_append_string(output_buffer, ")\n", 2);
8545
8546 // LoopFlags
8547 {
8548 pm_buffer_concat(output_buffer, prefix_buffer);
8549 pm_buffer_append_string(output_buffer, "+-- LoopFlags:", 14);
8550 bool found = false;
8551 if (cast->base.flags & PM_LOOP_FLAGS_BEGIN_MODIFIER) {
8552 if (found) pm_buffer_append_byte(output_buffer, ',');
8553 pm_buffer_append_string(output_buffer, " begin_modifier", 15);
8554 found = true;
8555 }
8556 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
8557 pm_buffer_append_byte(output_buffer, '\n');
8558 }
8559
8560 // keyword_loc
8561 {
8562 pm_buffer_concat(output_buffer, prefix_buffer);
8563 pm_buffer_append_string(output_buffer, "+-- keyword_loc:", 16);
8564 pm_location_t *location = &cast->keyword_loc;
8565 pm_buffer_append_byte(output_buffer, ' ');
8566 prettyprint_location(output_buffer, parser, location);
8567 pm_buffer_append_string(output_buffer, " = \"", 4);
8568 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8569 pm_buffer_append_string(output_buffer, "\"\n", 2);
8570 }
8571
8572 // do_keyword_loc
8573 {
8574 pm_buffer_concat(output_buffer, prefix_buffer);
8575 pm_buffer_append_string(output_buffer, "+-- do_keyword_loc:", 19);
8576 pm_location_t *location = &cast->do_keyword_loc;
8577 if (location->start == NULL) {
8578 pm_buffer_append_string(output_buffer, " nil\n", 5);
8579 } else {
8580 pm_buffer_append_byte(output_buffer, ' ');
8581 prettyprint_location(output_buffer, parser, location);
8582 pm_buffer_append_string(output_buffer, " = \"", 4);
8583 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8584 pm_buffer_append_string(output_buffer, "\"\n", 2);
8585 }
8586 }
8587
8588 // closing_loc
8589 {
8590 pm_buffer_concat(output_buffer, prefix_buffer);
8591 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
8592 pm_location_t *location = &cast->closing_loc;
8593 if (location->start == NULL) {
8594 pm_buffer_append_string(output_buffer, " nil\n", 5);
8595 } else {
8596 pm_buffer_append_byte(output_buffer, ' ');
8597 prettyprint_location(output_buffer, parser, location);
8598 pm_buffer_append_string(output_buffer, " = \"", 4);
8599 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8600 pm_buffer_append_string(output_buffer, "\"\n", 2);
8601 }
8602 }
8603
8604 // predicate
8605 {
8606 pm_buffer_concat(output_buffer, prefix_buffer);
8607 pm_buffer_append_string(output_buffer, "+-- predicate:", 14);
8608 pm_buffer_append_byte(output_buffer, '\n');
8609
8610 size_t prefix_length = prefix_buffer->length;
8611 pm_buffer_append_string(prefix_buffer, "| ", 4);
8612 pm_buffer_concat(output_buffer, prefix_buffer);
8613 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->predicate, prefix_buffer);
8614 prefix_buffer->length = prefix_length;
8615 }
8616
8617 // statements
8618 {
8619 pm_buffer_concat(output_buffer, prefix_buffer);
8620 pm_buffer_append_string(output_buffer, "+-- statements:", 15);
8621 if (cast->statements == NULL) {
8622 pm_buffer_append_string(output_buffer, " nil\n", 5);
8623 } else {
8624 pm_buffer_append_byte(output_buffer, '\n');
8625
8626 size_t prefix_length = prefix_buffer->length;
8627 pm_buffer_append_string(prefix_buffer, " ", 4);
8628 pm_buffer_concat(output_buffer, prefix_buffer);
8629 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->statements, prefix_buffer);
8630 prefix_buffer->length = prefix_length;
8631 }
8632 }
8633
8634 break;
8635 }
8636 case PM_WHEN_NODE: {
8637 pm_when_node_t *cast = (pm_when_node_t *) node;
8638 pm_buffer_append_string(output_buffer, "@ WhenNode (location: ", 22);
8639 prettyprint_location(output_buffer, parser, &node->location);
8640 pm_buffer_append_string(output_buffer, ")\n", 2);
8641
8642 // keyword_loc
8643 {
8644 pm_buffer_concat(output_buffer, prefix_buffer);
8645 pm_buffer_append_string(output_buffer, "+-- keyword_loc:", 16);
8646 pm_location_t *location = &cast->keyword_loc;
8647 pm_buffer_append_byte(output_buffer, ' ');
8648 prettyprint_location(output_buffer, parser, location);
8649 pm_buffer_append_string(output_buffer, " = \"", 4);
8650 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8651 pm_buffer_append_string(output_buffer, "\"\n", 2);
8652 }
8653
8654 // conditions
8655 {
8656 pm_buffer_concat(output_buffer, prefix_buffer);
8657 pm_buffer_append_string(output_buffer, "+-- conditions:", 15);
8658 pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->conditions.size));
8659
8660 size_t last_index = cast->conditions.size;
8661 for (uint32_t index = 0; index < last_index; index++) {
8662 size_t prefix_length = prefix_buffer->length;
8663 pm_buffer_append_string(prefix_buffer, "| ", 4);
8664 pm_buffer_concat(output_buffer, prefix_buffer);
8665 pm_buffer_append_string(output_buffer, "+-- ", 4);
8666 pm_buffer_append_string(prefix_buffer, (index == last_index - 1) ? " " : "| ", 4);
8667 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->conditions.nodes[index], prefix_buffer);
8668 prefix_buffer->length = prefix_length;
8669 }
8670 }
8671
8672 // then_keyword_loc
8673 {
8674 pm_buffer_concat(output_buffer, prefix_buffer);
8675 pm_buffer_append_string(output_buffer, "+-- then_keyword_loc:", 21);
8676 pm_location_t *location = &cast->then_keyword_loc;
8677 if (location->start == NULL) {
8678 pm_buffer_append_string(output_buffer, " nil\n", 5);
8679 } else {
8680 pm_buffer_append_byte(output_buffer, ' ');
8681 prettyprint_location(output_buffer, parser, location);
8682 pm_buffer_append_string(output_buffer, " = \"", 4);
8683 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8684 pm_buffer_append_string(output_buffer, "\"\n", 2);
8685 }
8686 }
8687
8688 // statements
8689 {
8690 pm_buffer_concat(output_buffer, prefix_buffer);
8691 pm_buffer_append_string(output_buffer, "+-- statements:", 15);
8692 if (cast->statements == NULL) {
8693 pm_buffer_append_string(output_buffer, " nil\n", 5);
8694 } else {
8695 pm_buffer_append_byte(output_buffer, '\n');
8696
8697 size_t prefix_length = prefix_buffer->length;
8698 pm_buffer_append_string(prefix_buffer, " ", 4);
8699 pm_buffer_concat(output_buffer, prefix_buffer);
8700 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->statements, prefix_buffer);
8701 prefix_buffer->length = prefix_length;
8702 }
8703 }
8704
8705 break;
8706 }
8707 case PM_WHILE_NODE: {
8708 pm_while_node_t *cast = (pm_while_node_t *) node;
8709 pm_buffer_append_string(output_buffer, "@ WhileNode (location: ", 23);
8710 prettyprint_location(output_buffer, parser, &node->location);
8711 pm_buffer_append_string(output_buffer, ")\n", 2);
8712
8713 // LoopFlags
8714 {
8715 pm_buffer_concat(output_buffer, prefix_buffer);
8716 pm_buffer_append_string(output_buffer, "+-- LoopFlags:", 14);
8717 bool found = false;
8718 if (cast->base.flags & PM_LOOP_FLAGS_BEGIN_MODIFIER) {
8719 if (found) pm_buffer_append_byte(output_buffer, ',');
8720 pm_buffer_append_string(output_buffer, " begin_modifier", 15);
8721 found = true;
8722 }
8723 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
8724 pm_buffer_append_byte(output_buffer, '\n');
8725 }
8726
8727 // keyword_loc
8728 {
8729 pm_buffer_concat(output_buffer, prefix_buffer);
8730 pm_buffer_append_string(output_buffer, "+-- keyword_loc:", 16);
8731 pm_location_t *location = &cast->keyword_loc;
8732 pm_buffer_append_byte(output_buffer, ' ');
8733 prettyprint_location(output_buffer, parser, location);
8734 pm_buffer_append_string(output_buffer, " = \"", 4);
8735 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8736 pm_buffer_append_string(output_buffer, "\"\n", 2);
8737 }
8738
8739 // do_keyword_loc
8740 {
8741 pm_buffer_concat(output_buffer, prefix_buffer);
8742 pm_buffer_append_string(output_buffer, "+-- do_keyword_loc:", 19);
8743 pm_location_t *location = &cast->do_keyword_loc;
8744 if (location->start == NULL) {
8745 pm_buffer_append_string(output_buffer, " nil\n", 5);
8746 } else {
8747 pm_buffer_append_byte(output_buffer, ' ');
8748 prettyprint_location(output_buffer, parser, location);
8749 pm_buffer_append_string(output_buffer, " = \"", 4);
8750 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8751 pm_buffer_append_string(output_buffer, "\"\n", 2);
8752 }
8753 }
8754
8755 // closing_loc
8756 {
8757 pm_buffer_concat(output_buffer, prefix_buffer);
8758 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
8759 pm_location_t *location = &cast->closing_loc;
8760 if (location->start == NULL) {
8761 pm_buffer_append_string(output_buffer, " nil\n", 5);
8762 } else {
8763 pm_buffer_append_byte(output_buffer, ' ');
8764 prettyprint_location(output_buffer, parser, location);
8765 pm_buffer_append_string(output_buffer, " = \"", 4);
8766 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8767 pm_buffer_append_string(output_buffer, "\"\n", 2);
8768 }
8769 }
8770
8771 // predicate
8772 {
8773 pm_buffer_concat(output_buffer, prefix_buffer);
8774 pm_buffer_append_string(output_buffer, "+-- predicate:", 14);
8775 pm_buffer_append_byte(output_buffer, '\n');
8776
8777 size_t prefix_length = prefix_buffer->length;
8778 pm_buffer_append_string(prefix_buffer, "| ", 4);
8779 pm_buffer_concat(output_buffer, prefix_buffer);
8780 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->predicate, prefix_buffer);
8781 prefix_buffer->length = prefix_length;
8782 }
8783
8784 // statements
8785 {
8786 pm_buffer_concat(output_buffer, prefix_buffer);
8787 pm_buffer_append_string(output_buffer, "+-- statements:", 15);
8788 if (cast->statements == NULL) {
8789 pm_buffer_append_string(output_buffer, " nil\n", 5);
8790 } else {
8791 pm_buffer_append_byte(output_buffer, '\n');
8792
8793 size_t prefix_length = prefix_buffer->length;
8794 pm_buffer_append_string(prefix_buffer, " ", 4);
8795 pm_buffer_concat(output_buffer, prefix_buffer);
8796 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->statements, prefix_buffer);
8797 prefix_buffer->length = prefix_length;
8798 }
8799 }
8800
8801 break;
8802 }
8803 case PM_X_STRING_NODE: {
8804 pm_x_string_node_t *cast = (pm_x_string_node_t *) node;
8805 pm_buffer_append_string(output_buffer, "@ XStringNode (location: ", 25);
8806 prettyprint_location(output_buffer, parser, &node->location);
8807 pm_buffer_append_string(output_buffer, ")\n", 2);
8808
8809 // EncodingFlags
8810 {
8811 pm_buffer_concat(output_buffer, prefix_buffer);
8812 pm_buffer_append_string(output_buffer, "+-- EncodingFlags:", 18);
8813 bool found = false;
8814 if (cast->base.flags & PM_ENCODING_FLAGS_FORCED_UTF8_ENCODING) {
8815 if (found) pm_buffer_append_byte(output_buffer, ',');
8816 pm_buffer_append_string(output_buffer, " forced_utf8_encoding", 21);
8817 found = true;
8818 }
8819 if (cast->base.flags & PM_ENCODING_FLAGS_FORCED_BINARY_ENCODING) {
8820 if (found) pm_buffer_append_byte(output_buffer, ',');
8821 pm_buffer_append_string(output_buffer, " forced_binary_encoding", 23);
8822 found = true;
8823 }
8824 if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
8825 pm_buffer_append_byte(output_buffer, '\n');
8826 }
8827
8828 // opening_loc
8829 {
8830 pm_buffer_concat(output_buffer, prefix_buffer);
8831 pm_buffer_append_string(output_buffer, "+-- opening_loc:", 16);
8832 pm_location_t *location = &cast->opening_loc;
8833 pm_buffer_append_byte(output_buffer, ' ');
8834 prettyprint_location(output_buffer, parser, location);
8835 pm_buffer_append_string(output_buffer, " = \"", 4);
8836 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8837 pm_buffer_append_string(output_buffer, "\"\n", 2);
8838 }
8839
8840 // content_loc
8841 {
8842 pm_buffer_concat(output_buffer, prefix_buffer);
8843 pm_buffer_append_string(output_buffer, "+-- content_loc:", 16);
8844 pm_location_t *location = &cast->content_loc;
8845 pm_buffer_append_byte(output_buffer, ' ');
8846 prettyprint_location(output_buffer, parser, location);
8847 pm_buffer_append_string(output_buffer, " = \"", 4);
8848 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8849 pm_buffer_append_string(output_buffer, "\"\n", 2);
8850 }
8851
8852 // closing_loc
8853 {
8854 pm_buffer_concat(output_buffer, prefix_buffer);
8855 pm_buffer_append_string(output_buffer, "+-- closing_loc:", 16);
8856 pm_location_t *location = &cast->closing_loc;
8857 pm_buffer_append_byte(output_buffer, ' ');
8858 prettyprint_location(output_buffer, parser, location);
8859 pm_buffer_append_string(output_buffer, " = \"", 4);
8860 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8861 pm_buffer_append_string(output_buffer, "\"\n", 2);
8862 }
8863
8864 // unescaped
8865 {
8866 pm_buffer_concat(output_buffer, prefix_buffer);
8867 pm_buffer_append_string(output_buffer, "+-- unescaped:", 14);
8868 pm_buffer_append_string(output_buffer, " \"", 2);
8869 pm_buffer_append_source(output_buffer, pm_string_source(&cast->unescaped), pm_string_length(&cast->unescaped), PM_BUFFER_ESCAPING_RUBY);
8870 pm_buffer_append_string(output_buffer, "\"\n", 2);
8871 }
8872
8873 break;
8874 }
8875 case PM_YIELD_NODE: {
8876 pm_yield_node_t *cast = (pm_yield_node_t *) node;
8877 pm_buffer_append_string(output_buffer, "@ YieldNode (location: ", 23);
8878 prettyprint_location(output_buffer, parser, &node->location);
8879 pm_buffer_append_string(output_buffer, ")\n", 2);
8880
8881 // keyword_loc
8882 {
8883 pm_buffer_concat(output_buffer, prefix_buffer);
8884 pm_buffer_append_string(output_buffer, "+-- keyword_loc:", 16);
8885 pm_location_t *location = &cast->keyword_loc;
8886 pm_buffer_append_byte(output_buffer, ' ');
8887 prettyprint_location(output_buffer, parser, location);
8888 pm_buffer_append_string(output_buffer, " = \"", 4);
8889 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8890 pm_buffer_append_string(output_buffer, "\"\n", 2);
8891 }
8892
8893 // lparen_loc
8894 {
8895 pm_buffer_concat(output_buffer, prefix_buffer);
8896 pm_buffer_append_string(output_buffer, "+-- lparen_loc:", 15);
8897 pm_location_t *location = &cast->lparen_loc;
8898 if (location->start == NULL) {
8899 pm_buffer_append_string(output_buffer, " nil\n", 5);
8900 } else {
8901 pm_buffer_append_byte(output_buffer, ' ');
8902 prettyprint_location(output_buffer, parser, location);
8903 pm_buffer_append_string(output_buffer, " = \"", 4);
8904 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8905 pm_buffer_append_string(output_buffer, "\"\n", 2);
8906 }
8907 }
8908
8909 // arguments
8910 {
8911 pm_buffer_concat(output_buffer, prefix_buffer);
8912 pm_buffer_append_string(output_buffer, "+-- arguments:", 14);
8913 if (cast->arguments == NULL) {
8914 pm_buffer_append_string(output_buffer, " nil\n", 5);
8915 } else {
8916 pm_buffer_append_byte(output_buffer, '\n');
8917
8918 size_t prefix_length = prefix_buffer->length;
8919 pm_buffer_append_string(prefix_buffer, "| ", 4);
8920 pm_buffer_concat(output_buffer, prefix_buffer);
8921 prettyprint_node(output_buffer, parser, (pm_node_t *) cast->arguments, prefix_buffer);
8922 prefix_buffer->length = prefix_length;
8923 }
8924 }
8925
8926 // rparen_loc
8927 {
8928 pm_buffer_concat(output_buffer, prefix_buffer);
8929 pm_buffer_append_string(output_buffer, "+-- rparen_loc:", 15);
8930 pm_location_t *location = &cast->rparen_loc;
8931 if (location->start == NULL) {
8932 pm_buffer_append_string(output_buffer, " nil\n", 5);
8933 } else {
8934 pm_buffer_append_byte(output_buffer, ' ');
8935 prettyprint_location(output_buffer, parser, location);
8936 pm_buffer_append_string(output_buffer, " = \"", 4);
8937 pm_buffer_append_source(output_buffer, location->start, (size_t) (location->end - location->start), PM_BUFFER_ESCAPING_RUBY);
8938 pm_buffer_append_string(output_buffer, "\"\n", 2);
8939 }
8940 }
8941
8942 break;
8943 }
8944 }
8945}
8946
8950 PRISM_EXPORTED_FUNCTION void
8951pm_prettyprint(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm_node_t *node) {
8952 pm_buffer_t prefix_buffer = { 0 };
8953 prettyprint_node(output_buffer, parser, node, &prefix_buffer);
8954 pm_buffer_free(&prefix_buffer);
8955}
8956
8957#endif
pm_parser_t
struct pm_parser pm_parser_t
The parser used to parse Ruby source.
Definition parser.h:267
pm_constant_id_t
uint32_t pm_constant_id_t
A constant id is a unique identifier for a constant in the constant pool.
Definition pm_constant_pool.h:31
prettyprint.h
An AST node pretty-printer.
PRISM_EXPORTED_FUNCTION
#define PRISM_EXPORTED_FUNCTION
By default, we compile with -fvisibility=hidden.
Definition defines.h:53
pm_alias_global_variable_node::old_name
struct pm_node * old_name
AliasGlobalVariableNode::old_name.
Definition ast.h:1139
pm_alias_global_variable_node::new_name
struct pm_node * new_name
AliasGlobalVariableNode::new_name.
Definition ast.h:1129
pm_alias_global_variable_node::keyword_loc
pm_location_t keyword_loc
AliasGlobalVariableNode::keyword_loc.
Definition ast.h:1149
pm_alias_method_node::old_name
struct pm_node * old_name
AliasMethodNode::old_name.
Definition ast.h:1199
pm_alias_method_node::new_name
struct pm_node * new_name
AliasMethodNode::new_name.
Definition ast.h:1183
pm_alias_method_node::keyword_loc
pm_location_t keyword_loc
AliasMethodNode::keyword_loc.
Definition ast.h:1209
pm_alternation_pattern_node::operator_loc
pm_location_t operator_loc
AlternationPatternNode::operator_loc.
Definition ast.h:1257
pm_alternation_pattern_node::left
struct pm_node * left
AlternationPatternNode::left.
Definition ast.h:1237
pm_alternation_pattern_node::right
struct pm_node * right
AlternationPatternNode::right.
Definition ast.h:1247
pm_and_node::left
struct pm_node * left
AndNode::left.
Definition ast.h:1288
pm_and_node::right
struct pm_node * right
AndNode::right.
Definition ast.h:1301
pm_and_node::operator_loc
pm_location_t operator_loc
AndNode::operator_loc.
Definition ast.h:1311
pm_arguments_node::base
pm_node_t base
The embedded base node.
Definition ast.h:1335
pm_arguments_node::arguments
struct pm_node_list arguments
ArgumentsNode::arguments.
Definition ast.h:1346
pm_array_node::base
pm_node_t base
The embedded base node.
Definition ast.h:1366
pm_array_node::closing_loc
pm_location_t closing_loc
ArrayNode::closing_loc.
Definition ast.h:1398
pm_array_node::elements
struct pm_node_list elements
ArrayNode::elements.
Definition ast.h:1374
pm_array_node::opening_loc
pm_location_t opening_loc
ArrayNode::opening_loc.
Definition ast.h:1386
pm_array_pattern_node::requireds
struct pm_node_list requireds
ArrayPatternNode::requireds.
Definition ast.h:1454
pm_array_pattern_node::rest
struct pm_node * rest
ArrayPatternNode::rest.
Definition ast.h:1464
pm_array_pattern_node::constant
struct pm_node * constant
ArrayPatternNode::constant.
Definition ast.h:1444
pm_array_pattern_node::opening_loc
pm_location_t opening_loc
ArrayPatternNode::opening_loc.
Definition ast.h:1484
pm_array_pattern_node::closing_loc
pm_location_t closing_loc
ArrayPatternNode::closing_loc.
Definition ast.h:1494
pm_array_pattern_node::posts
struct pm_node_list posts
ArrayPatternNode::posts.
Definition ast.h:1474
pm_assoc_node::value
struct pm_node * value
AssocNode::value.
Definition ast.h:1541
pm_assoc_node::key
struct pm_node * key
AssocNode::key.
Definition ast.h:1528
pm_assoc_node::operator_loc
pm_location_t operator_loc
AssocNode::operator_loc.
Definition ast.h:1551
pm_assoc_splat_node::value
struct pm_node * value
AssocSplatNode::value.
Definition ast.h:1579
pm_assoc_splat_node::operator_loc
pm_location_t operator_loc
AssocSplatNode::operator_loc.
Definition ast.h:1589
pm_back_reference_read_node::name
pm_constant_id_t name
BackReferenceReadNode::name.
Definition ast.h:1618
pm_begin_node::ensure_clause
struct pm_ensure_node * ensure_clause
BeginNode::ensure_clause.
Definition ast.h:1688
pm_begin_node::rescue_clause
struct pm_rescue_node * rescue_clause
BeginNode::rescue_clause.
Definition ast.h:1668
pm_begin_node::statements
struct pm_statements_node * statements
BeginNode::statements.
Definition ast.h:1658
pm_begin_node::end_keyword_loc
pm_location_t end_keyword_loc
BeginNode::end_keyword_loc.
Definition ast.h:1698
pm_begin_node::begin_keyword_loc
pm_location_t begin_keyword_loc
BeginNode::begin_keyword_loc.
Definition ast.h:1648
pm_begin_node::else_clause
struct pm_else_node * else_clause
BeginNode::else_clause.
Definition ast.h:1678
pm_block_argument_node::expression
struct pm_node * expression
BlockArgumentNode::expression.
Definition ast.h:1726
pm_block_argument_node::operator_loc
pm_location_t operator_loc
BlockArgumentNode::operator_loc.
Definition ast.h:1736
pm_block_local_variable_node::base
pm_node_t base
The embedded base node.
Definition ast.h:1756
pm_block_local_variable_node::name
pm_constant_id_t name
BlockLocalVariableNode::name.
Definition ast.h:1767
pm_block_node::closing_loc
pm_location_t closing_loc
BlockNode::closing_loc.
Definition ast.h:1839
pm_block_node::parameters
struct pm_node * parameters
BlockNode::parameters.
Definition ast.h:1809
pm_block_node::opening_loc
pm_location_t opening_loc
BlockNode::opening_loc.
Definition ast.h:1829
pm_block_node::body
struct pm_node * body
BlockNode::body.
Definition ast.h:1819
pm_block_node::locals
pm_constant_id_list_t locals
BlockNode::locals.
Definition ast.h:1795
pm_block_parameter_node::operator_loc
pm_location_t operator_loc
BlockParameterNode::operator_loc.
Definition ast.h:1893
pm_block_parameter_node::name_loc
pm_location_t name_loc
BlockParameterNode::name_loc.
Definition ast.h:1882
pm_block_parameter_node::name
pm_constant_id_t name
BlockParameterNode::name.
Definition ast.h:1872
pm_block_parameter_node::base
pm_node_t base
The embedded base node.
Definition ast.h:1860
pm_block_parameters_node::parameters
struct pm_parameters_node * parameters
BlockParametersNode::parameters.
Definition ast.h:1929
pm_block_parameters_node::locals
struct pm_node_list locals
BlockParametersNode::locals.
Definition ast.h:1943
pm_block_parameters_node::closing_loc
pm_location_t closing_loc
BlockParametersNode::closing_loc.
Definition ast.h:1971
pm_block_parameters_node::opening_loc
pm_location_t opening_loc
BlockParametersNode::opening_loc.
Definition ast.h:1957
pm_break_node::arguments
struct pm_arguments_node * arguments
BreakNode::arguments.
Definition ast.h:1999
pm_break_node::keyword_loc
pm_location_t keyword_loc
BreakNode::keyword_loc.
Definition ast.h:2009
pm_buffer_t
A pm_buffer_t is a simple memory buffer that stores data in a contiguous block of memory.
Definition pm_buffer.h:22
pm_buffer_t::length
size_t length
The length of the buffer in bytes.
Definition pm_buffer.h:24
pm_call_and_write_node::operator_loc
pm_location_t operator_loc
CallAndWriteNode::operator_loc.
Definition ast.h:2093
pm_call_and_write_node::value
struct pm_node * value
CallAndWriteNode::value.
Definition ast.h:2103
pm_call_and_write_node::base
pm_node_t base
The embedded base node.
Definition ast.h:2032
pm_call_and_write_node::call_operator_loc
pm_location_t call_operator_loc
CallAndWriteNode::call_operator_loc.
Definition ast.h:2053
pm_call_and_write_node::message_loc
pm_location_t message_loc
CallAndWriteNode::message_loc.
Definition ast.h:2063
pm_call_and_write_node::read_name
pm_constant_id_t read_name
CallAndWriteNode::read_name.
Definition ast.h:2073
pm_call_and_write_node::write_name
pm_constant_id_t write_name
CallAndWriteNode::write_name.
Definition ast.h:2083
pm_call_and_write_node::receiver
struct pm_node * receiver
CallAndWriteNode::receiver.
Definition ast.h:2043
pm_call_node::opening_loc
pm_location_t opening_loc
CallNode::opening_loc.
Definition ast.h:2200
pm_call_node::closing_loc
pm_location_t closing_loc
CallNode::closing_loc.
Definition ast.h:2220
pm_call_node::receiver
struct pm_node * receiver
CallNode::receiver.
Definition ast.h:2158
pm_call_node::name
pm_constant_id_t name
CallNode::name.
Definition ast.h:2181
pm_call_node::base
pm_node_t base
The embedded base node.
Definition ast.h:2141
pm_call_node::equal_loc
pm_location_t equal_loc
CallNode::equal_loc.
Definition ast.h:2233
pm_call_node::call_operator_loc
pm_location_t call_operator_loc
CallNode::call_operator_loc.
Definition ast.h:2171
pm_call_node::message_loc
pm_location_t message_loc
CallNode::message_loc.
Definition ast.h:2191
pm_call_node::arguments
struct pm_arguments_node * arguments
CallNode::arguments.
Definition ast.h:2210
pm_call_node::block
struct pm_node * block
CallNode::block.
Definition ast.h:2243
pm_call_operator_write_node::read_name
pm_constant_id_t read_name
CallOperatorWriteNode::read_name.
Definition ast.h:2307
pm_call_operator_write_node::binary_operator
pm_constant_id_t binary_operator
CallOperatorWriteNode::binary_operator.
Definition ast.h:2327
pm_call_operator_write_node::binary_operator_loc
pm_location_t binary_operator_loc
CallOperatorWriteNode::binary_operator_loc.
Definition ast.h:2337
pm_call_operator_write_node::receiver
struct pm_node * receiver
CallOperatorWriteNode::receiver.
Definition ast.h:2277
pm_call_operator_write_node::base
pm_node_t base
The embedded base node.
Definition ast.h:2266
pm_call_operator_write_node::write_name
pm_constant_id_t write_name
CallOperatorWriteNode::write_name.
Definition ast.h:2317
pm_call_operator_write_node::message_loc
pm_location_t message_loc
CallOperatorWriteNode::message_loc.
Definition ast.h:2297
pm_call_operator_write_node::value
struct pm_node * value
CallOperatorWriteNode::value.
Definition ast.h:2347
pm_call_operator_write_node::call_operator_loc
pm_location_t call_operator_loc
CallOperatorWriteNode::call_operator_loc.
Definition ast.h:2287
pm_call_or_write_node::operator_loc
pm_location_t operator_loc
CallOrWriteNode::operator_loc.
Definition ast.h:2431
pm_call_or_write_node::call_operator_loc
pm_location_t call_operator_loc
CallOrWriteNode::call_operator_loc.
Definition ast.h:2391
pm_call_or_write_node::base
pm_node_t base
The embedded base node.
Definition ast.h:2370
pm_call_or_write_node::receiver
struct pm_node * receiver
CallOrWriteNode::receiver.
Definition ast.h:2381
pm_call_or_write_node::value
struct pm_node * value
CallOrWriteNode::value.
Definition ast.h:2441
pm_call_or_write_node::write_name
pm_constant_id_t write_name
CallOrWriteNode::write_name.
Definition ast.h:2421
pm_call_or_write_node::read_name
pm_constant_id_t read_name
CallOrWriteNode::read_name.
Definition ast.h:2411
pm_call_or_write_node::message_loc
pm_location_t message_loc
CallOrWriteNode::message_loc.
Definition ast.h:2401
pm_call_target_node::base
pm_node_t base
The embedded base node.
Definition ast.h:2472
pm_call_target_node::name
pm_constant_id_t name
CallTargetNode::name.
Definition ast.h:2503
pm_call_target_node::receiver
struct pm_node * receiver
CallTargetNode::receiver.
Definition ast.h:2483
pm_call_target_node::call_operator_loc
pm_location_t call_operator_loc
CallTargetNode::call_operator_loc.
Definition ast.h:2493
pm_call_target_node::message_loc
pm_location_t message_loc
CallTargetNode::message_loc.
Definition ast.h:2513
pm_capture_pattern_node::target
struct pm_local_variable_target_node * target
CapturePatternNode::target.
Definition ast.h:2551
pm_capture_pattern_node::operator_loc
pm_location_t operator_loc
CapturePatternNode::operator_loc.
Definition ast.h:2561
pm_capture_pattern_node::value
struct pm_node * value
CapturePatternNode::value.
Definition ast.h:2541
pm_case_match_node::end_keyword_loc
pm_location_t end_keyword_loc
CaseMatchNode::end_keyword_loc.
Definition ast.h:2631
pm_case_match_node::conditions
struct pm_node_list conditions
CaseMatchNode::conditions.
Definition ast.h:2601
pm_case_match_node::case_keyword_loc
pm_location_t case_keyword_loc
CaseMatchNode::case_keyword_loc.
Definition ast.h:2621
pm_case_match_node::else_clause
struct pm_else_node * else_clause
CaseMatchNode::else_clause.
Definition ast.h:2611
pm_case_match_node::predicate
struct pm_node * predicate
CaseMatchNode::predicate.
Definition ast.h:2591
pm_case_node::predicate
struct pm_node * predicate
CaseNode::predicate.
Definition ast.h:2661
pm_case_node::else_clause
struct pm_else_node * else_clause
CaseNode::else_clause.
Definition ast.h:2681
pm_case_node::conditions
struct pm_node_list conditions
CaseNode::conditions.
Definition ast.h:2671
pm_case_node::case_keyword_loc
pm_location_t case_keyword_loc
CaseNode::case_keyword_loc.
Definition ast.h:2691
pm_case_node::end_keyword_loc
pm_location_t end_keyword_loc
CaseNode::end_keyword_loc.
Definition ast.h:2701
pm_class_node::class_keyword_loc
pm_location_t class_keyword_loc
ClassNode::class_keyword_loc.
Definition ast.h:2734
pm_class_node::end_keyword_loc
pm_location_t end_keyword_loc
ClassNode::end_keyword_loc.
Definition ast.h:2780
pm_class_node::constant_path
struct pm_node * constant_path
ClassNode::constant_path.
Definition ast.h:2739
pm_class_node::locals
pm_constant_id_list_t locals
ClassNode::locals.
Definition ast.h:2724
pm_class_node::inheritance_operator_loc
pm_location_t inheritance_operator_loc
ClassNode::inheritance_operator_loc.
Definition ast.h:2749
pm_class_node::name
pm_constant_id_t name
ClassNode::name.
Definition ast.h:2789
pm_class_node::body
struct pm_node * body
ClassNode::body.
Definition ast.h:2770
pm_class_node::superclass
struct pm_node * superclass
ClassNode::superclass.
Definition ast.h:2759
pm_class_variable_and_write_node::value
struct pm_node * value
ClassVariableAndWriteNode::value.
Definition ast.h:2847
pm_class_variable_and_write_node::name
pm_constant_id_t name
ClassVariableAndWriteNode::name.
Definition ast.h:2817
pm_class_variable_and_write_node::operator_loc
pm_location_t operator_loc
ClassVariableAndWriteNode::operator_loc.
Definition ast.h:2837
pm_class_variable_and_write_node::name_loc
pm_location_t name_loc
ClassVariableAndWriteNode::name_loc.
Definition ast.h:2827
pm_class_variable_operator_write_node::name
pm_constant_id_t name
ClassVariableOperatorWriteNode::name.
Definition ast.h:2870
pm_class_variable_operator_write_node::name_loc
pm_location_t name_loc
ClassVariableOperatorWriteNode::name_loc.
Definition ast.h:2875
pm_class_variable_operator_write_node::binary_operator
pm_constant_id_t binary_operator
ClassVariableOperatorWriteNode::binary_operator.
Definition ast.h:2890
pm_class_variable_operator_write_node::value
struct pm_node * value
ClassVariableOperatorWriteNode::value.
Definition ast.h:2885
pm_class_variable_operator_write_node::binary_operator_loc
pm_location_t binary_operator_loc
ClassVariableOperatorWriteNode::binary_operator_loc.
Definition ast.h:2880
pm_class_variable_or_write_node::name_loc
pm_location_t name_loc
ClassVariableOrWriteNode::name_loc.
Definition ast.h:2918
pm_class_variable_or_write_node::operator_loc
pm_location_t operator_loc
ClassVariableOrWriteNode::operator_loc.
Definition ast.h:2923
pm_class_variable_or_write_node::name
pm_constant_id_t name
ClassVariableOrWriteNode::name.
Definition ast.h:2913
pm_class_variable_or_write_node::value
struct pm_node * value
ClassVariableOrWriteNode::value.
Definition ast.h:2928
pm_class_variable_read_node::name
pm_constant_id_t name
ClassVariableReadNode::name.
Definition ast.h:2957
pm_class_variable_target_node::name
pm_constant_id_t name
ClassVariableTargetNode::name.
Definition ast.h:2980
pm_class_variable_write_node::name_loc
pm_location_t name_loc
ClassVariableWriteNode::name_loc.
Definition ast.h:3019
pm_class_variable_write_node::value
struct pm_node * value
ClassVariableWriteNode::value.
Definition ast.h:3032
pm_class_variable_write_node::operator_loc
pm_location_t operator_loc
ClassVariableWriteNode::operator_loc.
Definition ast.h:3042
pm_class_variable_write_node::name
pm_constant_id_t name
ClassVariableWriteNode::name.
Definition ast.h:3009
pm_constant_and_write_node::operator_loc
pm_location_t operator_loc
ConstantAndWriteNode::operator_loc.
Definition ast.h:3075
pm_constant_and_write_node::name_loc
pm_location_t name_loc
ConstantAndWriteNode::name_loc.
Definition ast.h:3070
pm_constant_and_write_node::name
pm_constant_id_t name
ConstantAndWriteNode::name.
Definition ast.h:3065
pm_constant_and_write_node::value
struct pm_node * value
ConstantAndWriteNode::value.
Definition ast.h:3080
pm_constant_id_list_t::size
size_t size
The number of constant ids in the list.
Definition pm_constant_pool.h:38
pm_constant_id_list_t::ids
pm_constant_id_t * ids
The constant ids in the list.
Definition pm_constant_pool.h:44
pm_constant_operator_write_node::name
pm_constant_id_t name
ConstantOperatorWriteNode::name.
Definition ast.h:3103
pm_constant_operator_write_node::name_loc
pm_location_t name_loc
ConstantOperatorWriteNode::name_loc.
Definition ast.h:3108
pm_constant_operator_write_node::binary_operator
pm_constant_id_t binary_operator
ConstantOperatorWriteNode::binary_operator.
Definition ast.h:3123
pm_constant_operator_write_node::binary_operator_loc
pm_location_t binary_operator_loc
ConstantOperatorWriteNode::binary_operator_loc.
Definition ast.h:3113
pm_constant_operator_write_node::value
struct pm_node * value
ConstantOperatorWriteNode::value.
Definition ast.h:3118
pm_constant_or_write_node::operator_loc
pm_location_t operator_loc
ConstantOrWriteNode::operator_loc.
Definition ast.h:3156
pm_constant_or_write_node::name_loc
pm_location_t name_loc
ConstantOrWriteNode::name_loc.
Definition ast.h:3151
pm_constant_or_write_node::name
pm_constant_id_t name
ConstantOrWriteNode::name.
Definition ast.h:3146
pm_constant_or_write_node::value
struct pm_node * value
ConstantOrWriteNode::value.
Definition ast.h:3161
pm_constant_path_and_write_node::target
struct pm_constant_path_node * target
ConstantPathAndWriteNode::target.
Definition ast.h:3184
pm_constant_path_and_write_node::operator_loc
pm_location_t operator_loc
ConstantPathAndWriteNode::operator_loc.
Definition ast.h:3189
pm_constant_path_and_write_node::value
struct pm_node * value
ConstantPathAndWriteNode::value.
Definition ast.h:3194
pm_constant_path_node::delimiter_loc
pm_location_t delimiter_loc
ConstantPathNode::delimiter_loc.
Definition ast.h:3248
pm_constant_path_node::name_loc
pm_location_t name_loc
ConstantPathNode::name_loc.
Definition ast.h:3261
pm_constant_path_node::name
pm_constant_id_t name
ConstantPathNode::name.
Definition ast.h:3235
pm_constant_path_node::parent
struct pm_node * parent
ConstantPathNode::parent.
Definition ast.h:3228
pm_constant_path_operator_write_node::target
struct pm_constant_path_node * target
ConstantPathOperatorWriteNode::target.
Definition ast.h:3284
pm_constant_path_operator_write_node::value
struct pm_node * value
ConstantPathOperatorWriteNode::value.
Definition ast.h:3294
pm_constant_path_operator_write_node::binary_operator
pm_constant_id_t binary_operator
ConstantPathOperatorWriteNode::binary_operator.
Definition ast.h:3299
pm_constant_path_operator_write_node::binary_operator_loc
pm_location_t binary_operator_loc
ConstantPathOperatorWriteNode::binary_operator_loc.
Definition ast.h:3289
pm_constant_path_or_write_node::operator_loc
pm_location_t operator_loc
ConstantPathOrWriteNode::operator_loc.
Definition ast.h:3327
pm_constant_path_or_write_node::value
struct pm_node * value
ConstantPathOrWriteNode::value.
Definition ast.h:3332
pm_constant_path_or_write_node::target
struct pm_constant_path_node * target
ConstantPathOrWriteNode::target.
Definition ast.h:3322
pm_constant_path_target_node::parent
struct pm_node * parent
ConstantPathTargetNode::parent.
Definition ast.h:3355
pm_constant_path_target_node::delimiter_loc
pm_location_t delimiter_loc
ConstantPathTargetNode::delimiter_loc.
Definition ast.h:3365
pm_constant_path_target_node::name
pm_constant_id_t name
ConstantPathTargetNode::name.
Definition ast.h:3360
pm_constant_path_target_node::name_loc
pm_location_t name_loc
ConstantPathTargetNode::name_loc.
Definition ast.h:3370
pm_constant_path_write_node::target
struct pm_constant_path_node * target
ConstantPathWriteNode::target.
Definition ast.h:3407
pm_constant_path_write_node::operator_loc
pm_location_t operator_loc
ConstantPathWriteNode::operator_loc.
Definition ast.h:3417
pm_constant_path_write_node::value
struct pm_node * value
ConstantPathWriteNode::value.
Definition ast.h:3427
pm_constant_read_node::name
pm_constant_id_t name
ConstantReadNode::name.
Definition ast.h:3456
pm_constant_t
A constant in the pool which effectively stores a string.
Definition pm_constant_pool.h:125
pm_constant_t::length
size_t length
The length of the string.
Definition pm_constant_pool.h:130
pm_constant_t::start
const uint8_t * start
A pointer to the start of the string.
Definition pm_constant_pool.h:127
pm_constant_target_node::name
pm_constant_id_t name
ConstantTargetNode::name.
Definition ast.h:3479
pm_constant_write_node::value
struct pm_node * value
ConstantWriteNode::value.
Definition ast.h:3531
pm_constant_write_node::name
pm_constant_id_t name
ConstantWriteNode::name.
Definition ast.h:3508
pm_constant_write_node::name_loc
pm_location_t name_loc
ConstantWriteNode::name_loc.
Definition ast.h:3518
pm_constant_write_node::operator_loc
pm_location_t operator_loc
ConstantWriteNode::operator_loc.
Definition ast.h:3541
pm_def_node::parameters
struct pm_parameters_node * parameters
DefNode::parameters.
Definition ast.h:3580
pm_def_node::end_keyword_loc
pm_location_t end_keyword_loc
DefNode::end_keyword_loc.
Definition ast.h:3620
pm_def_node::name
pm_constant_id_t name
DefNode::name.
Definition ast.h:3565
pm_def_node::name_loc
pm_location_t name_loc
DefNode::name_loc.
Definition ast.h:3570
pm_def_node::rparen_loc
pm_location_t rparen_loc
DefNode::rparen_loc.
Definition ast.h:3610
pm_def_node::body
struct pm_node * body
DefNode::body.
Definition ast.h:3585
pm_def_node::equal_loc
pm_location_t equal_loc
DefNode::equal_loc.
Definition ast.h:3615
pm_def_node::def_keyword_loc
pm_location_t def_keyword_loc
DefNode::def_keyword_loc.
Definition ast.h:3595
pm_def_node::receiver
struct pm_node * receiver
DefNode::receiver.
Definition ast.h:3575
pm_def_node::lparen_loc
pm_location_t lparen_loc
DefNode::lparen_loc.
Definition ast.h:3605
pm_def_node::operator_loc
pm_location_t operator_loc
DefNode::operator_loc.
Definition ast.h:3600
pm_def_node::locals
pm_constant_id_list_t locals
DefNode::locals.
Definition ast.h:3590
pm_defined_node::lparen_loc
pm_location_t lparen_loc
DefinedNode::lparen_loc.
Definition ast.h:3643
pm_defined_node::rparen_loc
pm_location_t rparen_loc
DefinedNode::rparen_loc.
Definition ast.h:3653
pm_defined_node::keyword_loc
pm_location_t keyword_loc
DefinedNode::keyword_loc.
Definition ast.h:3658
pm_defined_node::value
struct pm_node * value
DefinedNode::value.
Definition ast.h:3648
pm_else_node::statements
struct pm_statements_node * statements
ElseNode::statements.
Definition ast.h:3686
pm_else_node::else_keyword_loc
pm_location_t else_keyword_loc
ElseNode::else_keyword_loc.
Definition ast.h:3681
pm_else_node::end_keyword_loc
pm_location_t end_keyword_loc
ElseNode::end_keyword_loc.
Definition ast.h:3691
pm_embedded_statements_node::closing_loc
pm_location_t closing_loc
EmbeddedStatementsNode::closing_loc.
Definition ast.h:3724
pm_embedded_statements_node::statements
struct pm_statements_node * statements
EmbeddedStatementsNode::statements.
Definition ast.h:3719
pm_embedded_statements_node::opening_loc
pm_location_t opening_loc
EmbeddedStatementsNode::opening_loc.
Definition ast.h:3714
pm_embedded_variable_node::variable
struct pm_node * variable
EmbeddedVariableNode::variable.
Definition ast.h:3752
pm_embedded_variable_node::operator_loc
pm_location_t operator_loc
EmbeddedVariableNode::operator_loc.
Definition ast.h:3747
pm_ensure_node::statements
struct pm_statements_node * statements
EnsureNode::statements.
Definition ast.h:3784
pm_ensure_node::ensure_keyword_loc
pm_location_t ensure_keyword_loc
EnsureNode::ensure_keyword_loc.
Definition ast.h:3779
pm_ensure_node::end_keyword_loc
pm_location_t end_keyword_loc
EnsureNode::end_keyword_loc.
Definition ast.h:3789
pm_find_pattern_node::constant
struct pm_node * constant
FindPatternNode::constant.
Definition ast.h:3844
pm_find_pattern_node::right
struct pm_node * right
FindPatternNode::right.
Definition ast.h:3883
pm_find_pattern_node::opening_loc
pm_location_t opening_loc
FindPatternNode::opening_loc.
Definition ast.h:3896
pm_find_pattern_node::requireds
struct pm_node_list requireds
FindPatternNode::requireds.
Definition ast.h:3870
pm_find_pattern_node::left
struct pm_splat_node * left
FindPatternNode::left.
Definition ast.h:3857
pm_find_pattern_node::closing_loc
pm_location_t closing_loc
FindPatternNode::closing_loc.
Definition ast.h:3909
pm_flip_flop_node::base
pm_node_t base
The embedded base node.
Definition ast.h:3929
pm_flip_flop_node::operator_loc
pm_location_t operator_loc
FlipFlopNode::operator_loc.
Definition ast.h:3945
pm_flip_flop_node::left
struct pm_node * left
FlipFlopNode::left.
Definition ast.h:3935
pm_flip_flop_node::right
struct pm_node * right
FlipFlopNode::right.
Definition ast.h:3940
pm_float_node::value
double value
FloatNode::value.
Definition ast.h:3970
pm_for_node::statements
struct pm_statements_node * statements
ForNode::statements.
Definition ast.h:4020
pm_for_node::index
struct pm_node * index
ForNode::index.
Definition ast.h:3998
pm_for_node::collection
struct pm_node * collection
ForNode::collection.
Definition ast.h:4008
pm_for_node::end_keyword_loc
pm_location_t end_keyword_loc
ForNode::end_keyword_loc.
Definition ast.h:4060
pm_for_node::for_keyword_loc
pm_location_t for_keyword_loc
ForNode::for_keyword_loc.
Definition ast.h:4030
pm_for_node::do_keyword_loc
pm_location_t do_keyword_loc
ForNode::do_keyword_loc.
Definition ast.h:4050
pm_for_node::in_keyword_loc
pm_location_t in_keyword_loc
ForNode::in_keyword_loc.
Definition ast.h:4040
pm_forwarding_super_node::block
struct pm_block_node * block
ForwardingSuperNode::block.
Definition ast.h:4129
pm_global_variable_and_write_node::operator_loc
pm_location_t operator_loc
GlobalVariableAndWriteNode::operator_loc.
Definition ast.h:4162
pm_global_variable_and_write_node::name_loc
pm_location_t name_loc
GlobalVariableAndWriteNode::name_loc.
Definition ast.h:4157
pm_global_variable_and_write_node::value
struct pm_node * value
GlobalVariableAndWriteNode::value.
Definition ast.h:4167
pm_global_variable_and_write_node::name
pm_constant_id_t name
GlobalVariableAndWriteNode::name.
Definition ast.h:4152
pm_global_variable_operator_write_node::name
pm_constant_id_t name
GlobalVariableOperatorWriteNode::name.
Definition ast.h:4190
pm_global_variable_operator_write_node::binary_operator
pm_constant_id_t binary_operator
GlobalVariableOperatorWriteNode::binary_operator.
Definition ast.h:4210
pm_global_variable_operator_write_node::value
struct pm_node * value
GlobalVariableOperatorWriteNode::value.
Definition ast.h:4205
pm_global_variable_operator_write_node::name_loc
pm_location_t name_loc
GlobalVariableOperatorWriteNode::name_loc.
Definition ast.h:4195
pm_global_variable_operator_write_node::binary_operator_loc
pm_location_t binary_operator_loc
GlobalVariableOperatorWriteNode::binary_operator_loc.
Definition ast.h:4200
pm_global_variable_or_write_node::name
pm_constant_id_t name
GlobalVariableOrWriteNode::name.
Definition ast.h:4233
pm_global_variable_or_write_node::name_loc
pm_location_t name_loc
GlobalVariableOrWriteNode::name_loc.
Definition ast.h:4238
pm_global_variable_or_write_node::operator_loc
pm_location_t operator_loc
GlobalVariableOrWriteNode::operator_loc.
Definition ast.h:4243
pm_global_variable_or_write_node::value
struct pm_node * value
GlobalVariableOrWriteNode::value.
Definition ast.h:4248
pm_global_variable_read_node::name
pm_constant_id_t name
GlobalVariableReadNode::name.
Definition ast.h:4277
pm_global_variable_target_node::name
pm_constant_id_t name
GlobalVariableTargetNode::name.
Definition ast.h:4300
pm_global_variable_write_node::value
struct pm_node * value
GlobalVariableWriteNode::value.
Definition ast.h:4352
pm_global_variable_write_node::name_loc
pm_location_t name_loc
GlobalVariableWriteNode::name_loc.
Definition ast.h:4339
pm_global_variable_write_node::operator_loc
pm_location_t operator_loc
GlobalVariableWriteNode::operator_loc.
Definition ast.h:4362
pm_global_variable_write_node::name
pm_constant_id_t name
GlobalVariableWriteNode::name.
Definition ast.h:4329
pm_hash_node::elements
struct pm_node_list elements
HashNode::elements.
Definition ast.h:4403
pm_hash_node::closing_loc
pm_location_t closing_loc
HashNode::closing_loc.
Definition ast.h:4413
pm_hash_node::opening_loc
pm_location_t opening_loc
HashNode::opening_loc.
Definition ast.h:4390
pm_hash_pattern_node::elements
struct pm_node_list elements
HashPatternNode::elements.
Definition ast.h:4463
pm_hash_pattern_node::opening_loc
pm_location_t opening_loc
HashPatternNode::opening_loc.
Definition ast.h:4492
pm_hash_pattern_node::rest
struct pm_node * rest
HashPatternNode::rest.
Definition ast.h:4479
pm_hash_pattern_node::closing_loc
pm_location_t closing_loc
HashPatternNode::closing_loc.
Definition ast.h:4505
pm_hash_pattern_node::constant
struct pm_node * constant
HashPatternNode::constant.
Definition ast.h:4453
pm_if_node::predicate
struct pm_node * predicate
IfNode::predicate.
Definition ast.h:4559
pm_if_node::end_keyword_loc
pm_location_t end_keyword_loc
IfNode::end_keyword_loc.
Definition ast.h:4617
pm_if_node::if_keyword_loc
pm_location_t if_keyword_loc
IfNode::if_keyword_loc.
Definition ast.h:4541
pm_if_node::statements
struct pm_statements_node * statements
IfNode::statements.
Definition ast.h:4586
pm_if_node::subsequent
struct pm_node * subsequent
IfNode::subsequent.
Definition ast.h:4605
pm_if_node::then_keyword_loc
pm_location_t then_keyword_loc
IfNode::then_keyword_loc.
Definition ast.h:4572
pm_imaginary_node::numeric
struct pm_node * numeric
ImaginaryNode::numeric.
Definition ast.h:4640
pm_implicit_node::value
struct pm_node * value
ImplicitNode::value.
Definition ast.h:4669
pm_in_node::statements
struct pm_statements_node * statements
InNode::statements.
Definition ast.h:4724
pm_in_node::pattern
struct pm_node * pattern
InNode::pattern.
Definition ast.h:4719
pm_in_node::then_loc
pm_location_t then_loc
InNode::then_loc.
Definition ast.h:4734
pm_in_node::in_loc
pm_location_t in_loc
InNode::in_loc.
Definition ast.h:4729
pm_index_and_write_node::arguments
struct pm_arguments_node * arguments
IndexAndWriteNode::arguments.
Definition ast.h:4778
pm_index_and_write_node::receiver
struct pm_node * receiver
IndexAndWriteNode::receiver.
Definition ast.h:4763
pm_index_and_write_node::base
pm_node_t base
The embedded base node.
Definition ast.h:4757
pm_index_and_write_node::block
struct pm_block_argument_node * block
IndexAndWriteNode::block.
Definition ast.h:4788
pm_index_and_write_node::value
struct pm_node * value
IndexAndWriteNode::value.
Definition ast.h:4798
pm_index_and_write_node::operator_loc
pm_location_t operator_loc
IndexAndWriteNode::operator_loc.
Definition ast.h:4793
pm_index_and_write_node::closing_loc
pm_location_t closing_loc
IndexAndWriteNode::closing_loc.
Definition ast.h:4783
pm_index_and_write_node::opening_loc
pm_location_t opening_loc
IndexAndWriteNode::opening_loc.
Definition ast.h:4773
pm_index_and_write_node::call_operator_loc
pm_location_t call_operator_loc
IndexAndWriteNode::call_operator_loc.
Definition ast.h:4768
pm_index_operator_write_node::base
pm_node_t base
The embedded base node.
Definition ast.h:4821
pm_index_operator_write_node::block
struct pm_block_argument_node * block
IndexOperatorWriteNode::block.
Definition ast.h:4852
pm_index_operator_write_node::binary_operator_loc
pm_location_t binary_operator_loc
IndexOperatorWriteNode::binary_operator_loc.
Definition ast.h:4862
pm_index_operator_write_node::value
struct pm_node * value
IndexOperatorWriteNode::value.
Definition ast.h:4867
pm_index_operator_write_node::opening_loc
pm_location_t opening_loc
IndexOperatorWriteNode::opening_loc.
Definition ast.h:4837
pm_index_operator_write_node::call_operator_loc
pm_location_t call_operator_loc
IndexOperatorWriteNode::call_operator_loc.
Definition ast.h:4832
pm_index_operator_write_node::closing_loc
pm_location_t closing_loc
IndexOperatorWriteNode::closing_loc.
Definition ast.h:4847
pm_index_operator_write_node::arguments
struct pm_arguments_node * arguments
IndexOperatorWriteNode::arguments.
Definition ast.h:4842
pm_index_operator_write_node::binary_operator
pm_constant_id_t binary_operator
IndexOperatorWriteNode::binary_operator.
Definition ast.h:4857
pm_index_operator_write_node::receiver
struct pm_node * receiver
IndexOperatorWriteNode::receiver.
Definition ast.h:4827
pm_index_or_write_node::closing_loc
pm_location_t closing_loc
IndexOrWriteNode::closing_loc.
Definition ast.h:4916
pm_index_or_write_node::call_operator_loc
pm_location_t call_operator_loc
IndexOrWriteNode::call_operator_loc.
Definition ast.h:4901
pm_index_or_write_node::base
pm_node_t base
The embedded base node.
Definition ast.h:4890
pm_index_or_write_node::block
struct pm_block_argument_node * block
IndexOrWriteNode::block.
Definition ast.h:4921
pm_index_or_write_node::operator_loc
pm_location_t operator_loc
IndexOrWriteNode::operator_loc.
Definition ast.h:4926
pm_index_or_write_node::receiver
struct pm_node * receiver
IndexOrWriteNode::receiver.
Definition ast.h:4896
pm_index_or_write_node::opening_loc
pm_location_t opening_loc
IndexOrWriteNode::opening_loc.
Definition ast.h:4906
pm_index_or_write_node::value
struct pm_node * value
IndexOrWriteNode::value.
Definition ast.h:4931
pm_index_or_write_node::arguments
struct pm_arguments_node * arguments
IndexOrWriteNode::arguments.
Definition ast.h:4911
pm_index_target_node::base
pm_node_t base
The embedded base node.
Definition ast.h:4962
pm_index_target_node::receiver
struct pm_node * receiver
IndexTargetNode::receiver.
Definition ast.h:4968
pm_index_target_node::closing_loc
pm_location_t closing_loc
IndexTargetNode::closing_loc.
Definition ast.h:4983
pm_index_target_node::arguments
struct pm_arguments_node * arguments
IndexTargetNode::arguments.
Definition ast.h:4978
pm_index_target_node::opening_loc
pm_location_t opening_loc
IndexTargetNode::opening_loc.
Definition ast.h:4973
pm_index_target_node::block
struct pm_block_argument_node * block
IndexTargetNode::block.
Definition ast.h:4988
pm_instance_variable_and_write_node::operator_loc
pm_location_t operator_loc
InstanceVariableAndWriteNode::operator_loc.
Definition ast.h:5021
pm_instance_variable_and_write_node::name_loc
pm_location_t name_loc
InstanceVariableAndWriteNode::name_loc.
Definition ast.h:5016
pm_instance_variable_and_write_node::value
struct pm_node * value
InstanceVariableAndWriteNode::value.
Definition ast.h:5026
pm_instance_variable_and_write_node::name
pm_constant_id_t name
InstanceVariableAndWriteNode::name.
Definition ast.h:5011
pm_instance_variable_operator_write_node::value
struct pm_node * value
InstanceVariableOperatorWriteNode::value.
Definition ast.h:5064
pm_instance_variable_operator_write_node::binary_operator
pm_constant_id_t binary_operator
InstanceVariableOperatorWriteNode::binary_operator.
Definition ast.h:5069
pm_instance_variable_operator_write_node::binary_operator_loc
pm_location_t binary_operator_loc
InstanceVariableOperatorWriteNode::binary_operator_loc.
Definition ast.h:5059
pm_instance_variable_operator_write_node::name
pm_constant_id_t name
InstanceVariableOperatorWriteNode::name.
Definition ast.h:5049
pm_instance_variable_operator_write_node::name_loc
pm_location_t name_loc
InstanceVariableOperatorWriteNode::name_loc.
Definition ast.h:5054
pm_instance_variable_or_write_node::operator_loc
pm_location_t operator_loc
InstanceVariableOrWriteNode::operator_loc.
Definition ast.h:5102
pm_instance_variable_or_write_node::value
struct pm_node * value
InstanceVariableOrWriteNode::value.
Definition ast.h:5107
pm_instance_variable_or_write_node::name_loc
pm_location_t name_loc
InstanceVariableOrWriteNode::name_loc.
Definition ast.h:5097
pm_instance_variable_or_write_node::name
pm_constant_id_t name
InstanceVariableOrWriteNode::name.
Definition ast.h:5092
pm_instance_variable_read_node::name
pm_constant_id_t name
InstanceVariableReadNode::name.
Definition ast.h:5136
pm_instance_variable_target_node::name
pm_constant_id_t name
InstanceVariableTargetNode::name.
Definition ast.h:5159
pm_instance_variable_write_node::operator_loc
pm_location_t operator_loc
InstanceVariableWriteNode::operator_loc.
Definition ast.h:5221
pm_instance_variable_write_node::name
pm_constant_id_t name
InstanceVariableWriteNode::name.
Definition ast.h:5188
pm_instance_variable_write_node::value
struct pm_node * value
InstanceVariableWriteNode::value.
Definition ast.h:5211
pm_instance_variable_write_node::name_loc
pm_location_t name_loc
InstanceVariableWriteNode::name_loc.
Definition ast.h:5198
pm_integer_node::value
pm_integer_t value
IntegerNode::value.
Definition ast.h:5252
pm_integer_node::base
pm_node_t base
The embedded base node.
Definition ast.h:5244
pm_integer_t
A structure represents an arbitrary-sized integer.
Definition pm_integer.h:20
pm_interpolated_match_last_line_node::base
pm_node_t base
The embedded base node.
Definition ast.h:5282
pm_interpolated_match_last_line_node::closing_loc
pm_location_t closing_loc
InterpolatedMatchLastLineNode::closing_loc.
Definition ast.h:5298
pm_interpolated_match_last_line_node::parts
struct pm_node_list parts
InterpolatedMatchLastLineNode::parts.
Definition ast.h:5293
pm_interpolated_match_last_line_node::opening_loc
pm_location_t opening_loc
InterpolatedMatchLastLineNode::opening_loc.
Definition ast.h:5288
pm_interpolated_regular_expression_node::opening_loc
pm_location_t opening_loc
InterpolatedRegularExpressionNode::opening_loc.
Definition ast.h:5334
pm_interpolated_regular_expression_node::parts
struct pm_node_list parts
InterpolatedRegularExpressionNode::parts.
Definition ast.h:5339
pm_interpolated_regular_expression_node::base
pm_node_t base
The embedded base node.
Definition ast.h:5328
pm_interpolated_regular_expression_node::closing_loc
pm_location_t closing_loc
InterpolatedRegularExpressionNode::closing_loc.
Definition ast.h:5344
pm_interpolated_string_node::base
pm_node_t base
The embedded base node.
Definition ast.h:5365
pm_interpolated_string_node::closing_loc
pm_location_t closing_loc
InterpolatedStringNode::closing_loc.
Definition ast.h:5381
pm_interpolated_string_node::opening_loc
pm_location_t opening_loc
InterpolatedStringNode::opening_loc.
Definition ast.h:5371
pm_interpolated_string_node::parts
struct pm_node_list parts
InterpolatedStringNode::parts.
Definition ast.h:5376
pm_interpolated_symbol_node::parts
struct pm_node_list parts
InterpolatedSymbolNode::parts.
Definition ast.h:5409
pm_interpolated_symbol_node::closing_loc
pm_location_t closing_loc
InterpolatedSymbolNode::closing_loc.
Definition ast.h:5414
pm_interpolated_symbol_node::opening_loc
pm_location_t opening_loc
InterpolatedSymbolNode::opening_loc.
Definition ast.h:5404
pm_interpolated_x_string_node::opening_loc
pm_location_t opening_loc
InterpolatedXStringNode::opening_loc.
Definition ast.h:5437
pm_interpolated_x_string_node::closing_loc
pm_location_t closing_loc
InterpolatedXStringNode::closing_loc.
Definition ast.h:5447
pm_interpolated_x_string_node::parts
struct pm_node_list parts
InterpolatedXStringNode::parts.
Definition ast.h:5442
pm_keyword_hash_node::base
pm_node_t base
The embedded base node.
Definition ast.h:5503
pm_keyword_hash_node::elements
struct pm_node_list elements
KeywordHashNode::elements.
Definition ast.h:5509
pm_keyword_rest_parameter_node::base
pm_node_t base
The embedded base node.
Definition ast.h:5530
pm_keyword_rest_parameter_node::name
pm_constant_id_t name
KeywordRestParameterNode::name.
Definition ast.h:5536
pm_keyword_rest_parameter_node::operator_loc
pm_location_t operator_loc
KeywordRestParameterNode::operator_loc.
Definition ast.h:5546
pm_keyword_rest_parameter_node::name_loc
pm_location_t name_loc
KeywordRestParameterNode::name_loc.
Definition ast.h:5541
pm_lambda_node::closing_loc
pm_location_t closing_loc
LambdaNode::closing_loc.
Definition ast.h:5584
pm_lambda_node::body
struct pm_node * body
LambdaNode::body.
Definition ast.h:5594
pm_lambda_node::opening_loc
pm_location_t opening_loc
LambdaNode::opening_loc.
Definition ast.h:5579
pm_lambda_node::parameters
struct pm_node * parameters
LambdaNode::parameters.
Definition ast.h:5589
pm_lambda_node::operator_loc
pm_location_t operator_loc
LambdaNode::operator_loc.
Definition ast.h:5574
pm_lambda_node::locals
pm_constant_id_list_t locals
LambdaNode::locals.
Definition ast.h:5569
pm_line_column_t
A line and column in a string.
Definition pm_newline_list.h:45
pm_line_column_t::column
uint32_t column
The column number.
Definition pm_newline_list.h:50
pm_line_column_t::line
int32_t line
The line number.
Definition pm_newline_list.h:47
pm_local_variable_and_write_node::name
pm_constant_id_t name
LocalVariableAndWriteNode::name.
Definition ast.h:5632
pm_local_variable_and_write_node::depth
uint32_t depth
LocalVariableAndWriteNode::depth.
Definition ast.h:5637
pm_local_variable_and_write_node::operator_loc
pm_location_t operator_loc
LocalVariableAndWriteNode::operator_loc.
Definition ast.h:5622
pm_local_variable_and_write_node::value
struct pm_node * value
LocalVariableAndWriteNode::value.
Definition ast.h:5627
pm_local_variable_and_write_node::name_loc
pm_location_t name_loc
LocalVariableAndWriteNode::name_loc.
Definition ast.h:5617
pm_local_variable_operator_write_node::depth
uint32_t depth
LocalVariableOperatorWriteNode::depth.
Definition ast.h:5685
pm_local_variable_operator_write_node::binary_operator
pm_constant_id_t binary_operator
LocalVariableOperatorWriteNode::binary_operator.
Definition ast.h:5680
pm_local_variable_operator_write_node::value
struct pm_node * value
LocalVariableOperatorWriteNode::value.
Definition ast.h:5670
pm_local_variable_operator_write_node::name_loc
pm_location_t name_loc
LocalVariableOperatorWriteNode::name_loc.
Definition ast.h:5660
pm_local_variable_operator_write_node::binary_operator_loc
pm_location_t binary_operator_loc
LocalVariableOperatorWriteNode::binary_operator_loc.
Definition ast.h:5665
pm_local_variable_operator_write_node::name
pm_constant_id_t name
LocalVariableOperatorWriteNode::name.
Definition ast.h:5675
pm_local_variable_or_write_node::depth
uint32_t depth
LocalVariableOrWriteNode::depth.
Definition ast.h:5728
pm_local_variable_or_write_node::operator_loc
pm_location_t operator_loc
LocalVariableOrWriteNode::operator_loc.
Definition ast.h:5713
pm_local_variable_or_write_node::value
struct pm_node * value
LocalVariableOrWriteNode::value.
Definition ast.h:5718
pm_local_variable_or_write_node::name
pm_constant_id_t name
LocalVariableOrWriteNode::name.
Definition ast.h:5723
pm_local_variable_or_write_node::name_loc
pm_location_t name_loc
LocalVariableOrWriteNode::name_loc.
Definition ast.h:5708
pm_local_variable_read_node::depth
uint32_t depth
LocalVariableReadNode::depth.
Definition ast.h:5774
pm_local_variable_read_node::name
pm_constant_id_t name
LocalVariableReadNode::name.
Definition ast.h:5761
pm_local_variable_target_node::depth
uint32_t depth
LocalVariableTargetNode::depth.
Definition ast.h:5805
pm_local_variable_target_node::name
pm_constant_id_t name
LocalVariableTargetNode::name.
Definition ast.h:5800
pm_local_variable_write_node::operator_loc
pm_location_t operator_loc
LocalVariableWriteNode::operator_loc.
Definition ast.h:5884
pm_local_variable_write_node::name_loc
pm_location_t name_loc
LocalVariableWriteNode::name_loc.
Definition ast.h:5857
pm_local_variable_write_node::value
struct pm_node * value
LocalVariableWriteNode::value.
Definition ast.h:5874
pm_local_variable_write_node::depth
uint32_t depth
LocalVariableWriteNode::depth.
Definition ast.h:5847
pm_local_variable_write_node::name
pm_constant_id_t name
LocalVariableWriteNode::name.
Definition ast.h:5834
pm_location_t
This represents a range of bytes in the source string to which a node or token corresponds.
Definition ast.h:544
pm_location_t::start
const uint8_t * start
A pointer to the start location of the range in the source.
Definition ast.h:546
pm_location_t::end
const uint8_t * end
A pointer to the end location of the range in the source.
Definition ast.h:549
pm_match_last_line_node::content_loc
pm_location_t content_loc
MatchLastLineNode::content_loc.
Definition ast.h:5925
pm_match_last_line_node::opening_loc
pm_location_t opening_loc
MatchLastLineNode::opening_loc.
Definition ast.h:5920
pm_match_last_line_node::closing_loc
pm_location_t closing_loc
MatchLastLineNode::closing_loc.
Definition ast.h:5930
pm_match_last_line_node::unescaped
pm_string_t unescaped
MatchLastLineNode::unescaped.
Definition ast.h:5935
pm_match_last_line_node::base
pm_node_t base
The embedded base node.
Definition ast.h:5914
pm_match_predicate_node::operator_loc
pm_location_t operator_loc
MatchPredicateNode::operator_loc.
Definition ast.h:5968
pm_match_predicate_node::pattern
struct pm_node * pattern
MatchPredicateNode::pattern.
Definition ast.h:5963
pm_match_predicate_node::value
struct pm_node * value
MatchPredicateNode::value.
Definition ast.h:5958
pm_match_required_node::operator_loc
pm_location_t operator_loc
MatchRequiredNode::operator_loc.
Definition ast.h:6055
pm_match_required_node::value
struct pm_node * value
MatchRequiredNode::value.
Definition ast.h:5996
pm_match_required_node::pattern
struct pm_node * pattern
MatchRequiredNode::pattern.
Definition ast.h:6045
pm_match_write_node::targets
struct pm_node_list targets
MatchWriteNode::targets.
Definition ast.h:6083
pm_match_write_node::call
struct pm_call_node * call
MatchWriteNode::call.
Definition ast.h:6078
pm_module_node::end_keyword_loc
pm_location_t end_keyword_loc
ModuleNode::end_keyword_loc.
Definition ast.h:6141
pm_module_node::constant_path
struct pm_node * constant_path
ModuleNode::constant_path.
Definition ast.h:6131
pm_module_node::body
struct pm_node * body
ModuleNode::body.
Definition ast.h:6136
pm_module_node::locals
pm_constant_id_list_t locals
ModuleNode::locals.
Definition ast.h:6121
pm_module_node::module_keyword_loc
pm_location_t module_keyword_loc
ModuleNode::module_keyword_loc.
Definition ast.h:6126
pm_module_node::name
pm_constant_id_t name
ModuleNode::name.
Definition ast.h:6146
pm_multi_target_node::lparen_loc
pm_location_t lparen_loc
MultiTargetNode::lparen_loc.
Definition ast.h:6224
pm_multi_target_node::lefts
struct pm_node_list lefts
MultiTargetNode::lefts.
Definition ast.h:6184
pm_multi_target_node::rest
struct pm_node * rest
MultiTargetNode::rest.
Definition ast.h:6204
pm_multi_target_node::rparen_loc
pm_location_t rparen_loc
MultiTargetNode::rparen_loc.
Definition ast.h:6234
pm_multi_target_node::rights
struct pm_node_list rights
MultiTargetNode::rights.
Definition ast.h:6214
pm_multi_write_node::rparen_loc
pm_location_t rparen_loc
MultiWriteNode::rparen_loc.
Definition ast.h:6317
pm_multi_write_node::value
struct pm_node * value
MultiWriteNode::value.
Definition ast.h:6337
pm_multi_write_node::rest
struct pm_node * rest
MultiWriteNode::rest.
Definition ast.h:6287
pm_multi_write_node::rights
struct pm_node_list rights
MultiWriteNode::rights.
Definition ast.h:6297
pm_multi_write_node::operator_loc
pm_location_t operator_loc
MultiWriteNode::operator_loc.
Definition ast.h:6327
pm_multi_write_node::lparen_loc
pm_location_t lparen_loc
MultiWriteNode::lparen_loc.
Definition ast.h:6307
pm_multi_write_node::lefts
struct pm_node_list lefts
MultiWriteNode::lefts.
Definition ast.h:6267
pm_next_node::arguments
struct pm_arguments_node * arguments
NextNode::arguments.
Definition ast.h:6360
pm_next_node::keyword_loc
pm_location_t keyword_loc
NextNode::keyword_loc.
Definition ast.h:6365
pm_no_keywords_parameter_node::keyword_loc
pm_location_t keyword_loc
NoKeywordsParameterNode::keyword_loc.
Definition ast.h:6412
pm_no_keywords_parameter_node::operator_loc
pm_location_t operator_loc
NoKeywordsParameterNode::operator_loc.
Definition ast.h:6407
pm_node_list::size
size_t size
The number of nodes in the list.
Definition ast.h:559
pm_node_list::nodes
struct pm_node ** nodes
The nodes in the list.
Definition ast.h:565
pm_node::flags
pm_node_flags_t flags
This represents any flags on the node.
Definition ast.h:1063
pm_node::location
pm_location_t location
This is the location of the node in the source.
Definition ast.h:1075
pm_numbered_parameters_node::maximum
uint8_t maximum
NumberedParametersNode::maximum.
Definition ast.h:6435
pm_numbered_reference_read_node::number
uint32_t number
NumberedReferenceReadNode::number.
Definition ast.h:6466
pm_optional_keyword_parameter_node::base
pm_node_t base
The embedded base node.
Definition ast.h:6487
pm_optional_keyword_parameter_node::name
pm_constant_id_t name
OptionalKeywordParameterNode::name.
Definition ast.h:6493
pm_optional_keyword_parameter_node::value
struct pm_node * value
OptionalKeywordParameterNode::value.
Definition ast.h:6503
pm_optional_keyword_parameter_node::name_loc
pm_location_t name_loc
OptionalKeywordParameterNode::name_loc.
Definition ast.h:6498
pm_optional_parameter_node::name_loc
pm_location_t name_loc
OptionalParameterNode::name_loc.
Definition ast.h:6535
pm_optional_parameter_node::value
struct pm_node * value
OptionalParameterNode::value.
Definition ast.h:6545
pm_optional_parameter_node::name
pm_constant_id_t name
OptionalParameterNode::name.
Definition ast.h:6530
pm_optional_parameter_node::base
pm_node_t base
The embedded base node.
Definition ast.h:6524
pm_optional_parameter_node::operator_loc
pm_location_t operator_loc
OptionalParameterNode::operator_loc.
Definition ast.h:6540
pm_or_node::left
struct pm_node * left
OrNode::left.
Definition ast.h:6576
pm_or_node::right
struct pm_node * right
OrNode::right.
Definition ast.h:6589
pm_or_node::operator_loc
pm_location_t operator_loc
OrNode::operator_loc.
Definition ast.h:6599
pm_parameters_node::rest
struct pm_node * rest
ParametersNode::rest.
Definition ast.h:6633
pm_parameters_node::requireds
struct pm_node_list requireds
ParametersNode::requireds.
Definition ast.h:6623
pm_parameters_node::block
struct pm_block_parameter_node * block
ParametersNode::block.
Definition ast.h:6653
pm_parameters_node::optionals
struct pm_node_list optionals
ParametersNode::optionals.
Definition ast.h:6628
pm_parameters_node::posts
struct pm_node_list posts
ParametersNode::posts.
Definition ast.h:6638
pm_parameters_node::keyword_rest
struct pm_node * keyword_rest
ParametersNode::keyword_rest.
Definition ast.h:6648
pm_parameters_node::keywords
struct pm_node_list keywords
ParametersNode::keywords.
Definition ast.h:6643
pm_parentheses_node::body
struct pm_node * body
ParenthesesNode::body.
Definition ast.h:6679
pm_parentheses_node::closing_loc
pm_location_t closing_loc
ParenthesesNode::closing_loc.
Definition ast.h:6689
pm_parentheses_node::base
pm_node_t base
The embedded base node.
Definition ast.h:6673
pm_parentheses_node::opening_loc
pm_location_t opening_loc
ParenthesesNode::opening_loc.
Definition ast.h:6684
pm_parser::constant_pool
pm_constant_pool_t constant_pool
This constant pool keeps all of the constants defined throughout the file so that we can reference th...
Definition parser.h:789
pm_parser::start_line
int32_t start_line
The line number at the start of the parse.
Definition parser.h:812
pm_parser::newline_list
pm_newline_list_t newline_list
This is the list of newline offsets in the source file.
Definition parser.h:792
pm_pinned_expression_node::rparen_loc
pm_location_t rparen_loc
PinnedExpressionNode::rparen_loc.
Definition ast.h:6747
pm_pinned_expression_node::expression
struct pm_node * expression
PinnedExpressionNode::expression.
Definition ast.h:6717
pm_pinned_expression_node::lparen_loc
pm_location_t lparen_loc
PinnedExpressionNode::lparen_loc.
Definition ast.h:6737
pm_pinned_expression_node::operator_loc
pm_location_t operator_loc
PinnedExpressionNode::operator_loc.
Definition ast.h:6727
pm_pinned_variable_node::variable
struct pm_node * variable
PinnedVariableNode::variable.
Definition ast.h:6775
pm_pinned_variable_node::operator_loc
pm_location_t operator_loc
PinnedVariableNode::operator_loc.
Definition ast.h:6785
pm_post_execution_node::closing_loc
pm_location_t closing_loc
PostExecutionNode::closing_loc.
Definition ast.h:6823
pm_post_execution_node::statements
struct pm_statements_node * statements
PostExecutionNode::statements.
Definition ast.h:6808
pm_post_execution_node::opening_loc
pm_location_t opening_loc
PostExecutionNode::opening_loc.
Definition ast.h:6818
pm_post_execution_node::keyword_loc
pm_location_t keyword_loc
PostExecutionNode::keyword_loc.
Definition ast.h:6813
pm_pre_execution_node::statements
struct pm_statements_node * statements
PreExecutionNode::statements.
Definition ast.h:6846
pm_pre_execution_node::closing_loc
pm_location_t closing_loc
PreExecutionNode::closing_loc.
Definition ast.h:6861
pm_pre_execution_node::opening_loc
pm_location_t opening_loc
PreExecutionNode::opening_loc.
Definition ast.h:6856
pm_pre_execution_node::keyword_loc
pm_location_t keyword_loc
PreExecutionNode::keyword_loc.
Definition ast.h:6851
pm_program_node::statements
struct pm_statements_node * statements
ProgramNode::statements.
Definition ast.h:6886
pm_program_node::locals
pm_constant_id_list_t locals
ProgramNode::locals.
Definition ast.h:6881
pm_range_node::right
struct pm_node * right
RangeNode::right.
Definition ast.h:6937
pm_range_node::operator_loc
pm_location_t operator_loc
RangeNode::operator_loc.
Definition ast.h:6944
pm_range_node::base
pm_node_t base
The embedded base node.
Definition ast.h:6909
pm_range_node::left
struct pm_node * left
RangeNode::left.
Definition ast.h:6923
pm_rational_node::base
pm_node_t base
The embedded base node.
Definition ast.h:6967
pm_rational_node::denominator
pm_integer_t denominator
RationalNode::denominator.
Definition ast.h:6986
pm_rational_node::numerator
pm_integer_t numerator
RationalNode::numerator.
Definition ast.h:6977
pm_regular_expression_node::closing_loc
pm_location_t closing_loc
RegularExpressionNode::closing_loc.
Definition ast.h:7050
pm_regular_expression_node::base
pm_node_t base
The embedded base node.
Definition ast.h:7034
pm_regular_expression_node::unescaped
pm_string_t unescaped
RegularExpressionNode::unescaped.
Definition ast.h:7055
pm_regular_expression_node::opening_loc
pm_location_t opening_loc
RegularExpressionNode::opening_loc.
Definition ast.h:7040
pm_regular_expression_node::content_loc
pm_location_t content_loc
RegularExpressionNode::content_loc.
Definition ast.h:7045
pm_required_keyword_parameter_node::name_loc
pm_location_t name_loc
RequiredKeywordParameterNode::name_loc.
Definition ast.h:7087
pm_required_keyword_parameter_node::base
pm_node_t base
The embedded base node.
Definition ast.h:7076
pm_required_keyword_parameter_node::name
pm_constant_id_t name
RequiredKeywordParameterNode::name.
Definition ast.h:7082
pm_required_parameter_node::name
pm_constant_id_t name
RequiredParameterNode::name.
Definition ast.h:7114
pm_required_parameter_node::base
pm_node_t base
The embedded base node.
Definition ast.h:7108
pm_rescue_modifier_node::rescue_expression
struct pm_node * rescue_expression
RescueModifierNode::rescue_expression.
Definition ast.h:7147
pm_rescue_modifier_node::keyword_loc
pm_location_t keyword_loc
RescueModifierNode::keyword_loc.
Definition ast.h:7142
pm_rescue_modifier_node::expression
struct pm_node * expression
RescueModifierNode::expression.
Definition ast.h:7137
pm_rescue_node::keyword_loc
pm_location_t keyword_loc
RescueNode::keyword_loc.
Definition ast.h:7175
pm_rescue_node::subsequent
struct pm_rescue_node * subsequent
RescueNode::subsequent.
Definition ast.h:7205
pm_rescue_node::then_keyword_loc
pm_location_t then_keyword_loc
RescueNode::then_keyword_loc.
Definition ast.h:7195
pm_rescue_node::operator_loc
pm_location_t operator_loc
RescueNode::operator_loc.
Definition ast.h:7185
pm_rescue_node::reference
struct pm_node * reference
RescueNode::reference.
Definition ast.h:7190
pm_rescue_node::exceptions
struct pm_node_list exceptions
RescueNode::exceptions.
Definition ast.h:7180
pm_rescue_node::statements
struct pm_statements_node * statements
RescueNode::statements.
Definition ast.h:7200
pm_rest_parameter_node::name
pm_constant_id_t name
RestParameterNode::name.
Definition ast.h:7232
pm_rest_parameter_node::name_loc
pm_location_t name_loc
RestParameterNode::name_loc.
Definition ast.h:7237
pm_rest_parameter_node::base
pm_node_t base
The embedded base node.
Definition ast.h:7226
pm_rest_parameter_node::operator_loc
pm_location_t operator_loc
RestParameterNode::operator_loc.
Definition ast.h:7242
pm_return_node::keyword_loc
pm_location_t keyword_loc
ReturnNode::keyword_loc.
Definition ast.h:7283
pm_return_node::arguments
struct pm_arguments_node * arguments
ReturnNode::arguments.
Definition ast.h:7288
pm_shareable_constant_node::write
struct pm_node * write
ShareableConstantNode::write.
Definition ast.h:7337
pm_shareable_constant_node::base
pm_node_t base
The embedded base node.
Definition ast.h:7329
pm_singleton_class_node::locals
pm_constant_id_list_t locals
SingletonClassNode::locals.
Definition ast.h:7360
pm_singleton_class_node::operator_loc
pm_location_t operator_loc
SingletonClassNode::operator_loc.
Definition ast.h:7370
pm_singleton_class_node::expression
struct pm_node * expression
SingletonClassNode::expression.
Definition ast.h:7375
pm_singleton_class_node::end_keyword_loc
pm_location_t end_keyword_loc
SingletonClassNode::end_keyword_loc.
Definition ast.h:7385
pm_singleton_class_node::class_keyword_loc
pm_location_t class_keyword_loc
SingletonClassNode::class_keyword_loc.
Definition ast.h:7365
pm_singleton_class_node::body
struct pm_node * body
SingletonClassNode::body.
Definition ast.h:7380
pm_source_file_node::filepath
pm_string_t filepath
SourceFileNode::filepath.
Definition ast.h:7434
pm_source_file_node::base
pm_node_t base
The embedded base node.
Definition ast.h:7426
pm_splat_node::expression
struct pm_node * expression
SplatNode::expression.
Definition ast.h:7480
pm_splat_node::operator_loc
pm_location_t operator_loc
SplatNode::operator_loc.
Definition ast.h:7475
pm_statements_node::body
struct pm_node_list body
StatementsNode::body.
Definition ast.h:7503
pm_string_node::base
pm_node_t base
The embedded base node.
Definition ast.h:7532
pm_string_node::unescaped
pm_string_t unescaped
StringNode::unescaped.
Definition ast.h:7553
pm_string_node::content_loc
pm_location_t content_loc
StringNode::content_loc.
Definition ast.h:7543
pm_string_node::closing_loc
pm_location_t closing_loc
StringNode::closing_loc.
Definition ast.h:7548
pm_string_node::opening_loc
pm_location_t opening_loc
StringNode::opening_loc.
Definition ast.h:7538
pm_super_node::arguments
struct pm_arguments_node * arguments
SuperNode::arguments.
Definition ast.h:7593
pm_super_node::lparen_loc
pm_location_t lparen_loc
SuperNode::lparen_loc.
Definition ast.h:7586
pm_super_node::keyword_loc
pm_location_t keyword_loc
SuperNode::keyword_loc.
Definition ast.h:7581
pm_super_node::rparen_loc
pm_location_t rparen_loc
SuperNode::rparen_loc.
Definition ast.h:7598
pm_super_node::block
struct pm_node * block
SuperNode::block.
Definition ast.h:7603
pm_symbol_node::opening_loc
pm_location_t opening_loc
SymbolNode::opening_loc.
Definition ast.h:7634
pm_symbol_node::value_loc
pm_location_t value_loc
SymbolNode::value_loc.
Definition ast.h:7639
pm_symbol_node::closing_loc
pm_location_t closing_loc
SymbolNode::closing_loc.
Definition ast.h:7644
pm_symbol_node::unescaped
pm_string_t unescaped
SymbolNode::unescaped.
Definition ast.h:7649
pm_symbol_node::base
pm_node_t base
The embedded base node.
Definition ast.h:7628
pm_undef_node::keyword_loc
pm_location_t keyword_loc
UndefNode::keyword_loc.
Definition ast.h:7695
pm_undef_node::names
struct pm_node_list names
UndefNode::names.
Definition ast.h:7690
pm_unless_node::keyword_loc
pm_location_t keyword_loc
UnlessNode::keyword_loc.
Definition ast.h:7729
pm_unless_node::then_keyword_loc
pm_location_t then_keyword_loc
UnlessNode::then_keyword_loc.
Definition ast.h:7752
pm_unless_node::end_keyword_loc
pm_location_t end_keyword_loc
UnlessNode::end_keyword_loc.
Definition ast.h:7783
pm_unless_node::statements
struct pm_statements_node * statements
UnlessNode::statements.
Definition ast.h:7763
pm_unless_node::predicate
struct pm_node * predicate
UnlessNode::predicate.
Definition ast.h:7742
pm_unless_node::else_clause
struct pm_else_node * else_clause
UnlessNode::else_clause.
Definition ast.h:7773
pm_until_node::statements
struct pm_statements_node * statements
UntilNode::statements.
Definition ast.h:7832
pm_until_node::closing_loc
pm_location_t closing_loc
UntilNode::closing_loc.
Definition ast.h:7822
pm_until_node::predicate
struct pm_node * predicate
UntilNode::predicate.
Definition ast.h:7827
pm_until_node::keyword_loc
pm_location_t keyword_loc
UntilNode::keyword_loc.
Definition ast.h:7812
pm_until_node::base
pm_node_t base
The embedded base node.
Definition ast.h:7806
pm_until_node::do_keyword_loc
pm_location_t do_keyword_loc
UntilNode::do_keyword_loc.
Definition ast.h:7817
pm_when_node::statements
struct pm_statements_node * statements
WhenNode::statements.
Definition ast.h:7872
pm_when_node::then_keyword_loc
pm_location_t then_keyword_loc
WhenNode::then_keyword_loc.
Definition ast.h:7867
pm_when_node::keyword_loc
pm_location_t keyword_loc
WhenNode::keyword_loc.
Definition ast.h:7857
pm_when_node::conditions
struct pm_node_list conditions
WhenNode::conditions.
Definition ast.h:7862
pm_while_node::closing_loc
pm_location_t closing_loc
WhileNode::closing_loc.
Definition ast.h:7911
pm_while_node::keyword_loc
pm_location_t keyword_loc
WhileNode::keyword_loc.
Definition ast.h:7901
pm_while_node::statements
struct pm_statements_node * statements
WhileNode::statements.
Definition ast.h:7921
pm_while_node::base
pm_node_t base
The embedded base node.
Definition ast.h:7895
pm_while_node::do_keyword_loc
pm_location_t do_keyword_loc
WhileNode::do_keyword_loc.
Definition ast.h:7906
pm_while_node::predicate
struct pm_node * predicate
WhileNode::predicate.
Definition ast.h:7916
pm_x_string_node::closing_loc
pm_location_t closing_loc
XStringNode::closing_loc.
Definition ast.h:7958
pm_x_string_node::opening_loc
pm_location_t opening_loc
XStringNode::opening_loc.
Definition ast.h:7948
pm_x_string_node::content_loc
pm_location_t content_loc
XStringNode::content_loc.
Definition ast.h:7953
pm_x_string_node::unescaped
pm_string_t unescaped
XStringNode::unescaped.
Definition ast.h:7963
pm_x_string_node::base
pm_node_t base
The embedded base node.
Definition ast.h:7942
pm_yield_node::keyword_loc
pm_location_t keyword_loc
YieldNode::keyword_loc.
Definition ast.h:7986
pm_yield_node::lparen_loc
pm_location_t lparen_loc
YieldNode::lparen_loc.
Definition ast.h:7991
pm_yield_node::rparen_loc
pm_location_t rparen_loc
YieldNode::rparen_loc.
Definition ast.h:8001
pm_yield_node::arguments
struct pm_arguments_node * arguments
YieldNode::arguments.
Definition ast.h:7996