prism 0.18.0 → 0.19.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 +31 -1
- data/README.md +2 -1
- data/config.yml +188 -55
- data/docs/building.md +9 -2
- data/docs/configuration.md +10 -9
- data/docs/encoding.md +24 -56
- data/docs/local_variable_depth.md +229 -0
- data/docs/ruby_api.md +2 -0
- data/docs/serialization.md +18 -13
- data/ext/prism/api_node.c +337 -195
- data/ext/prism/extconf.rb +13 -7
- data/ext/prism/extension.c +96 -32
- data/ext/prism/extension.h +1 -1
- data/include/prism/ast.h +340 -137
- data/include/prism/defines.h +17 -0
- data/include/prism/diagnostic.h +11 -5
- data/include/prism/encoding.h +248 -0
- data/include/prism/options.h +2 -2
- data/include/prism/parser.h +62 -42
- data/include/prism/regexp.h +2 -2
- data/include/prism/util/pm_buffer.h +9 -1
- data/include/prism/util/pm_memchr.h +2 -2
- data/include/prism/util/pm_strpbrk.h +3 -3
- data/include/prism/version.h +2 -2
- data/include/prism.h +13 -15
- data/lib/prism/compiler.rb +12 -0
- data/lib/prism/debug.rb +9 -4
- data/lib/prism/desugar_compiler.rb +3 -3
- data/lib/prism/dispatcher.rb +56 -0
- data/lib/prism/dot_visitor.rb +476 -198
- data/lib/prism/dsl.rb +66 -46
- data/lib/prism/ffi.rb +16 -3
- data/lib/prism/lex_compat.rb +19 -9
- data/lib/prism/mutation_compiler.rb +20 -0
- data/lib/prism/node.rb +1173 -450
- data/lib/prism/node_ext.rb +41 -16
- data/lib/prism/parse_result.rb +12 -15
- data/lib/prism/ripper_compat.rb +49 -34
- data/lib/prism/serialize.rb +242 -212
- data/lib/prism/visitor.rb +12 -0
- data/lib/prism.rb +20 -4
- data/prism.gemspec +4 -10
- data/rbi/prism.rbi +605 -230
- data/rbi/prism_static.rbi +3 -0
- data/sig/prism.rbs +379 -124
- data/sig/prism_static.rbs +1 -0
- data/src/diagnostic.c +228 -222
- data/src/encoding.c +5137 -0
- data/src/node.c +66 -0
- data/src/options.c +21 -2
- data/src/prettyprint.c +806 -406
- data/src/prism.c +1092 -700
- data/src/regexp.c +3 -3
- data/src/serialize.c +227 -157
- data/src/util/pm_buffer.c +10 -1
- data/src/util/pm_memchr.c +1 -1
- data/src/util/pm_strpbrk.c +4 -4
- metadata +5 -11
- data/include/prism/enc/pm_encoding.h +0 -227
- data/src/enc/pm_big5.c +0 -116
- data/src/enc/pm_cp51932.c +0 -57
- data/src/enc/pm_euc_jp.c +0 -69
- data/src/enc/pm_gbk.c +0 -65
- data/src/enc/pm_shift_jis.c +0 -57
- data/src/enc/pm_tables.c +0 -2073
- data/src/enc/pm_unicode.c +0 -2369
- data/src/enc/pm_windows_31j.c +0 -57
data/src/prettyprint.c
CHANGED
@@ -251,16 +251,30 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
251
251
|
prettyprint_location(output_buffer, parser, &node->location);
|
252
252
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
253
253
|
|
254
|
+
// flags
|
255
|
+
{
|
256
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
257
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
258
|
+
bool found = false;
|
259
|
+
if (cast->base.flags & PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORD_SPLAT) {
|
260
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
261
|
+
pm_buffer_append_string(output_buffer, " contains_keyword_splat", 23);
|
262
|
+
found = true;
|
263
|
+
}
|
264
|
+
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
265
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
266
|
+
}
|
267
|
+
|
254
268
|
// arguments
|
255
269
|
{
|
256
270
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
257
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\
|
271
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 arguments:", 20);
|
258
272
|
pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->arguments.size));
|
259
273
|
|
260
274
|
size_t last_index = cast->arguments.size;
|
261
275
|
for (uint32_t index = 0; index < last_index; index++) {
|
262
276
|
size_t prefix_length = prefix_buffer->length;
|
263
|
-
pm_buffer_append_string(prefix_buffer, "
|
277
|
+
pm_buffer_append_string(prefix_buffer, " ", 4);
|
264
278
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
265
279
|
|
266
280
|
if (index == last_index - 1) {
|
@@ -276,28 +290,28 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
276
290
|
}
|
277
291
|
}
|
278
292
|
|
293
|
+
break;
|
294
|
+
}
|
295
|
+
case PM_ARRAY_NODE: {
|
296
|
+
pm_array_node_t *cast = (pm_array_node_t *) node;
|
297
|
+
pm_buffer_append_string(output_buffer, "@ ArrayNode (location: ", 23);
|
298
|
+
prettyprint_location(output_buffer, parser, &node->location);
|
299
|
+
pm_buffer_append_string(output_buffer, ")\n", 2);
|
300
|
+
|
279
301
|
// flags
|
280
302
|
{
|
281
303
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
282
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\
|
304
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
283
305
|
bool found = false;
|
284
|
-
if (cast->base.flags &
|
306
|
+
if (cast->base.flags & PM_ARRAY_NODE_FLAGS_CONTAINS_SPLAT) {
|
285
307
|
if (found) pm_buffer_append_byte(output_buffer, ',');
|
286
|
-
pm_buffer_append_string(output_buffer, "
|
308
|
+
pm_buffer_append_string(output_buffer, " contains_splat", 15);
|
287
309
|
found = true;
|
288
310
|
}
|
289
311
|
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
290
312
|
pm_buffer_append_byte(output_buffer, '\n');
|
291
313
|
}
|
292
314
|
|
293
|
-
break;
|
294
|
-
}
|
295
|
-
case PM_ARRAY_NODE: {
|
296
|
-
pm_array_node_t *cast = (pm_array_node_t *) node;
|
297
|
-
pm_buffer_append_string(output_buffer, "@ ArrayNode (location: ", 23);
|
298
|
-
prettyprint_location(output_buffer, parser, &node->location);
|
299
|
-
pm_buffer_append_string(output_buffer, ")\n", 2);
|
300
|
-
|
301
315
|
// elements
|
302
316
|
{
|
303
317
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -769,6 +783,13 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
769
783
|
pm_buffer_append_string(output_buffer, "]\n", 2);
|
770
784
|
}
|
771
785
|
|
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
|
+
|
772
793
|
// parameters
|
773
794
|
{
|
774
795
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -1003,6 +1024,30 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
1003
1024
|
prettyprint_location(output_buffer, parser, &node->location);
|
1004
1025
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
1005
1026
|
|
1027
|
+
// flags
|
1028
|
+
{
|
1029
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
1030
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
1031
|
+
bool found = false;
|
1032
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
|
1033
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1034
|
+
pm_buffer_append_string(output_buffer, " safe_navigation", 16);
|
1035
|
+
found = true;
|
1036
|
+
}
|
1037
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_VARIABLE_CALL) {
|
1038
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1039
|
+
pm_buffer_append_string(output_buffer, " variable_call", 14);
|
1040
|
+
found = true;
|
1041
|
+
}
|
1042
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE) {
|
1043
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1044
|
+
pm_buffer_append_string(output_buffer, " attribute_write", 16);
|
1045
|
+
found = true;
|
1046
|
+
}
|
1047
|
+
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
1048
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
1049
|
+
}
|
1050
|
+
|
1006
1051
|
// receiver
|
1007
1052
|
{
|
1008
1053
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -1052,25 +1097,6 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
1052
1097
|
}
|
1053
1098
|
}
|
1054
1099
|
|
1055
|
-
// flags
|
1056
|
-
{
|
1057
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
1058
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
1059
|
-
bool found = false;
|
1060
|
-
if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
|
1061
|
-
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1062
|
-
pm_buffer_append_string(output_buffer, " safe_navigation", 16);
|
1063
|
-
found = true;
|
1064
|
-
}
|
1065
|
-
if (cast->base.flags & PM_CALL_NODE_FLAGS_VARIABLE_CALL) {
|
1066
|
-
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1067
|
-
pm_buffer_append_string(output_buffer, " variable_call", 14);
|
1068
|
-
found = true;
|
1069
|
-
}
|
1070
|
-
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
1071
|
-
pm_buffer_append_byte(output_buffer, '\n');
|
1072
|
-
}
|
1073
|
-
|
1074
1100
|
// read_name
|
1075
1101
|
{
|
1076
1102
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -1122,6 +1148,30 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
1122
1148
|
prettyprint_location(output_buffer, parser, &node->location);
|
1123
1149
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
1124
1150
|
|
1151
|
+
// flags
|
1152
|
+
{
|
1153
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
1154
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
1155
|
+
bool found = false;
|
1156
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
|
1157
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1158
|
+
pm_buffer_append_string(output_buffer, " safe_navigation", 16);
|
1159
|
+
found = true;
|
1160
|
+
}
|
1161
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_VARIABLE_CALL) {
|
1162
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1163
|
+
pm_buffer_append_string(output_buffer, " variable_call", 14);
|
1164
|
+
found = true;
|
1165
|
+
}
|
1166
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE) {
|
1167
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1168
|
+
pm_buffer_append_string(output_buffer, " attribute_write", 16);
|
1169
|
+
found = true;
|
1170
|
+
}
|
1171
|
+
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
1172
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
1173
|
+
}
|
1174
|
+
|
1125
1175
|
// receiver
|
1126
1176
|
{
|
1127
1177
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -1155,6 +1205,15 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
1155
1205
|
}
|
1156
1206
|
}
|
1157
1207
|
|
1208
|
+
// name
|
1209
|
+
{
|
1210
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
1211
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 name:", 15);
|
1212
|
+
pm_buffer_append_byte(output_buffer, ' ');
|
1213
|
+
prettyprint_constant(output_buffer, parser, cast->name);
|
1214
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
1215
|
+
}
|
1216
|
+
|
1158
1217
|
// message_loc
|
1159
1218
|
{
|
1160
1219
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -1223,20 +1282,28 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
1223
1282
|
// block
|
1224
1283
|
{
|
1225
1284
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
1226
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\
|
1285
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 block:", 16);
|
1227
1286
|
if (cast->block == NULL) {
|
1228
1287
|
pm_buffer_append_string(output_buffer, " \xe2\x88\x85\n", 5);
|
1229
1288
|
} else {
|
1230
1289
|
pm_buffer_append_byte(output_buffer, '\n');
|
1231
1290
|
|
1232
1291
|
size_t prefix_length = prefix_buffer->length;
|
1233
|
-
pm_buffer_append_string(prefix_buffer, "
|
1292
|
+
pm_buffer_append_string(prefix_buffer, " ", 4);
|
1234
1293
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
1235
1294
|
prettyprint_node(output_buffer, parser, (pm_node_t *) cast->block, prefix_buffer);
|
1236
1295
|
prefix_buffer->length = prefix_length;
|
1237
1296
|
}
|
1238
1297
|
}
|
1239
1298
|
|
1299
|
+
break;
|
1300
|
+
}
|
1301
|
+
case PM_CALL_OPERATOR_WRITE_NODE: {
|
1302
|
+
pm_call_operator_write_node_t *cast = (pm_call_operator_write_node_t *) node;
|
1303
|
+
pm_buffer_append_string(output_buffer, "@ CallOperatorWriteNode (location: ", 35);
|
1304
|
+
prettyprint_location(output_buffer, parser, &node->location);
|
1305
|
+
pm_buffer_append_string(output_buffer, ")\n", 2);
|
1306
|
+
|
1240
1307
|
// flags
|
1241
1308
|
{
|
1242
1309
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -1252,27 +1319,15 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
1252
1319
|
pm_buffer_append_string(output_buffer, " variable_call", 14);
|
1253
1320
|
found = true;
|
1254
1321
|
}
|
1322
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE) {
|
1323
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1324
|
+
pm_buffer_append_string(output_buffer, " attribute_write", 16);
|
1325
|
+
found = true;
|
1326
|
+
}
|
1255
1327
|
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
1256
1328
|
pm_buffer_append_byte(output_buffer, '\n');
|
1257
1329
|
}
|
1258
1330
|
|
1259
|
-
// name
|
1260
|
-
{
|
1261
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
1262
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 name:", 15);
|
1263
|
-
pm_buffer_append_byte(output_buffer, ' ');
|
1264
|
-
prettyprint_constant(output_buffer, parser, cast->name);
|
1265
|
-
pm_buffer_append_byte(output_buffer, '\n');
|
1266
|
-
}
|
1267
|
-
|
1268
|
-
break;
|
1269
|
-
}
|
1270
|
-
case PM_CALL_OPERATOR_WRITE_NODE: {
|
1271
|
-
pm_call_operator_write_node_t *cast = (pm_call_operator_write_node_t *) node;
|
1272
|
-
pm_buffer_append_string(output_buffer, "@ CallOperatorWriteNode (location: ", 35);
|
1273
|
-
prettyprint_location(output_buffer, parser, &node->location);
|
1274
|
-
pm_buffer_append_string(output_buffer, ")\n", 2);
|
1275
|
-
|
1276
1331
|
// receiver
|
1277
1332
|
{
|
1278
1333
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -1322,25 +1377,6 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
1322
1377
|
}
|
1323
1378
|
}
|
1324
1379
|
|
1325
|
-
// flags
|
1326
|
-
{
|
1327
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
1328
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
1329
|
-
bool found = false;
|
1330
|
-
if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
|
1331
|
-
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1332
|
-
pm_buffer_append_string(output_buffer, " safe_navigation", 16);
|
1333
|
-
found = true;
|
1334
|
-
}
|
1335
|
-
if (cast->base.flags & PM_CALL_NODE_FLAGS_VARIABLE_CALL) {
|
1336
|
-
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1337
|
-
pm_buffer_append_string(output_buffer, " variable_call", 14);
|
1338
|
-
found = true;
|
1339
|
-
}
|
1340
|
-
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
1341
|
-
pm_buffer_append_byte(output_buffer, '\n');
|
1342
|
-
}
|
1343
|
-
|
1344
1380
|
// read_name
|
1345
1381
|
{
|
1346
1382
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -1401,6 +1437,30 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
1401
1437
|
prettyprint_location(output_buffer, parser, &node->location);
|
1402
1438
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
1403
1439
|
|
1440
|
+
// flags
|
1441
|
+
{
|
1442
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
1443
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
1444
|
+
bool found = false;
|
1445
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
|
1446
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1447
|
+
pm_buffer_append_string(output_buffer, " safe_navigation", 16);
|
1448
|
+
found = true;
|
1449
|
+
}
|
1450
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_VARIABLE_CALL) {
|
1451
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1452
|
+
pm_buffer_append_string(output_buffer, " variable_call", 14);
|
1453
|
+
found = true;
|
1454
|
+
}
|
1455
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE) {
|
1456
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1457
|
+
pm_buffer_append_string(output_buffer, " attribute_write", 16);
|
1458
|
+
found = true;
|
1459
|
+
}
|
1460
|
+
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
1461
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
1462
|
+
}
|
1463
|
+
|
1404
1464
|
// receiver
|
1405
1465
|
{
|
1406
1466
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -1450,25 +1510,6 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
1450
1510
|
}
|
1451
1511
|
}
|
1452
1512
|
|
1453
|
-
// flags
|
1454
|
-
{
|
1455
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
1456
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
1457
|
-
bool found = false;
|
1458
|
-
if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
|
1459
|
-
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1460
|
-
pm_buffer_append_string(output_buffer, " safe_navigation", 16);
|
1461
|
-
found = true;
|
1462
|
-
}
|
1463
|
-
if (cast->base.flags & PM_CALL_NODE_FLAGS_VARIABLE_CALL) {
|
1464
|
-
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1465
|
-
pm_buffer_append_string(output_buffer, " variable_call", 14);
|
1466
|
-
found = true;
|
1467
|
-
}
|
1468
|
-
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
1469
|
-
pm_buffer_append_byte(output_buffer, '\n');
|
1470
|
-
}
|
1471
|
-
|
1472
1513
|
// read_name
|
1473
1514
|
{
|
1474
1515
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -1514,43 +1555,54 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
1514
1555
|
|
1515
1556
|
break;
|
1516
1557
|
}
|
1517
|
-
case
|
1518
|
-
|
1519
|
-
pm_buffer_append_string(output_buffer, "@
|
1558
|
+
case PM_CALL_TARGET_NODE: {
|
1559
|
+
pm_call_target_node_t *cast = (pm_call_target_node_t *) node;
|
1560
|
+
pm_buffer_append_string(output_buffer, "@ CallTargetNode (location: ", 28);
|
1520
1561
|
prettyprint_location(output_buffer, parser, &node->location);
|
1521
1562
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
1522
1563
|
|
1523
|
-
//
|
1564
|
+
// flags
|
1524
1565
|
{
|
1525
1566
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
1526
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80
|
1567
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
1568
|
+
bool found = false;
|
1569
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
|
1570
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1571
|
+
pm_buffer_append_string(output_buffer, " safe_navigation", 16);
|
1572
|
+
found = true;
|
1573
|
+
}
|
1574
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_VARIABLE_CALL) {
|
1575
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1576
|
+
pm_buffer_append_string(output_buffer, " variable_call", 14);
|
1577
|
+
found = true;
|
1578
|
+
}
|
1579
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE) {
|
1580
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
1581
|
+
pm_buffer_append_string(output_buffer, " attribute_write", 16);
|
1582
|
+
found = true;
|
1583
|
+
}
|
1584
|
+
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
1527
1585
|
pm_buffer_append_byte(output_buffer, '\n');
|
1528
|
-
|
1529
|
-
size_t prefix_length = prefix_buffer->length;
|
1530
|
-
pm_buffer_append_string(prefix_buffer, "\xe2\x94\x82 ", 6);
|
1531
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
1532
|
-
prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
|
1533
|
-
prefix_buffer->length = prefix_length;
|
1534
1586
|
}
|
1535
1587
|
|
1536
|
-
//
|
1588
|
+
// receiver
|
1537
1589
|
{
|
1538
1590
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
1539
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80
|
1591
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 receiver:", 19);
|
1540
1592
|
pm_buffer_append_byte(output_buffer, '\n');
|
1541
1593
|
|
1542
1594
|
size_t prefix_length = prefix_buffer->length;
|
1543
1595
|
pm_buffer_append_string(prefix_buffer, "\xe2\x94\x82 ", 6);
|
1544
1596
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
1545
|
-
prettyprint_node(output_buffer, parser, (pm_node_t *) cast->
|
1597
|
+
prettyprint_node(output_buffer, parser, (pm_node_t *) cast->receiver, prefix_buffer);
|
1546
1598
|
prefix_buffer->length = prefix_length;
|
1547
1599
|
}
|
1548
1600
|
|
1549
|
-
//
|
1601
|
+
// call_operator_loc
|
1550
1602
|
{
|
1551
1603
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
1552
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\
|
1553
|
-
pm_location_t *location = &cast->
|
1604
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 call_operator_loc:", 28);
|
1605
|
+
pm_location_t *location = &cast->call_operator_loc;
|
1554
1606
|
pm_buffer_append_byte(output_buffer, ' ');
|
1555
1607
|
prettyprint_location(output_buffer, parser, location);
|
1556
1608
|
pm_buffer_append_string(output_buffer, " = \"", 4);
|
@@ -1558,22 +1610,89 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
1558
1610
|
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
1559
1611
|
}
|
1560
1612
|
|
1561
|
-
|
1562
|
-
}
|
1563
|
-
case PM_CASE_MATCH_NODE: {
|
1564
|
-
pm_case_match_node_t *cast = (pm_case_match_node_t *) node;
|
1565
|
-
pm_buffer_append_string(output_buffer, "@ CaseMatchNode (location: ", 27);
|
1566
|
-
prettyprint_location(output_buffer, parser, &node->location);
|
1567
|
-
pm_buffer_append_string(output_buffer, ")\n", 2);
|
1568
|
-
|
1569
|
-
// predicate
|
1613
|
+
// name
|
1570
1614
|
{
|
1571
1615
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
1572
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80
|
1573
|
-
|
1574
|
-
|
1575
|
-
|
1576
|
-
|
1616
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 name:", 15);
|
1617
|
+
pm_buffer_append_byte(output_buffer, ' ');
|
1618
|
+
prettyprint_constant(output_buffer, parser, cast->name);
|
1619
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
1620
|
+
}
|
1621
|
+
|
1622
|
+
// message_loc
|
1623
|
+
{
|
1624
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
1625
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 message_loc:", 22);
|
1626
|
+
pm_location_t *location = &cast->message_loc;
|
1627
|
+
pm_buffer_append_byte(output_buffer, ' ');
|
1628
|
+
prettyprint_location(output_buffer, parser, location);
|
1629
|
+
pm_buffer_append_string(output_buffer, " = \"", 4);
|
1630
|
+
prettyprint_source(output_buffer, location->start, (size_t) (location->end - location->start));
|
1631
|
+
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
1632
|
+
}
|
1633
|
+
|
1634
|
+
break;
|
1635
|
+
}
|
1636
|
+
case PM_CAPTURE_PATTERN_NODE: {
|
1637
|
+
pm_capture_pattern_node_t *cast = (pm_capture_pattern_node_t *) node;
|
1638
|
+
pm_buffer_append_string(output_buffer, "@ CapturePatternNode (location: ", 32);
|
1639
|
+
prettyprint_location(output_buffer, parser, &node->location);
|
1640
|
+
pm_buffer_append_string(output_buffer, ")\n", 2);
|
1641
|
+
|
1642
|
+
// value
|
1643
|
+
{
|
1644
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
1645
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 value:", 16);
|
1646
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
1647
|
+
|
1648
|
+
size_t prefix_length = prefix_buffer->length;
|
1649
|
+
pm_buffer_append_string(prefix_buffer, "\xe2\x94\x82 ", 6);
|
1650
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
1651
|
+
prettyprint_node(output_buffer, parser, (pm_node_t *) cast->value, prefix_buffer);
|
1652
|
+
prefix_buffer->length = prefix_length;
|
1653
|
+
}
|
1654
|
+
|
1655
|
+
// target
|
1656
|
+
{
|
1657
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
1658
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 target:", 17);
|
1659
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
1660
|
+
|
1661
|
+
size_t prefix_length = prefix_buffer->length;
|
1662
|
+
pm_buffer_append_string(prefix_buffer, "\xe2\x94\x82 ", 6);
|
1663
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
1664
|
+
prettyprint_node(output_buffer, parser, (pm_node_t *) cast->target, prefix_buffer);
|
1665
|
+
prefix_buffer->length = prefix_length;
|
1666
|
+
}
|
1667
|
+
|
1668
|
+
// operator_loc
|
1669
|
+
{
|
1670
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
1671
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 operator_loc:", 23);
|
1672
|
+
pm_location_t *location = &cast->operator_loc;
|
1673
|
+
pm_buffer_append_byte(output_buffer, ' ');
|
1674
|
+
prettyprint_location(output_buffer, parser, location);
|
1675
|
+
pm_buffer_append_string(output_buffer, " = \"", 4);
|
1676
|
+
prettyprint_source(output_buffer, location->start, (size_t) (location->end - location->start));
|
1677
|
+
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
1678
|
+
}
|
1679
|
+
|
1680
|
+
break;
|
1681
|
+
}
|
1682
|
+
case PM_CASE_MATCH_NODE: {
|
1683
|
+
pm_case_match_node_t *cast = (pm_case_match_node_t *) node;
|
1684
|
+
pm_buffer_append_string(output_buffer, "@ CaseMatchNode (location: ", 27);
|
1685
|
+
prettyprint_location(output_buffer, parser, &node->location);
|
1686
|
+
pm_buffer_append_string(output_buffer, ")\n", 2);
|
1687
|
+
|
1688
|
+
// predicate
|
1689
|
+
{
|
1690
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
1691
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 predicate:", 20);
|
1692
|
+
if (cast->predicate == NULL) {
|
1693
|
+
pm_buffer_append_string(output_buffer, " \xe2\x88\x85\n", 5);
|
1694
|
+
} else {
|
1695
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
1577
1696
|
|
1578
1697
|
size_t prefix_length = prefix_buffer->length;
|
1579
1698
|
pm_buffer_append_string(prefix_buffer, "\xe2\x94\x82 ", 6);
|
@@ -2763,6 +2882,13 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
2763
2882
|
pm_buffer_append_string(output_buffer, "]\n", 2);
|
2764
2883
|
}
|
2765
2884
|
|
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
|
+
|
2766
2892
|
// def_keyword_loc
|
2767
2893
|
{
|
2768
2894
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -3227,6 +3353,20 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
3227
3353
|
prettyprint_location(output_buffer, parser, &node->location);
|
3228
3354
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
3229
3355
|
|
3356
|
+
// flags
|
3357
|
+
{
|
3358
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
3359
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
3360
|
+
bool found = false;
|
3361
|
+
if (cast->base.flags & PM_RANGE_FLAGS_EXCLUDE_END) {
|
3362
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
3363
|
+
pm_buffer_append_string(output_buffer, " exclude_end", 12);
|
3364
|
+
found = true;
|
3365
|
+
}
|
3366
|
+
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
3367
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
3368
|
+
}
|
3369
|
+
|
3230
3370
|
// left
|
3231
3371
|
{
|
3232
3372
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -3264,7 +3404,7 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
3264
3404
|
// operator_loc
|
3265
3405
|
{
|
3266
3406
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
3267
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\
|
3407
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 operator_loc:", 23);
|
3268
3408
|
pm_location_t *location = &cast->operator_loc;
|
3269
3409
|
pm_buffer_append_byte(output_buffer, ' ');
|
3270
3410
|
prettyprint_location(output_buffer, parser, location);
|
@@ -3273,20 +3413,6 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
3273
3413
|
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
3274
3414
|
}
|
3275
3415
|
|
3276
|
-
// flags
|
3277
|
-
{
|
3278
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
3279
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
3280
|
-
bool found = false;
|
3281
|
-
if (cast->base.flags & PM_RANGE_FLAGS_EXCLUDE_END) {
|
3282
|
-
if (found) pm_buffer_append_byte(output_buffer, ',');
|
3283
|
-
pm_buffer_append_string(output_buffer, " exclude_end", 12);
|
3284
|
-
found = true;
|
3285
|
-
}
|
3286
|
-
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
3287
|
-
pm_buffer_append_byte(output_buffer, '\n');
|
3288
|
-
}
|
3289
|
-
|
3290
3416
|
break;
|
3291
3417
|
}
|
3292
3418
|
case PM_FLOAT_NODE: {
|
@@ -3998,6 +4124,13 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
3998
4124
|
|
3999
4125
|
break;
|
4000
4126
|
}
|
4127
|
+
case PM_IMPLICIT_REST_NODE: {
|
4128
|
+
pm_buffer_append_string(output_buffer, "@ ImplicitRestNode (location: ", 30);
|
4129
|
+
prettyprint_location(output_buffer, parser, &node->location);
|
4130
|
+
pm_buffer_append_string(output_buffer, ")\n", 2);
|
4131
|
+
|
4132
|
+
break;
|
4133
|
+
}
|
4001
4134
|
case PM_IN_NODE: {
|
4002
4135
|
pm_in_node_t *cast = (pm_in_node_t *) node;
|
4003
4136
|
pm_buffer_append_string(output_buffer, "@ InNode (location: ", 20);
|
@@ -4070,6 +4203,30 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
4070
4203
|
prettyprint_location(output_buffer, parser, &node->location);
|
4071
4204
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
4072
4205
|
|
4206
|
+
// flags
|
4207
|
+
{
|
4208
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
4209
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
4210
|
+
bool found = false;
|
4211
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
|
4212
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4213
|
+
pm_buffer_append_string(output_buffer, " safe_navigation", 16);
|
4214
|
+
found = true;
|
4215
|
+
}
|
4216
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_VARIABLE_CALL) {
|
4217
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4218
|
+
pm_buffer_append_string(output_buffer, " variable_call", 14);
|
4219
|
+
found = true;
|
4220
|
+
}
|
4221
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE) {
|
4222
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4223
|
+
pm_buffer_append_string(output_buffer, " attribute_write", 16);
|
4224
|
+
found = true;
|
4225
|
+
}
|
4226
|
+
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
4227
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
4228
|
+
}
|
4229
|
+
|
4073
4230
|
// receiver
|
4074
4231
|
{
|
4075
4232
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -4161,25 +4318,6 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
4161
4318
|
}
|
4162
4319
|
}
|
4163
4320
|
|
4164
|
-
// flags
|
4165
|
-
{
|
4166
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
4167
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
4168
|
-
bool found = false;
|
4169
|
-
if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
|
4170
|
-
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4171
|
-
pm_buffer_append_string(output_buffer, " safe_navigation", 16);
|
4172
|
-
found = true;
|
4173
|
-
}
|
4174
|
-
if (cast->base.flags & PM_CALL_NODE_FLAGS_VARIABLE_CALL) {
|
4175
|
-
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4176
|
-
pm_buffer_append_string(output_buffer, " variable_call", 14);
|
4177
|
-
found = true;
|
4178
|
-
}
|
4179
|
-
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
4180
|
-
pm_buffer_append_byte(output_buffer, '\n');
|
4181
|
-
}
|
4182
|
-
|
4183
4321
|
// operator_loc
|
4184
4322
|
{
|
4185
4323
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -4213,6 +4351,30 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
4213
4351
|
prettyprint_location(output_buffer, parser, &node->location);
|
4214
4352
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
4215
4353
|
|
4354
|
+
// flags
|
4355
|
+
{
|
4356
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
4357
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
4358
|
+
bool found = false;
|
4359
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
|
4360
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4361
|
+
pm_buffer_append_string(output_buffer, " safe_navigation", 16);
|
4362
|
+
found = true;
|
4363
|
+
}
|
4364
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_VARIABLE_CALL) {
|
4365
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4366
|
+
pm_buffer_append_string(output_buffer, " variable_call", 14);
|
4367
|
+
found = true;
|
4368
|
+
}
|
4369
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE) {
|
4370
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4371
|
+
pm_buffer_append_string(output_buffer, " attribute_write", 16);
|
4372
|
+
found = true;
|
4373
|
+
}
|
4374
|
+
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
4375
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
4376
|
+
}
|
4377
|
+
|
4216
4378
|
// receiver
|
4217
4379
|
{
|
4218
4380
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -4304,25 +4466,6 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
4304
4466
|
}
|
4305
4467
|
}
|
4306
4468
|
|
4307
|
-
// flags
|
4308
|
-
{
|
4309
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
4310
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
4311
|
-
bool found = false;
|
4312
|
-
if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
|
4313
|
-
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4314
|
-
pm_buffer_append_string(output_buffer, " safe_navigation", 16);
|
4315
|
-
found = true;
|
4316
|
-
}
|
4317
|
-
if (cast->base.flags & PM_CALL_NODE_FLAGS_VARIABLE_CALL) {
|
4318
|
-
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4319
|
-
pm_buffer_append_string(output_buffer, " variable_call", 14);
|
4320
|
-
found = true;
|
4321
|
-
}
|
4322
|
-
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
4323
|
-
pm_buffer_append_byte(output_buffer, '\n');
|
4324
|
-
}
|
4325
|
-
|
4326
4469
|
// operator
|
4327
4470
|
{
|
4328
4471
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -4365,6 +4508,30 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
4365
4508
|
prettyprint_location(output_buffer, parser, &node->location);
|
4366
4509
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
4367
4510
|
|
4511
|
+
// flags
|
4512
|
+
{
|
4513
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
4514
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
4515
|
+
bool found = false;
|
4516
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
|
4517
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4518
|
+
pm_buffer_append_string(output_buffer, " safe_navigation", 16);
|
4519
|
+
found = true;
|
4520
|
+
}
|
4521
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_VARIABLE_CALL) {
|
4522
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4523
|
+
pm_buffer_append_string(output_buffer, " variable_call", 14);
|
4524
|
+
found = true;
|
4525
|
+
}
|
4526
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE) {
|
4527
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4528
|
+
pm_buffer_append_string(output_buffer, " attribute_write", 16);
|
4529
|
+
found = true;
|
4530
|
+
}
|
4531
|
+
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
4532
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
4533
|
+
}
|
4534
|
+
|
4368
4535
|
// receiver
|
4369
4536
|
{
|
4370
4537
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -4456,25 +4623,6 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
4456
4623
|
}
|
4457
4624
|
}
|
4458
4625
|
|
4459
|
-
// flags
|
4460
|
-
{
|
4461
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
4462
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
4463
|
-
bool found = false;
|
4464
|
-
if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
|
4465
|
-
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4466
|
-
pm_buffer_append_string(output_buffer, " safe_navigation", 16);
|
4467
|
-
found = true;
|
4468
|
-
}
|
4469
|
-
if (cast->base.flags & PM_CALL_NODE_FLAGS_VARIABLE_CALL) {
|
4470
|
-
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4471
|
-
pm_buffer_append_string(output_buffer, " variable_call", 14);
|
4472
|
-
found = true;
|
4473
|
-
}
|
4474
|
-
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
4475
|
-
pm_buffer_append_byte(output_buffer, '\n');
|
4476
|
-
}
|
4477
|
-
|
4478
4626
|
// operator_loc
|
4479
4627
|
{
|
4480
4628
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -4502,25 +4650,128 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
4502
4650
|
|
4503
4651
|
break;
|
4504
4652
|
}
|
4505
|
-
case
|
4506
|
-
|
4507
|
-
pm_buffer_append_string(output_buffer, "@
|
4653
|
+
case PM_INDEX_TARGET_NODE: {
|
4654
|
+
pm_index_target_node_t *cast = (pm_index_target_node_t *) node;
|
4655
|
+
pm_buffer_append_string(output_buffer, "@ IndexTargetNode (location: ", 29);
|
4508
4656
|
prettyprint_location(output_buffer, parser, &node->location);
|
4509
4657
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
4510
4658
|
|
4511
|
-
//
|
4512
|
-
{
|
4513
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
4514
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 name:", 15);
|
4515
|
-
pm_buffer_append_byte(output_buffer, ' ');
|
4516
|
-
prettyprint_constant(output_buffer, parser, cast->name);
|
4517
|
-
pm_buffer_append_byte(output_buffer, '\n');
|
4518
|
-
}
|
4519
|
-
|
4520
|
-
// name_loc
|
4659
|
+
// flags
|
4521
4660
|
{
|
4522
4661
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
4523
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80
|
4662
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
4663
|
+
bool found = false;
|
4664
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) {
|
4665
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4666
|
+
pm_buffer_append_string(output_buffer, " safe_navigation", 16);
|
4667
|
+
found = true;
|
4668
|
+
}
|
4669
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_VARIABLE_CALL) {
|
4670
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4671
|
+
pm_buffer_append_string(output_buffer, " variable_call", 14);
|
4672
|
+
found = true;
|
4673
|
+
}
|
4674
|
+
if (cast->base.flags & PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE) {
|
4675
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4676
|
+
pm_buffer_append_string(output_buffer, " attribute_write", 16);
|
4677
|
+
found = true;
|
4678
|
+
}
|
4679
|
+
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
4680
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
4681
|
+
}
|
4682
|
+
|
4683
|
+
// receiver
|
4684
|
+
{
|
4685
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
4686
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 receiver:", 19);
|
4687
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
4688
|
+
|
4689
|
+
size_t prefix_length = prefix_buffer->length;
|
4690
|
+
pm_buffer_append_string(prefix_buffer, "\xe2\x94\x82 ", 6);
|
4691
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
4692
|
+
prettyprint_node(output_buffer, parser, (pm_node_t *) cast->receiver, prefix_buffer);
|
4693
|
+
prefix_buffer->length = prefix_length;
|
4694
|
+
}
|
4695
|
+
|
4696
|
+
// opening_loc
|
4697
|
+
{
|
4698
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
4699
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 opening_loc:", 22);
|
4700
|
+
pm_location_t *location = &cast->opening_loc;
|
4701
|
+
pm_buffer_append_byte(output_buffer, ' ');
|
4702
|
+
prettyprint_location(output_buffer, parser, location);
|
4703
|
+
pm_buffer_append_string(output_buffer, " = \"", 4);
|
4704
|
+
prettyprint_source(output_buffer, location->start, (size_t) (location->end - location->start));
|
4705
|
+
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
4706
|
+
}
|
4707
|
+
|
4708
|
+
// arguments
|
4709
|
+
{
|
4710
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
4711
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 arguments:", 20);
|
4712
|
+
if (cast->arguments == NULL) {
|
4713
|
+
pm_buffer_append_string(output_buffer, " \xe2\x88\x85\n", 5);
|
4714
|
+
} else {
|
4715
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
4716
|
+
|
4717
|
+
size_t prefix_length = prefix_buffer->length;
|
4718
|
+
pm_buffer_append_string(prefix_buffer, "\xe2\x94\x82 ", 6);
|
4719
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
4720
|
+
prettyprint_node(output_buffer, parser, (pm_node_t *) cast->arguments, prefix_buffer);
|
4721
|
+
prefix_buffer->length = prefix_length;
|
4722
|
+
}
|
4723
|
+
}
|
4724
|
+
|
4725
|
+
// closing_loc
|
4726
|
+
{
|
4727
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
4728
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 closing_loc:", 22);
|
4729
|
+
pm_location_t *location = &cast->closing_loc;
|
4730
|
+
pm_buffer_append_byte(output_buffer, ' ');
|
4731
|
+
prettyprint_location(output_buffer, parser, location);
|
4732
|
+
pm_buffer_append_string(output_buffer, " = \"", 4);
|
4733
|
+
prettyprint_source(output_buffer, location->start, (size_t) (location->end - location->start));
|
4734
|
+
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
4735
|
+
}
|
4736
|
+
|
4737
|
+
// block
|
4738
|
+
{
|
4739
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
4740
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 block:", 16);
|
4741
|
+
if (cast->block == NULL) {
|
4742
|
+
pm_buffer_append_string(output_buffer, " \xe2\x88\x85\n", 5);
|
4743
|
+
} else {
|
4744
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
4745
|
+
|
4746
|
+
size_t prefix_length = prefix_buffer->length;
|
4747
|
+
pm_buffer_append_string(prefix_buffer, " ", 4);
|
4748
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
4749
|
+
prettyprint_node(output_buffer, parser, (pm_node_t *) cast->block, prefix_buffer);
|
4750
|
+
prefix_buffer->length = prefix_length;
|
4751
|
+
}
|
4752
|
+
}
|
4753
|
+
|
4754
|
+
break;
|
4755
|
+
}
|
4756
|
+
case PM_INSTANCE_VARIABLE_AND_WRITE_NODE: {
|
4757
|
+
pm_instance_variable_and_write_node_t *cast = (pm_instance_variable_and_write_node_t *) node;
|
4758
|
+
pm_buffer_append_string(output_buffer, "@ InstanceVariableAndWriteNode (location: ", 42);
|
4759
|
+
prettyprint_location(output_buffer, parser, &node->location);
|
4760
|
+
pm_buffer_append_string(output_buffer, ")\n", 2);
|
4761
|
+
|
4762
|
+
// name
|
4763
|
+
{
|
4764
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
4765
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 name:", 15);
|
4766
|
+
pm_buffer_append_byte(output_buffer, ' ');
|
4767
|
+
prettyprint_constant(output_buffer, parser, cast->name);
|
4768
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
4769
|
+
}
|
4770
|
+
|
4771
|
+
// name_loc
|
4772
|
+
{
|
4773
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
4774
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 name_loc:", 19);
|
4524
4775
|
pm_location_t *location = &cast->name_loc;
|
4525
4776
|
pm_buffer_append_byte(output_buffer, ' ');
|
4526
4777
|
prettyprint_location(output_buffer, parser, location);
|
@@ -4777,14 +5028,14 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
4777
5028
|
pm_buffer_append_string(output_buffer, " binary", 7);
|
4778
5029
|
found = true;
|
4779
5030
|
}
|
4780
|
-
if (cast->base.flags &
|
5031
|
+
if (cast->base.flags & PM_INTEGER_BASE_FLAGS_DECIMAL) {
|
4781
5032
|
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4782
|
-
pm_buffer_append_string(output_buffer, "
|
5033
|
+
pm_buffer_append_string(output_buffer, " decimal", 8);
|
4783
5034
|
found = true;
|
4784
5035
|
}
|
4785
|
-
if (cast->base.flags &
|
5036
|
+
if (cast->base.flags & PM_INTEGER_BASE_FLAGS_OCTAL) {
|
4786
5037
|
if (found) pm_buffer_append_byte(output_buffer, ',');
|
4787
|
-
pm_buffer_append_string(output_buffer, "
|
5038
|
+
pm_buffer_append_string(output_buffer, " octal", 6);
|
4788
5039
|
found = true;
|
4789
5040
|
}
|
4790
5041
|
if (cast->base.flags & PM_INTEGER_BASE_FLAGS_HEXADECIMAL) {
|
@@ -4804,59 +5055,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
4804
5055
|
prettyprint_location(output_buffer, parser, &node->location);
|
4805
5056
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
4806
5057
|
|
4807
|
-
// opening_loc
|
4808
|
-
{
|
4809
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
4810
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 opening_loc:", 22);
|
4811
|
-
pm_location_t *location = &cast->opening_loc;
|
4812
|
-
pm_buffer_append_byte(output_buffer, ' ');
|
4813
|
-
prettyprint_location(output_buffer, parser, location);
|
4814
|
-
pm_buffer_append_string(output_buffer, " = \"", 4);
|
4815
|
-
prettyprint_source(output_buffer, location->start, (size_t) (location->end - location->start));
|
4816
|
-
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
4817
|
-
}
|
4818
|
-
|
4819
|
-
// parts
|
4820
|
-
{
|
4821
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
4822
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 parts:", 16);
|
4823
|
-
pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->parts.size));
|
4824
|
-
|
4825
|
-
size_t last_index = cast->parts.size;
|
4826
|
-
for (uint32_t index = 0; index < last_index; index++) {
|
4827
|
-
size_t prefix_length = prefix_buffer->length;
|
4828
|
-
pm_buffer_append_string(prefix_buffer, "\xe2\x94\x82 ", 6);
|
4829
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
4830
|
-
|
4831
|
-
if (index == last_index - 1) {
|
4832
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 ", 10);
|
4833
|
-
pm_buffer_append_string(prefix_buffer, " ", 4);
|
4834
|
-
} else {
|
4835
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 ", 10);
|
4836
|
-
pm_buffer_append_string(prefix_buffer, "\xe2\x94\x82 ", 6);
|
4837
|
-
}
|
4838
|
-
|
4839
|
-
prettyprint_node(output_buffer, parser, (pm_node_t *) cast->parts.nodes[index], prefix_buffer);
|
4840
|
-
prefix_buffer->length = prefix_length;
|
4841
|
-
}
|
4842
|
-
}
|
4843
|
-
|
4844
|
-
// closing_loc
|
4845
|
-
{
|
4846
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
4847
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 closing_loc:", 22);
|
4848
|
-
pm_location_t *location = &cast->closing_loc;
|
4849
|
-
pm_buffer_append_byte(output_buffer, ' ');
|
4850
|
-
prettyprint_location(output_buffer, parser, location);
|
4851
|
-
pm_buffer_append_string(output_buffer, " = \"", 4);
|
4852
|
-
prettyprint_source(output_buffer, location->start, (size_t) (location->end - location->start));
|
4853
|
-
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
4854
|
-
}
|
4855
|
-
|
4856
5058
|
// flags
|
4857
5059
|
{
|
4858
5060
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
4859
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\
|
5061
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
4860
5062
|
bool found = false;
|
4861
5063
|
if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE) {
|
4862
5064
|
if (found) pm_buffer_append_byte(output_buffer, ',');
|
@@ -4898,18 +5100,25 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
4898
5100
|
pm_buffer_append_string(output_buffer, " utf_8", 6);
|
4899
5101
|
found = true;
|
4900
5102
|
}
|
5103
|
+
if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING) {
|
5104
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
5105
|
+
pm_buffer_append_string(output_buffer, " forced_utf8_encoding", 21);
|
5106
|
+
found = true;
|
5107
|
+
}
|
5108
|
+
if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING) {
|
5109
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
5110
|
+
pm_buffer_append_string(output_buffer, " forced_binary_encoding", 23);
|
5111
|
+
found = true;
|
5112
|
+
}
|
5113
|
+
if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING) {
|
5114
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
5115
|
+
pm_buffer_append_string(output_buffer, " forced_us_ascii_encoding", 25);
|
5116
|
+
found = true;
|
5117
|
+
}
|
4901
5118
|
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
4902
5119
|
pm_buffer_append_byte(output_buffer, '\n');
|
4903
5120
|
}
|
4904
5121
|
|
4905
|
-
break;
|
4906
|
-
}
|
4907
|
-
case PM_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
|
4908
|
-
pm_interpolated_regular_expression_node_t *cast = (pm_interpolated_regular_expression_node_t *) node;
|
4909
|
-
pm_buffer_append_string(output_buffer, "@ InterpolatedRegularExpressionNode (location: ", 47);
|
4910
|
-
prettyprint_location(output_buffer, parser, &node->location);
|
4911
|
-
pm_buffer_append_string(output_buffer, ")\n", 2);
|
4912
|
-
|
4913
5122
|
// opening_loc
|
4914
5123
|
{
|
4915
5124
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -4950,7 +5159,7 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
4950
5159
|
// closing_loc
|
4951
5160
|
{
|
4952
5161
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
4953
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\
|
5162
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 closing_loc:", 22);
|
4954
5163
|
pm_location_t *location = &cast->closing_loc;
|
4955
5164
|
pm_buffer_append_byte(output_buffer, ' ');
|
4956
5165
|
prettyprint_location(output_buffer, parser, location);
|
@@ -4959,10 +5168,18 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
4959
5168
|
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
4960
5169
|
}
|
4961
5170
|
|
5171
|
+
break;
|
5172
|
+
}
|
5173
|
+
case PM_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
|
5174
|
+
pm_interpolated_regular_expression_node_t *cast = (pm_interpolated_regular_expression_node_t *) node;
|
5175
|
+
pm_buffer_append_string(output_buffer, "@ InterpolatedRegularExpressionNode (location: ", 47);
|
5176
|
+
prettyprint_location(output_buffer, parser, &node->location);
|
5177
|
+
pm_buffer_append_string(output_buffer, ")\n", 2);
|
5178
|
+
|
4962
5179
|
// flags
|
4963
5180
|
{
|
4964
5181
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
4965
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\
|
5182
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
4966
5183
|
bool found = false;
|
4967
5184
|
if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE) {
|
4968
5185
|
if (found) pm_buffer_append_byte(output_buffer, ',');
|
@@ -5004,10 +5221,74 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
5004
5221
|
pm_buffer_append_string(output_buffer, " utf_8", 6);
|
5005
5222
|
found = true;
|
5006
5223
|
}
|
5224
|
+
if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING) {
|
5225
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
5226
|
+
pm_buffer_append_string(output_buffer, " forced_utf8_encoding", 21);
|
5227
|
+
found = true;
|
5228
|
+
}
|
5229
|
+
if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING) {
|
5230
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
5231
|
+
pm_buffer_append_string(output_buffer, " forced_binary_encoding", 23);
|
5232
|
+
found = true;
|
5233
|
+
}
|
5234
|
+
if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING) {
|
5235
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
5236
|
+
pm_buffer_append_string(output_buffer, " forced_us_ascii_encoding", 25);
|
5237
|
+
found = true;
|
5238
|
+
}
|
5007
5239
|
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
5008
5240
|
pm_buffer_append_byte(output_buffer, '\n');
|
5009
5241
|
}
|
5010
5242
|
|
5243
|
+
// opening_loc
|
5244
|
+
{
|
5245
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
5246
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 opening_loc:", 22);
|
5247
|
+
pm_location_t *location = &cast->opening_loc;
|
5248
|
+
pm_buffer_append_byte(output_buffer, ' ');
|
5249
|
+
prettyprint_location(output_buffer, parser, location);
|
5250
|
+
pm_buffer_append_string(output_buffer, " = \"", 4);
|
5251
|
+
prettyprint_source(output_buffer, location->start, (size_t) (location->end - location->start));
|
5252
|
+
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
5253
|
+
}
|
5254
|
+
|
5255
|
+
// parts
|
5256
|
+
{
|
5257
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
5258
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 parts:", 16);
|
5259
|
+
pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast->parts.size));
|
5260
|
+
|
5261
|
+
size_t last_index = cast->parts.size;
|
5262
|
+
for (uint32_t index = 0; index < last_index; index++) {
|
5263
|
+
size_t prefix_length = prefix_buffer->length;
|
5264
|
+
pm_buffer_append_string(prefix_buffer, "\xe2\x94\x82 ", 6);
|
5265
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
5266
|
+
|
5267
|
+
if (index == last_index - 1) {
|
5268
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 ", 10);
|
5269
|
+
pm_buffer_append_string(prefix_buffer, " ", 4);
|
5270
|
+
} else {
|
5271
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 ", 10);
|
5272
|
+
pm_buffer_append_string(prefix_buffer, "\xe2\x94\x82 ", 6);
|
5273
|
+
}
|
5274
|
+
|
5275
|
+
prettyprint_node(output_buffer, parser, (pm_node_t *) cast->parts.nodes[index], prefix_buffer);
|
5276
|
+
prefix_buffer->length = prefix_length;
|
5277
|
+
}
|
5278
|
+
}
|
5279
|
+
|
5280
|
+
// closing_loc
|
5281
|
+
{
|
5282
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
5283
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 closing_loc:", 22);
|
5284
|
+
pm_location_t *location = &cast->closing_loc;
|
5285
|
+
pm_buffer_append_byte(output_buffer, ' ');
|
5286
|
+
prettyprint_location(output_buffer, parser, location);
|
5287
|
+
pm_buffer_append_string(output_buffer, " = \"", 4);
|
5288
|
+
prettyprint_source(output_buffer, location->start, (size_t) (location->end - location->start));
|
5289
|
+
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
5290
|
+
}
|
5291
|
+
|
5011
5292
|
break;
|
5012
5293
|
}
|
5013
5294
|
case PM_INTERPOLATED_STRING_NODE: {
|
@@ -5203,6 +5484,20 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
5203
5484
|
prettyprint_location(output_buffer, parser, &node->location);
|
5204
5485
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
5205
5486
|
|
5487
|
+
// flags
|
5488
|
+
{
|
5489
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
5490
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
5491
|
+
bool found = false;
|
5492
|
+
if (cast->base.flags & PM_KEYWORD_HASH_NODE_FLAGS_STATIC_KEYS) {
|
5493
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
5494
|
+
pm_buffer_append_string(output_buffer, " static_keys", 12);
|
5495
|
+
found = true;
|
5496
|
+
}
|
5497
|
+
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
5498
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
5499
|
+
}
|
5500
|
+
|
5206
5501
|
// elements
|
5207
5502
|
{
|
5208
5503
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -5297,6 +5592,13 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
5297
5592
|
pm_buffer_append_string(output_buffer, "]\n", 2);
|
5298
5593
|
}
|
5299
5594
|
|
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
|
+
|
5300
5602
|
// operator_loc
|
5301
5603
|
{
|
5302
5604
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -5676,55 +5978,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
5676
5978
|
prettyprint_location(output_buffer, parser, &node->location);
|
5677
5979
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
5678
5980
|
|
5679
|
-
// opening_loc
|
5680
|
-
{
|
5681
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
5682
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 opening_loc:", 22);
|
5683
|
-
pm_location_t *location = &cast->opening_loc;
|
5684
|
-
pm_buffer_append_byte(output_buffer, ' ');
|
5685
|
-
prettyprint_location(output_buffer, parser, location);
|
5686
|
-
pm_buffer_append_string(output_buffer, " = \"", 4);
|
5687
|
-
prettyprint_source(output_buffer, location->start, (size_t) (location->end - location->start));
|
5688
|
-
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
5689
|
-
}
|
5690
|
-
|
5691
|
-
// content_loc
|
5692
|
-
{
|
5693
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
5694
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 content_loc:", 22);
|
5695
|
-
pm_location_t *location = &cast->content_loc;
|
5696
|
-
pm_buffer_append_byte(output_buffer, ' ');
|
5697
|
-
prettyprint_location(output_buffer, parser, location);
|
5698
|
-
pm_buffer_append_string(output_buffer, " = \"", 4);
|
5699
|
-
prettyprint_source(output_buffer, location->start, (size_t) (location->end - location->start));
|
5700
|
-
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
5701
|
-
}
|
5702
|
-
|
5703
|
-
// closing_loc
|
5704
|
-
{
|
5705
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
5706
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 closing_loc:", 22);
|
5707
|
-
pm_location_t *location = &cast->closing_loc;
|
5708
|
-
pm_buffer_append_byte(output_buffer, ' ');
|
5709
|
-
prettyprint_location(output_buffer, parser, location);
|
5710
|
-
pm_buffer_append_string(output_buffer, " = \"", 4);
|
5711
|
-
prettyprint_source(output_buffer, location->start, (size_t) (location->end - location->start));
|
5712
|
-
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
5713
|
-
}
|
5714
|
-
|
5715
|
-
// unescaped
|
5716
|
-
{
|
5717
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
5718
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 unescaped:", 20);
|
5719
|
-
pm_buffer_append_string(output_buffer, " \"", 2);
|
5720
|
-
prettyprint_source(output_buffer, pm_string_source(&cast->unescaped), pm_string_length(&cast->unescaped));
|
5721
|
-
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
5722
|
-
}
|
5723
|
-
|
5724
5981
|
// flags
|
5725
5982
|
{
|
5726
5983
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
5727
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\
|
5984
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
5728
5985
|
bool found = false;
|
5729
5986
|
if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE) {
|
5730
5987
|
if (found) pm_buffer_append_byte(output_buffer, ',');
|
@@ -5766,10 +6023,70 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
5766
6023
|
pm_buffer_append_string(output_buffer, " utf_8", 6);
|
5767
6024
|
found = true;
|
5768
6025
|
}
|
6026
|
+
if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING) {
|
6027
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
6028
|
+
pm_buffer_append_string(output_buffer, " forced_utf8_encoding", 21);
|
6029
|
+
found = true;
|
6030
|
+
}
|
6031
|
+
if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING) {
|
6032
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
6033
|
+
pm_buffer_append_string(output_buffer, " forced_binary_encoding", 23);
|
6034
|
+
found = true;
|
6035
|
+
}
|
6036
|
+
if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING) {
|
6037
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
6038
|
+
pm_buffer_append_string(output_buffer, " forced_us_ascii_encoding", 25);
|
6039
|
+
found = true;
|
6040
|
+
}
|
5769
6041
|
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
5770
6042
|
pm_buffer_append_byte(output_buffer, '\n');
|
5771
6043
|
}
|
5772
6044
|
|
6045
|
+
// opening_loc
|
6046
|
+
{
|
6047
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
6048
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 opening_loc:", 22);
|
6049
|
+
pm_location_t *location = &cast->opening_loc;
|
6050
|
+
pm_buffer_append_byte(output_buffer, ' ');
|
6051
|
+
prettyprint_location(output_buffer, parser, location);
|
6052
|
+
pm_buffer_append_string(output_buffer, " = \"", 4);
|
6053
|
+
prettyprint_source(output_buffer, location->start, (size_t) (location->end - location->start));
|
6054
|
+
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
6055
|
+
}
|
6056
|
+
|
6057
|
+
// content_loc
|
6058
|
+
{
|
6059
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
6060
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 content_loc:", 22);
|
6061
|
+
pm_location_t *location = &cast->content_loc;
|
6062
|
+
pm_buffer_append_byte(output_buffer, ' ');
|
6063
|
+
prettyprint_location(output_buffer, parser, location);
|
6064
|
+
pm_buffer_append_string(output_buffer, " = \"", 4);
|
6065
|
+
prettyprint_source(output_buffer, location->start, (size_t) (location->end - location->start));
|
6066
|
+
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
6067
|
+
}
|
6068
|
+
|
6069
|
+
// closing_loc
|
6070
|
+
{
|
6071
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
6072
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 closing_loc:", 22);
|
6073
|
+
pm_location_t *location = &cast->closing_loc;
|
6074
|
+
pm_buffer_append_byte(output_buffer, ' ');
|
6075
|
+
prettyprint_location(output_buffer, parser, location);
|
6076
|
+
pm_buffer_append_string(output_buffer, " = \"", 4);
|
6077
|
+
prettyprint_source(output_buffer, location->start, (size_t) (location->end - location->start));
|
6078
|
+
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
6079
|
+
}
|
6080
|
+
|
6081
|
+
// unescaped
|
6082
|
+
{
|
6083
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
6084
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 unescaped:", 20);
|
6085
|
+
pm_buffer_append_string(output_buffer, " \"", 2);
|
6086
|
+
prettyprint_source(output_buffer, pm_string_source(&cast->unescaped), pm_string_length(&cast->unescaped));
|
6087
|
+
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
6088
|
+
}
|
6089
|
+
|
5773
6090
|
break;
|
5774
6091
|
}
|
5775
6092
|
case PM_MATCH_PREDICATE_NODE: {
|
@@ -6315,6 +6632,21 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
6315
6632
|
|
6316
6633
|
break;
|
6317
6634
|
}
|
6635
|
+
case PM_NUMBERED_PARAMETERS_NODE: {
|
6636
|
+
pm_numbered_parameters_node_t *cast = (pm_numbered_parameters_node_t *) node;
|
6637
|
+
pm_buffer_append_string(output_buffer, "@ NumberedParametersNode (location: ", 36);
|
6638
|
+
prettyprint_location(output_buffer, parser, &node->location);
|
6639
|
+
pm_buffer_append_string(output_buffer, ")\n", 2);
|
6640
|
+
|
6641
|
+
// maximum
|
6642
|
+
{
|
6643
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
6644
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 maximum:", 18);
|
6645
|
+
pm_buffer_append_format(output_buffer, " %d\n", cast->maximum);
|
6646
|
+
}
|
6647
|
+
|
6648
|
+
break;
|
6649
|
+
}
|
6318
6650
|
case PM_NUMBERED_REFERENCE_READ_NODE: {
|
6319
6651
|
pm_numbered_reference_read_node_t *cast = (pm_numbered_reference_read_node_t *) node;
|
6320
6652
|
pm_buffer_append_string(output_buffer, "@ NumberedReferenceReadNode (location: ", 39);
|
@@ -6931,6 +7263,20 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
6931
7263
|
prettyprint_location(output_buffer, parser, &node->location);
|
6932
7264
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
6933
7265
|
|
7266
|
+
// flags
|
7267
|
+
{
|
7268
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
7269
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
7270
|
+
bool found = false;
|
7271
|
+
if (cast->base.flags & PM_RANGE_FLAGS_EXCLUDE_END) {
|
7272
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
7273
|
+
pm_buffer_append_string(output_buffer, " exclude_end", 12);
|
7274
|
+
found = true;
|
7275
|
+
}
|
7276
|
+
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
7277
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
7278
|
+
}
|
7279
|
+
|
6934
7280
|
// left
|
6935
7281
|
{
|
6936
7282
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -6968,7 +7314,7 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
6968
7314
|
// operator_loc
|
6969
7315
|
{
|
6970
7316
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
6971
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\
|
7317
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 operator_loc:", 23);
|
6972
7318
|
pm_location_t *location = &cast->operator_loc;
|
6973
7319
|
pm_buffer_append_byte(output_buffer, ' ');
|
6974
7320
|
prettyprint_location(output_buffer, parser, location);
|
@@ -6977,20 +7323,6 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
6977
7323
|
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
6978
7324
|
}
|
6979
7325
|
|
6980
|
-
// flags
|
6981
|
-
{
|
6982
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
6983
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
6984
|
-
bool found = false;
|
6985
|
-
if (cast->base.flags & PM_RANGE_FLAGS_EXCLUDE_END) {
|
6986
|
-
if (found) pm_buffer_append_byte(output_buffer, ',');
|
6987
|
-
pm_buffer_append_string(output_buffer, " exclude_end", 12);
|
6988
|
-
found = true;
|
6989
|
-
}
|
6990
|
-
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
6991
|
-
pm_buffer_append_byte(output_buffer, '\n');
|
6992
|
-
}
|
6993
|
-
|
6994
7326
|
break;
|
6995
7327
|
}
|
6996
7328
|
case PM_RATIONAL_NODE: {
|
@@ -7027,55 +7359,10 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
7027
7359
|
prettyprint_location(output_buffer, parser, &node->location);
|
7028
7360
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
7029
7361
|
|
7030
|
-
// opening_loc
|
7031
|
-
{
|
7032
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
7033
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 opening_loc:", 22);
|
7034
|
-
pm_location_t *location = &cast->opening_loc;
|
7035
|
-
pm_buffer_append_byte(output_buffer, ' ');
|
7036
|
-
prettyprint_location(output_buffer, parser, location);
|
7037
|
-
pm_buffer_append_string(output_buffer, " = \"", 4);
|
7038
|
-
prettyprint_source(output_buffer, location->start, (size_t) (location->end - location->start));
|
7039
|
-
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
7040
|
-
}
|
7041
|
-
|
7042
|
-
// content_loc
|
7043
|
-
{
|
7044
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
7045
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 content_loc:", 22);
|
7046
|
-
pm_location_t *location = &cast->content_loc;
|
7047
|
-
pm_buffer_append_byte(output_buffer, ' ');
|
7048
|
-
prettyprint_location(output_buffer, parser, location);
|
7049
|
-
pm_buffer_append_string(output_buffer, " = \"", 4);
|
7050
|
-
prettyprint_source(output_buffer, location->start, (size_t) (location->end - location->start));
|
7051
|
-
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
7052
|
-
}
|
7053
|
-
|
7054
|
-
// closing_loc
|
7055
|
-
{
|
7056
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
7057
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 closing_loc:", 22);
|
7058
|
-
pm_location_t *location = &cast->closing_loc;
|
7059
|
-
pm_buffer_append_byte(output_buffer, ' ');
|
7060
|
-
prettyprint_location(output_buffer, parser, location);
|
7061
|
-
pm_buffer_append_string(output_buffer, " = \"", 4);
|
7062
|
-
prettyprint_source(output_buffer, location->start, (size_t) (location->end - location->start));
|
7063
|
-
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
7064
|
-
}
|
7065
|
-
|
7066
|
-
// unescaped
|
7067
|
-
{
|
7068
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
7069
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 unescaped:", 20);
|
7070
|
-
pm_buffer_append_string(output_buffer, " \"", 2);
|
7071
|
-
prettyprint_source(output_buffer, pm_string_source(&cast->unescaped), pm_string_length(&cast->unescaped));
|
7072
|
-
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
7073
|
-
}
|
7074
|
-
|
7075
7362
|
// flags
|
7076
7363
|
{
|
7077
7364
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
7078
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\
|
7365
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
7079
7366
|
bool found = false;
|
7080
7367
|
if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE) {
|
7081
7368
|
if (found) pm_buffer_append_byte(output_buffer, ',');
|
@@ -7117,10 +7404,70 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
7117
7404
|
pm_buffer_append_string(output_buffer, " utf_8", 6);
|
7118
7405
|
found = true;
|
7119
7406
|
}
|
7407
|
+
if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING) {
|
7408
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
7409
|
+
pm_buffer_append_string(output_buffer, " forced_utf8_encoding", 21);
|
7410
|
+
found = true;
|
7411
|
+
}
|
7412
|
+
if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING) {
|
7413
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
7414
|
+
pm_buffer_append_string(output_buffer, " forced_binary_encoding", 23);
|
7415
|
+
found = true;
|
7416
|
+
}
|
7417
|
+
if (cast->base.flags & PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING) {
|
7418
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
7419
|
+
pm_buffer_append_string(output_buffer, " forced_us_ascii_encoding", 25);
|
7420
|
+
found = true;
|
7421
|
+
}
|
7120
7422
|
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
7121
7423
|
pm_buffer_append_byte(output_buffer, '\n');
|
7122
7424
|
}
|
7123
7425
|
|
7426
|
+
// opening_loc
|
7427
|
+
{
|
7428
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
7429
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 opening_loc:", 22);
|
7430
|
+
pm_location_t *location = &cast->opening_loc;
|
7431
|
+
pm_buffer_append_byte(output_buffer, ' ');
|
7432
|
+
prettyprint_location(output_buffer, parser, location);
|
7433
|
+
pm_buffer_append_string(output_buffer, " = \"", 4);
|
7434
|
+
prettyprint_source(output_buffer, location->start, (size_t) (location->end - location->start));
|
7435
|
+
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
7436
|
+
}
|
7437
|
+
|
7438
|
+
// content_loc
|
7439
|
+
{
|
7440
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
7441
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 content_loc:", 22);
|
7442
|
+
pm_location_t *location = &cast->content_loc;
|
7443
|
+
pm_buffer_append_byte(output_buffer, ' ');
|
7444
|
+
prettyprint_location(output_buffer, parser, location);
|
7445
|
+
pm_buffer_append_string(output_buffer, " = \"", 4);
|
7446
|
+
prettyprint_source(output_buffer, location->start, (size_t) (location->end - location->start));
|
7447
|
+
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
7448
|
+
}
|
7449
|
+
|
7450
|
+
// closing_loc
|
7451
|
+
{
|
7452
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
7453
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 closing_loc:", 22);
|
7454
|
+
pm_location_t *location = &cast->closing_loc;
|
7455
|
+
pm_buffer_append_byte(output_buffer, ' ');
|
7456
|
+
prettyprint_location(output_buffer, parser, location);
|
7457
|
+
pm_buffer_append_string(output_buffer, " = \"", 4);
|
7458
|
+
prettyprint_source(output_buffer, location->start, (size_t) (location->end - location->start));
|
7459
|
+
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
7460
|
+
}
|
7461
|
+
|
7462
|
+
// unescaped
|
7463
|
+
{
|
7464
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
7465
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 unescaped:", 20);
|
7466
|
+
pm_buffer_append_string(output_buffer, " \"", 2);
|
7467
|
+
prettyprint_source(output_buffer, pm_string_source(&cast->unescaped), pm_string_length(&cast->unescaped));
|
7468
|
+
pm_buffer_append_string(output_buffer, "\"\n", 2);
|
7469
|
+
}
|
7470
|
+
|
7124
7471
|
break;
|
7125
7472
|
}
|
7126
7473
|
case PM_REQUIRED_KEYWORD_PARAMETER_NODE: {
|
@@ -7625,6 +7972,16 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
7625
7972
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
7626
7973
|
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
7627
7974
|
bool found = false;
|
7975
|
+
if (cast->base.flags & PM_STRING_FLAGS_FORCED_UTF8_ENCODING) {
|
7976
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
7977
|
+
pm_buffer_append_string(output_buffer, " forced_utf8_encoding", 21);
|
7978
|
+
found = true;
|
7979
|
+
}
|
7980
|
+
if (cast->base.flags & PM_STRING_FLAGS_FORCED_BINARY_ENCODING) {
|
7981
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
7982
|
+
pm_buffer_append_string(output_buffer, " forced_binary_encoding", 23);
|
7983
|
+
found = true;
|
7984
|
+
}
|
7628
7985
|
if (cast->base.flags & PM_STRING_FLAGS_FROZEN) {
|
7629
7986
|
if (found) pm_buffer_append_byte(output_buffer, ',');
|
7630
7987
|
pm_buffer_append_string(output_buffer, " frozen", 7);
|
@@ -7781,6 +8138,30 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
7781
8138
|
prettyprint_location(output_buffer, parser, &node->location);
|
7782
8139
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
7783
8140
|
|
8141
|
+
// flags
|
8142
|
+
{
|
8143
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
8144
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
8145
|
+
bool found = false;
|
8146
|
+
if (cast->base.flags & PM_SYMBOL_FLAGS_FORCED_UTF8_ENCODING) {
|
8147
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
8148
|
+
pm_buffer_append_string(output_buffer, " forced_utf8_encoding", 21);
|
8149
|
+
found = true;
|
8150
|
+
}
|
8151
|
+
if (cast->base.flags & PM_SYMBOL_FLAGS_FORCED_BINARY_ENCODING) {
|
8152
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
8153
|
+
pm_buffer_append_string(output_buffer, " forced_binary_encoding", 23);
|
8154
|
+
found = true;
|
8155
|
+
}
|
8156
|
+
if (cast->base.flags & PM_SYMBOL_FLAGS_FORCED_US_ASCII_ENCODING) {
|
8157
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
8158
|
+
pm_buffer_append_string(output_buffer, " forced_us_ascii_encoding", 25);
|
8159
|
+
found = true;
|
8160
|
+
}
|
8161
|
+
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
8162
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
8163
|
+
}
|
8164
|
+
|
7784
8165
|
// opening_loc
|
7785
8166
|
{
|
7786
8167
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -7997,6 +8378,20 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
7997
8378
|
prettyprint_location(output_buffer, parser, &node->location);
|
7998
8379
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
7999
8380
|
|
8381
|
+
// flags
|
8382
|
+
{
|
8383
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
8384
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
8385
|
+
bool found = false;
|
8386
|
+
if (cast->base.flags & PM_LOOP_FLAGS_BEGIN_MODIFIER) {
|
8387
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
8388
|
+
pm_buffer_append_string(output_buffer, " begin_modifier", 15);
|
8389
|
+
found = true;
|
8390
|
+
}
|
8391
|
+
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
8392
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
8393
|
+
}
|
8394
|
+
|
8000
8395
|
// keyword_loc
|
8001
8396
|
{
|
8002
8397
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -8041,34 +8436,20 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
8041
8436
|
// statements
|
8042
8437
|
{
|
8043
8438
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
8044
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\
|
8439
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 statements:", 21);
|
8045
8440
|
if (cast->statements == NULL) {
|
8046
8441
|
pm_buffer_append_string(output_buffer, " \xe2\x88\x85\n", 5);
|
8047
8442
|
} else {
|
8048
8443
|
pm_buffer_append_byte(output_buffer, '\n');
|
8049
8444
|
|
8050
8445
|
size_t prefix_length = prefix_buffer->length;
|
8051
|
-
pm_buffer_append_string(prefix_buffer, "
|
8446
|
+
pm_buffer_append_string(prefix_buffer, " ", 4);
|
8052
8447
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
8053
8448
|
prettyprint_node(output_buffer, parser, (pm_node_t *) cast->statements, prefix_buffer);
|
8054
8449
|
prefix_buffer->length = prefix_length;
|
8055
8450
|
}
|
8056
8451
|
}
|
8057
8452
|
|
8058
|
-
// flags
|
8059
|
-
{
|
8060
|
-
pm_buffer_concat(output_buffer, prefix_buffer);
|
8061
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
8062
|
-
bool found = false;
|
8063
|
-
if (cast->base.flags & PM_LOOP_FLAGS_BEGIN_MODIFIER) {
|
8064
|
-
if (found) pm_buffer_append_byte(output_buffer, ',');
|
8065
|
-
pm_buffer_append_string(output_buffer, " begin_modifier", 15);
|
8066
|
-
found = true;
|
8067
|
-
}
|
8068
|
-
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
8069
|
-
pm_buffer_append_byte(output_buffer, '\n');
|
8070
|
-
}
|
8071
|
-
|
8072
8453
|
break;
|
8073
8454
|
}
|
8074
8455
|
case PM_WHEN_NODE: {
|
@@ -8139,6 +8520,20 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
8139
8520
|
prettyprint_location(output_buffer, parser, &node->location);
|
8140
8521
|
pm_buffer_append_string(output_buffer, ")\n", 2);
|
8141
8522
|
|
8523
|
+
// flags
|
8524
|
+
{
|
8525
|
+
pm_buffer_concat(output_buffer, prefix_buffer);
|
8526
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
8527
|
+
bool found = false;
|
8528
|
+
if (cast->base.flags & PM_LOOP_FLAGS_BEGIN_MODIFIER) {
|
8529
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
8530
|
+
pm_buffer_append_string(output_buffer, " begin_modifier", 15);
|
8531
|
+
found = true;
|
8532
|
+
}
|
8533
|
+
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
8534
|
+
pm_buffer_append_byte(output_buffer, '\n');
|
8535
|
+
}
|
8536
|
+
|
8142
8537
|
// keyword_loc
|
8143
8538
|
{
|
8144
8539
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
@@ -8183,42 +8578,47 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
|
|
8183
8578
|
// statements
|
8184
8579
|
{
|
8185
8580
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
8186
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\
|
8581
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 statements:", 21);
|
8187
8582
|
if (cast->statements == NULL) {
|
8188
8583
|
pm_buffer_append_string(output_buffer, " \xe2\x88\x85\n", 5);
|
8189
8584
|
} else {
|
8190
8585
|
pm_buffer_append_byte(output_buffer, '\n');
|
8191
8586
|
|
8192
8587
|
size_t prefix_length = prefix_buffer->length;
|
8193
|
-
pm_buffer_append_string(prefix_buffer, "
|
8588
|
+
pm_buffer_append_string(prefix_buffer, " ", 4);
|
8194
8589
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
8195
8590
|
prettyprint_node(output_buffer, parser, (pm_node_t *) cast->statements, prefix_buffer);
|
8196
8591
|
prefix_buffer->length = prefix_length;
|
8197
8592
|
}
|
8198
8593
|
}
|
8199
8594
|
|
8595
|
+
break;
|
8596
|
+
}
|
8597
|
+
case PM_X_STRING_NODE: {
|
8598
|
+
pm_x_string_node_t *cast = (pm_x_string_node_t *) node;
|
8599
|
+
pm_buffer_append_string(output_buffer, "@ XStringNode (location: ", 25);
|
8600
|
+
prettyprint_location(output_buffer, parser, &node->location);
|
8601
|
+
pm_buffer_append_string(output_buffer, ")\n", 2);
|
8602
|
+
|
8200
8603
|
// flags
|
8201
8604
|
{
|
8202
8605
|
pm_buffer_concat(output_buffer, prefix_buffer);
|
8203
|
-
pm_buffer_append_string(output_buffer, "\xe2\x94\
|
8606
|
+
pm_buffer_append_string(output_buffer, "\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 flags:", 16);
|
8204
8607
|
bool found = false;
|
8205
|
-
if (cast->base.flags &
|
8608
|
+
if (cast->base.flags & PM_ENCODING_FLAGS_FORCED_UTF8_ENCODING) {
|
8206
8609
|
if (found) pm_buffer_append_byte(output_buffer, ',');
|
8207
|
-
pm_buffer_append_string(output_buffer, "
|
8610
|
+
pm_buffer_append_string(output_buffer, " forced_utf8_encoding", 21);
|
8611
|
+
found = true;
|
8612
|
+
}
|
8613
|
+
if (cast->base.flags & PM_ENCODING_FLAGS_FORCED_BINARY_ENCODING) {
|
8614
|
+
if (found) pm_buffer_append_byte(output_buffer, ',');
|
8615
|
+
pm_buffer_append_string(output_buffer, " forced_binary_encoding", 23);
|
8208
8616
|
found = true;
|
8209
8617
|
}
|
8210
8618
|
if (!found) pm_buffer_append_string(output_buffer, " \xe2\x88\x85", 4);
|
8211
8619
|
pm_buffer_append_byte(output_buffer, '\n');
|
8212
8620
|
}
|
8213
8621
|
|
8214
|
-
break;
|
8215
|
-
}
|
8216
|
-
case PM_X_STRING_NODE: {
|
8217
|
-
pm_x_string_node_t *cast = (pm_x_string_node_t *) node;
|
8218
|
-
pm_buffer_append_string(output_buffer, "@ XStringNode (location: ", 25);
|
8219
|
-
prettyprint_location(output_buffer, parser, &node->location);
|
8220
|
-
pm_buffer_append_string(output_buffer, ")\n", 2);
|
8221
|
-
|
8222
8622
|
// opening_loc
|
8223
8623
|
{
|
8224
8624
|
pm_buffer_concat(output_buffer, prefix_buffer);
|