prism 0.30.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -1
  3. data/README.md +3 -1
  4. data/config.yml +185 -126
  5. data/docs/serialization.md +3 -0
  6. data/ext/prism/api_node.c +2843 -2085
  7. data/ext/prism/extconf.rb +1 -1
  8. data/ext/prism/extension.c +35 -25
  9. data/ext/prism/extension.h +2 -2
  10. data/include/prism/ast.h +1048 -69
  11. data/include/prism/defines.h +9 -0
  12. data/include/prism/diagnostic.h +11 -3
  13. data/include/prism/options.h +55 -1
  14. data/include/prism/parser.h +27 -3
  15. data/include/prism/regexp.h +2 -1
  16. data/include/prism/util/pm_integer.h +6 -6
  17. data/include/prism/util/pm_newline_list.h +11 -0
  18. data/include/prism/util/pm_string.h +1 -0
  19. data/include/prism/version.h +3 -3
  20. data/lib/prism/desugar_compiler.rb +111 -74
  21. data/lib/prism/dispatcher.rb +2 -1
  22. data/lib/prism/dot_visitor.rb +21 -31
  23. data/lib/prism/dsl.rb +656 -471
  24. data/lib/prism/ffi.rb +3 -0
  25. data/lib/prism/inspect_visitor.rb +285 -57
  26. data/lib/prism/mutation_compiler.rb +5 -5
  27. data/lib/prism/node.rb +2282 -4754
  28. data/lib/prism/node_ext.rb +72 -11
  29. data/lib/prism/parse_result/errors.rb +65 -0
  30. data/lib/prism/parse_result/newlines.rb +28 -28
  31. data/lib/prism/parse_result.rb +25 -2
  32. data/lib/prism/reflection.rb +7 -7
  33. data/lib/prism/serialize.rb +468 -610
  34. data/lib/prism/translation/parser/compiler.rb +18 -18
  35. data/lib/prism/translation/parser/lexer.rb +1 -1
  36. data/lib/prism/translation/parser.rb +3 -3
  37. data/lib/prism/translation/ripper.rb +14 -14
  38. data/lib/prism/translation/ruby_parser.rb +43 -7
  39. data/prism.gemspec +3 -1
  40. data/rbi/prism/dsl.rbi +521 -0
  41. data/rbi/prism/node.rbi +1456 -5616
  42. data/rbi/prism.rbi +16 -16
  43. data/sig/prism/dsl.rbs +189 -305
  44. data/sig/prism/node.rbs +702 -603
  45. data/sig/prism/parse_result.rbs +2 -0
  46. data/src/diagnostic.c +22 -6
  47. data/src/node.c +277 -284
  48. data/src/options.c +18 -0
  49. data/src/prettyprint.c +99 -108
  50. data/src/prism.c +1282 -760
  51. data/src/regexp.c +72 -4
  52. data/src/serialize.c +165 -50
  53. data/src/token_type.c +2 -2
  54. data/src/util/pm_integer.c +14 -14
  55. data/src/util/pm_newline_list.c +29 -0
  56. data/src/util/pm_string.c +9 -5
  57. metadata +4 -2
data/src/prettyprint.c CHANGED
@@ -1,10 +1,10 @@
1
- /******************************************************************************/
1
+ /*----------------------------------------------------------------------------*/
2
2
  /* This file is generated by the templates/template.rb script and should not */
3
3
  /* be modified manually. See */
4
4
  /* templates/src/prettyprint.c.erb */
5
5
  /* if you are looking to modify the */
6
6
  /* template */
7
- /******************************************************************************/
7
+ /*----------------------------------------------------------------------------*/
8
8
 
9
9
  #include "prism/prettyprint.h"
10
10
 
@@ -226,10 +226,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
226
226
  prettyprint_location(output_buffer, parser, &node->location);
227
227
  pm_buffer_append_string(output_buffer, ")\n", 2);
228
228
 
229
- // flags
229
+ // ArgumentsNodeFlags
230
230
  {
231
231
  pm_buffer_concat(output_buffer, prefix_buffer);
232
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
232
+ pm_buffer_append_string(output_buffer, "+-- ArgumentsNodeFlags:", 23);
233
233
  bool found = false;
234
234
  if (cast->base.flags & PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORDS) {
235
235
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -241,6 +241,11 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
241
241
  pm_buffer_append_string(output_buffer, " contains_keyword_splat", 23);
242
242
  found = true;
243
243
  }
244
+ if (cast->base.flags & PM_ARGUMENTS_NODE_FLAGS_CONTAINS_SPLAT) {
245
+ if (found) pm_buffer_append_byte(output_buffer, ',');
246
+ pm_buffer_append_string(output_buffer, " contains_splat", 15);
247
+ found = true;
248
+ }
244
249
  if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
245
250
  pm_buffer_append_byte(output_buffer, '\n');
246
251
  }
@@ -271,10 +276,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
271
276
  prettyprint_location(output_buffer, parser, &node->location);
272
277
  pm_buffer_append_string(output_buffer, ")\n", 2);
273
278
 
274
- // flags
279
+ // ArrayNodeFlags
275
280
  {
276
281
  pm_buffer_concat(output_buffer, prefix_buffer);
277
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
282
+ pm_buffer_append_string(output_buffer, "+-- ArrayNodeFlags:", 19);
278
283
  bool found = false;
279
284
  if (cast->base.flags & PM_ARRAY_NODE_FLAGS_CONTAINS_SPLAT) {
280
285
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -702,10 +707,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
702
707
  prettyprint_location(output_buffer, parser, &node->location);
703
708
  pm_buffer_append_string(output_buffer, ")\n", 2);
704
709
 
705
- // flags
710
+ // ParameterFlags
706
711
  {
707
712
  pm_buffer_concat(output_buffer, prefix_buffer);
708
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
713
+ pm_buffer_append_string(output_buffer, "+-- ParameterFlags:", 19);
709
714
  bool found = false;
710
715
  if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
711
716
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -811,10 +816,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
811
816
  prettyprint_location(output_buffer, parser, &node->location);
812
817
  pm_buffer_append_string(output_buffer, ")\n", 2);
813
818
 
814
- // flags
819
+ // ParameterFlags
815
820
  {
816
821
  pm_buffer_concat(output_buffer, prefix_buffer);
817
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
822
+ pm_buffer_append_string(output_buffer, "+-- ParameterFlags:", 19);
818
823
  bool found = false;
819
824
  if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
820
825
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -986,10 +991,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
986
991
  prettyprint_location(output_buffer, parser, &node->location);
987
992
  pm_buffer_append_string(output_buffer, ")\n", 2);
988
993
 
989
- // flags
994
+ // CallNodeFlags
990
995
  {
991
996
  pm_buffer_concat(output_buffer, prefix_buffer);
992
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
997
+ pm_buffer_append_string(output_buffer, "+-- CallNodeFlags:", 18);
993
998
  bool found = false;
994
999
  if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
995
1000
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -1115,10 +1120,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
1115
1120
  prettyprint_location(output_buffer, parser, &node->location);
1116
1121
  pm_buffer_append_string(output_buffer, ")\n", 2);
1117
1122
 
1118
- // flags
1123
+ // CallNodeFlags
1119
1124
  {
1120
1125
  pm_buffer_concat(output_buffer, prefix_buffer);
1121
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
1126
+ pm_buffer_append_string(output_buffer, "+-- CallNodeFlags:", 18);
1122
1127
  bool found = false;
1123
1128
  if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
1124
1129
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -1276,10 +1281,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
1276
1281
  prettyprint_location(output_buffer, parser, &node->location);
1277
1282
  pm_buffer_append_string(output_buffer, ")\n", 2);
1278
1283
 
1279
- // flags
1284
+ // CallNodeFlags
1280
1285
  {
1281
1286
  pm_buffer_concat(output_buffer, prefix_buffer);
1282
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
1287
+ pm_buffer_append_string(output_buffer, "+-- CallNodeFlags:", 18);
1283
1288
  bool found = false;
1284
1289
  if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
1285
1290
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -1414,10 +1419,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
1414
1419
  prettyprint_location(output_buffer, parser, &node->location);
1415
1420
  pm_buffer_append_string(output_buffer, ")\n", 2);
1416
1421
 
1417
- // flags
1422
+ // CallNodeFlags
1418
1423
  {
1419
1424
  pm_buffer_concat(output_buffer, prefix_buffer);
1420
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
1425
+ pm_buffer_append_string(output_buffer, "+-- CallNodeFlags:", 18);
1421
1426
  bool found = false;
1422
1427
  if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
1423
1428
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -1543,10 +1548,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
1543
1548
  prettyprint_location(output_buffer, parser, &node->location);
1544
1549
  pm_buffer_append_string(output_buffer, ")\n", 2);
1545
1550
 
1546
- // flags
1551
+ // CallNodeFlags
1547
1552
  {
1548
1553
  pm_buffer_concat(output_buffer, prefix_buffer);
1549
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
1554
+ pm_buffer_append_string(output_buffer, "+-- CallNodeFlags:", 18);
1550
1555
  bool found = false;
1551
1556
  if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
1552
1557
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -1707,11 +1712,11 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
1707
1712
  }
1708
1713
  }
1709
1714
 
1710
- // consequent
1715
+ // else_clause
1711
1716
  {
1712
1717
  pm_buffer_concat(output_buffer, prefix_buffer);
1713
- pm_buffer_append_string(output_buffer, "+-- consequent:", 15);
1714
- if (cast->consequent == NULL) {
1718
+ pm_buffer_append_string(output_buffer, "+-- else_clause:", 16);
1719
+ if (cast->else_clause == NULL) {
1715
1720
  pm_buffer_append_string(output_buffer, " nil\n", 5);
1716
1721
  } else {
1717
1722
  pm_buffer_append_byte(output_buffer, '\n');
@@ -1719,7 +1724,7 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
1719
1724
  size_t prefix_length = prefix_buffer->length;
1720
1725
  pm_buffer_append_string(prefix_buffer, "| ", 4);
1721
1726
  pm_buffer_concat(output_buffer, prefix_buffer);
1722
- prettyprint_node(output_buffer, parser, (pm_node_t *) cast->consequent, prefix_buffer);
1727
+ prettyprint_node(output_buffer, parser, (pm_node_t *) cast->else_clause, prefix_buffer);
1723
1728
  prefix_buffer->length = prefix_length;
1724
1729
  }
1725
1730
  }
@@ -1791,11 +1796,11 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
1791
1796
  }
1792
1797
  }
1793
1798
 
1794
- // consequent
1799
+ // else_clause
1795
1800
  {
1796
1801
  pm_buffer_concat(output_buffer, prefix_buffer);
1797
- pm_buffer_append_string(output_buffer, "+-- consequent:", 15);
1798
- if (cast->consequent == NULL) {
1802
+ pm_buffer_append_string(output_buffer, "+-- else_clause:", 16);
1803
+ if (cast->else_clause == NULL) {
1799
1804
  pm_buffer_append_string(output_buffer, " nil\n", 5);
1800
1805
  } else {
1801
1806
  pm_buffer_append_byte(output_buffer, '\n');
@@ -1803,7 +1808,7 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
1803
1808
  size_t prefix_length = prefix_buffer->length;
1804
1809
  pm_buffer_append_string(prefix_buffer, "| ", 4);
1805
1810
  pm_buffer_concat(output_buffer, prefix_buffer);
1806
- prettyprint_node(output_buffer, parser, (pm_node_t *) cast->consequent, prefix_buffer);
1811
+ prettyprint_node(output_buffer, parser, (pm_node_t *) cast->else_clause, prefix_buffer);
1807
1812
  prefix_buffer->length = prefix_length;
1808
1813
  }
1809
1814
  }
@@ -3332,10 +3337,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
3332
3337
  prettyprint_location(output_buffer, parser, &node->location);
3333
3338
  pm_buffer_append_string(output_buffer, ")\n", 2);
3334
3339
 
3335
- // flags
3340
+ // RangeFlags
3336
3341
  {
3337
3342
  pm_buffer_concat(output_buffer, prefix_buffer);
3338
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
3343
+ pm_buffer_append_string(output_buffer, "+-- RangeFlags:", 15);
3339
3344
  bool found = false;
3340
3345
  if (cast->base.flags & PM_RANGE_FLAGS_EXCLUDE_END) {
3341
3346
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -4020,11 +4025,11 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
4020
4025
  }
4021
4026
  }
4022
4027
 
4023
- // consequent
4028
+ // subsequent
4024
4029
  {
4025
4030
  pm_buffer_concat(output_buffer, prefix_buffer);
4026
- pm_buffer_append_string(output_buffer, "+-- consequent:", 15);
4027
- if (cast->consequent == NULL) {
4031
+ pm_buffer_append_string(output_buffer, "+-- subsequent:", 15);
4032
+ if (cast->subsequent == NULL) {
4028
4033
  pm_buffer_append_string(output_buffer, " nil\n", 5);
4029
4034
  } else {
4030
4035
  pm_buffer_append_byte(output_buffer, '\n');
@@ -4032,7 +4037,7 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
4032
4037
  size_t prefix_length = prefix_buffer->length;
4033
4038
  pm_buffer_append_string(prefix_buffer, "| ", 4);
4034
4039
  pm_buffer_concat(output_buffer, prefix_buffer);
4035
- prettyprint_node(output_buffer, parser, (pm_node_t *) cast->consequent, prefix_buffer);
4040
+ prettyprint_node(output_buffer, parser, (pm_node_t *) cast->subsequent, prefix_buffer);
4036
4041
  prefix_buffer->length = prefix_length;
4037
4042
  }
4038
4043
  }
@@ -4176,10 +4181,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
4176
4181
  prettyprint_location(output_buffer, parser, &node->location);
4177
4182
  pm_buffer_append_string(output_buffer, ")\n", 2);
4178
4183
 
4179
- // flags
4184
+ // CallNodeFlags
4180
4185
  {
4181
4186
  pm_buffer_concat(output_buffer, prefix_buffer);
4182
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
4187
+ pm_buffer_append_string(output_buffer, "+-- CallNodeFlags:", 18);
4183
4188
  bool found = false;
4184
4189
  if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
4185
4190
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -4329,10 +4334,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
4329
4334
  prettyprint_location(output_buffer, parser, &node->location);
4330
4335
  pm_buffer_append_string(output_buffer, ")\n", 2);
4331
4336
 
4332
- // flags
4337
+ // CallNodeFlags
4333
4338
  {
4334
4339
  pm_buffer_concat(output_buffer, prefix_buffer);
4335
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
4340
+ pm_buffer_append_string(output_buffer, "+-- CallNodeFlags:", 18);
4336
4341
  bool found = false;
4337
4342
  if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
4338
4343
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -4491,10 +4496,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
4491
4496
  prettyprint_location(output_buffer, parser, &node->location);
4492
4497
  pm_buffer_append_string(output_buffer, ")\n", 2);
4493
4498
 
4494
- // flags
4499
+ // CallNodeFlags
4495
4500
  {
4496
4501
  pm_buffer_concat(output_buffer, prefix_buffer);
4497
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
4502
+ pm_buffer_append_string(output_buffer, "+-- CallNodeFlags:", 18);
4498
4503
  bool found = false;
4499
4504
  if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
4500
4505
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -4644,10 +4649,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
4644
4649
  prettyprint_location(output_buffer, parser, &node->location);
4645
4650
  pm_buffer_append_string(output_buffer, ")\n", 2);
4646
4651
 
4647
- // flags
4652
+ // CallNodeFlags
4648
4653
  {
4649
4654
  pm_buffer_concat(output_buffer, prefix_buffer);
4650
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
4655
+ pm_buffer_append_string(output_buffer, "+-- CallNodeFlags:", 18);
4651
4656
  bool found = false;
4652
4657
  if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
4653
4658
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -5011,10 +5016,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
5011
5016
  prettyprint_location(output_buffer, parser, &node->location);
5012
5017
  pm_buffer_append_string(output_buffer, ")\n", 2);
5013
5018
 
5014
- // flags
5019
+ // IntegerBaseFlags
5015
5020
  {
5016
5021
  pm_buffer_concat(output_buffer, prefix_buffer);
5017
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
5022
+ pm_buffer_append_string(output_buffer, "+-- IntegerBaseFlags:", 21);
5018
5023
  bool found = false;
5019
5024
  if (cast->base.flags & PM_INTEGER_BASE_FLAGS_BINARY) {
5020
5025
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -5058,10 +5063,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
5058
5063
  prettyprint_location(output_buffer, parser, &node->location);
5059
5064
  pm_buffer_append_string(output_buffer, ")\n", 2);
5060
5065
 
5061
- // flags
5066
+ // RegularExpressionFlags
5062
5067
  {
5063
5068
  pm_buffer_concat(output_buffer, prefix_buffer);
5064
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
5069
+ pm_buffer_append_string(output_buffer, "+-- RegularExpressionFlags:", 27);
5065
5070
  bool found = false;
5066
5071
  if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE) {
5067
5072
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -5172,10 +5177,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
5172
5177
  prettyprint_location(output_buffer, parser, &node->location);
5173
5178
  pm_buffer_append_string(output_buffer, ")\n", 2);
5174
5179
 
5175
- // flags
5180
+ // RegularExpressionFlags
5176
5181
  {
5177
5182
  pm_buffer_concat(output_buffer, prefix_buffer);
5178
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
5183
+ pm_buffer_append_string(output_buffer, "+-- RegularExpressionFlags:", 27);
5179
5184
  bool found = false;
5180
5185
  if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE) {
5181
5186
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -5286,10 +5291,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
5286
5291
  prettyprint_location(output_buffer, parser, &node->location);
5287
5292
  pm_buffer_append_string(output_buffer, ")\n", 2);
5288
5293
 
5289
- // flags
5294
+ // InterpolatedStringNodeFlags
5290
5295
  {
5291
5296
  pm_buffer_concat(output_buffer, prefix_buffer);
5292
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
5297
+ pm_buffer_append_string(output_buffer, "+-- InterpolatedStringNodeFlags:", 32);
5293
5298
  bool found = false;
5294
5299
  if (cast->base.flags & PM_INTERPOLATED_STRING_NODE_FLAGS_FROZEN) {
5295
5300
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -5485,10 +5490,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
5485
5490
  prettyprint_location(output_buffer, parser, &node->location);
5486
5491
  pm_buffer_append_string(output_buffer, ")\n", 2);
5487
5492
 
5488
- // flags
5493
+ // KeywordHashNodeFlags
5489
5494
  {
5490
5495
  pm_buffer_concat(output_buffer, prefix_buffer);
5491
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
5496
+ pm_buffer_append_string(output_buffer, "+-- KeywordHashNodeFlags:", 25);
5492
5497
  bool found = false;
5493
5498
  if (cast->base.flags & PM_KEYWORD_HASH_NODE_FLAGS_SYMBOL_KEYS) {
5494
5499
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -5525,10 +5530,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
5525
5530
  prettyprint_location(output_buffer, parser, &node->location);
5526
5531
  pm_buffer_append_string(output_buffer, ")\n", 2);
5527
5532
 
5528
- // flags
5533
+ // ParameterFlags
5529
5534
  {
5530
5535
  pm_buffer_concat(output_buffer, prefix_buffer);
5531
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
5536
+ pm_buffer_append_string(output_buffer, "+-- ParameterFlags:", 19);
5532
5537
  bool found = false;
5533
5538
  if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
5534
5539
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -5979,10 +5984,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
5979
5984
  prettyprint_location(output_buffer, parser, &node->location);
5980
5985
  pm_buffer_append_string(output_buffer, ")\n", 2);
5981
5986
 
5982
- // flags
5987
+ // RegularExpressionFlags
5983
5988
  {
5984
5989
  pm_buffer_concat(output_buffer, prefix_buffer);
5985
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
5990
+ pm_buffer_append_string(output_buffer, "+-- RegularExpressionFlags:", 27);
5986
5991
  bool found = false;
5987
5992
  if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE) {
5988
5993
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -6634,10 +6639,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
6634
6639
  prettyprint_location(output_buffer, parser, &node->location);
6635
6640
  pm_buffer_append_string(output_buffer, ")\n", 2);
6636
6641
 
6637
- // flags
6642
+ // ParameterFlags
6638
6643
  {
6639
6644
  pm_buffer_concat(output_buffer, prefix_buffer);
6640
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
6645
+ pm_buffer_append_string(output_buffer, "+-- ParameterFlags:", 19);
6641
6646
  bool found = false;
6642
6647
  if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
6643
6648
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -6690,10 +6695,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
6690
6695
  prettyprint_location(output_buffer, parser, &node->location);
6691
6696
  pm_buffer_append_string(output_buffer, ")\n", 2);
6692
6697
 
6693
- // flags
6698
+ // ParameterFlags
6694
6699
  {
6695
6700
  pm_buffer_concat(output_buffer, prefix_buffer);
6696
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
6701
+ pm_buffer_append_string(output_buffer, "+-- ParameterFlags:", 19);
6697
6702
  bool found = false;
6698
6703
  if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
6699
6704
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -7229,10 +7234,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
7229
7234
  prettyprint_location(output_buffer, parser, &node->location);
7230
7235
  pm_buffer_append_string(output_buffer, ")\n", 2);
7231
7236
 
7232
- // flags
7237
+ // RangeFlags
7233
7238
  {
7234
7239
  pm_buffer_concat(output_buffer, prefix_buffer);
7235
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
7240
+ pm_buffer_append_string(output_buffer, "+-- RangeFlags:", 15);
7236
7241
  bool found = false;
7237
7242
  if (cast->base.flags & PM_RANGE_FLAGS_EXCLUDE_END) {
7238
7243
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -7297,10 +7302,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
7297
7302
  prettyprint_location(output_buffer, parser, &node->location);
7298
7303
  pm_buffer_append_string(output_buffer, ")\n", 2);
7299
7304
 
7300
- // flags
7305
+ // IntegerBaseFlags
7301
7306
  {
7302
7307
  pm_buffer_concat(output_buffer, prefix_buffer);
7303
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
7308
+ pm_buffer_append_string(output_buffer, "+-- IntegerBaseFlags:", 21);
7304
7309
  bool found = false;
7305
7310
  if (cast->base.flags & PM_INTEGER_BASE_FLAGS_BINARY) {
7306
7311
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -7361,10 +7366,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
7361
7366
  prettyprint_location(output_buffer, parser, &node->location);
7362
7367
  pm_buffer_append_string(output_buffer, ")\n", 2);
7363
7368
 
7364
- // flags
7369
+ // RegularExpressionFlags
7365
7370
  {
7366
7371
  pm_buffer_concat(output_buffer, prefix_buffer);
7367
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
7372
+ pm_buffer_append_string(output_buffer, "+-- RegularExpressionFlags:", 27);
7368
7373
  bool found = false;
7369
7374
  if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE) {
7370
7375
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -7478,10 +7483,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
7478
7483
  prettyprint_location(output_buffer, parser, &node->location);
7479
7484
  pm_buffer_append_string(output_buffer, ")\n", 2);
7480
7485
 
7481
- // flags
7486
+ // ParameterFlags
7482
7487
  {
7483
7488
  pm_buffer_concat(output_buffer, prefix_buffer);
7484
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
7489
+ pm_buffer_append_string(output_buffer, "+-- ParameterFlags:", 19);
7485
7490
  bool found = false;
7486
7491
  if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
7487
7492
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -7521,10 +7526,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
7521
7526
  prettyprint_location(output_buffer, parser, &node->location);
7522
7527
  pm_buffer_append_string(output_buffer, ")\n", 2);
7523
7528
 
7524
- // flags
7529
+ // ParameterFlags
7525
7530
  {
7526
7531
  pm_buffer_concat(output_buffer, prefix_buffer);
7527
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
7532
+ pm_buffer_append_string(output_buffer, "+-- ParameterFlags:", 19);
7528
7533
  bool found = false;
7529
7534
  if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
7530
7535
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -7678,11 +7683,11 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
7678
7683
  }
7679
7684
  }
7680
7685
 
7681
- // consequent
7686
+ // subsequent
7682
7687
  {
7683
7688
  pm_buffer_concat(output_buffer, prefix_buffer);
7684
- pm_buffer_append_string(output_buffer, "+-- consequent:", 15);
7685
- if (cast->consequent == NULL) {
7689
+ pm_buffer_append_string(output_buffer, "+-- subsequent:", 15);
7690
+ if (cast->subsequent == NULL) {
7686
7691
  pm_buffer_append_string(output_buffer, " nil\n", 5);
7687
7692
  } else {
7688
7693
  pm_buffer_append_byte(output_buffer, '\n');
@@ -7690,7 +7695,7 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
7690
7695
  size_t prefix_length = prefix_buffer->length;
7691
7696
  pm_buffer_append_string(prefix_buffer, " ", 4);
7692
7697
  pm_buffer_concat(output_buffer, prefix_buffer);
7693
- prettyprint_node(output_buffer, parser, (pm_node_t *) cast->consequent, prefix_buffer);
7698
+ prettyprint_node(output_buffer, parser, (pm_node_t *) cast->subsequent, prefix_buffer);
7694
7699
  prefix_buffer->length = prefix_length;
7695
7700
  }
7696
7701
  }
@@ -7703,10 +7708,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
7703
7708
  prettyprint_location(output_buffer, parser, &node->location);
7704
7709
  pm_buffer_append_string(output_buffer, ")\n", 2);
7705
7710
 
7706
- // flags
7711
+ // ParameterFlags
7707
7712
  {
7708
7713
  pm_buffer_concat(output_buffer, prefix_buffer);
7709
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
7714
+ pm_buffer_append_string(output_buffer, "+-- ParameterFlags:", 19);
7710
7715
  bool found = false;
7711
7716
  if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
7712
7717
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -7773,20 +7778,6 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
7773
7778
  prettyprint_location(output_buffer, parser, &node->location);
7774
7779
  pm_buffer_append_string(output_buffer, ")\n", 2);
7775
7780
 
7776
- // flags
7777
- {
7778
- pm_buffer_concat(output_buffer, prefix_buffer);
7779
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
7780
- bool found = false;
7781
- if (cast->base.flags & PM_RETURN_NODE_FLAGS_REDUNDANT) {
7782
- if (found) pm_buffer_append_byte(output_buffer, ',');
7783
- pm_buffer_append_string(output_buffer, " redundant", 10);
7784
- found = true;
7785
- }
7786
- if (!found) pm_buffer_append_string(output_buffer, " nil", 4);
7787
- pm_buffer_append_byte(output_buffer, '\n');
7788
- }
7789
-
7790
7781
  // keyword_loc
7791
7782
  {
7792
7783
  pm_buffer_concat(output_buffer, prefix_buffer);
@@ -7831,10 +7822,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
7831
7822
  prettyprint_location(output_buffer, parser, &node->location);
7832
7823
  pm_buffer_append_string(output_buffer, ")\n", 2);
7833
7824
 
7834
- // flags
7825
+ // ShareableConstantNodeFlags
7835
7826
  {
7836
7827
  pm_buffer_concat(output_buffer, prefix_buffer);
7837
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
7828
+ pm_buffer_append_string(output_buffer, "+-- ShareableConstantNodeFlags:", 31);
7838
7829
  bool found = false;
7839
7830
  if (cast->base.flags & PM_SHAREABLE_CONSTANT_NODE_FLAGS_LITERAL) {
7840
7831
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -7969,10 +7960,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
7969
7960
  prettyprint_location(output_buffer, parser, &node->location);
7970
7961
  pm_buffer_append_string(output_buffer, ")\n", 2);
7971
7962
 
7972
- // flags
7963
+ // StringFlags
7973
7964
  {
7974
7965
  pm_buffer_concat(output_buffer, prefix_buffer);
7975
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
7966
+ pm_buffer_append_string(output_buffer, "+-- StringFlags:", 16);
7976
7967
  bool found = false;
7977
7968
  if (cast->base.flags & PM_STRING_FLAGS_FORCED_UTF8_ENCODING) {
7978
7969
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -8085,10 +8076,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
8085
8076
  prettyprint_location(output_buffer, parser, &node->location);
8086
8077
  pm_buffer_append_string(output_buffer, ")\n", 2);
8087
8078
 
8088
- // flags
8079
+ // StringFlags
8089
8080
  {
8090
8081
  pm_buffer_concat(output_buffer, prefix_buffer);
8091
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
8082
+ pm_buffer_append_string(output_buffer, "+-- StringFlags:", 16);
8092
8083
  bool found = false;
8093
8084
  if (cast->base.flags & PM_STRING_FLAGS_FORCED_UTF8_ENCODING) {
8094
8085
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -8261,10 +8252,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
8261
8252
  prettyprint_location(output_buffer, parser, &node->location);
8262
8253
  pm_buffer_append_string(output_buffer, ")\n", 2);
8263
8254
 
8264
- // flags
8255
+ // SymbolFlags
8265
8256
  {
8266
8257
  pm_buffer_concat(output_buffer, prefix_buffer);
8267
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
8258
+ pm_buffer_append_string(output_buffer, "+-- SymbolFlags:", 16);
8268
8259
  bool found = false;
8269
8260
  if (cast->base.flags & PM_SYMBOL_FLAGS_FORCED_UTF8_ENCODING) {
8270
8261
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -8453,11 +8444,11 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
8453
8444
  }
8454
8445
  }
8455
8446
 
8456
- // consequent
8447
+ // else_clause
8457
8448
  {
8458
8449
  pm_buffer_concat(output_buffer, prefix_buffer);
8459
- pm_buffer_append_string(output_buffer, "+-- consequent:", 15);
8460
- if (cast->consequent == NULL) {
8450
+ pm_buffer_append_string(output_buffer, "+-- else_clause:", 16);
8451
+ if (cast->else_clause == NULL) {
8461
8452
  pm_buffer_append_string(output_buffer, " nil\n", 5);
8462
8453
  } else {
8463
8454
  pm_buffer_append_byte(output_buffer, '\n');
@@ -8465,7 +8456,7 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
8465
8456
  size_t prefix_length = prefix_buffer->length;
8466
8457
  pm_buffer_append_string(prefix_buffer, "| ", 4);
8467
8458
  pm_buffer_concat(output_buffer, prefix_buffer);
8468
- prettyprint_node(output_buffer, parser, (pm_node_t *) cast->consequent, prefix_buffer);
8459
+ prettyprint_node(output_buffer, parser, (pm_node_t *) cast->else_clause, prefix_buffer);
8469
8460
  prefix_buffer->length = prefix_length;
8470
8461
  }
8471
8462
  }
@@ -8494,10 +8485,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
8494
8485
  prettyprint_location(output_buffer, parser, &node->location);
8495
8486
  pm_buffer_append_string(output_buffer, ")\n", 2);
8496
8487
 
8497
- // flags
8488
+ // LoopFlags
8498
8489
  {
8499
8490
  pm_buffer_concat(output_buffer, prefix_buffer);
8500
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
8491
+ pm_buffer_append_string(output_buffer, "+-- LoopFlags:", 14);
8501
8492
  bool found = false;
8502
8493
  if (cast->base.flags & PM_LOOP_FLAGS_BEGIN_MODIFIER) {
8503
8494
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -8645,10 +8636,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
8645
8636
  prettyprint_location(output_buffer, parser, &node->location);
8646
8637
  pm_buffer_append_string(output_buffer, ")\n", 2);
8647
8638
 
8648
- // flags
8639
+ // LoopFlags
8649
8640
  {
8650
8641
  pm_buffer_concat(output_buffer, prefix_buffer);
8651
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
8642
+ pm_buffer_append_string(output_buffer, "+-- LoopFlags:", 14);
8652
8643
  bool found = false;
8653
8644
  if (cast->base.flags & PM_LOOP_FLAGS_BEGIN_MODIFIER) {
8654
8645
  if (found) pm_buffer_append_byte(output_buffer, ',');
@@ -8725,10 +8716,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
8725
8716
  prettyprint_location(output_buffer, parser, &node->location);
8726
8717
  pm_buffer_append_string(output_buffer, ")\n", 2);
8727
8718
 
8728
- // flags
8719
+ // EncodingFlags
8729
8720
  {
8730
8721
  pm_buffer_concat(output_buffer, prefix_buffer);
8731
- pm_buffer_append_string(output_buffer, "+-- flags:", 10);
8722
+ pm_buffer_append_string(output_buffer, "+-- EncodingFlags:", 18);
8732
8723
  bool found = false;
8733
8724
  if (cast->base.flags & PM_ENCODING_FLAGS_FORCED_UTF8_ENCODING) {
8734
8725
  if (found) pm_buffer_append_byte(output_buffer, ',');