prism 0.19.0 → 0.24.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +102 -1
- data/Makefile +5 -0
- data/README.md +9 -6
- data/config.yml +236 -38
- data/docs/build_system.md +19 -2
- data/docs/cruby_compilation.md +27 -0
- data/docs/parser_translation.md +34 -0
- data/docs/parsing_rules.md +19 -0
- data/docs/releasing.md +84 -16
- data/docs/ruby_api.md +1 -1
- data/docs/ruby_parser_translation.md +19 -0
- data/docs/serialization.md +19 -5
- data/ext/prism/api_node.c +1989 -1525
- data/ext/prism/extension.c +130 -30
- data/ext/prism/extension.h +2 -2
- data/include/prism/ast.h +1700 -505
- data/include/prism/defines.h +8 -0
- data/include/prism/diagnostic.h +49 -7
- data/include/prism/encoding.h +17 -0
- data/include/prism/options.h +40 -14
- data/include/prism/parser.h +34 -18
- data/include/prism/util/pm_buffer.h +9 -0
- data/include/prism/util/pm_constant_pool.h +18 -0
- data/include/prism/util/pm_newline_list.h +4 -14
- data/include/prism/util/pm_strpbrk.h +4 -1
- data/include/prism/version.h +2 -2
- data/include/prism.h +19 -2
- data/lib/prism/debug.rb +11 -5
- data/lib/prism/desugar_compiler.rb +225 -80
- data/lib/prism/dot_visitor.rb +36 -14
- data/lib/prism/dsl.rb +302 -299
- data/lib/prism/ffi.rb +107 -76
- data/lib/prism/lex_compat.rb +17 -1
- data/lib/prism/node.rb +4580 -2607
- data/lib/prism/node_ext.rb +27 -4
- data/lib/prism/parse_result.rb +75 -29
- data/lib/prism/serialize.rb +633 -305
- data/lib/prism/translation/parser/compiler.rb +1838 -0
- data/lib/prism/translation/parser/lexer.rb +335 -0
- data/lib/prism/translation/parser/rubocop.rb +45 -0
- data/lib/prism/translation/parser.rb +190 -0
- data/lib/prism/translation/parser33.rb +12 -0
- data/lib/prism/translation/parser34.rb +12 -0
- data/lib/prism/translation/ripper.rb +696 -0
- data/lib/prism/translation/ruby_parser.rb +1521 -0
- data/lib/prism/translation.rb +11 -0
- data/lib/prism.rb +1 -1
- data/prism.gemspec +18 -7
- data/rbi/prism.rbi +150 -88
- data/rbi/prism_static.rbi +15 -3
- data/sig/prism.rbs +996 -961
- data/sig/prism_static.rbs +123 -46
- data/src/diagnostic.c +264 -219
- data/src/encoding.c +21 -26
- data/src/node.c +2 -6
- data/src/options.c +29 -5
- data/src/prettyprint.c +176 -44
- data/src/prism.c +1499 -564
- data/src/serialize.c +35 -21
- data/src/token_type.c +353 -4
- data/src/util/pm_buffer.c +11 -0
- data/src/util/pm_constant_pool.c +37 -11
- data/src/util/pm_newline_list.c +6 -15
- data/src/util/pm_string.c +0 -7
- data/src/util/pm_strpbrk.c +122 -14
- metadata +16 -5
- data/docs/building.md +0 -29
- data/lib/prism/ripper_compat.rb +0 -207
data/src/encoding.c
CHANGED
@@ -2252,13 +2252,13 @@ static const uint8_t pm_utf_8_dfa[] = {
|
|
2252
2252
|
*/
|
2253
2253
|
static pm_unicode_codepoint_t
|
2254
2254
|
pm_utf_8_codepoint(const uint8_t *b, ptrdiff_t n, size_t *width) {
|
2255
|
-
assert(n >=
|
2256
|
-
size_t maximum = (size_t) n;
|
2255
|
+
assert(n >= 0);
|
2257
2256
|
|
2257
|
+
size_t maximum = (n > 4) ? 4 : ((size_t) n);
|
2258
2258
|
uint32_t codepoint;
|
2259
2259
|
uint32_t state = 0;
|
2260
2260
|
|
2261
|
-
for (size_t index = 0; index <
|
2261
|
+
for (size_t index = 0; index < maximum; index++) {
|
2262
2262
|
uint32_t byte = b[index];
|
2263
2263
|
uint32_t type = pm_utf_8_dfa[byte];
|
2264
2264
|
|
@@ -2267,7 +2267,7 @@ pm_utf_8_codepoint(const uint8_t *b, ptrdiff_t n, size_t *width) {
|
|
2267
2267
|
(0xffu >> type) & (byte);
|
2268
2268
|
|
2269
2269
|
state = pm_utf_8_dfa[256 + (state * 16) + type];
|
2270
|
-
if (
|
2270
|
+
if (state == 0) {
|
2271
2271
|
*width = index + 1;
|
2272
2272
|
return (pm_unicode_codepoint_t) codepoint;
|
2273
2273
|
}
|
@@ -2277,11 +2277,22 @@ pm_utf_8_codepoint(const uint8_t *b, ptrdiff_t n, size_t *width) {
|
|
2277
2277
|
return 0;
|
2278
2278
|
}
|
2279
2279
|
|
2280
|
-
|
2280
|
+
/**
|
2281
|
+
* Return the size of the next character in the UTF-8 encoding.
|
2282
|
+
*/
|
2283
|
+
size_t
|
2281
2284
|
pm_encoding_utf_8_char_width(const uint8_t *b, ptrdiff_t n) {
|
2282
|
-
|
2283
|
-
|
2284
|
-
|
2285
|
+
assert(n >= 0);
|
2286
|
+
|
2287
|
+
size_t maximum = (n > 4) ? 4 : ((size_t) n);
|
2288
|
+
uint32_t state = 0;
|
2289
|
+
|
2290
|
+
for (size_t index = 0; index < maximum; index++) {
|
2291
|
+
state = pm_utf_8_dfa[256 + (state * 16) + pm_utf_8_dfa[b[index]]];
|
2292
|
+
if (state == 0) return index + 1;
|
2293
|
+
}
|
2294
|
+
|
2295
|
+
return 0;
|
2285
2296
|
}
|
2286
2297
|
|
2287
2298
|
/**
|
@@ -4183,15 +4194,6 @@ pm_encoding_gbk_char_width(const uint8_t *b, ptrdiff_t n) {
|
|
4183
4194
|
return 0;
|
4184
4195
|
}
|
4185
4196
|
|
4186
|
-
/**
|
4187
|
-
* Returns the size of the next character in the KOI-8 encoding. This means
|
4188
|
-
* checking if it's a valid codepoint in KOI-8 and if it is returning 1.
|
4189
|
-
*/
|
4190
|
-
static size_t
|
4191
|
-
pm_encoding_koi8_char_width(const uint8_t *b, PRISM_ATTRIBUTE_UNUSED ptrdiff_t n) {
|
4192
|
-
return ((*b >= 0x20 && *b <= 0x7E) || (*b >= 0x80)) ? 1 : 0;
|
4193
|
-
}
|
4194
|
-
|
4195
4197
|
/**
|
4196
4198
|
* Returns the size of the next character in the Shift_JIS encoding, or 0 if a
|
4197
4199
|
* character cannot be decoded from the given bytes.
|
@@ -4649,7 +4651,7 @@ const pm_encoding_t pm_encodings[] = {
|
|
4649
4651
|
},
|
4650
4652
|
[PM_ENCODING_KOI8_R] = {
|
4651
4653
|
.name = "KOI8-R",
|
4652
|
-
.char_width =
|
4654
|
+
.char_width = pm_encoding_single_char_width,
|
4653
4655
|
.alnum_char = pm_encoding_koi8_r_alnum_char,
|
4654
4656
|
.alpha_char = pm_encoding_koi8_r_alpha_char,
|
4655
4657
|
.isupper_char = pm_encoding_koi8_r_isupper_char,
|
@@ -4657,7 +4659,7 @@ const pm_encoding_t pm_encodings[] = {
|
|
4657
4659
|
},
|
4658
4660
|
[PM_ENCODING_KOI8_U] = {
|
4659
4661
|
.name = "KOI8-U",
|
4660
|
-
.char_width =
|
4662
|
+
.char_width = pm_encoding_single_char_width,
|
4661
4663
|
.alnum_char = pm_encoding_koi8_u_alnum_char,
|
4662
4664
|
.alpha_char = pm_encoding_koi8_u_alpha_char,
|
4663
4665
|
.isupper_char = pm_encoding_koi8_u_isupper_char,
|
@@ -5022,10 +5024,6 @@ pm_encoding_find(const uint8_t *start, const uint8_t *end) {
|
|
5022
5024
|
ENCODING2("EUC-CN", "eucCN", PM_ENCODING_GB2312);
|
5023
5025
|
ENCODING2("EUC-TW", "eucTW", PM_ENCODING_EUC_TW);
|
5024
5026
|
ENCODING1("Emacs-Mule", PM_ENCODING_EMACS_MULE);
|
5025
|
-
ENCODING1("external", PM_ENCODING_UTF_8);
|
5026
|
-
break;
|
5027
|
-
case 'F': case 'f':
|
5028
|
-
ENCODING1("filesystem", PM_ENCODING_UTF_8);
|
5029
5027
|
break;
|
5030
5028
|
case 'G': case 'g':
|
5031
5029
|
ENCODING1("GBK", PM_ENCODING_GBK);
|
@@ -5071,9 +5069,6 @@ pm_encoding_find(const uint8_t *start, const uint8_t *end) {
|
|
5071
5069
|
ENCODING1("KOI8-R", PM_ENCODING_KOI8_R);
|
5072
5070
|
ENCODING1("KOI8-U", PM_ENCODING_KOI8_U);
|
5073
5071
|
break;
|
5074
|
-
case 'L': case 'l':
|
5075
|
-
ENCODING1("locale", PM_ENCODING_UTF_8);
|
5076
|
-
break;
|
5077
5072
|
case 'M': case 'm':
|
5078
5073
|
ENCODING1("macCentEuro", PM_ENCODING_MAC_CENT_EURO);
|
5079
5074
|
ENCODING1("macCroatian", PM_ENCODING_MAC_CROATIAN);
|
data/src/node.c
CHANGED
@@ -117,9 +117,7 @@ pm_node_destroy(pm_parser_t *parser, pm_node_t *node) {
|
|
117
117
|
case PM_ASSOC_NODE: {
|
118
118
|
pm_assoc_node_t *cast = (pm_assoc_node_t *) node;
|
119
119
|
pm_node_destroy(parser, (pm_node_t *)cast->key);
|
120
|
-
|
121
|
-
pm_node_destroy(parser, (pm_node_t *)cast->value);
|
122
|
-
}
|
120
|
+
pm_node_destroy(parser, (pm_node_t *)cast->value);
|
123
121
|
break;
|
124
122
|
}
|
125
123
|
#line 58 "node.c.erb"
|
@@ -1223,9 +1221,7 @@ pm_node_memsize_node(pm_node_t *node, pm_memsize_t *memsize) {
|
|
1223
1221
|
pm_assoc_node_t *cast = (pm_assoc_node_t *) node;
|
1224
1222
|
memsize->memsize += sizeof(*cast);
|
1225
1223
|
pm_node_memsize_node((pm_node_t *)cast->key, memsize);
|
1226
|
-
|
1227
|
-
pm_node_memsize_node((pm_node_t *)cast->value, memsize);
|
1228
|
-
}
|
1224
|
+
pm_node_memsize_node((pm_node_t *)cast->value, memsize);
|
1229
1225
|
break;
|
1230
1226
|
}
|
1231
1227
|
#line 103 "node.c.erb"
|
data/src/options.c
CHANGED
@@ -33,11 +33,35 @@ pm_options_frozen_string_literal_set(pm_options_t *options, bool frozen_string_l
|
|
33
33
|
}
|
34
34
|
|
35
35
|
/**
|
36
|
-
* Set the
|
36
|
+
* Set the version option on the given options struct by parsing the given
|
37
|
+
* string. If the string contains an invalid option, this returns false.
|
38
|
+
* Otherwise, it returns true.
|
37
39
|
*/
|
38
|
-
PRISM_EXPORTED_FUNCTION
|
39
|
-
|
40
|
-
|
40
|
+
PRISM_EXPORTED_FUNCTION bool
|
41
|
+
pm_options_version_set(pm_options_t *options, const char *version, size_t length) {
|
42
|
+
if (version == NULL && length == 0) {
|
43
|
+
options->version = PM_OPTIONS_VERSION_LATEST;
|
44
|
+
return true;
|
45
|
+
}
|
46
|
+
|
47
|
+
if (length == 5) {
|
48
|
+
if (strncmp(version, "3.3.0", length) == 0) {
|
49
|
+
options->version = PM_OPTIONS_VERSION_CRUBY_3_3_0;
|
50
|
+
return true;
|
51
|
+
}
|
52
|
+
|
53
|
+
if (strncmp(version, "3.4.0", length) == 0) {
|
54
|
+
options->version = PM_OPTIONS_VERSION_LATEST;
|
55
|
+
return true;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
if (length == 6 && strncmp(version, "latest", length) == 0) {
|
60
|
+
options->version = PM_OPTIONS_VERSION_LATEST;
|
61
|
+
return true;
|
62
|
+
}
|
63
|
+
|
64
|
+
return false;
|
41
65
|
}
|
42
66
|
|
43
67
|
/**
|
@@ -162,7 +186,7 @@ pm_options_read(pm_options_t *options, const char *data) {
|
|
162
186
|
}
|
163
187
|
|
164
188
|
options->frozen_string_literal = *data++;
|
165
|
-
options->
|
189
|
+
options->version = (pm_options_version_t) *data++;
|
166
190
|
|
167
191
|
uint32_t scopes_count = pm_options_read_u32(data);
|
168
192
|
data += 4;
|
data/src/prettyprint.c
CHANGED
@@ -44,9 +44,9 @@ prettyprint_source(pm_buffer_t *output_buffer, const uint8_t *source, size_t len
|
|
44
44
|
|
45
45
|
static inline void
|
46
46
|
prettyprint_location(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm_location_t *location) {
|
47
|
-
pm_line_column_t start = pm_newline_list_line_column(&parser->newline_list, location->start);
|
48
|
-
pm_line_column_t end = pm_newline_list_line_column(&parser->newline_list, location->end);
|
49
|
-
pm_buffer_append_format(output_buffer, "(%
|
47
|
+
pm_line_column_t start = pm_newline_list_line_column(&parser->newline_list, location->start, parser->start_line);
|
48
|
+
pm_line_column_t end = pm_newline_list_line_column(&parser->newline_list, location->end, parser->start_line);
|
49
|
+
pm_buffer_append_format(output_buffer, "(%" PRIi32 ",%" PRIu32 ")-(%" PRIi32 ",%" PRIu32 ")", start.line, start.column, end.line, end.column);
|
50
50
|
}
|
51
51
|
|
52
52
|
static inline void
|
@@ -518,17 +518,13 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
518
518
|
{
|
519
519
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
520
520
|
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 value:", 16);
|
521
|
-
|
522
|
-
pm_buffer_append_string(output_buffer, " \xe2\x88\x85\n", 5);
|
523
|
-
} else {
|
524
|
-
pm_buffer_append_byte(output_buffer, '\n');
|
521
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
525
522
|
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
}
|
523
|
+
size_t prefix_length = prefix_buffer->length;
|
524
|
+
pm_buffer_append_string(prefix_buffer, "\xe2\x94\x82 ", 6);
|
525
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
526
|
+
prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
|
527
|
+
prefix_buffer->length = prefix_length;
|
532
528
|
}
|
533
529
|
|
534
530
|
// operator_loc
|
@@ -754,6 +750,20 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
754
750
|
prettyprint_location(output_buffer, parser, &node->location);
|
755
751
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
756
752
|
|
753
|
+
// flags
|
754
|
+
{
|
755
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
756
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
757
|
+
bool found = false;
|
758
|
+
if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
|
759
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
760
|
+
pm_buffer_append_string(output_buffer, " repeated_parameter", 19);
|
761
|
+
found = true;
|
762
|
+
}
|
763
|
+
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
764
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
765
|
+
}
|
766
|
+
|
757
767
|
// name
|
758
768
|
{
|
759
769
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -783,13 +793,6 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
783
793
|
pm_buffer_append_string(output_buffer, "]\n", 2);
|
784
794
|
}
|
785
795
|
|
786
|
-
// locals_body_index
|
787
|
-
{
|
788
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
789
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 locals_body_index:", 28);
|
790
|
-
pm_buffer_append_format(output_buffer, " %d\n", cast->locals_body_index);
|
791
|
-
}
|
792
|
-
|
793
796
|
// parameters
|
794
797
|
{
|
795
798
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -856,6 +859,20 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
856
859
|
prettyprint_location(output_buffer, parser, &node->location);
|
857
860
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
858
861
|
|
862
|
+
// flags
|
863
|
+
{
|
864
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
865
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
866
|
+
bool found = false;
|
867
|
+
if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
|
868
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
869
|
+
pm_buffer_append_string(output_buffer, " repeated_parameter", 19);
|
870
|
+
found = true;
|
871
|
+
}
|
872
|
+
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
873
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
874
|
+
}
|
875
|
+
|
859
876
|
// name
|
860
877
|
{
|
861
878
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -1044,6 +1061,11 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
1044
1061
|
pm_buffer_append_string(output_buffer, " attribute_write", 16);
|
1045
1062
|
found = true;
|
1046
1063
|
}
|
1064
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY) {
|
1065
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1066
|
+
pm_buffer_append_string(output_buffer, " ignore_visibility", 18);
|
1067
|
+
found = true;
|
1068
|
+
}
|
1047
1069
|
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
1048
1070
|
pm_buffer_append_byte(output_buffer, '\n');
|
1049
1071
|
}
|
@@ -1168,6 +1190,11 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
1168
1190
|
pm_buffer_append_string(output_buffer, " attribute_write", 16);
|
1169
1191
|
found = true;
|
1170
1192
|
}
|
1193
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY) {
|
1194
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1195
|
+
pm_buffer_append_string(output_buffer, " ignore_visibility", 18);
|
1196
|
+
found = true;
|
1197
|
+
}
|
1171
1198
|
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
1172
1199
|
pm_buffer_append_byte(output_buffer, '\n');
|
1173
1200
|
}
|
@@ -1324,6 +1351,11 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
1324
1351
|
pm_buffer_append_string(output_buffer, " attribute_write", 16);
|
1325
1352
|
found = true;
|
1326
1353
|
}
|
1354
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY) {
|
1355
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1356
|
+
pm_buffer_append_string(output_buffer, " ignore_visibility", 18);
|
1357
|
+
found = true;
|
1358
|
+
}
|
1327
1359
|
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
1328
1360
|
pm_buffer_append_byte(output_buffer, '\n');
|
1329
1361
|
}
|
@@ -1457,6 +1489,11 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
1457
1489
|
pm_buffer_append_string(output_buffer, " attribute_write", 16);
|
1458
1490
|
found = true;
|
1459
1491
|
}
|
1492
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY) {
|
1493
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1494
|
+
pm_buffer_append_string(output_buffer, " ignore_visibility", 18);
|
1495
|
+
found = true;
|
1496
|
+
}
|
1460
1497
|
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
1461
1498
|
pm_buffer_append_byte(output_buffer, '\n');
|
1462
1499
|
}
|
@@ -1581,6 +1618,11 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
1581
1618
|
pm_buffer_append_string(output_buffer, " attribute_write", 16);
|
1582
1619
|
found = true;
|
1583
1620
|
}
|
1621
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY) {
|
1622
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1623
|
+
pm_buffer_append_string(output_buffer, " ignore_visibility", 18);
|
1624
|
+
found = true;
|
1625
|
+
}
|
1584
1626
|
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
1585
1627
|
pm_buffer_append_byte(output_buffer, '\n');
|
1586
1628
|
}
|
@@ -2882,13 +2924,6 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
2882
2924
|
pm_buffer_append_string(output_buffer, "]\n", 2);
|
2883
2925
|
}
|
2884
2926
|
|
2885
|
-
// locals_body_index
|
2886
|
-
{
|
2887
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
2888
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 locals_body_index:", 28);
|
2889
|
-
pm_buffer_append_format(output_buffer, " %d\n", cast->locals_body_index);
|
2890
|
-
}
|
2891
|
-
|
2892
2927
|
// def_keyword_loc
|
2893
2928
|
{
|
2894
2929
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -4223,6 +4258,11 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
4223
4258
|
pm_buffer_append_string(output_buffer, " attribute_write", 16);
|
4224
4259
|
found = true;
|
4225
4260
|
}
|
4261
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY) {
|
4262
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4263
|
+
pm_buffer_append_string(output_buffer, " ignore_visibility", 18);
|
4264
|
+
found = true;
|
4265
|
+
}
|
4226
4266
|
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
4227
4267
|
pm_buffer_append_byte(output_buffer, '\n');
|
4228
4268
|
}
|
@@ -4371,6 +4411,11 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
4371
4411
|
pm_buffer_append_string(output_buffer, " attribute_write", 16);
|
4372
4412
|
found = true;
|
4373
4413
|
}
|
4414
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY) {
|
4415
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4416
|
+
pm_buffer_append_string(output_buffer, " ignore_visibility", 18);
|
4417
|
+
found = true;
|
4418
|
+
}
|
4374
4419
|
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
4375
4420
|
pm_buffer_append_byte(output_buffer, '\n');
|
4376
4421
|
}
|
@@ -4528,6 +4573,11 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
4528
4573
|
pm_buffer_append_string(output_buffer, " attribute_write", 16);
|
4529
4574
|
found = true;
|
4530
4575
|
}
|
4576
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY) {
|
4577
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4578
|
+
pm_buffer_append_string(output_buffer, " ignore_visibility", 18);
|
4579
|
+
found = true;
|
4580
|
+
}
|
4531
4581
|
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
4532
4582
|
pm_buffer_append_byte(output_buffer, '\n');
|
4533
4583
|
}
|
@@ -4676,6 +4726,11 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
4676
4726
|
pm_buffer_append_string(output_buffer, " attribute_write", 16);
|
4677
4727
|
found = true;
|
4678
4728
|
}
|
4729
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY) {
|
4730
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4731
|
+
pm_buffer_append_string(output_buffer, " ignore_visibility", 18);
|
4732
|
+
found = true;
|
4733
|
+
}
|
4679
4734
|
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
4680
4735
|
pm_buffer_append_byte(output_buffer, '\n');
|
4681
4736
|
}
|
@@ -5489,9 +5544,9 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
5489
5544
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
5490
5545
|
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
5491
5546
|
bool found = false;
|
5492
|
-
if (cast->base.flags &
|
5547
|
+
if (cast->base.flags & PM_KEYWORD_HASH_NODE_FLAGS_SYMBOL_KEYS) {
|
5493
5548
|
if (found) pm_buffer_append_byte(output_buffer, ',');
|
5494
|
-
pm_buffer_append_string(output_buffer, "
|
5549
|
+
pm_buffer_append_string(output_buffer, " symbol_keys", 12);
|
5495
5550
|
found = true;
|
5496
5551
|
}
|
5497
5552
|
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
@@ -5531,6 +5586,20 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
5531
5586
|
prettyprint_location(output_buffer, parser, &node->location);
|
5532
5587
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
5533
5588
|
|
5589
|
+
// flags
|
5590
|
+
{
|
5591
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
5592
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
5593
|
+
bool found = false;
|
5594
|
+
if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
|
5595
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
5596
|
+
pm_buffer_append_string(output_buffer, " repeated_parameter", 19);
|
5597
|
+
found = true;
|
5598
|
+
}
|
5599
|
+
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
5600
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
5601
|
+
}
|
5602
|
+
|
5534
5603
|
// name
|
5535
5604
|
{
|
5536
5605
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -5592,13 +5661,6 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
5592
5661
|
pm_buffer_append_string(output_buffer, "]\n", 2);
|
5593
5662
|
}
|
5594
5663
|
|
5595
|
-
// locals_body_index
|
5596
|
-
{
|
5597
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
5598
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 locals_body_index:", 28);
|
5599
|
-
pm_buffer_append_format(output_buffer, " %d\n", cast->locals_body_index);
|
5600
|
-
}
|
5601
|
-
|
5602
5664
|
// operator_loc
|
5603
5665
|
{
|
5604
5666
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -5727,7 +5789,7 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
5727
5789
|
{
|
5728
5790
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
5729
5791
|
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 depth:", 16);
|
5730
|
-
pm_buffer_append_format(output_buffer, " %
|
5792
|
+
pm_buffer_append_format(output_buffer, " %" PRIu32 "\n", cast->depth);
|
5731
5793
|
}
|
5732
5794
|
|
5733
5795
|
break;
|
@@ -5797,7 +5859,7 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
5797
5859
|
{
|
5798
5860
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
5799
5861
|
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 depth:", 16);
|
5800
|
-
pm_buffer_append_format(output_buffer, " %
|
5862
|
+
pm_buffer_append_format(output_buffer, " %" PRIu32 "\n", cast->depth);
|
5801
5863
|
}
|
5802
5864
|
|
5803
5865
|
break;
|
@@ -5858,7 +5920,7 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
5858
5920
|
{
|
5859
5921
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
5860
5922
|
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 depth:", 16);
|
5861
|
-
pm_buffer_append_format(output_buffer, " %
|
5923
|
+
pm_buffer_append_format(output_buffer, " %" PRIu32 "\n", cast->depth);
|
5862
5924
|
}
|
5863
5925
|
|
5864
5926
|
break;
|
@@ -5882,7 +5944,7 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
5882
5944
|
{
|
5883
5945
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
5884
5946
|
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 depth:", 16);
|
5885
|
-
pm_buffer_append_format(output_buffer, " %
|
5947
|
+
pm_buffer_append_format(output_buffer, " %" PRIu32 "\n", cast->depth);
|
5886
5948
|
}
|
5887
5949
|
|
5888
5950
|
break;
|
@@ -5906,7 +5968,7 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
5906
5968
|
{
|
5907
5969
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
5908
5970
|
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 depth:", 16);
|
5909
|
-
pm_buffer_append_format(output_buffer, " %
|
5971
|
+
pm_buffer_append_format(output_buffer, " %" PRIu32 "\n", cast->depth);
|
5910
5972
|
}
|
5911
5973
|
|
5912
5974
|
break;
|
@@ -5930,7 +5992,7 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
5930
5992
|
{
|
5931
5993
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
5932
5994
|
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 depth:", 16);
|
5933
|
-
pm_buffer_append_format(output_buffer, " %
|
5995
|
+
pm_buffer_append_format(output_buffer, " %" PRIu32 "\n", cast->depth);
|
5934
5996
|
}
|
5935
5997
|
|
5936
5998
|
// name_loc
|
@@ -6642,7 +6704,7 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
6642
6704
|
{
|
6643
6705
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
6644
6706
|
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 maximum:", 18);
|
6645
|
-
pm_buffer_append_format(output_buffer, " %
|
6707
|
+
pm_buffer_append_format(output_buffer, " %" PRIu8 "\n", cast->maximum);
|
6646
6708
|
}
|
6647
6709
|
|
6648
6710
|
break;
|
@@ -6657,7 +6719,7 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
6657
6719
|
{
|
6658
6720
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
6659
6721
|
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 number:", 17);
|
6660
|
-
pm_buffer_append_format(output_buffer, " %
|
6722
|
+
pm_buffer_append_format(output_buffer, " %" PRIu32 "\n", cast->number);
|
6661
6723
|
}
|
6662
6724
|
|
6663
6725
|
break;
|
@@ -6668,6 +6730,20 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
6668
6730
|
prettyprint_location(output_buffer, parser, &node->location);
|
6669
6731
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
6670
6732
|
|
6733
|
+
// flags
|
6734
|
+
{
|
6735
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
6736
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
6737
|
+
bool found = false;
|
6738
|
+
if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
|
6739
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
6740
|
+
pm_buffer_append_string(output_buffer, " repeated_parameter", 19);
|
6741
|
+
found = true;
|
6742
|
+
}
|
6743
|
+
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
6744
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
6745
|
+
}
|
6746
|
+
|
6671
6747
|
// name
|
6672
6748
|
{
|
6673
6749
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -6710,6 +6786,20 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
6710
6786
|
prettyprint_location(output_buffer, parser, &node->location);
|
6711
6787
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
6712
6788
|
|
6789
|
+
// flags
|
6790
|
+
{
|
6791
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
6792
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
6793
|
+
bool found = false;
|
6794
|
+
if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
|
6795
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
6796
|
+
pm_buffer_append_string(output_buffer, " repeated_parameter", 19);
|
6797
|
+
found = true;
|
6798
|
+
}
|
6799
|
+
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
6800
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
6801
|
+
}
|
6802
|
+
|
6713
6803
|
// name
|
6714
6804
|
{
|
6715
6805
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -7476,6 +7566,20 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
7476
7566
|
prettyprint_location(output_buffer, parser, &node->location);
|
7477
7567
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
7478
7568
|
|
7569
|
+
// flags
|
7570
|
+
{
|
7571
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
7572
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
7573
|
+
bool found = false;
|
7574
|
+
if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
|
7575
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
7576
|
+
pm_buffer_append_string(output_buffer, " repeated_parameter", 19);
|
7577
|
+
found = true;
|
7578
|
+
}
|
7579
|
+
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
7580
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
7581
|
+
}
|
7582
|
+
|
7479
7583
|
// name
|
7480
7584
|
{
|
7481
7585
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -7505,6 +7609,20 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
7505
7609
|
prettyprint_location(output_buffer, parser, &node->location);
|
7506
7610
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
7507
7611
|
|
7612
|
+
// flags
|
7613
|
+
{
|
7614
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
7615
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
7616
|
+
bool found = false;
|
7617
|
+
if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
|
7618
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
7619
|
+
pm_buffer_append_string(output_buffer, " repeated_parameter", 19);
|
7620
|
+
found = true;
|
7621
|
+
}
|
7622
|
+
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
7623
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
7624
|
+
}
|
7625
|
+
|
7508
7626
|
// name
|
7509
7627
|
{
|
7510
7628
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -7680,6 +7798,20 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
7680
7798
|
prettyprint_location(output_buffer, parser, &node->location);
|
7681
7799
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
7682
7800
|
|
7801
|
+
// flags
|
7802
|
+
{
|
7803
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
7804
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
7805
|
+
bool found = false;
|
7806
|
+
if (cast->base.flags & PM_PARAMETER_FLAGS_REPEATED_PARAMETER) {
|
7807
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
7808
|
+
pm_buffer_append_string(output_buffer, " repeated_parameter", 19);
|
7809
|
+
found = true;
|
7810
|
+
}
|
7811
|
+
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
7812
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
7813
|
+
}
|
7814
|
+
|
7683
7815
|
// name
|
7684
7816
|
{
|
7685
7817
|
pm_buffer_concat(output_buffer, prefix_buffer);
|