yarp 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
data/src/prettyprint.c CHANGED
@@ -25,9 +25,9 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
25
25
  switch (YP_NODE_TYPE(node)) {
26
26
  // We do not need to print a ScopeNode as it's not part
27
27
  // of the AST
28
- case YP_NODE_SCOPE_NODE:
28
+ case YP_SCOPE_NODE:
29
29
  return;
30
- case YP_NODE_ALIAS_NODE: {
30
+ case YP_ALIAS_NODE: {
31
31
  yp_buffer_append_str(buffer, "AliasNode(", 10);
32
32
  prettyprint_node(buffer, parser, (yp_node_t *)((yp_alias_node_t *)node)->new_name);
33
33
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_alias_node_t *)node)->old_name);
@@ -35,7 +35,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
35
35
  yp_buffer_append_str(buffer, ")", 1);
36
36
  break;
37
37
  }
38
- case YP_NODE_ALTERNATION_PATTERN_NODE: {
38
+ case YP_ALTERNATION_PATTERN_NODE: {
39
39
  yp_buffer_append_str(buffer, "AlternationPatternNode(", 23);
40
40
  prettyprint_node(buffer, parser, (yp_node_t *)((yp_alternation_pattern_node_t *)node)->left);
41
41
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_alternation_pattern_node_t *)node)->right);
@@ -43,7 +43,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
43
43
  yp_buffer_append_str(buffer, ")", 1);
44
44
  break;
45
45
  }
46
- case YP_NODE_AND_NODE: {
46
+ case YP_AND_NODE: {
47
47
  yp_buffer_append_str(buffer, "AndNode(", 8);
48
48
  prettyprint_node(buffer, parser, (yp_node_t *)((yp_and_node_t *)node)->left);
49
49
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_and_node_t *)node)->right);
@@ -51,7 +51,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
51
51
  yp_buffer_append_str(buffer, ")", 1);
52
52
  break;
53
53
  }
54
- case YP_NODE_ARGUMENTS_NODE: {
54
+ case YP_ARGUMENTS_NODE: {
55
55
  yp_buffer_append_str(buffer, "ArgumentsNode(", 14);
56
56
  yp_buffer_append_str(buffer, "[", 1);
57
57
  for (uint32_t index = 0; index < ((yp_arguments_node_t *)node)->arguments.size; index++) {
@@ -62,7 +62,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
62
62
  yp_buffer_append_str(buffer, ")", 1);
63
63
  break;
64
64
  }
65
- case YP_NODE_ARRAY_NODE: {
65
+ case YP_ARRAY_NODE: {
66
66
  yp_buffer_append_str(buffer, "ArrayNode(", 10);
67
67
  yp_buffer_append_str(buffer, "[", 1);
68
68
  for (uint32_t index = 0; index < ((yp_array_node_t *)node)->elements.size; index++) {
@@ -83,7 +83,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
83
83
  yp_buffer_append_str(buffer, ")", 1);
84
84
  break;
85
85
  }
86
- case YP_NODE_ARRAY_PATTERN_NODE: {
86
+ case YP_ARRAY_PATTERN_NODE: {
87
87
  yp_buffer_append_str(buffer, "ArrayPatternNode(", 17);
88
88
  if (((yp_array_pattern_node_t *)node)->constant == NULL) {
89
89
  yp_buffer_append_str(buffer, "nil", 3);
@@ -120,7 +120,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
120
120
  yp_buffer_append_str(buffer, ")", 1);
121
121
  break;
122
122
  }
123
- case YP_NODE_ASSOC_NODE: {
123
+ case YP_ASSOC_NODE: {
124
124
  yp_buffer_append_str(buffer, "AssocNode(", 10);
125
125
  prettyprint_node(buffer, parser, (yp_node_t *)((yp_assoc_node_t *)node)->key);
126
126
  yp_buffer_append_str(buffer, ", ", 2); if (((yp_assoc_node_t *)node)->value == NULL) {
@@ -136,7 +136,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
136
136
  yp_buffer_append_str(buffer, ")", 1);
137
137
  break;
138
138
  }
139
- case YP_NODE_ASSOC_SPLAT_NODE: {
139
+ case YP_ASSOC_SPLAT_NODE: {
140
140
  yp_buffer_append_str(buffer, "AssocSplatNode(", 15);
141
141
  if (((yp_assoc_splat_node_t *)node)->value == NULL) {
142
142
  yp_buffer_append_str(buffer, "nil", 3);
@@ -147,12 +147,12 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
147
147
  yp_buffer_append_str(buffer, ")", 1);
148
148
  break;
149
149
  }
150
- case YP_NODE_BACK_REFERENCE_READ_NODE: {
150
+ case YP_BACK_REFERENCE_READ_NODE: {
151
151
  yp_buffer_append_str(buffer, "BackReferenceReadNode(", 22);
152
152
  yp_buffer_append_str(buffer, ")", 1);
153
153
  break;
154
154
  }
155
- case YP_NODE_BEGIN_NODE: {
155
+ case YP_BEGIN_NODE: {
156
156
  yp_buffer_append_str(buffer, "BeginNode(", 10);
157
157
  if (((yp_begin_node_t *)node)->begin_keyword_loc.start == NULL) {
158
158
  yp_buffer_append_str(buffer, "nil", 3);
@@ -187,7 +187,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
187
187
  yp_buffer_append_str(buffer, ")", 1);
188
188
  break;
189
189
  }
190
- case YP_NODE_BLOCK_ARGUMENT_NODE: {
190
+ case YP_BLOCK_ARGUMENT_NODE: {
191
191
  yp_buffer_append_str(buffer, "BlockArgumentNode(", 18);
192
192
  if (((yp_block_argument_node_t *)node)->expression == NULL) {
193
193
  yp_buffer_append_str(buffer, "nil", 3);
@@ -198,7 +198,15 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
198
198
  yp_buffer_append_str(buffer, ")", 1);
199
199
  break;
200
200
  }
201
- case YP_NODE_BLOCK_NODE: {
201
+ case YP_BLOCK_LOCAL_VARIABLE_NODE: {
202
+ yp_buffer_append_str(buffer, "BlockLocalVariableNode(", 23);
203
+ char name_buffer[12];
204
+ snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_block_local_variable_node_t *)node)->name);
205
+ yp_buffer_append_str(buffer, name_buffer, strlen(name_buffer));
206
+ yp_buffer_append_str(buffer, ")", 1);
207
+ break;
208
+ }
209
+ case YP_BLOCK_NODE: {
202
210
  yp_buffer_append_str(buffer, "BlockNode(", 10);
203
211
  yp_buffer_append_str(buffer, "[", 1);
204
212
  for (uint32_t index = 0; index < ((yp_block_node_t *)node)->locals.size; index++) {
@@ -223,9 +231,16 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
223
231
  yp_buffer_append_str(buffer, ")", 1);
224
232
  break;
225
233
  }
226
- case YP_NODE_BLOCK_PARAMETER_NODE: {
234
+ case YP_BLOCK_PARAMETER_NODE: {
227
235
  yp_buffer_append_str(buffer, "BlockParameterNode(", 19);
228
- if (((yp_block_parameter_node_t *)node)->name_loc.start == NULL) {
236
+ if (((yp_block_parameter_node_t *)node)->name == 0) {
237
+ yp_buffer_append_str(buffer, "nil", 3);
238
+ } else {
239
+ char name_buffer[12];
240
+ snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_block_parameter_node_t *)node)->name);
241
+ yp_buffer_append_str(buffer, name_buffer, strlen(name_buffer));
242
+ }
243
+ yp_buffer_append_str(buffer, ", ", 2); if (((yp_block_parameter_node_t *)node)->name_loc.start == NULL) {
229
244
  yp_buffer_append_str(buffer, "nil", 3);
230
245
  } else {
231
246
  prettyprint_location(buffer, parser, &((yp_block_parameter_node_t *)node)->name_loc);
@@ -234,7 +249,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
234
249
  yp_buffer_append_str(buffer, ")", 1);
235
250
  break;
236
251
  }
237
- case YP_NODE_BLOCK_PARAMETERS_NODE: {
252
+ case YP_BLOCK_PARAMETERS_NODE: {
238
253
  yp_buffer_append_str(buffer, "BlockParametersNode(", 20);
239
254
  if (((yp_block_parameters_node_t *)node)->parameters == NULL) {
240
255
  yp_buffer_append_str(buffer, "nil", 3);
@@ -244,7 +259,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
244
259
  yp_buffer_append_str(buffer, ", ", 2); yp_buffer_append_str(buffer, "[", 1);
245
260
  for (uint32_t index = 0; index < ((yp_block_parameters_node_t *)node)->locals.size; index++) {
246
261
  if (index != 0) yp_buffer_append_str(buffer, ", ", 2);
247
- prettyprint_location(buffer, parser, &((yp_block_parameters_node_t *)node)->locals.locations[index]);
262
+ prettyprint_node(buffer, parser, (yp_node_t *) ((yp_block_parameters_node_t *) node)->locals.nodes[index]);
248
263
  }
249
264
  yp_buffer_append_str(buffer, "]", 1);
250
265
  yp_buffer_append_str(buffer, ", ", 2); if (((yp_block_parameters_node_t *)node)->opening_loc.start == NULL) {
@@ -260,7 +275,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
260
275
  yp_buffer_append_str(buffer, ")", 1);
261
276
  break;
262
277
  }
263
- case YP_NODE_BREAK_NODE: {
278
+ case YP_BREAK_NODE: {
264
279
  yp_buffer_append_str(buffer, "BreakNode(", 10);
265
280
  if (((yp_break_node_t *)node)->arguments == NULL) {
266
281
  yp_buffer_append_str(buffer, "nil", 3);
@@ -271,17 +286,63 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
271
286
  yp_buffer_append_str(buffer, ")", 1);
272
287
  break;
273
288
  }
274
- case YP_NODE_CALL_NODE: {
289
+ case YP_CALL_AND_WRITE_NODE: {
290
+ yp_buffer_append_str(buffer, "CallAndWriteNode(", 17);
291
+ if (((yp_call_and_write_node_t *)node)->receiver == NULL) {
292
+ yp_buffer_append_str(buffer, "nil", 3);
293
+ } else {
294
+ prettyprint_node(buffer, parser, (yp_node_t *)((yp_call_and_write_node_t *)node)->receiver);
295
+ }
296
+ yp_buffer_append_str(buffer, ", ", 2); if (((yp_call_and_write_node_t *)node)->call_operator_loc.start == NULL) {
297
+ yp_buffer_append_str(buffer, "nil", 3);
298
+ } else {
299
+ prettyprint_location(buffer, parser, &((yp_call_and_write_node_t *)node)->call_operator_loc);
300
+ }
301
+ yp_buffer_append_str(buffer, ", ", 2); if (((yp_call_and_write_node_t *)node)->message_loc.start == NULL) {
302
+ yp_buffer_append_str(buffer, "nil", 3);
303
+ } else {
304
+ prettyprint_location(buffer, parser, &((yp_call_and_write_node_t *)node)->message_loc);
305
+ }
306
+ yp_buffer_append_str(buffer, ", ", 2); if (((yp_call_and_write_node_t *)node)->opening_loc.start == NULL) {
307
+ yp_buffer_append_str(buffer, "nil", 3);
308
+ } else {
309
+ prettyprint_location(buffer, parser, &((yp_call_and_write_node_t *)node)->opening_loc);
310
+ }
311
+ yp_buffer_append_str(buffer, ", ", 2); if (((yp_call_and_write_node_t *)node)->arguments == NULL) {
312
+ yp_buffer_append_str(buffer, "nil", 3);
313
+ } else {
314
+ prettyprint_node(buffer, parser, (yp_node_t *)((yp_call_and_write_node_t *)node)->arguments);
315
+ }
316
+ yp_buffer_append_str(buffer, ", ", 2); if (((yp_call_and_write_node_t *)node)->closing_loc.start == NULL) {
317
+ yp_buffer_append_str(buffer, "nil", 3);
318
+ } else {
319
+ prettyprint_location(buffer, parser, &((yp_call_and_write_node_t *)node)->closing_loc);
320
+ }
321
+ yp_buffer_append_str(buffer, ", ", 2); char flags_buffer[12];
322
+ snprintf(flags_buffer, sizeof(flags_buffer), "+%d", node->flags >> 1);
323
+ yp_buffer_append_str(buffer, flags_buffer, strlen(flags_buffer));
324
+ yp_buffer_append_str(buffer, ", ", 2); yp_buffer_append_str(buffer, "\"", 1);
325
+ yp_buffer_append_bytes(buffer, yp_string_source(&((yp_call_and_write_node_t *)node)->read_name), yp_string_length(&((yp_call_and_write_node_t *)node)->read_name));
326
+ yp_buffer_append_str(buffer, "\"", 1);
327
+ yp_buffer_append_str(buffer, ", ", 2); yp_buffer_append_str(buffer, "\"", 1);
328
+ yp_buffer_append_bytes(buffer, yp_string_source(&((yp_call_and_write_node_t *)node)->write_name), yp_string_length(&((yp_call_and_write_node_t *)node)->write_name));
329
+ yp_buffer_append_str(buffer, "\"", 1);
330
+ yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_call_and_write_node_t *)node)->operator_loc);
331
+ yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_call_and_write_node_t *)node)->value);
332
+ yp_buffer_append_str(buffer, ")", 1);
333
+ break;
334
+ }
335
+ case YP_CALL_NODE: {
275
336
  yp_buffer_append_str(buffer, "CallNode(", 9);
276
337
  if (((yp_call_node_t *)node)->receiver == NULL) {
277
338
  yp_buffer_append_str(buffer, "nil", 3);
278
339
  } else {
279
340
  prettyprint_node(buffer, parser, (yp_node_t *)((yp_call_node_t *)node)->receiver);
280
341
  }
281
- yp_buffer_append_str(buffer, ", ", 2); if (((yp_call_node_t *)node)->operator_loc.start == NULL) {
342
+ yp_buffer_append_str(buffer, ", ", 2); if (((yp_call_node_t *)node)->call_operator_loc.start == NULL) {
282
343
  yp_buffer_append_str(buffer, "nil", 3);
283
344
  } else {
284
- prettyprint_location(buffer, parser, &((yp_call_node_t *)node)->operator_loc);
345
+ prettyprint_location(buffer, parser, &((yp_call_node_t *)node)->call_operator_loc);
285
346
  }
286
347
  yp_buffer_append_str(buffer, ", ", 2); if (((yp_call_node_t *)node)->message_loc.start == NULL) {
287
348
  yp_buffer_append_str(buffer, "nil", 3);
@@ -317,34 +378,102 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
317
378
  yp_buffer_append_str(buffer, ")", 1);
318
379
  break;
319
380
  }
320
- case YP_NODE_CALL_OPERATOR_AND_WRITE_NODE: {
321
- yp_buffer_append_str(buffer, "CallOperatorAndWriteNode(", 25);
322
- prettyprint_node(buffer, parser, (yp_node_t *)((yp_call_operator_and_write_node_t *)node)->target);
323
- yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_call_operator_and_write_node_t *)node)->operator_loc);
324
- yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_call_operator_and_write_node_t *)node)->value);
325
- yp_buffer_append_str(buffer, ")", 1);
326
- break;
327
- }
328
- case YP_NODE_CALL_OPERATOR_OR_WRITE_NODE: {
329
- yp_buffer_append_str(buffer, "CallOperatorOrWriteNode(", 24);
330
- prettyprint_node(buffer, parser, (yp_node_t *)((yp_call_operator_or_write_node_t *)node)->target);
331
- yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_call_operator_or_write_node_t *)node)->value);
332
- yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_call_operator_or_write_node_t *)node)->operator_loc);
333
- yp_buffer_append_str(buffer, ")", 1);
334
- break;
335
- }
336
- case YP_NODE_CALL_OPERATOR_WRITE_NODE: {
381
+ case YP_CALL_OPERATOR_WRITE_NODE: {
337
382
  yp_buffer_append_str(buffer, "CallOperatorWriteNode(", 22);
338
- prettyprint_node(buffer, parser, (yp_node_t *)((yp_call_operator_write_node_t *)node)->target);
339
- yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_call_operator_write_node_t *)node)->operator_loc);
340
- yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_call_operator_write_node_t *)node)->value);
383
+ if (((yp_call_operator_write_node_t *)node)->receiver == NULL) {
384
+ yp_buffer_append_str(buffer, "nil", 3);
385
+ } else {
386
+ prettyprint_node(buffer, parser, (yp_node_t *)((yp_call_operator_write_node_t *)node)->receiver);
387
+ }
388
+ yp_buffer_append_str(buffer, ", ", 2); if (((yp_call_operator_write_node_t *)node)->call_operator_loc.start == NULL) {
389
+ yp_buffer_append_str(buffer, "nil", 3);
390
+ } else {
391
+ prettyprint_location(buffer, parser, &((yp_call_operator_write_node_t *)node)->call_operator_loc);
392
+ }
393
+ yp_buffer_append_str(buffer, ", ", 2); if (((yp_call_operator_write_node_t *)node)->message_loc.start == NULL) {
394
+ yp_buffer_append_str(buffer, "nil", 3);
395
+ } else {
396
+ prettyprint_location(buffer, parser, &((yp_call_operator_write_node_t *)node)->message_loc);
397
+ }
398
+ yp_buffer_append_str(buffer, ", ", 2); if (((yp_call_operator_write_node_t *)node)->opening_loc.start == NULL) {
399
+ yp_buffer_append_str(buffer, "nil", 3);
400
+ } else {
401
+ prettyprint_location(buffer, parser, &((yp_call_operator_write_node_t *)node)->opening_loc);
402
+ }
403
+ yp_buffer_append_str(buffer, ", ", 2); if (((yp_call_operator_write_node_t *)node)->arguments == NULL) {
404
+ yp_buffer_append_str(buffer, "nil", 3);
405
+ } else {
406
+ prettyprint_node(buffer, parser, (yp_node_t *)((yp_call_operator_write_node_t *)node)->arguments);
407
+ }
408
+ yp_buffer_append_str(buffer, ", ", 2); if (((yp_call_operator_write_node_t *)node)->closing_loc.start == NULL) {
409
+ yp_buffer_append_str(buffer, "nil", 3);
410
+ } else {
411
+ prettyprint_location(buffer, parser, &((yp_call_operator_write_node_t *)node)->closing_loc);
412
+ }
413
+ yp_buffer_append_str(buffer, ", ", 2); char flags_buffer[12];
414
+ snprintf(flags_buffer, sizeof(flags_buffer), "+%d", node->flags >> 1);
415
+ yp_buffer_append_str(buffer, flags_buffer, strlen(flags_buffer));
416
+ yp_buffer_append_str(buffer, ", ", 2); yp_buffer_append_str(buffer, "\"", 1);
417
+ yp_buffer_append_bytes(buffer, yp_string_source(&((yp_call_operator_write_node_t *)node)->read_name), yp_string_length(&((yp_call_operator_write_node_t *)node)->read_name));
418
+ yp_buffer_append_str(buffer, "\"", 1);
419
+ yp_buffer_append_str(buffer, ", ", 2); yp_buffer_append_str(buffer, "\"", 1);
420
+ yp_buffer_append_bytes(buffer, yp_string_source(&((yp_call_operator_write_node_t *)node)->write_name), yp_string_length(&((yp_call_operator_write_node_t *)node)->write_name));
421
+ yp_buffer_append_str(buffer, "\"", 1);
341
422
  yp_buffer_append_str(buffer, ", ", 2); char operator_buffer[12];
342
423
  snprintf(operator_buffer, sizeof(operator_buffer), "%u", ((yp_call_operator_write_node_t *)node)->operator);
343
424
  yp_buffer_append_str(buffer, operator_buffer, strlen(operator_buffer));
425
+ yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_call_operator_write_node_t *)node)->operator_loc);
426
+ yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_call_operator_write_node_t *)node)->value);
344
427
  yp_buffer_append_str(buffer, ")", 1);
345
428
  break;
346
429
  }
347
- case YP_NODE_CAPTURE_PATTERN_NODE: {
430
+ case YP_CALL_OR_WRITE_NODE: {
431
+ yp_buffer_append_str(buffer, "CallOrWriteNode(", 16);
432
+ if (((yp_call_or_write_node_t *)node)->receiver == NULL) {
433
+ yp_buffer_append_str(buffer, "nil", 3);
434
+ } else {
435
+ prettyprint_node(buffer, parser, (yp_node_t *)((yp_call_or_write_node_t *)node)->receiver);
436
+ }
437
+ yp_buffer_append_str(buffer, ", ", 2); if (((yp_call_or_write_node_t *)node)->call_operator_loc.start == NULL) {
438
+ yp_buffer_append_str(buffer, "nil", 3);
439
+ } else {
440
+ prettyprint_location(buffer, parser, &((yp_call_or_write_node_t *)node)->call_operator_loc);
441
+ }
442
+ yp_buffer_append_str(buffer, ", ", 2); if (((yp_call_or_write_node_t *)node)->message_loc.start == NULL) {
443
+ yp_buffer_append_str(buffer, "nil", 3);
444
+ } else {
445
+ prettyprint_location(buffer, parser, &((yp_call_or_write_node_t *)node)->message_loc);
446
+ }
447
+ yp_buffer_append_str(buffer, ", ", 2); if (((yp_call_or_write_node_t *)node)->opening_loc.start == NULL) {
448
+ yp_buffer_append_str(buffer, "nil", 3);
449
+ } else {
450
+ prettyprint_location(buffer, parser, &((yp_call_or_write_node_t *)node)->opening_loc);
451
+ }
452
+ yp_buffer_append_str(buffer, ", ", 2); if (((yp_call_or_write_node_t *)node)->arguments == NULL) {
453
+ yp_buffer_append_str(buffer, "nil", 3);
454
+ } else {
455
+ prettyprint_node(buffer, parser, (yp_node_t *)((yp_call_or_write_node_t *)node)->arguments);
456
+ }
457
+ yp_buffer_append_str(buffer, ", ", 2); if (((yp_call_or_write_node_t *)node)->closing_loc.start == NULL) {
458
+ yp_buffer_append_str(buffer, "nil", 3);
459
+ } else {
460
+ prettyprint_location(buffer, parser, &((yp_call_or_write_node_t *)node)->closing_loc);
461
+ }
462
+ yp_buffer_append_str(buffer, ", ", 2); char flags_buffer[12];
463
+ snprintf(flags_buffer, sizeof(flags_buffer), "+%d", node->flags >> 1);
464
+ yp_buffer_append_str(buffer, flags_buffer, strlen(flags_buffer));
465
+ yp_buffer_append_str(buffer, ", ", 2); yp_buffer_append_str(buffer, "\"", 1);
466
+ yp_buffer_append_bytes(buffer, yp_string_source(&((yp_call_or_write_node_t *)node)->read_name), yp_string_length(&((yp_call_or_write_node_t *)node)->read_name));
467
+ yp_buffer_append_str(buffer, "\"", 1);
468
+ yp_buffer_append_str(buffer, ", ", 2); yp_buffer_append_str(buffer, "\"", 1);
469
+ yp_buffer_append_bytes(buffer, yp_string_source(&((yp_call_or_write_node_t *)node)->write_name), yp_string_length(&((yp_call_or_write_node_t *)node)->write_name));
470
+ yp_buffer_append_str(buffer, "\"", 1);
471
+ yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_call_or_write_node_t *)node)->operator_loc);
472
+ yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_call_or_write_node_t *)node)->value);
473
+ yp_buffer_append_str(buffer, ")", 1);
474
+ break;
475
+ }
476
+ case YP_CAPTURE_PATTERN_NODE: {
348
477
  yp_buffer_append_str(buffer, "CapturePatternNode(", 19);
349
478
  prettyprint_node(buffer, parser, (yp_node_t *)((yp_capture_pattern_node_t *)node)->value);
350
479
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_capture_pattern_node_t *)node)->target);
@@ -352,7 +481,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
352
481
  yp_buffer_append_str(buffer, ")", 1);
353
482
  break;
354
483
  }
355
- case YP_NODE_CASE_NODE: {
484
+ case YP_CASE_NODE: {
356
485
  yp_buffer_append_str(buffer, "CaseNode(", 9);
357
486
  if (((yp_case_node_t *)node)->predicate == NULL) {
358
487
  yp_buffer_append_str(buffer, "nil", 3);
@@ -375,7 +504,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
375
504
  yp_buffer_append_str(buffer, ")", 1);
376
505
  break;
377
506
  }
378
- case YP_NODE_CLASS_NODE: {
507
+ case YP_CLASS_NODE: {
379
508
  yp_buffer_append_str(buffer, "ClassNode(", 10);
380
509
  yp_buffer_append_str(buffer, "[", 1);
381
510
  for (uint32_t index = 0; index < ((yp_class_node_t *)node)->locals.size; index++) {
@@ -403,13 +532,13 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
403
532
  prettyprint_node(buffer, parser, (yp_node_t *)((yp_class_node_t *)node)->body);
404
533
  }
405
534
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_class_node_t *)node)->end_keyword_loc);
406
- yp_buffer_append_str(buffer, ", ", 2); yp_buffer_append_str(buffer, "\"", 1);
407
- yp_buffer_append_bytes(buffer, yp_string_source(&((yp_class_node_t *)node)->name), yp_string_length(&((yp_class_node_t *)node)->name));
408
- yp_buffer_append_str(buffer, "\"", 1);
535
+ yp_buffer_append_str(buffer, ", ", 2); char name_buffer[12];
536
+ snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_class_node_t *)node)->name);
537
+ yp_buffer_append_str(buffer, name_buffer, strlen(name_buffer));
409
538
  yp_buffer_append_str(buffer, ")", 1);
410
539
  break;
411
540
  }
412
- case YP_NODE_CLASS_VARIABLE_AND_WRITE_NODE: {
541
+ case YP_CLASS_VARIABLE_AND_WRITE_NODE: {
413
542
  yp_buffer_append_str(buffer, "ClassVariableAndWriteNode(", 26);
414
543
  char name_buffer[12];
415
544
  snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_class_variable_and_write_node_t *)node)->name);
@@ -420,7 +549,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
420
549
  yp_buffer_append_str(buffer, ")", 1);
421
550
  break;
422
551
  }
423
- case YP_NODE_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
552
+ case YP_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
424
553
  yp_buffer_append_str(buffer, "ClassVariableOperatorWriteNode(", 31);
425
554
  char name_buffer[12];
426
555
  snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_class_variable_operator_write_node_t *)node)->name);
@@ -434,7 +563,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
434
563
  yp_buffer_append_str(buffer, ")", 1);
435
564
  break;
436
565
  }
437
- case YP_NODE_CLASS_VARIABLE_OR_WRITE_NODE: {
566
+ case YP_CLASS_VARIABLE_OR_WRITE_NODE: {
438
567
  yp_buffer_append_str(buffer, "ClassVariableOrWriteNode(", 25);
439
568
  char name_buffer[12];
440
569
  snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_class_variable_or_write_node_t *)node)->name);
@@ -445,7 +574,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
445
574
  yp_buffer_append_str(buffer, ")", 1);
446
575
  break;
447
576
  }
448
- case YP_NODE_CLASS_VARIABLE_READ_NODE: {
577
+ case YP_CLASS_VARIABLE_READ_NODE: {
449
578
  yp_buffer_append_str(buffer, "ClassVariableReadNode(", 22);
450
579
  char name_buffer[12];
451
580
  snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_class_variable_read_node_t *)node)->name);
@@ -453,7 +582,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
453
582
  yp_buffer_append_str(buffer, ")", 1);
454
583
  break;
455
584
  }
456
- case YP_NODE_CLASS_VARIABLE_TARGET_NODE: {
585
+ case YP_CLASS_VARIABLE_TARGET_NODE: {
457
586
  yp_buffer_append_str(buffer, "ClassVariableTargetNode(", 24);
458
587
  char name_buffer[12];
459
588
  snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_class_variable_target_node_t *)node)->name);
@@ -461,17 +590,13 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
461
590
  yp_buffer_append_str(buffer, ")", 1);
462
591
  break;
463
592
  }
464
- case YP_NODE_CLASS_VARIABLE_WRITE_NODE: {
593
+ case YP_CLASS_VARIABLE_WRITE_NODE: {
465
594
  yp_buffer_append_str(buffer, "ClassVariableWriteNode(", 23);
466
595
  char name_buffer[12];
467
596
  snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_class_variable_write_node_t *)node)->name);
468
597
  yp_buffer_append_str(buffer, name_buffer, strlen(name_buffer));
469
598
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_class_variable_write_node_t *)node)->name_loc);
470
- yp_buffer_append_str(buffer, ", ", 2); if (((yp_class_variable_write_node_t *)node)->value == NULL) {
471
- yp_buffer_append_str(buffer, "nil", 3);
472
- } else {
473
- prettyprint_node(buffer, parser, (yp_node_t *)((yp_class_variable_write_node_t *)node)->value);
474
- }
599
+ yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_class_variable_write_node_t *)node)->value);
475
600
  yp_buffer_append_str(buffer, ", ", 2); if (((yp_class_variable_write_node_t *)node)->operator_loc.start == NULL) {
476
601
  yp_buffer_append_str(buffer, "nil", 3);
477
602
  } else {
@@ -480,17 +605,23 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
480
605
  yp_buffer_append_str(buffer, ")", 1);
481
606
  break;
482
607
  }
483
- case YP_NODE_CONSTANT_AND_WRITE_NODE: {
608
+ case YP_CONSTANT_AND_WRITE_NODE: {
484
609
  yp_buffer_append_str(buffer, "ConstantAndWriteNode(", 21);
485
- prettyprint_location(buffer, parser, &((yp_constant_and_write_node_t *)node)->name_loc);
610
+ char name_buffer[12];
611
+ snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_constant_and_write_node_t *)node)->name);
612
+ yp_buffer_append_str(buffer, name_buffer, strlen(name_buffer));
613
+ yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_constant_and_write_node_t *)node)->name_loc);
486
614
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_constant_and_write_node_t *)node)->operator_loc);
487
615
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_constant_and_write_node_t *)node)->value);
488
616
  yp_buffer_append_str(buffer, ")", 1);
489
617
  break;
490
618
  }
491
- case YP_NODE_CONSTANT_OPERATOR_WRITE_NODE: {
619
+ case YP_CONSTANT_OPERATOR_WRITE_NODE: {
492
620
  yp_buffer_append_str(buffer, "ConstantOperatorWriteNode(", 26);
493
- prettyprint_location(buffer, parser, &((yp_constant_operator_write_node_t *)node)->name_loc);
621
+ char name_buffer[12];
622
+ snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_constant_operator_write_node_t *)node)->name);
623
+ yp_buffer_append_str(buffer, name_buffer, strlen(name_buffer));
624
+ yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_constant_operator_write_node_t *)node)->name_loc);
494
625
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_constant_operator_write_node_t *)node)->operator_loc);
495
626
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_constant_operator_write_node_t *)node)->value);
496
627
  yp_buffer_append_str(buffer, ", ", 2); char operator_buffer[12];
@@ -499,15 +630,18 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
499
630
  yp_buffer_append_str(buffer, ")", 1);
500
631
  break;
501
632
  }
502
- case YP_NODE_CONSTANT_OR_WRITE_NODE: {
633
+ case YP_CONSTANT_OR_WRITE_NODE: {
503
634
  yp_buffer_append_str(buffer, "ConstantOrWriteNode(", 20);
504
- prettyprint_location(buffer, parser, &((yp_constant_or_write_node_t *)node)->name_loc);
635
+ char name_buffer[12];
636
+ snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_constant_or_write_node_t *)node)->name);
637
+ yp_buffer_append_str(buffer, name_buffer, strlen(name_buffer));
638
+ yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_constant_or_write_node_t *)node)->name_loc);
505
639
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_constant_or_write_node_t *)node)->operator_loc);
506
640
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_constant_or_write_node_t *)node)->value);
507
641
  yp_buffer_append_str(buffer, ")", 1);
508
642
  break;
509
643
  }
510
- case YP_NODE_CONSTANT_PATH_AND_WRITE_NODE: {
644
+ case YP_CONSTANT_PATH_AND_WRITE_NODE: {
511
645
  yp_buffer_append_str(buffer, "ConstantPathAndWriteNode(", 25);
512
646
  prettyprint_node(buffer, parser, (yp_node_t *)((yp_constant_path_and_write_node_t *)node)->target);
513
647
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_constant_path_and_write_node_t *)node)->operator_loc);
@@ -515,7 +649,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
515
649
  yp_buffer_append_str(buffer, ")", 1);
516
650
  break;
517
651
  }
518
- case YP_NODE_CONSTANT_PATH_NODE: {
652
+ case YP_CONSTANT_PATH_NODE: {
519
653
  yp_buffer_append_str(buffer, "ConstantPathNode(", 17);
520
654
  if (((yp_constant_path_node_t *)node)->parent == NULL) {
521
655
  yp_buffer_append_str(buffer, "nil", 3);
@@ -527,7 +661,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
527
661
  yp_buffer_append_str(buffer, ")", 1);
528
662
  break;
529
663
  }
530
- case YP_NODE_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
664
+ case YP_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
531
665
  yp_buffer_append_str(buffer, "ConstantPathOperatorWriteNode(", 30);
532
666
  prettyprint_node(buffer, parser, (yp_node_t *)((yp_constant_path_operator_write_node_t *)node)->target);
533
667
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_constant_path_operator_write_node_t *)node)->operator_loc);
@@ -538,7 +672,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
538
672
  yp_buffer_append_str(buffer, ")", 1);
539
673
  break;
540
674
  }
541
- case YP_NODE_CONSTANT_PATH_OR_WRITE_NODE: {
675
+ case YP_CONSTANT_PATH_OR_WRITE_NODE: {
542
676
  yp_buffer_append_str(buffer, "ConstantPathOrWriteNode(", 24);
543
677
  prettyprint_node(buffer, parser, (yp_node_t *)((yp_constant_path_or_write_node_t *)node)->target);
544
678
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_constant_path_or_write_node_t *)node)->operator_loc);
@@ -546,7 +680,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
546
680
  yp_buffer_append_str(buffer, ")", 1);
547
681
  break;
548
682
  }
549
- case YP_NODE_CONSTANT_PATH_TARGET_NODE: {
683
+ case YP_CONSTANT_PATH_TARGET_NODE: {
550
684
  yp_buffer_append_str(buffer, "ConstantPathTargetNode(", 23);
551
685
  if (((yp_constant_path_target_node_t *)node)->parent == NULL) {
552
686
  yp_buffer_append_str(buffer, "nil", 3);
@@ -558,7 +692,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
558
692
  yp_buffer_append_str(buffer, ")", 1);
559
693
  break;
560
694
  }
561
- case YP_NODE_CONSTANT_PATH_WRITE_NODE: {
695
+ case YP_CONSTANT_PATH_WRITE_NODE: {
562
696
  yp_buffer_append_str(buffer, "ConstantPathWriteNode(", 22);
563
697
  prettyprint_node(buffer, parser, (yp_node_t *)((yp_constant_path_write_node_t *)node)->target);
564
698
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_constant_path_write_node_t *)node)->operator_loc);
@@ -566,27 +700,39 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
566
700
  yp_buffer_append_str(buffer, ")", 1);
567
701
  break;
568
702
  }
569
- case YP_NODE_CONSTANT_READ_NODE: {
703
+ case YP_CONSTANT_READ_NODE: {
570
704
  yp_buffer_append_str(buffer, "ConstantReadNode(", 17);
705
+ char name_buffer[12];
706
+ snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_constant_read_node_t *)node)->name);
707
+ yp_buffer_append_str(buffer, name_buffer, strlen(name_buffer));
571
708
  yp_buffer_append_str(buffer, ")", 1);
572
709
  break;
573
710
  }
574
- case YP_NODE_CONSTANT_TARGET_NODE: {
711
+ case YP_CONSTANT_TARGET_NODE: {
575
712
  yp_buffer_append_str(buffer, "ConstantTargetNode(", 19);
713
+ char name_buffer[12];
714
+ snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_constant_target_node_t *)node)->name);
715
+ yp_buffer_append_str(buffer, name_buffer, strlen(name_buffer));
576
716
  yp_buffer_append_str(buffer, ")", 1);
577
717
  break;
578
718
  }
579
- case YP_NODE_CONSTANT_WRITE_NODE: {
719
+ case YP_CONSTANT_WRITE_NODE: {
580
720
  yp_buffer_append_str(buffer, "ConstantWriteNode(", 18);
581
- prettyprint_location(buffer, parser, &((yp_constant_write_node_t *)node)->name_loc);
721
+ char name_buffer[12];
722
+ snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_constant_write_node_t *)node)->name);
723
+ yp_buffer_append_str(buffer, name_buffer, strlen(name_buffer));
724
+ yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_constant_write_node_t *)node)->name_loc);
582
725
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_constant_write_node_t *)node)->value);
583
726
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_constant_write_node_t *)node)->operator_loc);
584
727
  yp_buffer_append_str(buffer, ")", 1);
585
728
  break;
586
729
  }
587
- case YP_NODE_DEF_NODE: {
730
+ case YP_DEF_NODE: {
588
731
  yp_buffer_append_str(buffer, "DefNode(", 8);
589
- prettyprint_location(buffer, parser, &((yp_def_node_t *)node)->name_loc);
732
+ char name_buffer[12];
733
+ snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_def_node_t *)node)->name);
734
+ yp_buffer_append_str(buffer, name_buffer, strlen(name_buffer));
735
+ yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_def_node_t *)node)->name_loc);
590
736
  yp_buffer_append_str(buffer, ", ", 2); if (((yp_def_node_t *)node)->receiver == NULL) {
591
737
  yp_buffer_append_str(buffer, "nil", 3);
592
738
  } else {
@@ -639,7 +785,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
639
785
  yp_buffer_append_str(buffer, ")", 1);
640
786
  break;
641
787
  }
642
- case YP_NODE_DEFINED_NODE: {
788
+ case YP_DEFINED_NODE: {
643
789
  yp_buffer_append_str(buffer, "DefinedNode(", 12);
644
790
  if (((yp_defined_node_t *)node)->lparen_loc.start == NULL) {
645
791
  yp_buffer_append_str(buffer, "nil", 3);
@@ -656,7 +802,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
656
802
  yp_buffer_append_str(buffer, ")", 1);
657
803
  break;
658
804
  }
659
- case YP_NODE_ELSE_NODE: {
805
+ case YP_ELSE_NODE: {
660
806
  yp_buffer_append_str(buffer, "ElseNode(", 9);
661
807
  prettyprint_location(buffer, parser, &((yp_else_node_t *)node)->else_keyword_loc);
662
808
  yp_buffer_append_str(buffer, ", ", 2); if (((yp_else_node_t *)node)->statements == NULL) {
@@ -672,7 +818,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
672
818
  yp_buffer_append_str(buffer, ")", 1);
673
819
  break;
674
820
  }
675
- case YP_NODE_EMBEDDED_STATEMENTS_NODE: {
821
+ case YP_EMBEDDED_STATEMENTS_NODE: {
676
822
  yp_buffer_append_str(buffer, "EmbeddedStatementsNode(", 23);
677
823
  prettyprint_location(buffer, parser, &((yp_embedded_statements_node_t *)node)->opening_loc);
678
824
  yp_buffer_append_str(buffer, ", ", 2); if (((yp_embedded_statements_node_t *)node)->statements == NULL) {
@@ -684,14 +830,14 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
684
830
  yp_buffer_append_str(buffer, ")", 1);
685
831
  break;
686
832
  }
687
- case YP_NODE_EMBEDDED_VARIABLE_NODE: {
833
+ case YP_EMBEDDED_VARIABLE_NODE: {
688
834
  yp_buffer_append_str(buffer, "EmbeddedVariableNode(", 21);
689
835
  prettyprint_location(buffer, parser, &((yp_embedded_variable_node_t *)node)->operator_loc);
690
836
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_embedded_variable_node_t *)node)->variable);
691
837
  yp_buffer_append_str(buffer, ")", 1);
692
838
  break;
693
839
  }
694
- case YP_NODE_ENSURE_NODE: {
840
+ case YP_ENSURE_NODE: {
695
841
  yp_buffer_append_str(buffer, "EnsureNode(", 11);
696
842
  prettyprint_location(buffer, parser, &((yp_ensure_node_t *)node)->ensure_keyword_loc);
697
843
  yp_buffer_append_str(buffer, ", ", 2); if (((yp_ensure_node_t *)node)->statements == NULL) {
@@ -703,12 +849,12 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
703
849
  yp_buffer_append_str(buffer, ")", 1);
704
850
  break;
705
851
  }
706
- case YP_NODE_FALSE_NODE: {
852
+ case YP_FALSE_NODE: {
707
853
  yp_buffer_append_str(buffer, "FalseNode(", 10);
708
854
  yp_buffer_append_str(buffer, ")", 1);
709
855
  break;
710
856
  }
711
- case YP_NODE_FIND_PATTERN_NODE: {
857
+ case YP_FIND_PATTERN_NODE: {
712
858
  yp_buffer_append_str(buffer, "FindPatternNode(", 16);
713
859
  if (((yp_find_pattern_node_t *)node)->constant == NULL) {
714
860
  yp_buffer_append_str(buffer, "nil", 3);
@@ -736,7 +882,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
736
882
  yp_buffer_append_str(buffer, ")", 1);
737
883
  break;
738
884
  }
739
- case YP_NODE_FLIP_FLOP_NODE: {
885
+ case YP_FLIP_FLOP_NODE: {
740
886
  yp_buffer_append_str(buffer, "FlipFlopNode(", 13);
741
887
  if (((yp_flip_flop_node_t *)node)->left == NULL) {
742
888
  yp_buffer_append_str(buffer, "nil", 3);
@@ -755,12 +901,12 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
755
901
  yp_buffer_append_str(buffer, ")", 1);
756
902
  break;
757
903
  }
758
- case YP_NODE_FLOAT_NODE: {
904
+ case YP_FLOAT_NODE: {
759
905
  yp_buffer_append_str(buffer, "FloatNode(", 10);
760
906
  yp_buffer_append_str(buffer, ")", 1);
761
907
  break;
762
908
  }
763
- case YP_NODE_FOR_NODE: {
909
+ case YP_FOR_NODE: {
764
910
  yp_buffer_append_str(buffer, "ForNode(", 8);
765
911
  prettyprint_node(buffer, parser, (yp_node_t *)((yp_for_node_t *)node)->index);
766
912
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_for_node_t *)node)->collection);
@@ -780,17 +926,17 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
780
926
  yp_buffer_append_str(buffer, ")", 1);
781
927
  break;
782
928
  }
783
- case YP_NODE_FORWARDING_ARGUMENTS_NODE: {
929
+ case YP_FORWARDING_ARGUMENTS_NODE: {
784
930
  yp_buffer_append_str(buffer, "ForwardingArgumentsNode(", 24);
785
931
  yp_buffer_append_str(buffer, ")", 1);
786
932
  break;
787
933
  }
788
- case YP_NODE_FORWARDING_PARAMETER_NODE: {
934
+ case YP_FORWARDING_PARAMETER_NODE: {
789
935
  yp_buffer_append_str(buffer, "ForwardingParameterNode(", 24);
790
936
  yp_buffer_append_str(buffer, ")", 1);
791
937
  break;
792
938
  }
793
- case YP_NODE_FORWARDING_SUPER_NODE: {
939
+ case YP_FORWARDING_SUPER_NODE: {
794
940
  yp_buffer_append_str(buffer, "ForwardingSuperNode(", 20);
795
941
  if (((yp_forwarding_super_node_t *)node)->block == NULL) {
796
942
  yp_buffer_append_str(buffer, "nil", 3);
@@ -800,17 +946,23 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
800
946
  yp_buffer_append_str(buffer, ")", 1);
801
947
  break;
802
948
  }
803
- case YP_NODE_GLOBAL_VARIABLE_AND_WRITE_NODE: {
949
+ case YP_GLOBAL_VARIABLE_AND_WRITE_NODE: {
804
950
  yp_buffer_append_str(buffer, "GlobalVariableAndWriteNode(", 27);
805
- prettyprint_location(buffer, parser, &((yp_global_variable_and_write_node_t *)node)->name_loc);
951
+ char name_buffer[12];
952
+ snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_global_variable_and_write_node_t *)node)->name);
953
+ yp_buffer_append_str(buffer, name_buffer, strlen(name_buffer));
954
+ yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_global_variable_and_write_node_t *)node)->name_loc);
806
955
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_global_variable_and_write_node_t *)node)->operator_loc);
807
956
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_global_variable_and_write_node_t *)node)->value);
808
957
  yp_buffer_append_str(buffer, ")", 1);
809
958
  break;
810
959
  }
811
- case YP_NODE_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
960
+ case YP_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
812
961
  yp_buffer_append_str(buffer, "GlobalVariableOperatorWriteNode(", 32);
813
- prettyprint_location(buffer, parser, &((yp_global_variable_operator_write_node_t *)node)->name_loc);
962
+ char name_buffer[12];
963
+ snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_global_variable_operator_write_node_t *)node)->name);
964
+ yp_buffer_append_str(buffer, name_buffer, strlen(name_buffer));
965
+ yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_global_variable_operator_write_node_t *)node)->name_loc);
814
966
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_global_variable_operator_write_node_t *)node)->operator_loc);
815
967
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_global_variable_operator_write_node_t *)node)->value);
816
968
  yp_buffer_append_str(buffer, ", ", 2); char operator_buffer[12];
@@ -819,33 +971,45 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
819
971
  yp_buffer_append_str(buffer, ")", 1);
820
972
  break;
821
973
  }
822
- case YP_NODE_GLOBAL_VARIABLE_OR_WRITE_NODE: {
974
+ case YP_GLOBAL_VARIABLE_OR_WRITE_NODE: {
823
975
  yp_buffer_append_str(buffer, "GlobalVariableOrWriteNode(", 26);
824
- prettyprint_location(buffer, parser, &((yp_global_variable_or_write_node_t *)node)->name_loc);
976
+ char name_buffer[12];
977
+ snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_global_variable_or_write_node_t *)node)->name);
978
+ yp_buffer_append_str(buffer, name_buffer, strlen(name_buffer));
979
+ yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_global_variable_or_write_node_t *)node)->name_loc);
825
980
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_global_variable_or_write_node_t *)node)->operator_loc);
826
981
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_global_variable_or_write_node_t *)node)->value);
827
982
  yp_buffer_append_str(buffer, ")", 1);
828
983
  break;
829
984
  }
830
- case YP_NODE_GLOBAL_VARIABLE_READ_NODE: {
985
+ case YP_GLOBAL_VARIABLE_READ_NODE: {
831
986
  yp_buffer_append_str(buffer, "GlobalVariableReadNode(", 23);
987
+ char name_buffer[12];
988
+ snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_global_variable_read_node_t *)node)->name);
989
+ yp_buffer_append_str(buffer, name_buffer, strlen(name_buffer));
832
990
  yp_buffer_append_str(buffer, ")", 1);
833
991
  break;
834
992
  }
835
- case YP_NODE_GLOBAL_VARIABLE_TARGET_NODE: {
993
+ case YP_GLOBAL_VARIABLE_TARGET_NODE: {
836
994
  yp_buffer_append_str(buffer, "GlobalVariableTargetNode(", 25);
995
+ char name_buffer[12];
996
+ snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_global_variable_target_node_t *)node)->name);
997
+ yp_buffer_append_str(buffer, name_buffer, strlen(name_buffer));
837
998
  yp_buffer_append_str(buffer, ")", 1);
838
999
  break;
839
1000
  }
840
- case YP_NODE_GLOBAL_VARIABLE_WRITE_NODE: {
1001
+ case YP_GLOBAL_VARIABLE_WRITE_NODE: {
841
1002
  yp_buffer_append_str(buffer, "GlobalVariableWriteNode(", 24);
842
- prettyprint_location(buffer, parser, &((yp_global_variable_write_node_t *)node)->name_loc);
1003
+ char name_buffer[12];
1004
+ snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_global_variable_write_node_t *)node)->name);
1005
+ yp_buffer_append_str(buffer, name_buffer, strlen(name_buffer));
1006
+ yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_global_variable_write_node_t *)node)->name_loc);
843
1007
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_global_variable_write_node_t *)node)->value);
844
1008
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_global_variable_write_node_t *)node)->operator_loc);
845
1009
  yp_buffer_append_str(buffer, ")", 1);
846
1010
  break;
847
1011
  }
848
- case YP_NODE_HASH_NODE: {
1012
+ case YP_HASH_NODE: {
849
1013
  yp_buffer_append_str(buffer, "HashNode(", 9);
850
1014
  prettyprint_location(buffer, parser, &((yp_hash_node_t *)node)->opening_loc);
851
1015
  yp_buffer_append_str(buffer, ", ", 2); yp_buffer_append_str(buffer, "[", 1);
@@ -858,7 +1022,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
858
1022
  yp_buffer_append_str(buffer, ")", 1);
859
1023
  break;
860
1024
  }
861
- case YP_NODE_HASH_PATTERN_NODE: {
1025
+ case YP_HASH_PATTERN_NODE: {
862
1026
  yp_buffer_append_str(buffer, "HashPatternNode(", 16);
863
1027
  if (((yp_hash_pattern_node_t *)node)->constant == NULL) {
864
1028
  yp_buffer_append_str(buffer, "nil", 3);
@@ -889,7 +1053,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
889
1053
  yp_buffer_append_str(buffer, ")", 1);
890
1054
  break;
891
1055
  }
892
- case YP_NODE_IF_NODE: {
1056
+ case YP_IF_NODE: {
893
1057
  yp_buffer_append_str(buffer, "IfNode(", 7);
894
1058
  if (((yp_if_node_t *)node)->if_keyword_loc.start == NULL) {
895
1059
  yp_buffer_append_str(buffer, "nil", 3);
@@ -915,13 +1079,13 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
915
1079
  yp_buffer_append_str(buffer, ")", 1);
916
1080
  break;
917
1081
  }
918
- case YP_NODE_IMAGINARY_NODE: {
1082
+ case YP_IMAGINARY_NODE: {
919
1083
  yp_buffer_append_str(buffer, "ImaginaryNode(", 14);
920
1084
  prettyprint_node(buffer, parser, (yp_node_t *)((yp_imaginary_node_t *)node)->numeric);
921
1085
  yp_buffer_append_str(buffer, ")", 1);
922
1086
  break;
923
1087
  }
924
- case YP_NODE_IN_NODE: {
1088
+ case YP_IN_NODE: {
925
1089
  yp_buffer_append_str(buffer, "InNode(", 7);
926
1090
  prettyprint_node(buffer, parser, (yp_node_t *)((yp_in_node_t *)node)->pattern);
927
1091
  yp_buffer_append_str(buffer, ", ", 2); if (((yp_in_node_t *)node)->statements == NULL) {
@@ -938,7 +1102,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
938
1102
  yp_buffer_append_str(buffer, ")", 1);
939
1103
  break;
940
1104
  }
941
- case YP_NODE_INSTANCE_VARIABLE_AND_WRITE_NODE: {
1105
+ case YP_INSTANCE_VARIABLE_AND_WRITE_NODE: {
942
1106
  yp_buffer_append_str(buffer, "InstanceVariableAndWriteNode(", 29);
943
1107
  char name_buffer[12];
944
1108
  snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_instance_variable_and_write_node_t *)node)->name);
@@ -949,7 +1113,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
949
1113
  yp_buffer_append_str(buffer, ")", 1);
950
1114
  break;
951
1115
  }
952
- case YP_NODE_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
1116
+ case YP_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
953
1117
  yp_buffer_append_str(buffer, "InstanceVariableOperatorWriteNode(", 34);
954
1118
  char name_buffer[12];
955
1119
  snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_instance_variable_operator_write_node_t *)node)->name);
@@ -963,7 +1127,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
963
1127
  yp_buffer_append_str(buffer, ")", 1);
964
1128
  break;
965
1129
  }
966
- case YP_NODE_INSTANCE_VARIABLE_OR_WRITE_NODE: {
1130
+ case YP_INSTANCE_VARIABLE_OR_WRITE_NODE: {
967
1131
  yp_buffer_append_str(buffer, "InstanceVariableOrWriteNode(", 28);
968
1132
  char name_buffer[12];
969
1133
  snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_instance_variable_or_write_node_t *)node)->name);
@@ -974,7 +1138,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
974
1138
  yp_buffer_append_str(buffer, ")", 1);
975
1139
  break;
976
1140
  }
977
- case YP_NODE_INSTANCE_VARIABLE_READ_NODE: {
1141
+ case YP_INSTANCE_VARIABLE_READ_NODE: {
978
1142
  yp_buffer_append_str(buffer, "InstanceVariableReadNode(", 25);
979
1143
  char name_buffer[12];
980
1144
  snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_instance_variable_read_node_t *)node)->name);
@@ -982,7 +1146,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
982
1146
  yp_buffer_append_str(buffer, ")", 1);
983
1147
  break;
984
1148
  }
985
- case YP_NODE_INSTANCE_VARIABLE_TARGET_NODE: {
1149
+ case YP_INSTANCE_VARIABLE_TARGET_NODE: {
986
1150
  yp_buffer_append_str(buffer, "InstanceVariableTargetNode(", 27);
987
1151
  char name_buffer[12];
988
1152
  snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_instance_variable_target_node_t *)node)->name);
@@ -990,7 +1154,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
990
1154
  yp_buffer_append_str(buffer, ")", 1);
991
1155
  break;
992
1156
  }
993
- case YP_NODE_INSTANCE_VARIABLE_WRITE_NODE: {
1157
+ case YP_INSTANCE_VARIABLE_WRITE_NODE: {
994
1158
  yp_buffer_append_str(buffer, "InstanceVariableWriteNode(", 26);
995
1159
  char name_buffer[12];
996
1160
  snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_instance_variable_write_node_t *)node)->name);
@@ -1001,12 +1165,12 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1001
1165
  yp_buffer_append_str(buffer, ")", 1);
1002
1166
  break;
1003
1167
  }
1004
- case YP_NODE_INTEGER_NODE: {
1168
+ case YP_INTEGER_NODE: {
1005
1169
  yp_buffer_append_str(buffer, "IntegerNode(", 12);
1006
1170
  yp_buffer_append_str(buffer, ")", 1);
1007
1171
  break;
1008
1172
  }
1009
- case YP_NODE_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
1173
+ case YP_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
1010
1174
  yp_buffer_append_str(buffer, "InterpolatedRegularExpressionNode(", 34);
1011
1175
  prettyprint_location(buffer, parser, &((yp_interpolated_regular_expression_node_t *)node)->opening_loc);
1012
1176
  yp_buffer_append_str(buffer, ", ", 2); yp_buffer_append_str(buffer, "[", 1);
@@ -1022,7 +1186,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1022
1186
  yp_buffer_append_str(buffer, ")", 1);
1023
1187
  break;
1024
1188
  }
1025
- case YP_NODE_INTERPOLATED_STRING_NODE: {
1189
+ case YP_INTERPOLATED_STRING_NODE: {
1026
1190
  yp_buffer_append_str(buffer, "InterpolatedStringNode(", 23);
1027
1191
  if (((yp_interpolated_string_node_t *)node)->opening_loc.start == NULL) {
1028
1192
  yp_buffer_append_str(buffer, "nil", 3);
@@ -1043,7 +1207,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1043
1207
  yp_buffer_append_str(buffer, ")", 1);
1044
1208
  break;
1045
1209
  }
1046
- case YP_NODE_INTERPOLATED_SYMBOL_NODE: {
1210
+ case YP_INTERPOLATED_SYMBOL_NODE: {
1047
1211
  yp_buffer_append_str(buffer, "InterpolatedSymbolNode(", 23);
1048
1212
  if (((yp_interpolated_symbol_node_t *)node)->opening_loc.start == NULL) {
1049
1213
  yp_buffer_append_str(buffer, "nil", 3);
@@ -1064,7 +1228,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1064
1228
  yp_buffer_append_str(buffer, ")", 1);
1065
1229
  break;
1066
1230
  }
1067
- case YP_NODE_INTERPOLATED_X_STRING_NODE: {
1231
+ case YP_INTERPOLATED_X_STRING_NODE: {
1068
1232
  yp_buffer_append_str(buffer, "InterpolatedXStringNode(", 24);
1069
1233
  prettyprint_location(buffer, parser, &((yp_interpolated_x_string_node_t *)node)->opening_loc);
1070
1234
  yp_buffer_append_str(buffer, ", ", 2); yp_buffer_append_str(buffer, "[", 1);
@@ -1077,7 +1241,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1077
1241
  yp_buffer_append_str(buffer, ")", 1);
1078
1242
  break;
1079
1243
  }
1080
- case YP_NODE_KEYWORD_HASH_NODE: {
1244
+ case YP_KEYWORD_HASH_NODE: {
1081
1245
  yp_buffer_append_str(buffer, "KeywordHashNode(", 16);
1082
1246
  yp_buffer_append_str(buffer, "[", 1);
1083
1247
  for (uint32_t index = 0; index < ((yp_keyword_hash_node_t *)node)->elements.size; index++) {
@@ -1088,9 +1252,12 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1088
1252
  yp_buffer_append_str(buffer, ")", 1);
1089
1253
  break;
1090
1254
  }
1091
- case YP_NODE_KEYWORD_PARAMETER_NODE: {
1255
+ case YP_KEYWORD_PARAMETER_NODE: {
1092
1256
  yp_buffer_append_str(buffer, "KeywordParameterNode(", 21);
1093
- prettyprint_location(buffer, parser, &((yp_keyword_parameter_node_t *)node)->name_loc);
1257
+ char name_buffer[12];
1258
+ snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_keyword_parameter_node_t *)node)->name);
1259
+ yp_buffer_append_str(buffer, name_buffer, strlen(name_buffer));
1260
+ yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_keyword_parameter_node_t *)node)->name_loc);
1094
1261
  yp_buffer_append_str(buffer, ", ", 2); if (((yp_keyword_parameter_node_t *)node)->value == NULL) {
1095
1262
  yp_buffer_append_str(buffer, "nil", 3);
1096
1263
  } else {
@@ -1099,18 +1266,25 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1099
1266
  yp_buffer_append_str(buffer, ")", 1);
1100
1267
  break;
1101
1268
  }
1102
- case YP_NODE_KEYWORD_REST_PARAMETER_NODE: {
1269
+ case YP_KEYWORD_REST_PARAMETER_NODE: {
1103
1270
  yp_buffer_append_str(buffer, "KeywordRestParameterNode(", 25);
1104
- prettyprint_location(buffer, parser, &((yp_keyword_rest_parameter_node_t *)node)->operator_loc);
1271
+ if (((yp_keyword_rest_parameter_node_t *)node)->name == 0) {
1272
+ yp_buffer_append_str(buffer, "nil", 3);
1273
+ } else {
1274
+ char name_buffer[12];
1275
+ snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_keyword_rest_parameter_node_t *)node)->name);
1276
+ yp_buffer_append_str(buffer, name_buffer, strlen(name_buffer));
1277
+ }
1105
1278
  yp_buffer_append_str(buffer, ", ", 2); if (((yp_keyword_rest_parameter_node_t *)node)->name_loc.start == NULL) {
1106
1279
  yp_buffer_append_str(buffer, "nil", 3);
1107
1280
  } else {
1108
1281
  prettyprint_location(buffer, parser, &((yp_keyword_rest_parameter_node_t *)node)->name_loc);
1109
1282
  }
1283
+ yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_keyword_rest_parameter_node_t *)node)->operator_loc);
1110
1284
  yp_buffer_append_str(buffer, ")", 1);
1111
1285
  break;
1112
1286
  }
1113
- case YP_NODE_LAMBDA_NODE: {
1287
+ case YP_LAMBDA_NODE: {
1114
1288
  yp_buffer_append_str(buffer, "LambdaNode(", 11);
1115
1289
  yp_buffer_append_str(buffer, "[", 1);
1116
1290
  for (uint32_t index = 0; index < ((yp_lambda_node_t *)node)->locals.size; index++) {
@@ -1136,7 +1310,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1136
1310
  yp_buffer_append_str(buffer, ")", 1);
1137
1311
  break;
1138
1312
  }
1139
- case YP_NODE_LOCAL_VARIABLE_AND_WRITE_NODE: {
1313
+ case YP_LOCAL_VARIABLE_AND_WRITE_NODE: {
1140
1314
  yp_buffer_append_str(buffer, "LocalVariableAndWriteNode(", 26);
1141
1315
  prettyprint_location(buffer, parser, &((yp_local_variable_and_write_node_t *)node)->name_loc);
1142
1316
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_local_variable_and_write_node_t *)node)->operator_loc);
@@ -1150,7 +1324,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1150
1324
  yp_buffer_append_str(buffer, ")", 1);
1151
1325
  break;
1152
1326
  }
1153
- case YP_NODE_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
1327
+ case YP_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
1154
1328
  yp_buffer_append_str(buffer, "LocalVariableOperatorWriteNode(", 31);
1155
1329
  prettyprint_location(buffer, parser, &((yp_local_variable_operator_write_node_t *)node)->name_loc);
1156
1330
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_local_variable_operator_write_node_t *)node)->operator_loc);
@@ -1167,7 +1341,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1167
1341
  yp_buffer_append_str(buffer, ")", 1);
1168
1342
  break;
1169
1343
  }
1170
- case YP_NODE_LOCAL_VARIABLE_OR_WRITE_NODE: {
1344
+ case YP_LOCAL_VARIABLE_OR_WRITE_NODE: {
1171
1345
  yp_buffer_append_str(buffer, "LocalVariableOrWriteNode(", 25);
1172
1346
  prettyprint_location(buffer, parser, &((yp_local_variable_or_write_node_t *)node)->name_loc);
1173
1347
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_local_variable_or_write_node_t *)node)->operator_loc);
@@ -1181,7 +1355,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1181
1355
  yp_buffer_append_str(buffer, ")", 1);
1182
1356
  break;
1183
1357
  }
1184
- case YP_NODE_LOCAL_VARIABLE_READ_NODE: {
1358
+ case YP_LOCAL_VARIABLE_READ_NODE: {
1185
1359
  yp_buffer_append_str(buffer, "LocalVariableReadNode(", 22);
1186
1360
  char name_buffer[12];
1187
1361
  snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_local_variable_read_node_t *)node)->name);
@@ -1192,7 +1366,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1192
1366
  yp_buffer_append_str(buffer, ")", 1);
1193
1367
  break;
1194
1368
  }
1195
- case YP_NODE_LOCAL_VARIABLE_TARGET_NODE: {
1369
+ case YP_LOCAL_VARIABLE_TARGET_NODE: {
1196
1370
  yp_buffer_append_str(buffer, "LocalVariableTargetNode(", 24);
1197
1371
  char name_buffer[12];
1198
1372
  snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_local_variable_target_node_t *)node)->name);
@@ -1203,7 +1377,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1203
1377
  yp_buffer_append_str(buffer, ")", 1);
1204
1378
  break;
1205
1379
  }
1206
- case YP_NODE_LOCAL_VARIABLE_WRITE_NODE: {
1380
+ case YP_LOCAL_VARIABLE_WRITE_NODE: {
1207
1381
  yp_buffer_append_str(buffer, "LocalVariableWriteNode(", 23);
1208
1382
  char name_buffer[12];
1209
1383
  snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_local_variable_write_node_t *)node)->name);
@@ -1217,7 +1391,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1217
1391
  yp_buffer_append_str(buffer, ")", 1);
1218
1392
  break;
1219
1393
  }
1220
- case YP_NODE_MATCH_PREDICATE_NODE: {
1394
+ case YP_MATCH_PREDICATE_NODE: {
1221
1395
  yp_buffer_append_str(buffer, "MatchPredicateNode(", 19);
1222
1396
  prettyprint_node(buffer, parser, (yp_node_t *)((yp_match_predicate_node_t *)node)->value);
1223
1397
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_match_predicate_node_t *)node)->pattern);
@@ -1225,7 +1399,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1225
1399
  yp_buffer_append_str(buffer, ")", 1);
1226
1400
  break;
1227
1401
  }
1228
- case YP_NODE_MATCH_REQUIRED_NODE: {
1402
+ case YP_MATCH_REQUIRED_NODE: {
1229
1403
  yp_buffer_append_str(buffer, "MatchRequiredNode(", 18);
1230
1404
  prettyprint_node(buffer, parser, (yp_node_t *)((yp_match_required_node_t *)node)->value);
1231
1405
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_match_required_node_t *)node)->pattern);
@@ -1233,12 +1407,12 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1233
1407
  yp_buffer_append_str(buffer, ")", 1);
1234
1408
  break;
1235
1409
  }
1236
- case YP_NODE_MISSING_NODE: {
1410
+ case YP_MISSING_NODE: {
1237
1411
  yp_buffer_append_str(buffer, "MissingNode(", 12);
1238
1412
  yp_buffer_append_str(buffer, ")", 1);
1239
1413
  break;
1240
1414
  }
1241
- case YP_NODE_MODULE_NODE: {
1415
+ case YP_MODULE_NODE: {
1242
1416
  yp_buffer_append_str(buffer, "ModuleNode(", 11);
1243
1417
  yp_buffer_append_str(buffer, "[", 1);
1244
1418
  for (uint32_t index = 0; index < ((yp_module_node_t *)node)->locals.size; index++) {
@@ -1256,30 +1430,41 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1256
1430
  prettyprint_node(buffer, parser, (yp_node_t *)((yp_module_node_t *)node)->body);
1257
1431
  }
1258
1432
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_module_node_t *)node)->end_keyword_loc);
1259
- yp_buffer_append_str(buffer, ", ", 2); yp_buffer_append_str(buffer, "\"", 1);
1260
- yp_buffer_append_bytes(buffer, yp_string_source(&((yp_module_node_t *)node)->name), yp_string_length(&((yp_module_node_t *)node)->name));
1261
- yp_buffer_append_str(buffer, "\"", 1);
1433
+ yp_buffer_append_str(buffer, ", ", 2); char name_buffer[12];
1434
+ snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_module_node_t *)node)->name);
1435
+ yp_buffer_append_str(buffer, name_buffer, strlen(name_buffer));
1262
1436
  yp_buffer_append_str(buffer, ")", 1);
1263
1437
  break;
1264
1438
  }
1265
- case YP_NODE_MULTI_WRITE_NODE: {
1266
- yp_buffer_append_str(buffer, "MultiWriteNode(", 15);
1439
+ case YP_MULTI_TARGET_NODE: {
1440
+ yp_buffer_append_str(buffer, "MultiTargetNode(", 16);
1267
1441
  yp_buffer_append_str(buffer, "[", 1);
1268
- for (uint32_t index = 0; index < ((yp_multi_write_node_t *)node)->targets.size; index++) {
1442
+ for (uint32_t index = 0; index < ((yp_multi_target_node_t *)node)->targets.size; index++) {
1269
1443
  if (index != 0) yp_buffer_append_str(buffer, ", ", 2);
1270
- prettyprint_node(buffer, parser, (yp_node_t *) ((yp_multi_write_node_t *) node)->targets.nodes[index]);
1444
+ prettyprint_node(buffer, parser, (yp_node_t *) ((yp_multi_target_node_t *) node)->targets.nodes[index]);
1271
1445
  }
1272
1446
  yp_buffer_append_str(buffer, "]", 1);
1273
- yp_buffer_append_str(buffer, ", ", 2); if (((yp_multi_write_node_t *)node)->operator_loc.start == NULL) {
1447
+ yp_buffer_append_str(buffer, ", ", 2); if (((yp_multi_target_node_t *)node)->lparen_loc.start == NULL) {
1274
1448
  yp_buffer_append_str(buffer, "nil", 3);
1275
1449
  } else {
1276
- prettyprint_location(buffer, parser, &((yp_multi_write_node_t *)node)->operator_loc);
1450
+ prettyprint_location(buffer, parser, &((yp_multi_target_node_t *)node)->lparen_loc);
1277
1451
  }
1278
- yp_buffer_append_str(buffer, ", ", 2); if (((yp_multi_write_node_t *)node)->value == NULL) {
1452
+ yp_buffer_append_str(buffer, ", ", 2); if (((yp_multi_target_node_t *)node)->rparen_loc.start == NULL) {
1279
1453
  yp_buffer_append_str(buffer, "nil", 3);
1280
1454
  } else {
1281
- prettyprint_node(buffer, parser, (yp_node_t *)((yp_multi_write_node_t *)node)->value);
1455
+ prettyprint_location(buffer, parser, &((yp_multi_target_node_t *)node)->rparen_loc);
1282
1456
  }
1457
+ yp_buffer_append_str(buffer, ")", 1);
1458
+ break;
1459
+ }
1460
+ case YP_MULTI_WRITE_NODE: {
1461
+ yp_buffer_append_str(buffer, "MultiWriteNode(", 15);
1462
+ yp_buffer_append_str(buffer, "[", 1);
1463
+ for (uint32_t index = 0; index < ((yp_multi_write_node_t *)node)->targets.size; index++) {
1464
+ if (index != 0) yp_buffer_append_str(buffer, ", ", 2);
1465
+ prettyprint_node(buffer, parser, (yp_node_t *) ((yp_multi_write_node_t *) node)->targets.nodes[index]);
1466
+ }
1467
+ yp_buffer_append_str(buffer, "]", 1);
1283
1468
  yp_buffer_append_str(buffer, ", ", 2); if (((yp_multi_write_node_t *)node)->lparen_loc.start == NULL) {
1284
1469
  yp_buffer_append_str(buffer, "nil", 3);
1285
1470
  } else {
@@ -1290,10 +1475,12 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1290
1475
  } else {
1291
1476
  prettyprint_location(buffer, parser, &((yp_multi_write_node_t *)node)->rparen_loc);
1292
1477
  }
1478
+ yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_multi_write_node_t *)node)->operator_loc);
1479
+ yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_multi_write_node_t *)node)->value);
1293
1480
  yp_buffer_append_str(buffer, ")", 1);
1294
1481
  break;
1295
1482
  }
1296
- case YP_NODE_NEXT_NODE: {
1483
+ case YP_NEXT_NODE: {
1297
1484
  yp_buffer_append_str(buffer, "NextNode(", 9);
1298
1485
  if (((yp_next_node_t *)node)->arguments == NULL) {
1299
1486
  yp_buffer_append_str(buffer, "nil", 3);
@@ -1304,19 +1491,19 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1304
1491
  yp_buffer_append_str(buffer, ")", 1);
1305
1492
  break;
1306
1493
  }
1307
- case YP_NODE_NIL_NODE: {
1494
+ case YP_NIL_NODE: {
1308
1495
  yp_buffer_append_str(buffer, "NilNode(", 8);
1309
1496
  yp_buffer_append_str(buffer, ")", 1);
1310
1497
  break;
1311
1498
  }
1312
- case YP_NODE_NO_KEYWORDS_PARAMETER_NODE: {
1499
+ case YP_NO_KEYWORDS_PARAMETER_NODE: {
1313
1500
  yp_buffer_append_str(buffer, "NoKeywordsParameterNode(", 24);
1314
1501
  prettyprint_location(buffer, parser, &((yp_no_keywords_parameter_node_t *)node)->operator_loc);
1315
1502
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_no_keywords_parameter_node_t *)node)->keyword_loc);
1316
1503
  yp_buffer_append_str(buffer, ")", 1);
1317
1504
  break;
1318
1505
  }
1319
- case YP_NODE_NUMBERED_REFERENCE_READ_NODE: {
1506
+ case YP_NUMBERED_REFERENCE_READ_NODE: {
1320
1507
  yp_buffer_append_str(buffer, "NumberedReferenceReadNode(", 26);
1321
1508
  char number_buffer[12];
1322
1509
  snprintf(number_buffer, sizeof(number_buffer), "+%d", ((yp_numbered_reference_read_node_t *)node)->number);
@@ -1324,7 +1511,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1324
1511
  yp_buffer_append_str(buffer, ")", 1);
1325
1512
  break;
1326
1513
  }
1327
- case YP_NODE_OPTIONAL_PARAMETER_NODE: {
1514
+ case YP_OPTIONAL_PARAMETER_NODE: {
1328
1515
  yp_buffer_append_str(buffer, "OptionalParameterNode(", 22);
1329
1516
  char name_buffer[12];
1330
1517
  snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_optional_parameter_node_t *)node)->name);
@@ -1335,7 +1522,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1335
1522
  yp_buffer_append_str(buffer, ")", 1);
1336
1523
  break;
1337
1524
  }
1338
- case YP_NODE_OR_NODE: {
1525
+ case YP_OR_NODE: {
1339
1526
  yp_buffer_append_str(buffer, "OrNode(", 7);
1340
1527
  prettyprint_node(buffer, parser, (yp_node_t *)((yp_or_node_t *)node)->left);
1341
1528
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_or_node_t *)node)->right);
@@ -1343,7 +1530,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1343
1530
  yp_buffer_append_str(buffer, ")", 1);
1344
1531
  break;
1345
1532
  }
1346
- case YP_NODE_PARAMETERS_NODE: {
1533
+ case YP_PARAMETERS_NODE: {
1347
1534
  yp_buffer_append_str(buffer, "ParametersNode(", 15);
1348
1535
  yp_buffer_append_str(buffer, "[", 1);
1349
1536
  for (uint32_t index = 0; index < ((yp_parameters_node_t *)node)->requireds.size; index++) {
@@ -1387,7 +1574,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1387
1574
  yp_buffer_append_str(buffer, ")", 1);
1388
1575
  break;
1389
1576
  }
1390
- case YP_NODE_PARENTHESES_NODE: {
1577
+ case YP_PARENTHESES_NODE: {
1391
1578
  yp_buffer_append_str(buffer, "ParenthesesNode(", 16);
1392
1579
  if (((yp_parentheses_node_t *)node)->body == NULL) {
1393
1580
  yp_buffer_append_str(buffer, "nil", 3);
@@ -1399,7 +1586,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1399
1586
  yp_buffer_append_str(buffer, ")", 1);
1400
1587
  break;
1401
1588
  }
1402
- case YP_NODE_PINNED_EXPRESSION_NODE: {
1589
+ case YP_PINNED_EXPRESSION_NODE: {
1403
1590
  yp_buffer_append_str(buffer, "PinnedExpressionNode(", 21);
1404
1591
  prettyprint_node(buffer, parser, (yp_node_t *)((yp_pinned_expression_node_t *)node)->expression);
1405
1592
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_pinned_expression_node_t *)node)->operator_loc);
@@ -1408,14 +1595,14 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1408
1595
  yp_buffer_append_str(buffer, ")", 1);
1409
1596
  break;
1410
1597
  }
1411
- case YP_NODE_PINNED_VARIABLE_NODE: {
1598
+ case YP_PINNED_VARIABLE_NODE: {
1412
1599
  yp_buffer_append_str(buffer, "PinnedVariableNode(", 19);
1413
1600
  prettyprint_node(buffer, parser, (yp_node_t *)((yp_pinned_variable_node_t *)node)->variable);
1414
1601
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_pinned_variable_node_t *)node)->operator_loc);
1415
1602
  yp_buffer_append_str(buffer, ")", 1);
1416
1603
  break;
1417
1604
  }
1418
- case YP_NODE_POST_EXECUTION_NODE: {
1605
+ case YP_POST_EXECUTION_NODE: {
1419
1606
  yp_buffer_append_str(buffer, "PostExecutionNode(", 18);
1420
1607
  if (((yp_post_execution_node_t *)node)->statements == NULL) {
1421
1608
  yp_buffer_append_str(buffer, "nil", 3);
@@ -1428,7 +1615,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1428
1615
  yp_buffer_append_str(buffer, ")", 1);
1429
1616
  break;
1430
1617
  }
1431
- case YP_NODE_PRE_EXECUTION_NODE: {
1618
+ case YP_PRE_EXECUTION_NODE: {
1432
1619
  yp_buffer_append_str(buffer, "PreExecutionNode(", 17);
1433
1620
  if (((yp_pre_execution_node_t *)node)->statements == NULL) {
1434
1621
  yp_buffer_append_str(buffer, "nil", 3);
@@ -1441,7 +1628,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1441
1628
  yp_buffer_append_str(buffer, ")", 1);
1442
1629
  break;
1443
1630
  }
1444
- case YP_NODE_PROGRAM_NODE: {
1631
+ case YP_PROGRAM_NODE: {
1445
1632
  yp_buffer_append_str(buffer, "ProgramNode(", 12);
1446
1633
  yp_buffer_append_str(buffer, "[", 1);
1447
1634
  for (uint32_t index = 0; index < ((yp_program_node_t *)node)->locals.size; index++) {
@@ -1455,7 +1642,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1455
1642
  yp_buffer_append_str(buffer, ")", 1);
1456
1643
  break;
1457
1644
  }
1458
- case YP_NODE_RANGE_NODE: {
1645
+ case YP_RANGE_NODE: {
1459
1646
  yp_buffer_append_str(buffer, "RangeNode(", 10);
1460
1647
  if (((yp_range_node_t *)node)->left == NULL) {
1461
1648
  yp_buffer_append_str(buffer, "nil", 3);
@@ -1474,18 +1661,18 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1474
1661
  yp_buffer_append_str(buffer, ")", 1);
1475
1662
  break;
1476
1663
  }
1477
- case YP_NODE_RATIONAL_NODE: {
1664
+ case YP_RATIONAL_NODE: {
1478
1665
  yp_buffer_append_str(buffer, "RationalNode(", 13);
1479
1666
  prettyprint_node(buffer, parser, (yp_node_t *)((yp_rational_node_t *)node)->numeric);
1480
1667
  yp_buffer_append_str(buffer, ")", 1);
1481
1668
  break;
1482
1669
  }
1483
- case YP_NODE_REDO_NODE: {
1670
+ case YP_REDO_NODE: {
1484
1671
  yp_buffer_append_str(buffer, "RedoNode(", 9);
1485
1672
  yp_buffer_append_str(buffer, ")", 1);
1486
1673
  break;
1487
1674
  }
1488
- case YP_NODE_REGULAR_EXPRESSION_NODE: {
1675
+ case YP_REGULAR_EXPRESSION_NODE: {
1489
1676
  yp_buffer_append_str(buffer, "RegularExpressionNode(", 22);
1490
1677
  prettyprint_location(buffer, parser, &((yp_regular_expression_node_t *)node)->opening_loc);
1491
1678
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_regular_expression_node_t *)node)->content_loc);
@@ -1499,7 +1686,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1499
1686
  yp_buffer_append_str(buffer, ")", 1);
1500
1687
  break;
1501
1688
  }
1502
- case YP_NODE_REQUIRED_DESTRUCTURED_PARAMETER_NODE: {
1689
+ case YP_REQUIRED_DESTRUCTURED_PARAMETER_NODE: {
1503
1690
  yp_buffer_append_str(buffer, "RequiredDestructuredParameterNode(", 34);
1504
1691
  yp_buffer_append_str(buffer, "[", 1);
1505
1692
  for (uint32_t index = 0; index < ((yp_required_destructured_parameter_node_t *)node)->parameters.size; index++) {
@@ -1512,7 +1699,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1512
1699
  yp_buffer_append_str(buffer, ")", 1);
1513
1700
  break;
1514
1701
  }
1515
- case YP_NODE_REQUIRED_PARAMETER_NODE: {
1702
+ case YP_REQUIRED_PARAMETER_NODE: {
1516
1703
  yp_buffer_append_str(buffer, "RequiredParameterNode(", 22);
1517
1704
  char name_buffer[12];
1518
1705
  snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_required_parameter_node_t *)node)->name);
@@ -1520,7 +1707,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1520
1707
  yp_buffer_append_str(buffer, ")", 1);
1521
1708
  break;
1522
1709
  }
1523
- case YP_NODE_RESCUE_MODIFIER_NODE: {
1710
+ case YP_RESCUE_MODIFIER_NODE: {
1524
1711
  yp_buffer_append_str(buffer, "RescueModifierNode(", 19);
1525
1712
  prettyprint_node(buffer, parser, (yp_node_t *)((yp_rescue_modifier_node_t *)node)->expression);
1526
1713
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_rescue_modifier_node_t *)node)->keyword_loc);
@@ -1528,7 +1715,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1528
1715
  yp_buffer_append_str(buffer, ")", 1);
1529
1716
  break;
1530
1717
  }
1531
- case YP_NODE_RESCUE_NODE: {
1718
+ case YP_RESCUE_NODE: {
1532
1719
  yp_buffer_append_str(buffer, "RescueNode(", 11);
1533
1720
  prettyprint_location(buffer, parser, &((yp_rescue_node_t *)node)->keyword_loc);
1534
1721
  yp_buffer_append_str(buffer, ", ", 2); yp_buffer_append_str(buffer, "[", 1);
@@ -1560,23 +1747,30 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1560
1747
  yp_buffer_append_str(buffer, ")", 1);
1561
1748
  break;
1562
1749
  }
1563
- case YP_NODE_REST_PARAMETER_NODE: {
1750
+ case YP_REST_PARAMETER_NODE: {
1564
1751
  yp_buffer_append_str(buffer, "RestParameterNode(", 18);
1565
- prettyprint_location(buffer, parser, &((yp_rest_parameter_node_t *)node)->operator_loc);
1752
+ if (((yp_rest_parameter_node_t *)node)->name == 0) {
1753
+ yp_buffer_append_str(buffer, "nil", 3);
1754
+ } else {
1755
+ char name_buffer[12];
1756
+ snprintf(name_buffer, sizeof(name_buffer), "%u", ((yp_rest_parameter_node_t *)node)->name);
1757
+ yp_buffer_append_str(buffer, name_buffer, strlen(name_buffer));
1758
+ }
1566
1759
  yp_buffer_append_str(buffer, ", ", 2); if (((yp_rest_parameter_node_t *)node)->name_loc.start == NULL) {
1567
1760
  yp_buffer_append_str(buffer, "nil", 3);
1568
1761
  } else {
1569
1762
  prettyprint_location(buffer, parser, &((yp_rest_parameter_node_t *)node)->name_loc);
1570
1763
  }
1764
+ yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_rest_parameter_node_t *)node)->operator_loc);
1571
1765
  yp_buffer_append_str(buffer, ")", 1);
1572
1766
  break;
1573
1767
  }
1574
- case YP_NODE_RETRY_NODE: {
1768
+ case YP_RETRY_NODE: {
1575
1769
  yp_buffer_append_str(buffer, "RetryNode(", 10);
1576
1770
  yp_buffer_append_str(buffer, ")", 1);
1577
1771
  break;
1578
1772
  }
1579
- case YP_NODE_RETURN_NODE: {
1773
+ case YP_RETURN_NODE: {
1580
1774
  yp_buffer_append_str(buffer, "ReturnNode(", 11);
1581
1775
  prettyprint_location(buffer, parser, &((yp_return_node_t *)node)->keyword_loc);
1582
1776
  yp_buffer_append_str(buffer, ", ", 2); if (((yp_return_node_t *)node)->arguments == NULL) {
@@ -1587,12 +1781,12 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1587
1781
  yp_buffer_append_str(buffer, ")", 1);
1588
1782
  break;
1589
1783
  }
1590
- case YP_NODE_SELF_NODE: {
1784
+ case YP_SELF_NODE: {
1591
1785
  yp_buffer_append_str(buffer, "SelfNode(", 9);
1592
1786
  yp_buffer_append_str(buffer, ")", 1);
1593
1787
  break;
1594
1788
  }
1595
- case YP_NODE_SINGLETON_CLASS_NODE: {
1789
+ case YP_SINGLETON_CLASS_NODE: {
1596
1790
  yp_buffer_append_str(buffer, "SingletonClassNode(", 19);
1597
1791
  yp_buffer_append_str(buffer, "[", 1);
1598
1792
  for (uint32_t index = 0; index < ((yp_singleton_class_node_t *)node)->locals.size; index++) {
@@ -1614,12 +1808,12 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1614
1808
  yp_buffer_append_str(buffer, ")", 1);
1615
1809
  break;
1616
1810
  }
1617
- case YP_NODE_SOURCE_ENCODING_NODE: {
1811
+ case YP_SOURCE_ENCODING_NODE: {
1618
1812
  yp_buffer_append_str(buffer, "SourceEncodingNode(", 19);
1619
1813
  yp_buffer_append_str(buffer, ")", 1);
1620
1814
  break;
1621
1815
  }
1622
- case YP_NODE_SOURCE_FILE_NODE: {
1816
+ case YP_SOURCE_FILE_NODE: {
1623
1817
  yp_buffer_append_str(buffer, "SourceFileNode(", 15);
1624
1818
  yp_buffer_append_str(buffer, "\"", 1);
1625
1819
  yp_buffer_append_bytes(buffer, yp_string_source(&((yp_source_file_node_t *)node)->filepath), yp_string_length(&((yp_source_file_node_t *)node)->filepath));
@@ -1627,12 +1821,12 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1627
1821
  yp_buffer_append_str(buffer, ")", 1);
1628
1822
  break;
1629
1823
  }
1630
- case YP_NODE_SOURCE_LINE_NODE: {
1824
+ case YP_SOURCE_LINE_NODE: {
1631
1825
  yp_buffer_append_str(buffer, "SourceLineNode(", 15);
1632
1826
  yp_buffer_append_str(buffer, ")", 1);
1633
1827
  break;
1634
1828
  }
1635
- case YP_NODE_SPLAT_NODE: {
1829
+ case YP_SPLAT_NODE: {
1636
1830
  yp_buffer_append_str(buffer, "SplatNode(", 10);
1637
1831
  prettyprint_location(buffer, parser, &((yp_splat_node_t *)node)->operator_loc);
1638
1832
  yp_buffer_append_str(buffer, ", ", 2); if (((yp_splat_node_t *)node)->expression == NULL) {
@@ -1643,7 +1837,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1643
1837
  yp_buffer_append_str(buffer, ")", 1);
1644
1838
  break;
1645
1839
  }
1646
- case YP_NODE_STATEMENTS_NODE: {
1840
+ case YP_STATEMENTS_NODE: {
1647
1841
  yp_buffer_append_str(buffer, "StatementsNode(", 15);
1648
1842
  yp_buffer_append_str(buffer, "[", 1);
1649
1843
  for (uint32_t index = 0; index < ((yp_statements_node_t *)node)->body.size; index++) {
@@ -1654,14 +1848,14 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1654
1848
  yp_buffer_append_str(buffer, ")", 1);
1655
1849
  break;
1656
1850
  }
1657
- case YP_NODE_STRING_CONCAT_NODE: {
1851
+ case YP_STRING_CONCAT_NODE: {
1658
1852
  yp_buffer_append_str(buffer, "StringConcatNode(", 17);
1659
1853
  prettyprint_node(buffer, parser, (yp_node_t *)((yp_string_concat_node_t *)node)->left);
1660
1854
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_string_concat_node_t *)node)->right);
1661
1855
  yp_buffer_append_str(buffer, ")", 1);
1662
1856
  break;
1663
1857
  }
1664
- case YP_NODE_STRING_NODE: {
1858
+ case YP_STRING_NODE: {
1665
1859
  yp_buffer_append_str(buffer, "StringNode(", 11);
1666
1860
  if (((yp_string_node_t *)node)->opening_loc.start == NULL) {
1667
1861
  yp_buffer_append_str(buffer, "nil", 3);
@@ -1680,7 +1874,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1680
1874
  yp_buffer_append_str(buffer, ")", 1);
1681
1875
  break;
1682
1876
  }
1683
- case YP_NODE_SUPER_NODE: {
1877
+ case YP_SUPER_NODE: {
1684
1878
  yp_buffer_append_str(buffer, "SuperNode(", 10);
1685
1879
  prettyprint_location(buffer, parser, &((yp_super_node_t *)node)->keyword_loc);
1686
1880
  yp_buffer_append_str(buffer, ", ", 2); if (((yp_super_node_t *)node)->lparen_loc.start == NULL) {
@@ -1706,7 +1900,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1706
1900
  yp_buffer_append_str(buffer, ")", 1);
1707
1901
  break;
1708
1902
  }
1709
- case YP_NODE_SYMBOL_NODE: {
1903
+ case YP_SYMBOL_NODE: {
1710
1904
  yp_buffer_append_str(buffer, "SymbolNode(", 11);
1711
1905
  if (((yp_symbol_node_t *)node)->opening_loc.start == NULL) {
1712
1906
  yp_buffer_append_str(buffer, "nil", 3);
@@ -1729,12 +1923,12 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1729
1923
  yp_buffer_append_str(buffer, ")", 1);
1730
1924
  break;
1731
1925
  }
1732
- case YP_NODE_TRUE_NODE: {
1926
+ case YP_TRUE_NODE: {
1733
1927
  yp_buffer_append_str(buffer, "TrueNode(", 9);
1734
1928
  yp_buffer_append_str(buffer, ")", 1);
1735
1929
  break;
1736
1930
  }
1737
- case YP_NODE_UNDEF_NODE: {
1931
+ case YP_UNDEF_NODE: {
1738
1932
  yp_buffer_append_str(buffer, "UndefNode(", 10);
1739
1933
  yp_buffer_append_str(buffer, "[", 1);
1740
1934
  for (uint32_t index = 0; index < ((yp_undef_node_t *)node)->names.size; index++) {
@@ -1746,7 +1940,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1746
1940
  yp_buffer_append_str(buffer, ")", 1);
1747
1941
  break;
1748
1942
  }
1749
- case YP_NODE_UNLESS_NODE: {
1943
+ case YP_UNLESS_NODE: {
1750
1944
  yp_buffer_append_str(buffer, "UnlessNode(", 11);
1751
1945
  prettyprint_location(buffer, parser, &((yp_unless_node_t *)node)->keyword_loc);
1752
1946
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_node(buffer, parser, (yp_node_t *)((yp_unless_node_t *)node)->predicate);
@@ -1768,7 +1962,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1768
1962
  yp_buffer_append_str(buffer, ")", 1);
1769
1963
  break;
1770
1964
  }
1771
- case YP_NODE_UNTIL_NODE: {
1965
+ case YP_UNTIL_NODE: {
1772
1966
  yp_buffer_append_str(buffer, "UntilNode(", 10);
1773
1967
  prettyprint_location(buffer, parser, &((yp_until_node_t *)node)->keyword_loc);
1774
1968
  yp_buffer_append_str(buffer, ", ", 2); if (((yp_until_node_t *)node)->closing_loc.start == NULL) {
@@ -1788,7 +1982,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1788
1982
  yp_buffer_append_str(buffer, ")", 1);
1789
1983
  break;
1790
1984
  }
1791
- case YP_NODE_WHEN_NODE: {
1985
+ case YP_WHEN_NODE: {
1792
1986
  yp_buffer_append_str(buffer, "WhenNode(", 9);
1793
1987
  prettyprint_location(buffer, parser, &((yp_when_node_t *)node)->keyword_loc);
1794
1988
  yp_buffer_append_str(buffer, ", ", 2); yp_buffer_append_str(buffer, "[", 1);
@@ -1805,7 +1999,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1805
1999
  yp_buffer_append_str(buffer, ")", 1);
1806
2000
  break;
1807
2001
  }
1808
- case YP_NODE_WHILE_NODE: {
2002
+ case YP_WHILE_NODE: {
1809
2003
  yp_buffer_append_str(buffer, "WhileNode(", 10);
1810
2004
  prettyprint_location(buffer, parser, &((yp_while_node_t *)node)->keyword_loc);
1811
2005
  yp_buffer_append_str(buffer, ", ", 2); if (((yp_while_node_t *)node)->closing_loc.start == NULL) {
@@ -1825,7 +2019,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1825
2019
  yp_buffer_append_str(buffer, ")", 1);
1826
2020
  break;
1827
2021
  }
1828
- case YP_NODE_X_STRING_NODE: {
2022
+ case YP_X_STRING_NODE: {
1829
2023
  yp_buffer_append_str(buffer, "XStringNode(", 12);
1830
2024
  prettyprint_location(buffer, parser, &((yp_x_string_node_t *)node)->opening_loc);
1831
2025
  yp_buffer_append_str(buffer, ", ", 2); prettyprint_location(buffer, parser, &((yp_x_string_node_t *)node)->content_loc);
@@ -1836,7 +2030,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
1836
2030
  yp_buffer_append_str(buffer, ")", 1);
1837
2031
  break;
1838
2032
  }
1839
- case YP_NODE_YIELD_NODE: {
2033
+ case YP_YIELD_NODE: {
1840
2034
  yp_buffer_append_str(buffer, "YieldNode(", 10);
1841
2035
  prettyprint_location(buffer, parser, &((yp_yield_node_t *)node)->keyword_loc);
1842
2036
  yp_buffer_append_str(buffer, ", ", 2); if (((yp_yield_node_t *)node)->lparen_loc.start == NULL) {