From 4abe66722bfca7aafff628bf2fc1370921cb5dad Mon Sep 17 00:00:00 2001 From: Margret Riegert Date: Wed, 8 Jan 2025 11:04:29 -0500 Subject: [PATCH 01/13] More fields for lib objects --- grammar.js | 14 +- src/grammar.json | 164 ++++--- src/node-types.json | 291 ++++++------ src/parser.c | 905 +++++++++++++++++++------------------ test/corpus/statements.txt | 39 +- 5 files changed, 749 insertions(+), 664 deletions(-) diff --git a/grammar.js b/grammar.js index 483e0d1..f1be8bc 100644 --- a/grammar.js +++ b/grammar.js @@ -1193,9 +1193,9 @@ module.exports = grammar({ type_def: $ => seq( 'type', - $.constant, + field('name', $.constant), '=', - $._bare_type, + field('type', $._bare_type), ), c_struct_def: $ => { @@ -1204,7 +1204,7 @@ module.exports = grammar({ return seq( 'struct', name, - $._c_struct_expressions, + field('body', alias($._c_struct_expressions, $.expressions)), 'end', ) }, @@ -1232,7 +1232,7 @@ module.exports = grammar({ const names = seq($.identifier, repeat(seq(',', $.identifier))) return seq( - names, + field('name', names), /[ \t]:\s/, field('type', $._bare_type), ) @@ -1244,7 +1244,7 @@ module.exports = grammar({ return seq( 'union', name, - $._union_expressions, + field('body', alias($._union_expressions, $.expressions)), 'end', ) }, @@ -1271,14 +1271,14 @@ module.exports = grammar({ const names = seq($.identifier, repeat(seq(',', $.identifier))) return seq( - names, + field('name', names), /[ \t]:\s/, field('type', $._bare_type), ) }, global_var: $ => { - const name = seq('$', $.identifier) + const name = field('name', seq('$', $.identifier)) const real_name = field('real_name', choice($.identifier, $.constant)) const return_type = field('type', seq(/[ \t]:\s/, $._bare_type)) diff --git a/src/grammar.json b/src/grammar.json index ae69e03..2a73059 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -5162,16 +5162,24 @@ "value": "type" }, { - "type": "SYMBOL", - "name": "constant" + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "constant" + } }, { "type": "STRING", "value": "=" }, { - "type": "SYMBOL", - "name": "_bare_type" + "type": "FIELD", + "name": "type", + "content": { + "type": "SYMBOL", + "name": "_bare_type" + } } ] }, @@ -5191,8 +5199,17 @@ } }, { - "type": "SYMBOL", - "name": "_c_struct_expressions" + "type": "FIELD", + "name": "body", + "content": { + "type": "ALIAS", + "content": { + "type": "SYMBOL", + "name": "_c_struct_expressions" + }, + "named": true, + "value": "expressions" + } }, { "type": "STRING", @@ -5276,29 +5293,33 @@ "type": "SEQ", "members": [ { - "type": "SEQ", - "members": [ - { - "type": "SYMBOL", - "name": "identifier" - }, - { - "type": "REPEAT", - "content": { - "type": "SEQ", - "members": [ - { - "type": "STRING", - "value": "," - }, - { - "type": "SYMBOL", - "name": "identifier" - } - ] + "type": "FIELD", + "name": "name", + "content": { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "identifier" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "SYMBOL", + "name": "identifier" + } + ] + } } - } - ] + ] + } }, { "type": "PATTERN", @@ -5330,8 +5351,17 @@ } }, { - "type": "SYMBOL", - "name": "_union_expressions" + "type": "FIELD", + "name": "body", + "content": { + "type": "ALIAS", + "content": { + "type": "SYMBOL", + "name": "_union_expressions" + }, + "named": true, + "value": "expressions" + } }, { "type": "STRING", @@ -5411,29 +5441,33 @@ "type": "SEQ", "members": [ { - "type": "SEQ", - "members": [ - { - "type": "SYMBOL", - "name": "identifier" - }, - { - "type": "REPEAT", - "content": { - "type": "SEQ", - "members": [ - { - "type": "STRING", - "value": "," - }, - { - "type": "SYMBOL", - "name": "identifier" - } - ] + "type": "FIELD", + "name": "name", + "content": { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "identifier" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "SYMBOL", + "name": "identifier" + } + ] + } } - } - ] + ] + } }, { "type": "PATTERN", @@ -5453,17 +5487,21 @@ "type": "SEQ", "members": [ { - "type": "SEQ", - "members": [ - { - "type": "STRING", - "value": "$" - }, - { - "type": "SYMBOL", - "name": "identifier" - } - ] + "type": "FIELD", + "name": "name", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "$" + }, + { + "type": "SYMBOL", + "name": "identifier" + } + ] + } }, { "type": "CHOICE", diff --git a/src/node-types.json b/src/node-types.json index eb9e051..982e8c3 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -2775,6 +2775,16 @@ "type": "c_struct_def", "named": true, "fields": { + "body": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expressions", + "named": true + } + ] + }, "name": { "multiple": false, "required": true, @@ -2785,30 +2795,26 @@ } ] } - }, - "children": { - "multiple": true, - "required": false, - "types": [ - { - "type": "c_struct_fields", - "named": true - }, - { - "type": "include", - "named": true - }, - { - "type": "macro_expression", - "named": true - } - ] } }, { "type": "c_struct_fields", "named": true, "fields": { + "name": { + "multiple": true, + "required": true, + "types": [ + { + "type": ",", + "named": false + }, + { + "type": "identifier", + "named": true + } + ] + }, "type": { "multiple": true, "required": true, @@ -2887,16 +2893,6 @@ } ] } - }, - "children": { - "multiple": true, - "required": true, - "types": [ - { - "type": "identifier", - "named": true - } - ] } }, { @@ -6272,6 +6268,10 @@ "type": "c_struct_def", "named": true }, + { + "type": "c_struct_fields", + "named": true + }, { "type": "call", "named": true @@ -6544,6 +6544,10 @@ "type": "union_def", "named": true }, + { + "type": "union_fields", + "named": true + }, { "type": "unless", "named": true @@ -6900,6 +6904,20 @@ "type": "global_var", "named": true, "fields": { + "name": { + "multiple": true, + "required": true, + "types": [ + { + "type": "$", + "named": false + }, + { + "type": "identifier", + "named": true + } + ] + }, "real_name": { "multiple": false, "required": false, @@ -6992,16 +7010,6 @@ } ] } - }, - "children": { - "multiple": false, - "required": true, - "types": [ - { - "type": "identifier", - "named": true - } - ] } }, { @@ -18200,76 +18208,95 @@ { "type": "type_def", "named": true, - "fields": {}, - "children": { - "multiple": true, - "required": true, - "types": [ - { - "type": "class_type", - "named": true - }, - { - "type": "constant", - "named": true - }, - { - "type": "double_splat_type", - "named": true - }, - { - "type": "generic_instance_type", - "named": true - }, - { - "type": "macro_expression", - "named": true - }, - { - "type": "named_tuple_type", - "named": true - }, - { - "type": "nilable_type", - "named": true - }, - { - "type": "pointer_type", - "named": true - }, - { - "type": "proc_type", - "named": true - }, - { - "type": "self", - "named": true - }, - { - "type": "splat_type", - "named": true - }, - { - "type": "static_array_type", - "named": true - }, - { - "type": "tuple_type", - "named": true - }, - { - "type": "typeof", - "named": true - }, - { - "type": "underscore", - "named": true - }, - { - "type": "union_type", - "named": true - } - ] + "fields": { + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "constant", + "named": true + } + ] + }, + "type": { + "multiple": true, + "required": true, + "types": [ + { + "type": "(", + "named": false + }, + { + "type": ")", + "named": false + }, + { + "type": "class_type", + "named": true + }, + { + "type": "constant", + "named": true + }, + { + "type": "double_splat_type", + "named": true + }, + { + "type": "generic_instance_type", + "named": true + }, + { + "type": "macro_expression", + "named": true + }, + { + "type": "named_tuple_type", + "named": true + }, + { + "type": "nilable_type", + "named": true + }, + { + "type": "pointer_type", + "named": true + }, + { + "type": "proc_type", + "named": true + }, + { + "type": "self", + "named": true + }, + { + "type": "splat_type", + "named": true + }, + { + "type": "static_array_type", + "named": true + }, + { + "type": "tuple_type", + "named": true + }, + { + "type": "typeof", + "named": true + }, + { + "type": "underscore", + "named": true + }, + { + "type": "union_type", + "named": true + } + ] + } } }, { @@ -18594,6 +18621,16 @@ "type": "union_def", "named": true, "fields": { + "body": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expressions", + "named": true + } + ] + }, "name": { "multiple": false, "required": true, @@ -18604,26 +18641,26 @@ } ] } - }, - "children": { - "multiple": true, - "required": false, - "types": [ - { - "type": "include", - "named": true - }, - { - "type": "union_fields", - "named": true - } - ] } }, { "type": "union_fields", "named": true, "fields": { + "name": { + "multiple": true, + "required": true, + "types": [ + { + "type": ",", + "named": false + }, + { + "type": "identifier", + "named": true + } + ] + }, "type": { "multiple": true, "required": true, @@ -18702,16 +18739,6 @@ } ] } - }, - "children": { - "multiple": true, - "required": true, - "types": [ - { - "type": "identifier", - "named": true - } - ] } }, { diff --git a/src/parser.c b/src/parser.c index 679819e..ddc5ac9 100644 --- a/src/parser.c +++ b/src/parser.c @@ -21,7 +21,7 @@ #define EXTERNAL_TOKEN_COUNT 61 #define FIELD_COUNT 41 #define MAX_ALIAS_SEQUENCE_LENGTH 11 -#define PRODUCTION_ID_COUNT 251 +#define PRODUCTION_ID_COUNT 252 enum ts_symbol_identifiers { sym_identifier = 1, @@ -816,11 +816,11 @@ static const char * const ts_symbol_names[] = { [sym_fun_param] = "fun_param", [sym_type_def] = "type_def", [sym_c_struct_def] = "c_struct_def", - [sym__c_struct_expressions] = "_c_struct_expressions", + [sym__c_struct_expressions] = "expressions", [sym__c_struct_expression] = "_c_struct_expression", [sym_c_struct_fields] = "c_struct_fields", [sym_union_def] = "union_def", - [sym__union_expressions] = "_union_expressions", + [sym__union_expressions] = "expressions", [sym__union_expression] = "_union_expression", [sym_union_fields] = "union_fields", [sym_global_var] = "global_var", @@ -1318,11 +1318,11 @@ static const TSSymbol ts_symbol_map[] = { [sym_fun_param] = sym_fun_param, [sym_type_def] = sym_type_def, [sym_c_struct_def] = sym_c_struct_def, - [sym__c_struct_expressions] = sym__c_struct_expressions, + [sym__c_struct_expressions] = sym_expressions, [sym__c_struct_expression] = sym__c_struct_expression, [sym_c_struct_fields] = sym_c_struct_fields, [sym_union_def] = sym_union_def, - [sym__union_expressions] = sym__union_expressions, + [sym__union_expressions] = sym_expressions, [sym__union_expression] = sym__union_expression, [sym_union_fields] = sym_union_fields, [sym_global_var] = sym_global_var, @@ -2694,7 +2694,7 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .named = true, }, [sym__c_struct_expressions] = { - .visible = false, + .visible = true, .named = true, }, [sym__c_struct_expression] = { @@ -2710,7 +2710,7 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .named = true, }, [sym__union_expressions] = { - .visible = false, + .visible = true, .named = true, }, [sym__union_expression] = { @@ -3684,185 +3684,186 @@ static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = { [68] = {.index = 132, .length = 2}, [69] = {.index = 134, .length = 1}, [70] = {.index = 132, .length = 2}, - [71] = {.index = 135, .length = 2}, - [72] = {.index = 137, .length = 3}, - [74] = {.index = 137, .length = 3}, - [75] = {.index = 140, .length = 3}, - [76] = {.index = 140, .length = 3}, - [77] = {.index = 143, .length = 1}, - [78] = {.index = 144, .length = 2}, - [79] = {.index = 146, .length = 1}, - [80] = {.index = 147, .length = 2}, - [81] = {.index = 149, .length = 7}, - [82] = {.index = 156, .length = 9}, - [83] = {.index = 165, .length = 3}, - [84] = {.index = 168, .length = 1}, - [85] = {.index = 169, .length = 1}, - [86] = {.index = 170, .length = 1}, - [87] = {.index = 171, .length = 3}, - [88] = {.index = 174, .length = 4}, - [89] = {.index = 178, .length = 3}, - [90] = {.index = 181, .length = 1}, - [91] = {.index = 182, .length = 2}, - [92] = {.index = 184, .length = 3}, - [93] = {.index = 187, .length = 1}, - [94] = {.index = 188, .length = 5}, + [71] = {.index = 135, .length = 4}, + [72] = {.index = 139, .length = 3}, + [74] = {.index = 139, .length = 3}, + [75] = {.index = 142, .length = 3}, + [76] = {.index = 142, .length = 3}, + [77] = {.index = 145, .length = 1}, + [78] = {.index = 146, .length = 2}, + [79] = {.index = 148, .length = 1}, + [80] = {.index = 149, .length = 2}, + [81] = {.index = 151, .length = 7}, + [82] = {.index = 158, .length = 9}, + [83] = {.index = 167, .length = 3}, + [84] = {.index = 170, .length = 1}, + [85] = {.index = 171, .length = 1}, + [86] = {.index = 172, .length = 1}, + [87] = {.index = 173, .length = 3}, + [88] = {.index = 176, .length = 4}, + [89] = {.index = 180, .length = 3}, + [90] = {.index = 183, .length = 1}, + [91] = {.index = 184, .length = 2}, + [92] = {.index = 186, .length = 3}, + [93] = {.index = 189, .length = 1}, + [94] = {.index = 190, .length = 5}, [95] = {.index = 89, .length = 3}, - [96] = {.index = 193, .length = 3}, - [97] = {.index = 196, .length = 3}, - [98] = {.index = 199, .length = 6}, - [99] = {.index = 205, .length = 8}, - [100] = {.index = 213, .length = 9}, - [101] = {.index = 222, .length = 4}, - [102] = {.index = 226, .length = 1}, - [103] = {.index = 227, .length = 1}, - [104] = {.index = 228, .length = 3}, - [105] = {.index = 231, .length = 2}, - [106] = {.index = 233, .length = 3}, - [107] = {.index = 236, .length = 1}, - [108] = {.index = 237, .length = 2}, - [109] = {.index = 239, .length = 2}, - [110] = {.index = 241, .length = 2}, - [111] = {.index = 243, .length = 2}, - [112] = {.index = 245, .length = 2}, - [113] = {.index = 247, .length = 3}, - [114] = {.index = 250, .length = 3}, - [115] = {.index = 253, .length = 2}, - [116] = {.index = 255, .length = 2}, - [117] = {.index = 257, .length = 2}, - [118] = {.index = 259, .length = 2}, - [119] = {.index = 261, .length = 2}, - [120] = {.index = 263, .length = 2}, - [121] = {.index = 265, .length = 2}, - [122] = {.index = 267, .length = 2}, - [123] = {.index = 269, .length = 2}, - [124] = {.index = 271, .length = 4}, - [125] = {.index = 267, .length = 2}, - [126] = {.index = 269, .length = 2}, - [127] = {.index = 271, .length = 4}, - [128] = {.index = 275, .length = 4}, - [129] = {.index = 275, .length = 4}, - [130] = {.index = 279, .length = 3}, - [131] = {.index = 282, .length = 3}, - [132] = {.index = 285, .length = 2}, - [133] = {.index = 282, .length = 3}, - [134] = {.index = 287, .length = 3}, - [135] = {.index = 290, .length = 7}, - [136] = {.index = 297, .length = 9}, - [137] = {.index = 306, .length = 10}, - [138] = {.index = 316, .length = 2}, - [139] = {.index = 318, .length = 2}, - [140] = {.index = 320, .length = 4}, - [141] = {.index = 324, .length = 1}, - [142] = {.index = 325, .length = 2}, - [143] = {.index = 327, .length = 2}, - [144] = {.index = 329, .length = 2}, - [145] = {.index = 331, .length = 2}, - [146] = {.index = 333, .length = 1}, - [147] = {.index = 334, .length = 4}, - [148] = {.index = 196, .length = 3}, - [149] = {.index = 338, .length = 3}, - [150] = {.index = 341, .length = 9}, - [151] = {.index = 350, .length = 4}, - [152] = {.index = 354, .length = 3}, - [153] = {.index = 357, .length = 2}, - [154] = {.index = 359, .length = 3}, - [155] = {.index = 362, .length = 2}, - [156] = {.index = 364, .length = 3}, - [157] = {.index = 367, .length = 4}, - [158] = {.index = 371, .length = 4}, - [159] = {.index = 375, .length = 3}, - [160] = {.index = 378, .length = 2}, - [161] = {.index = 380, .length = 3}, - [162] = {.index = 383, .length = 4}, - [163] = {.index = 387, .length = 2}, - [164] = {.index = 389, .length = 3}, - [165] = {.index = 383, .length = 4}, - [166] = {.index = 392, .length = 3}, - [167] = {.index = 395, .length = 3}, - [168] = {.index = 398, .length = 2}, - [169] = {.index = 400, .length = 3}, - [170] = {.index = 395, .length = 3}, - [171] = {.index = 400, .length = 3}, - [172] = {.index = 403, .length = 5}, - [173] = {.index = 403, .length = 5}, - [174] = {.index = 408, .length = 2}, - [175] = {.index = 410, .length = 4}, - [176] = {.index = 414, .length = 3}, - [177] = {.index = 417, .length = 3}, - [178] = {.index = 420, .length = 3}, - [179] = {.index = 423, .length = 4}, - [180] = {.index = 427, .length = 3}, - [181] = {.index = 427, .length = 3}, - [182] = {.index = 430, .length = 10}, - [183] = {.index = 440, .length = 2}, - [184] = {.index = 442, .length = 3}, - [185] = {.index = 445, .length = 1}, - [186] = {.index = 446, .length = 1}, - [187] = {.index = 447, .length = 3}, - [188] = {.index = 450, .length = 2}, - [189] = {.index = 452, .length = 2}, - [190] = {.index = 454, .length = 2}, - [191] = {.index = 456, .length = 5}, - [192] = {.index = 461, .length = 4}, - [193] = {.index = 465, .length = 4}, - [194] = {.index = 469, .length = 4}, - [195] = {.index = 473, .length = 3}, - [196] = {.index = 476, .length = 4}, - [197] = {.index = 480, .length = 3}, - [198] = {.index = 483, .length = 1}, - [199] = {.index = 484, .length = 3}, - [200] = {.index = 487, .length = 4}, - [201] = {.index = 491, .length = 4}, - [202] = {.index = 495, .length = 4}, - [203] = {.index = 491, .length = 4}, - [204] = {.index = 495, .length = 4}, - [205] = {.index = 499, .length = 4}, - [206] = {.index = 503, .length = 4}, - [207] = {.index = 507, .length = 6}, - [208] = {.index = 499, .length = 4}, - [209] = {.index = 503, .length = 4}, - [210] = {.index = 507, .length = 6}, - [211] = {.index = 513, .length = 3}, - [212] = {.index = 516, .length = 4}, - [213] = {.index = 520, .length = 5}, - [214] = {.index = 525, .length = 3}, - [215] = {.index = 528, .length = 1}, - [216] = {.index = 529, .length = 1}, - [217] = {.index = 530, .length = 2}, - [218] = {.index = 532, .length = 2}, - [219] = {.index = 534, .length = 2}, - [220] = {.index = 536, .length = 6}, - [221] = {.index = 542, .length = 5}, - [222] = {.index = 547, .length = 5}, - [223] = {.index = 552, .length = 1}, - [224] = {.index = 553, .length = 4}, - [225] = {.index = 557, .length = 3}, - [226] = {.index = 560, .length = 3}, - [227] = {.index = 563, .length = 5}, - [228] = {.index = 568, .length = 5}, - [229] = {.index = 573, .length = 3}, - [230] = {.index = 568, .length = 5}, - [231] = {.index = 576, .length = 5}, - [232] = {.index = 581, .length = 5}, - [233] = {.index = 576, .length = 5}, - [234] = {.index = 581, .length = 5}, - [235] = {.index = 586, .length = 4}, - [236] = {.index = 590, .length = 1}, - [237] = {.index = 591, .length = 2}, - [238] = {.index = 593, .length = 6}, - [239] = {.index = 599, .length = 5}, - [240] = {.index = 604, .length = 4}, - [241] = {.index = 608, .length = 4}, - [242] = {.index = 612, .length = 6}, - [243] = {.index = 618, .length = 6}, - [244] = {.index = 612, .length = 6}, - [245] = {.index = 618, .length = 6}, - [246] = {.index = 624, .length = 5}, - [247] = {.index = 629, .length = 5}, - [248] = {.index = 634, .length = 7}, - [249] = {.index = 634, .length = 7}, - [250] = {.index = 641, .length = 6}, + [96] = {.index = 195, .length = 3}, + [97] = {.index = 198, .length = 3}, + [98] = {.index = 201, .length = 6}, + [99] = {.index = 207, .length = 8}, + [100] = {.index = 215, .length = 9}, + [101] = {.index = 224, .length = 4}, + [102] = {.index = 228, .length = 1}, + [103] = {.index = 229, .length = 1}, + [104] = {.index = 230, .length = 3}, + [105] = {.index = 233, .length = 2}, + [106] = {.index = 235, .length = 3}, + [107] = {.index = 238, .length = 1}, + [108] = {.index = 239, .length = 2}, + [109] = {.index = 241, .length = 2}, + [110] = {.index = 243, .length = 2}, + [111] = {.index = 245, .length = 2}, + [112] = {.index = 247, .length = 2}, + [113] = {.index = 249, .length = 3}, + [114] = {.index = 252, .length = 3}, + [115] = {.index = 255, .length = 2}, + [116] = {.index = 257, .length = 2}, + [117] = {.index = 259, .length = 2}, + [118] = {.index = 261, .length = 2}, + [119] = {.index = 263, .length = 2}, + [120] = {.index = 265, .length = 2}, + [121] = {.index = 267, .length = 2}, + [122] = {.index = 269, .length = 2}, + [123] = {.index = 271, .length = 2}, + [124] = {.index = 273, .length = 4}, + [125] = {.index = 269, .length = 2}, + [126] = {.index = 271, .length = 2}, + [127] = {.index = 273, .length = 4}, + [128] = {.index = 277, .length = 4}, + [129] = {.index = 277, .length = 4}, + [130] = {.index = 281, .length = 3}, + [131] = {.index = 284, .length = 3}, + [132] = {.index = 287, .length = 2}, + [133] = {.index = 284, .length = 3}, + [134] = {.index = 289, .length = 3}, + [135] = {.index = 292, .length = 7}, + [136] = {.index = 299, .length = 9}, + [137] = {.index = 308, .length = 10}, + [138] = {.index = 318, .length = 2}, + [139] = {.index = 320, .length = 2}, + [140] = {.index = 322, .length = 4}, + [141] = {.index = 326, .length = 1}, + [142] = {.index = 327, .length = 2}, + [143] = {.index = 329, .length = 2}, + [144] = {.index = 331, .length = 2}, + [145] = {.index = 333, .length = 2}, + [146] = {.index = 335, .length = 1}, + [147] = {.index = 336, .length = 4}, + [148] = {.index = 198, .length = 3}, + [149] = {.index = 340, .length = 3}, + [150] = {.index = 343, .length = 9}, + [151] = {.index = 352, .length = 4}, + [152] = {.index = 356, .length = 3}, + [153] = {.index = 359, .length = 2}, + [154] = {.index = 361, .length = 3}, + [155] = {.index = 364, .length = 2}, + [156] = {.index = 366, .length = 3}, + [157] = {.index = 369, .length = 4}, + [158] = {.index = 373, .length = 4}, + [159] = {.index = 377, .length = 3}, + [160] = {.index = 380, .length = 2}, + [161] = {.index = 382, .length = 3}, + [162] = {.index = 385, .length = 4}, + [163] = {.index = 389, .length = 2}, + [164] = {.index = 391, .length = 3}, + [165] = {.index = 385, .length = 4}, + [166] = {.index = 394, .length = 5}, + [167] = {.index = 399, .length = 3}, + [168] = {.index = 402, .length = 2}, + [169] = {.index = 404, .length = 3}, + [170] = {.index = 399, .length = 3}, + [171] = {.index = 404, .length = 3}, + [172] = {.index = 407, .length = 5}, + [173] = {.index = 407, .length = 5}, + [174] = {.index = 412, .length = 2}, + [175] = {.index = 414, .length = 4}, + [176] = {.index = 418, .length = 3}, + [177] = {.index = 421, .length = 3}, + [178] = {.index = 424, .length = 3}, + [179] = {.index = 427, .length = 4}, + [180] = {.index = 431, .length = 3}, + [181] = {.index = 431, .length = 3}, + [182] = {.index = 434, .length = 10}, + [183] = {.index = 444, .length = 2}, + [184] = {.index = 446, .length = 3}, + [185] = {.index = 449, .length = 1}, + [186] = {.index = 450, .length = 1}, + [187] = {.index = 451, .length = 3}, + [188] = {.index = 454, .length = 2}, + [189] = {.index = 456, .length = 2}, + [190] = {.index = 458, .length = 2}, + [191] = {.index = 460, .length = 5}, + [192] = {.index = 465, .length = 4}, + [193] = {.index = 469, .length = 4}, + [194] = {.index = 473, .length = 4}, + [195] = {.index = 477, .length = 3}, + [196] = {.index = 480, .length = 4}, + [197] = {.index = 484, .length = 3}, + [198] = {.index = 487, .length = 2}, + [199] = {.index = 489, .length = 3}, + [200] = {.index = 492, .length = 4}, + [201] = {.index = 496, .length = 4}, + [202] = {.index = 500, .length = 4}, + [203] = {.index = 504, .length = 2}, + [204] = {.index = 496, .length = 4}, + [205] = {.index = 500, .length = 4}, + [206] = {.index = 506, .length = 4}, + [207] = {.index = 510, .length = 4}, + [208] = {.index = 514, .length = 6}, + [209] = {.index = 506, .length = 4}, + [210] = {.index = 510, .length = 4}, + [211] = {.index = 514, .length = 6}, + [212] = {.index = 520, .length = 3}, + [213] = {.index = 523, .length = 4}, + [214] = {.index = 527, .length = 5}, + [215] = {.index = 532, .length = 3}, + [216] = {.index = 535, .length = 1}, + [217] = {.index = 536, .length = 1}, + [218] = {.index = 537, .length = 2}, + [219] = {.index = 539, .length = 2}, + [220] = {.index = 541, .length = 2}, + [221] = {.index = 543, .length = 6}, + [222] = {.index = 549, .length = 5}, + [223] = {.index = 554, .length = 5}, + [224] = {.index = 559, .length = 3}, + [225] = {.index = 562, .length = 4}, + [226] = {.index = 566, .length = 3}, + [227] = {.index = 569, .length = 3}, + [228] = {.index = 572, .length = 5}, + [229] = {.index = 577, .length = 5}, + [230] = {.index = 582, .length = 3}, + [231] = {.index = 577, .length = 5}, + [232] = {.index = 585, .length = 5}, + [233] = {.index = 590, .length = 5}, + [234] = {.index = 585, .length = 5}, + [235] = {.index = 590, .length = 5}, + [236] = {.index = 595, .length = 4}, + [237] = {.index = 599, .length = 1}, + [238] = {.index = 600, .length = 2}, + [239] = {.index = 602, .length = 6}, + [240] = {.index = 608, .length = 5}, + [241] = {.index = 613, .length = 4}, + [242] = {.index = 617, .length = 4}, + [243] = {.index = 621, .length = 6}, + [244] = {.index = 627, .length = 6}, + [245] = {.index = 621, .length = 6}, + [246] = {.index = 627, .length = 6}, + [247] = {.index = 633, .length = 5}, + [248] = {.index = 638, .length = 5}, + [249] = {.index = 643, .length = 7}, + [250] = {.index = 643, .length = 7}, + [251] = {.index = 650, .length = 6}, }; static const TSFieldMapEntry ts_field_map_entries[] = { @@ -4063,27 +4064,29 @@ static const TSFieldMapEntry ts_field_map_entries[] = { [134] = {field_name, 2}, [135] = + {field_name, 0}, + {field_name, 1}, {field_type, 2}, {field_type, 3}, - [137] = + [139] = {field_name, 1}, {field_type, 2}, {field_type, 3}, - [140] = + [142] = {field_class, 1}, {field_class, 2}, {field_name, 3}, - [143] = + [145] = {field_with, 1}, - [144] = + [146] = {field_method, 1}, {field_receiver, 0}, - [146] = + [148] = {field_receiver, 0}, - [147] = + [149] = {field_type, 3}, {field_var, 0}, - [149] = + [151] = {field_body, 2}, {field_class, 1, .inherited = true}, {field_forall, 1, .inherited = true}, @@ -4091,7 +4094,7 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_params, 1, .inherited = true}, {field_type, 1, .inherited = true}, {field_visibility, 0}, - [156] = + [158] = {field_class, 1, .inherited = true}, {field_else, 2, .inherited = true}, {field_ensure, 2, .inherited = true}, @@ -4101,62 +4104,62 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_rescue, 2, .inherited = true}, {field_type, 1, .inherited = true}, {field_visibility, 0}, - [165] = + [167] = {field_lhs, 1}, {field_rhs, 3}, {field_visibility, 0}, - [168] = + [170] = {field_variable, 1}, - [169] = + [171] = {field_body, 2}, - [170] = + [172] = {field_type, 1}, - [171] = + [173] = {field_else, 2, .inherited = true}, {field_ensure, 2, .inherited = true}, {field_rescue, 2, .inherited = true}, - [174] = + [176] = {field_body, 1}, {field_else, 2, .inherited = true}, {field_ensure, 2, .inherited = true}, {field_rescue, 2, .inherited = true}, - [178] = + [180] = {field_else, 1}, {field_ensure, 2}, {field_rescue, 0}, - [181] = + [183] = {field_return, 2}, - [182] = + [184] = {field_name, 1}, {field_type, 3}, - [184] = + [186] = {field_clobbers, 1, .inherited = true}, {field_inputs, 1, .inherited = true}, {field_options, 1, .inherited = true}, - [187] = + [189] = {field_outputs, 1}, - [188] = + [190] = {field_clobbers, 2, .inherited = true}, {field_inputs, 2, .inherited = true}, {field_options, 2, .inherited = true}, {field_outputs, 2, .inherited = true}, {field_text, 1}, - [193] = + [195] = {field_begin, 0}, {field_end, 3}, {field_operator, 1}, - [196] = + [198] = {field_arguments, 3}, {field_method, 2}, {field_receiver, 0}, - [199] = + [201] = {field_body, 2}, {field_class, 0, .inherited = true}, {field_forall, 0, .inherited = true}, {field_name, 0, .inherited = true}, {field_params, 0, .inherited = true}, {field_type, 0, .inherited = true}, - [205] = + [207] = {field_class, 0, .inherited = true}, {field_else, 2, .inherited = true}, {field_ensure, 2, .inherited = true}, @@ -4165,7 +4168,7 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_params, 0, .inherited = true}, {field_rescue, 2, .inherited = true}, {field_type, 0, .inherited = true}, - [213] = + [215] = {field_body, 1}, {field_class, 0, .inherited = true}, {field_else, 2, .inherited = true}, @@ -4175,104 +4178,104 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_params, 0, .inherited = true}, {field_rescue, 2, .inherited = true}, {field_type, 0, .inherited = true}, - [222] = + [224] = {field_body, 2}, {field_name, 0, .inherited = true}, {field_params, 0, .inherited = true}, {field_visibility, 0, .inherited = true}, - [226] = + [228] = {field_params, 2}, - [227] = + [229] = {field_rhs, 0}, - [228] = + [230] = {field_lhs, 0}, {field_rhs, 2, .inherited = true}, {field_rhs, 3}, - [231] = + [233] = {field_rhs, 0, .inherited = true}, {field_rhs, 1, .inherited = true}, - [233] = + [235] = {field_lhs, 0, .inherited = true}, {field_lhs, 1}, {field_rhs, 3}, - [236] = + [238] = {field_var, 1}, - [237] = + [239] = {field_cond, 3}, {field_var, 1}, - [239] = + [241] = {field_var, 0, .inherited = true}, {field_var, 1, .inherited = true}, - [241] = + [243] = {field_cond, 1}, {field_then, 3}, - [243] = + [245] = {field_cond, 1}, {field_else, 3}, - [245] = + [247] = {field_of, 3}, {field_of, 4}, - [247] = + [249] = {field_default, 1}, {field_default, 2}, {field_name, 0}, - [250] = + [252] = {field_name, 0}, {field_type, 1}, {field_type, 2}, - [253] = + [255] = {field_block, 4}, {field_params, 2}, - [255] = + [257] = {field_extern_name, 1}, {field_name, 2}, - [257] = + [259] = {field_method, 1}, {field_params, 3}, - [259] = + [261] = {field_method, 1, .inherited = true}, {field_params, 3}, - [261] = + [263] = {field_body, 3}, {field_name, 2}, - [263] = + [265] = {field_name, 1}, {field_superclass, 3}, - [265] = + [267] = {field_name, 1}, {field_real_name, 3}, - [267] = + [269] = {field_forall, 4}, {field_name, 1}, - [269] = + [271] = {field_name, 1}, {field_params, 3}, - [271] = + [273] = {field_forall, 4}, {field_name, 1}, {field_type, 2}, {field_type, 3}, - [275] = + [277] = {field_class, 1}, {field_class, 2}, {field_forall, 4}, {field_name, 3}, - [279] = + [281] = {field_block, 2}, {field_method, 1}, {field_receiver, 0}, - [282] = + [284] = {field_body, 3}, {field_name, 2}, {field_visibility, 0}, - [285] = + [287] = {field_name, 3}, {field_visibility, 0}, - [287] = + [289] = {field_name, 2}, {field_type, 4}, {field_visibility, 0}, - [290] = + [292] = {field_body, 3}, {field_class, 1, .inherited = true}, {field_forall, 1, .inherited = true}, @@ -4280,7 +4283,7 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_params, 1, .inherited = true}, {field_type, 1, .inherited = true}, {field_visibility, 0}, - [297] = + [299] = {field_class, 1, .inherited = true}, {field_else, 3, .inherited = true}, {field_ensure, 3, .inherited = true}, @@ -4290,7 +4293,7 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_rescue, 3, .inherited = true}, {field_type, 1, .inherited = true}, {field_visibility, 0}, - [306] = + [308] = {field_body, 2}, {field_class, 1, .inherited = true}, {field_else, 3, .inherited = true}, @@ -4301,43 +4304,43 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_rescue, 3, .inherited = true}, {field_type, 1, .inherited = true}, {field_visibility, 0}, - [316] = + [318] = {field_body, 3}, {field_variable, 1}, - [318] = + [320] = {field_body, 3}, {field_type, 1}, - [320] = + [322] = {field_body, 2}, {field_else, 3, .inherited = true}, {field_ensure, 3, .inherited = true}, {field_rescue, 3, .inherited = true}, - [324] = + [326] = {field_return, 3}, - [325] = + [327] = {field_body, 3}, {field_cond, 1}, - [327] = + [329] = {field_cond, 1}, {field_cond, 2, .inherited = true}, - [329] = + [331] = {field_cond, 0, .inherited = true}, {field_cond, 1, .inherited = true}, - [331] = + [333] = {field_clobbers, 1, .inherited = true}, {field_options, 1, .inherited = true}, - [333] = + [335] = {field_inputs, 1}, - [334] = + [336] = {field_clobbers, 2, .inherited = true}, {field_inputs, 2, .inherited = true}, {field_options, 2, .inherited = true}, {field_outputs, 1}, - [338] = + [340] = {field_cond, 0}, {field_else, 4}, {field_then, 2}, - [341] = + [343] = {field_body, 2}, {field_class, 0, .inherited = true}, {field_else, 3, .inherited = true}, @@ -4347,113 +4350,115 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_params, 0, .inherited = true}, {field_rescue, 3, .inherited = true}, {field_type, 0, .inherited = true}, - [350] = + [352] = {field_lhs, 0, .inherited = true}, {field_lhs, 1}, {field_rhs, 3, .inherited = true}, {field_rhs, 4}, - [354] = + [356] = {field_cond, 4}, {field_var, 1}, {field_var, 2, .inherited = true}, - [357] = + [359] = {field_of_key, 3}, {field_of_value, 5}, - [359] = + [361] = {field_cond, 1}, {field_else, 4}, {field_then, 3}, - [362] = + [364] = {field_of, 4}, {field_of, 5}, - [364] = + [366] = {field_block, 5}, {field_type, 3}, {field_type, 4}, - [367] = + [369] = {field_default, 2}, {field_default, 3}, {field_extern_name, 0}, {field_name, 1}, - [371] = + [373] = {field_extern_name, 0}, {field_name, 1}, {field_type, 2}, {field_type, 3}, - [375] = + [377] = {field_default, 2}, {field_default, 3}, {field_name, 1}, - [378] = + [380] = {field_name, 2}, {field_superclass, 4}, - [380] = + [382] = {field_body, 4}, {field_name, 1}, {field_superclass, 3}, - [383] = + [385] = {field_body, 4}, {field_name, 1}, {field_type, 2}, {field_type, 3}, - [387] = + [389] = {field_body, 4}, {field_name, 1}, - [389] = + [391] = {field_body, 4}, {field_name, 1}, {field_real_name, 3}, - [392] = + [394] = + {field_name, 0}, + {field_name, 1}, {field_real_name, 3}, {field_type, 4}, {field_type, 5}, - [395] = + [399] = {field_name, 1}, {field_type, 4}, {field_type, 5}, - [398] = + [402] = {field_type, 1}, {field_type, 2}, - [400] = + [404] = {field_forall, 5}, {field_name, 1}, {field_params, 3}, - [403] = + [407] = {field_class, 1}, {field_class, 2}, {field_name, 3}, {field_type, 4}, {field_type, 5}, - [408] = + [412] = {field_arguments, 2}, {field_method, 1}, - [410] = + [414] = {field_arguments, 2}, {field_block, 3}, {field_method, 1}, {field_receiver, 0}, - [414] = + [418] = {field_type, 3}, {field_value, 5}, {field_var, 0}, - [417] = + [421] = {field_body, 4}, {field_name, 3}, {field_visibility, 0}, - [420] = + [424] = {field_name, 2}, {field_superclass, 4}, {field_visibility, 0}, - [423] = + [427] = {field_name, 2}, {field_type, 3}, {field_type, 4}, {field_visibility, 0}, - [427] = + [431] = {field_name, 2}, {field_params, 4}, {field_visibility, 0}, - [430] = + [434] = {field_body, 3}, {field_class, 1, .inherited = true}, {field_else, 4, .inherited = true}, @@ -4464,256 +4469,262 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_rescue, 4, .inherited = true}, {field_type, 1, .inherited = true}, {field_visibility, 0}, - [440] = + [444] = {field_type, 3}, {field_variable, 1}, - [442] = + [446] = {field_body, 4}, {field_cond, 1}, {field_cond, 2, .inherited = true}, - [445] = + [449] = {field_options, 1, .inherited = true}, - [446] = + [450] = {field_clobbers, 1}, - [447] = + [451] = {field_clobbers, 2, .inherited = true}, {field_inputs, 1}, {field_options, 2, .inherited = true}, - [450] = + [454] = {field_of_key, 4}, {field_of_value, 6}, - [452] = + [456] = {field_of, 5}, {field_of, 6}, - [454] = + [458] = {field_body, 4}, {field_params, 2}, - [456] = + [460] = {field_default, 3}, {field_default, 4}, {field_name, 0}, {field_type, 1}, {field_type, 2}, - [461] = + [465] = {field_block, 6}, {field_params, 2}, {field_type, 4}, {field_type, 5}, - [465] = + [469] = {field_default, 3}, {field_default, 4}, {field_extern_name, 1}, {field_name, 2}, - [469] = + [473] = {field_extern_name, 1}, {field_name, 2}, {field_type, 3}, {field_type, 4}, - [473] = + [477] = {field_method, 3}, {field_params, 5}, {field_receiver, 1}, - [476] = + [480] = {field_else, 4, .inherited = true}, {field_ensure, 4, .inherited = true}, {field_params, 2}, {field_rescue, 4, .inherited = true}, - [480] = + [484] = {field_body, 5}, {field_name, 2}, {field_superclass, 4}, - [483] = + [487] = + {field_name, 0}, {field_type, 2}, - [484] = + [489] = {field_body, 5}, {field_name, 1}, {field_params, 3}, - [487] = + [492] = {field_name, 1}, {field_real_name, 3}, {field_type, 4}, {field_type, 5}, - [491] = + [496] = {field_forall, 6}, {field_name, 1}, {field_type, 4}, {field_type, 5}, - [495] = + [500] = {field_name, 1}, {field_params, 3}, {field_type, 5}, {field_type, 6}, - [499] = + [504] = + {field_type, 2}, + {field_type, 3}, + [506] = {field_class, 1}, {field_class, 2}, {field_forall, 6}, {field_name, 3}, - [503] = + [510] = {field_class, 1}, {field_class, 2}, {field_name, 3}, {field_params, 5}, - [507] = + [514] = {field_class, 1}, {field_class, 2}, {field_forall, 6}, {field_name, 3}, {field_type, 4}, {field_type, 5}, - [513] = + [520] = {field_name, 3}, {field_superclass, 5}, {field_visibility, 0}, - [516] = + [523] = {field_body, 5}, {field_name, 2}, {field_superclass, 4}, {field_visibility, 0}, - [520] = + [527] = {field_body, 5}, {field_name, 2}, {field_type, 3}, {field_type, 4}, {field_visibility, 0}, - [525] = + [532] = {field_body, 5}, {field_type, 3}, {field_variable, 1}, - [528] = + [535] = {field_return, 5}, - [529] = + [536] = {field_options, 1}, - [530] = + [537] = {field_clobbers, 1}, {field_options, 2, .inherited = true}, - [532] = + [539] = {field_constraint, 0}, {field_expression, 2}, - [534] = + [541] = {field_of_key, 5}, {field_of_value, 7}, - [536] = + [543] = {field_default, 4}, {field_default, 5}, {field_extern_name, 0}, {field_name, 1}, {field_type, 2}, {field_type, 3}, - [542] = + [549] = {field_default, 4}, {field_default, 5}, {field_name, 1}, {field_type, 2}, {field_type, 3}, - [547] = + [554] = {field_body, 4}, {field_else, 5, .inherited = true}, {field_ensure, 5, .inherited = true}, {field_params, 2}, {field_rescue, 5, .inherited = true}, - [552] = + [559] = + {field_name, 0}, + {field_name, 1}, {field_type, 3}, - [553] = + [562] = {field_body, 6}, {field_name, 1}, {field_type, 4}, {field_type, 5}, - [557] = + [566] = {field_body, 6}, {field_name, 1}, {field_real_name, 3}, - [560] = + [569] = {field_name, 1}, {field_params, 5}, {field_real_name, 3}, - [563] = + [572] = {field_body, 6}, {field_name, 1}, {field_real_name, 3}, {field_type, 4}, {field_type, 5}, - [568] = + [577] = {field_forall, 7}, {field_name, 1}, {field_params, 3}, {field_type, 5}, {field_type, 6}, - [573] = + [582] = {field_name, 2}, {field_type, 3}, {field_type, 4}, - [576] = + [585] = {field_class, 1}, {field_class, 2}, {field_name, 3}, {field_type, 6}, {field_type, 7}, - [581] = + [590] = {field_class, 1}, {field_class, 2}, {field_forall, 7}, {field_name, 3}, {field_params, 5}, - [586] = + [595] = {field_body, 6}, {field_name, 3}, {field_superclass, 5}, {field_visibility, 0}, - [590] = + [599] = {field_return, 6}, - [591] = + [600] = {field_of_key, 6}, {field_of_value, 8}, - [593] = + [602] = {field_default, 5}, {field_default, 6}, {field_extern_name, 1}, {field_name, 2}, {field_type, 3}, {field_type, 4}, - [599] = + [608] = {field_body, 7}, {field_name, 1}, {field_params, 3}, {field_type, 5}, {field_type, 6}, - [604] = + [613] = {field_name, 1}, {field_real_name, 3}, {field_type, 6}, {field_type, 7}, - [608] = + [617] = {field_body, 7}, {field_name, 1}, {field_params, 5}, {field_real_name, 3}, - [612] = + [621] = {field_class, 1}, {field_class, 2}, {field_forall, 8}, {field_name, 3}, {field_type, 6}, {field_type, 7}, - [618] = + [627] = {field_class, 1}, {field_class, 2}, {field_name, 3}, {field_params, 5}, {field_type, 7}, {field_type, 8}, - [624] = + [633] = {field_body, 8}, {field_name, 1}, {field_real_name, 3}, {field_type, 6}, {field_type, 7}, - [629] = + [638] = {field_name, 1}, {field_params, 5}, {field_real_name, 3}, {field_type, 7}, {field_type, 8}, - [634] = + [643] = {field_class, 1}, {field_class, 2}, {field_forall, 9}, @@ -4721,7 +4732,7 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_params, 5}, {field_type, 7}, {field_type, 8}, - [641] = + [650] = {field_body, 9}, {field_name, 1}, {field_params, 5}, @@ -4901,64 +4912,64 @@ static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE [202] = { [1] = sym__start_of_index_operator, }, - [205] = { - [3] = sym__start_of_index_operator, - }, [206] = { [3] = sym__start_of_index_operator, }, [207] = { [3] = sym__start_of_index_operator, }, - [212] = { + [208] = { + [3] = sym__start_of_index_operator, + }, + [213] = { [5] = sym_expressions, }, - [214] = { + [215] = { [5] = sym_expressions, }, - [222] = { + [223] = { [4] = sym_expressions, }, - [224] = { - [6] = sym_expressions, - }, [225] = { [6] = sym_expressions, }, - [227] = { + [226] = { [6] = sym_expressions, }, [228] = { + [6] = sym_expressions, + }, + [229] = { [1] = sym__start_of_index_operator, }, - [231] = { + [232] = { [3] = sym__start_of_index_operator, }, - [232] = { + [233] = { [3] = sym__start_of_index_operator, }, - [235] = { + [236] = { [6] = sym_expressions, }, - [239] = { + [240] = { [7] = sym_expressions, }, - [241] = { + [242] = { [7] = sym_expressions, }, - [242] = { + [243] = { [3] = sym__start_of_index_operator, }, - [243] = { + [244] = { [3] = sym__start_of_index_operator, }, - [246] = { + [247] = { [8] = sym_expressions, }, - [248] = { + [249] = { [3] = sym__start_of_index_operator, }, - [250] = { + [251] = { [9] = sym_expressions, }, }; @@ -1513617,8 +1513628,8 @@ static const TSParseActionEntry ts_parse_actions[] = { [8883] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21290), [8885] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3791), [8887] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3790), - [8889] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_parenthesized_proc_type, 7, 10, 236), - [8891] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parenthesized_proc_type, 7, 10, 236), + [8889] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_parenthesized_proc_type, 7, 10, 237), + [8891] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parenthesized_proc_type, 7, 10, 237), [8893] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_union_type_repeat1, 2, 0, 0), SHIFT_REPEAT(14603), [8896] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_double_splat_type, 2, 0, 0), [8898] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_double_splat_type, 2, 0, 0), @@ -1513629,8 +1513640,8 @@ static const TSParseActionEntry ts_parse_actions[] = { [8908] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__type, 1, 0, 0), [8910] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__type, 1, 0, 0), [8912] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4323), - [8914] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_parenthesized_proc_type, 6, 10, 215), - [8916] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parenthesized_proc_type, 6, 10, 215), + [8914] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_parenthesized_proc_type, 6, 10, 216), + [8916] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parenthesized_proc_type, 6, 10, 216), [8918] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_typeof, 4, 0, 0), [8920] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_typeof, 4, 0, 0), [8922] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_typeof, 6, 0, 0), @@ -1513688,15 +1513699,15 @@ static const TSParseActionEntry ts_parse_actions[] = { [9027] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 6, 0, 76), [9029] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 6, 0, 76), [9031] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13548), - [9033] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 7, 0, 206), - [9035] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 7, 0, 206), + [9033] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 7, 0, 207), + [9035] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 7, 0, 207), [9037] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13737), [9039] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 4, 0, 76), [9041] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 4, 0, 76), [9043] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14768), [9045] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14079), - [9047] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 7, 0, 209), - [9049] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 7, 0, 209), + [9047] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 7, 0, 210), + [9049] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 7, 0, 210), [9051] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13743), [9053] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 4, 0, 15), [9055] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 4, 0, 15), @@ -1513727,8 +1513738,8 @@ static const TSParseActionEntry ts_parse_actions[] = { [9106] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4317), [9108] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 6, 0, 173), [9110] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 6, 0, 173), - [9112] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 7, 0, 204), - [9114] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 7, 0, 204), + [9112] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 7, 0, 205), + [9114] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 7, 0, 205), [9116] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 7, 0, 202), [9118] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 7, 0, 202), [9120] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 6, 0, 170), @@ -1513737,77 +1513748,77 @@ static const TSParseActionEntry ts_parse_actions[] = { [9126] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 6, 0, 172), [9128] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 4, 0, 74), [9130] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 4, 0, 74), - [9132] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 9, 0, 243), - [9134] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 9, 0, 243), + [9132] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 9, 0, 244), + [9134] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 9, 0, 244), [9136] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_forall, 3, 0, 73), [9138] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_forall, 3, 0, 73), [9140] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19324), [9142] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 6, 0, 167), [9144] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 6, 0, 167), - [9146] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 8, 0, 233), - [9148] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 8, 0, 233), + [9146] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 8, 0, 234), + [9148] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 8, 0, 234), [9150] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_union_type_repeat1, 2, 0, 0), SHIFT_REPEAT(14611), - [9153] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 9, 0, 245), - [9155] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 9, 0, 245), + [9153] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 9, 0, 246), + [9155] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 9, 0, 246), [9157] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_forall_repeat1, 2, 0, 0), [9159] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_forall_repeat1, 2, 0, 0), [9161] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_forall_repeat1, 2, 0, 0), SHIFT_REPEAT(19324), [9164] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 4, 0, 72), [9166] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 4, 0, 72), - [9168] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 8, 0, 231), - [9170] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 8, 0, 231), + [9168] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 8, 0, 232), + [9170] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 8, 0, 232), [9172] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_forall, 2, 0, 73), [9174] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_forall, 2, 0, 73), [9176] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_forall_repeat1, 2, 0, 73), [9178] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_forall_repeat1, 2, 0, 73), - [9180] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 8, 0, 228), - [9182] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 8, 0, 228), - [9184] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 8, 0, 232), - [9186] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 8, 0, 232), - [9188] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 10, 0, 249), - [9190] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 10, 0, 249), - [9192] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 8, 0, 230), - [9194] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 8, 0, 230), - [9196] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 9, 0, 244), - [9198] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 9, 0, 244), + [9180] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 8, 0, 229), + [9182] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 8, 0, 229), + [9184] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 8, 0, 233), + [9186] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 8, 0, 233), + [9188] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 10, 0, 250), + [9190] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 10, 0, 250), + [9192] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 8, 0, 231), + [9194] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 8, 0, 231), + [9196] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 9, 0, 245), + [9198] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 9, 0, 245), [9200] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 3, 0, 34), [9202] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 3, 0, 34), - [9204] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 7, 0, 203), - [9206] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 7, 0, 203), + [9204] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 7, 0, 204), + [9206] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 7, 0, 204), [9208] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 5, 0, 124), [9210] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 5, 0, 124), [9212] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 5, 0, 129), [9214] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 5, 0, 129), [9216] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 3, 0, 35), [9218] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 3, 0, 35), - [9220] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 7, 0, 207), - [9222] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 7, 0, 207), - [9224] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 7, 0, 208), - [9226] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 7, 0, 208), + [9220] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 7, 0, 208), + [9222] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 7, 0, 208), + [9224] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 7, 0, 209), + [9226] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 7, 0, 209), [9228] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 5, 0, 128), [9230] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 5, 0, 128), - [9232] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 8, 0, 234), - [9234] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 8, 0, 234), - [9236] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 7, 0, 205), - [9238] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 7, 0, 205), + [9232] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 8, 0, 235), + [9234] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 8, 0, 235), + [9236] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 7, 0, 206), + [9238] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 7, 0, 206), [9240] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 5, 0, 122), [9242] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 5, 0, 122), - [9244] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 7, 0, 210), - [9246] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 7, 0, 210), + [9244] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 7, 0, 211), + [9246] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 7, 0, 211), [9248] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 6, 0, 169), [9250] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 6, 0, 169), [9252] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 5, 0, 127), [9254] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 5, 0, 127), [9256] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 7, 0, 201), [9258] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 7, 0, 201), - [9260] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 10, 0, 248), - [9262] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 10, 0, 248), + [9260] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 10, 0, 249), + [9262] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 10, 0, 249), [9264] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 5, 0, 125), [9266] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 5, 0, 125), [9268] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 6, 0, 171), [9270] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 6, 0, 171), - [9272] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 9, 0, 242), - [9274] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 9, 0, 242), + [9272] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__base_method_def, 9, 0, 243), + [9274] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__base_method_def, 9, 0, 243), [9276] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17897), [9278] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_constant_repeat1, 2, 0, 0), SHIFT_REPEAT(17897), [9281] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18692), @@ -1514341,8 +1514352,8 @@ static const TSParseActionEntry ts_parse_actions[] = { [10417] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_argument_list_with_parens_and_block, 6, 0, 0), [10419] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_argument_list_with_parens_and_block, 6, 0, 0), [10421] = {.entry = {.count = 1, .reusable = false}}, SHIFT(2990), - [10423] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_do_end_block, 7, 0, 222), - [10425] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_do_end_block, 7, 0, 222), + [10423] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_do_end_block, 7, 0, 223), + [10425] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_do_end_block, 7, 0, 223), [10427] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_argument_list_with_parens, 2, 0, 0), [10429] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_argument_list_with_parens, 2, 0, 0), [10431] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17887), @@ -1514833,10 +1514844,10 @@ static const TSParseActionEntry ts_parse_actions[] = { [11413] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_proc, 7, 0, 192), [11415] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_method_proc, 7, 0, 195), [11417] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_method_proc, 7, 0, 195), - [11419] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_hash, 8, 0, 219), - [11421] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_hash, 8, 0, 219), - [11423] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_hash, 9, 0, 237), - [11425] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_hash, 9, 0, 237), + [11419] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_hash, 8, 0, 220), + [11421] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_hash, 8, 0, 220), + [11423] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_hash, 9, 0, 238), + [11425] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_hash, 9, 0, 238), [11427] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_constant_repeat1, 2, 0, 0), SHIFT_REPEAT(17855), [11430] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_splat, 2, 0, 0), [11432] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_double_splat, 2, 0, 0), @@ -1517360,7 +1517371,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [16617] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12280), [16619] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14065), [16621] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_parenthesized_proc_type, 5, 0, 0), SHIFT(12942), - [16624] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param, 7, 0, 238), + [16624] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param, 7, 0, 239), [16626] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13837), [16628] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13698), [16630] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13839), @@ -1517469,8 +1517480,8 @@ static const TSParseActionEntry ts_parse_actions[] = { [16837] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10386), [16839] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_hash_entry, 3, 0, 0), [16841] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13695), - [16843] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param, 6, 0, 220), - [16845] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param, 6, 0, 221), + [16843] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param, 6, 0, 221), + [16845] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param, 6, 0, 222), [16847] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9267), [16849] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9013), [16851] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9013), @@ -1518531,7 +1518542,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [19016] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 5, 0, 121), [19018] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_method_def, 4, 0, 82), [19020] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 6, 0, 163), - [19022] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 10, 0, 247), + [19022] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 10, 0, 248), [19024] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_alias, 4, 0, 91), [19026] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_def, 6, 0, 177), [19028] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 6, 0, 126), @@ -1518542,22 +1518553,22 @@ static const TSParseActionEntry ts_parse_actions[] = { [19038] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_union_type_repeat1, 2, 0, 0), SHIFT_REPEAT(14522), [19041] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_method_def, 2, 0, 24), [19043] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_method_def, 6, 0, 182), - [19045] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 8, 0, 224), + [19045] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 8, 0, 225), [19047] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_def, 5, 0, 131), - [19049] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 8, 0, 204), + [19049] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 8, 0, 205), [19051] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_def, 3, 0, 15), [19053] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_def, 5, 0, 120), [19055] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_def, 5, 0, 74), [19057] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_def, 5, 0, 120), [19059] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 5, 0, 74), - [19061] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 10, 0, 246), - [19063] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 8, 0, 225), + [19061] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 10, 0, 247), + [19063] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 8, 0, 226), [19065] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_annotation_def, 4, 0, 15), [19067] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_method_def, 4, 0, 81), - [19069] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 8, 0, 226), + [19069] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 8, 0, 227), [19071] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 7, 0, 170), - [19073] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_def, 8, 0, 235), - [19075] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_def, 8, 0, 235), + [19073] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_def, 8, 0, 236), + [19075] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_def, 8, 0, 236), [19077] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_abstract_method_def, 3, 0, 12), [19079] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_def, 5, 0, 132), [19081] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 7, 0, 199), @@ -1518569,22 +1518580,22 @@ static const TSParseActionEntry ts_parse_actions[] = { [19093] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_def, 3, 0, 15), [19095] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_const_assign, 4, 0, 83), [19097] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13338), - [19099] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_def, 7, 0, 211), + [19099] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_def, 7, 0, 212), [19101] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_abstract_method_def, 4, 0, 38), [19103] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14773), [19105] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13512), [19107] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_method_def, 4, 0, 41), [19109] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 7, 0, 200), - [19111] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 11, 0, 250), + [19111] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 11, 0, 251), [19113] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_def, 5, 0, 132), [19115] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_annotation, 4, 0, 67), [19117] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_break, 2, 0, 0), - [19119] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 8, 0, 227), + [19119] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 8, 0, 228), [19121] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 3, 0, 15), [19123] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_return, 2, 0, 0), [19125] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 6, 0, 164), [19127] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 6, 0, 165), - [19129] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_def, 7, 0, 211), + [19129] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_def, 7, 0, 212), [19131] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_def, 4, 0, 68), [19133] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_def, 5, 0, 119), [19135] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_def, 6, 0, 160), @@ -1518601,9 +1518612,9 @@ static const TSParseActionEntry ts_parse_actions[] = { [19157] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_method_def, 4, 0, 98), [19159] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_method_def, 3, 0, 41), [19161] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_lib_def, 5, 0, 133), - [19163] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 9, 0, 239), - [19165] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 9, 0, 240), - [19167] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 9, 0, 241), + [19163] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 9, 0, 240), + [19165] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 9, 0, 241), + [19167] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 9, 0, 242), [19169] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_def, 4, 0, 69), [19171] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14810), [19173] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13526), @@ -1518615,11 +1518626,11 @@ static const TSParseActionEntry ts_parse_actions[] = { [19185] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_def, 4, 0, 70), [19187] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_lib_def, 4, 0, 70), [19189] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_top_level_fun_def, 4, 0, 68), - [19191] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_def, 7, 0, 212), + [19191] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_def, 7, 0, 213), [19193] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_method_def, 3, 0, 24), [19195] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_method_def, 3, 0, 56), - [19197] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_def, 7, 0, 212), - [19199] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_def, 7, 0, 213), + [19197] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_def, 7, 0, 213), + [19199] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_def, 7, 0, 214), [19201] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_def, 3, 0, 15), [19203] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_annotation, 3, 0, 0), [19205] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_def, 5, 0, 131), @@ -1520172,7 +1520183,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [22352] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11048), [22354] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19657), [22356] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14429), - [22358] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_fun_def, 7, 0, 226), + [22358] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_fun_def, 7, 0, 227), [22360] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13427), [22362] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11098), [22364] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11101), @@ -1520360,7 +1520371,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [22731] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12621), [22733] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11421), [22735] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11422), - [22737] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_rescue, 6, 0, 214), + [22737] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_rescue, 6, 0, 215), [22739] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7636), [22741] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7637), [22743] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_implicit_object_tuple, 8, 0, 0), @@ -1520698,7 +1520709,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [23413] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2274), [23415] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5430), [23417] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14318), - [23419] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_c_struct_fields, 4, 0, 223), + [23419] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_c_struct_fields, 4, 0, 224), [23421] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14353), [23423] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5876), [23425] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1834), @@ -1520954,7 +1520965,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [23933] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2243), [23935] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1262), [23937] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1265), - [23939] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_union_fields, 4, 0, 223), + [23939] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_union_fields, 4, 0, 224), [23941] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1268), [23943] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7711), [23945] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2088), @@ -1521006,7 +1521017,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [24037] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1895), [24039] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2558), [24041] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16838), - [24043] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type_def, 4, 0, 0), + [24043] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type_def, 4, 0, 91), [24045] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14400), [24047] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18931), [24049] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1884), @@ -1521019,7 +1521030,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [24063] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5204), [24065] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1818), [24067] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2573), - [24069] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_union_def, 4, 0, 15), + [24069] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_union_def, 4, 0, 70), [24071] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2375), [24073] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10447), [24075] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1974), @@ -1521059,9 +1521070,9 @@ static const TSParseActionEntry ts_parse_actions[] = { [24143] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14408), [24145] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15667), [24147] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8950), - [24149] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_fun_def, 8, 0, 240), + [24149] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_fun_def, 8, 0, 241), [24151] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2060), - [24153] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_fun_def, 9, 0, 247), + [24153] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_fun_def, 9, 0, 248), [24155] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2163), [24157] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_c_struct_fields, 3, 0, 198), [24159] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4077), @@ -1521082,7 +1521093,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [24189] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_type_param_list_repeat1, 2, 0, 0), SHIFT_REPEAT(14689), [24192] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5116), [24194] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1846), - [24196] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asm_operand, 4, 0, 218), + [24196] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asm_operand, 4, 0, 219), [24198] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param, 3, 0, 114), [24200] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2896), [24202] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16247), @@ -1521169,7 +1521180,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [24366] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2269), [24368] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11497), [24370] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7817), - [24372] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_c_struct_def, 4, 0, 15), + [24372] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_c_struct_def, 4, 0, 70), [24374] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1873), [24376] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1584), [24378] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1989), @@ -1521257,7 +1521268,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [24543] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15959), [24545] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1324), [24547] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12764), - [24549] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_fun_def, 7, 0, 204), + [24549] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_fun_def, 7, 0, 205), [24551] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8858), [24553] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14387), [24555] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8863), @@ -1521565,7 +1521576,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [25162] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4240), [25164] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19781), [25166] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21617), - [25168] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_splat_param, 5, 0, 229), + [25168] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_splat_param, 5, 0, 230), [25170] = {.entry = {.count = 1, .reusable = false}}, SHIFT(5138), [25172] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5138), [25174] = {.entry = {.count = 1, .reusable = false}}, SHIFT(4256), @@ -1521671,7 +1521682,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [25374] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14040), [25376] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16624), [25378] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13509), - [25380] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_splat_param, 4, 0, 71), + [25380] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_splat_param, 4, 0, 203), [25382] = {.entry = {.count = 1, .reusable = false}}, SHIFT(7904), [25384] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7904), [25386] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13416), @@ -1521708,7 +1521719,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [25448] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21622), [25450] = {.entry = {.count = 1, .reusable = false}}, SHIFT(4625), [25452] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4625), - [25454] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_double_splat_param, 5, 0, 229), + [25454] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_double_splat_param, 5, 0, 230), [25456] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19101), [25458] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20183), [25460] = {.entry = {.count = 1, .reusable = false}}, SHIFT(4503), @@ -1521989,7 +1522000,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [26010] = {.entry = {.count = 1, .reusable = true}}, SHIFT(799), [26012] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15583), [26014] = {.entry = {.count = 1, .reusable = true}}, SHIFT(333), - [26016] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block_param, 5, 0, 229), + [26016] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block_param, 5, 0, 230), [26018] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13429), [26020] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4011), [26022] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14154), @@ -1522709,7 +1522720,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [27450] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5484), [27452] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4727), [27454] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7772), - [27456] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block_param, 4, 0, 71), + [27456] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block_param, 4, 0, 203), [27458] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8056), [27460] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4938), [27462] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3939), @@ -1523082,7 +1523093,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [28196] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12933), [28198] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12934), [28200] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4994), - [28202] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__asm_options, 2, 0, 216), + [28202] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__asm_options, 2, 0, 217), [28204] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9708), [28206] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14248), [28208] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6108), @@ -1523215,7 +1523226,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [28462] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13713), [28464] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13714), [28466] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16059), - [28468] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__asm_clobbers, 3, 0, 217), + [28468] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__asm_clobbers, 3, 0, 218), [28470] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13719), [28472] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5005), [28474] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3709), diff --git a/test/corpus/statements.txt b/test/corpus/statements.txt index fc541bf..6e4bef5 100644 --- a/test/corpus/statements.txt +++ b/test/corpus/statements.txt @@ -1319,6 +1319,8 @@ lib def + objects ================= lib MyLib + $external = Name : Int32? + fun name = Name : Void fun cos(value : Float64) : Float64 @@ -1349,6 +1351,11 @@ end (lib_def name: (constant) body: (expressions + (global_var + name: (identifier) + real_name: (constant) + type: (nilable_type + (constant))) (fun_def name: (identifier) real_name: (constant) @@ -1362,21 +1369,23 @@ end type: (constant)) (union_def name: (constant) - (union_fields - (identifier) - type: (constant)) - (union_fields - (identifier) - type: (constant))) + body: (expressions + (union_fields + name: (identifier) + type: (constant)) + (union_fields + name: (identifier) + type: (constant)))) (c_struct_def name: (constant) - (c_struct_fields - (identifier) - (identifier) - type: (constant)) - (c_struct_fields - (identifier) - type: (constant))) + body: (expressions + (c_struct_fields + name: (identifier) + name: (identifier) + type: (constant)) + (c_struct_fields + name: (identifier) + type: (constant)))) (enum_def name: (constant) body: (expressions @@ -1385,8 +1394,8 @@ end (constant) (constant))) (type_def - (constant) - (constant))))) + name: (constant) + type: (constant))))) ============= fun with dots From 91b6998ec78fb7f39f0a59c092b418caa3c7b6c8 Mon Sep 17 00:00:00 2001 From: Margret Riegert Date: Wed, 8 Jan 2025 11:04:58 -0500 Subject: [PATCH 02/13] Add s_exp support for external vars --- test/s_exp_visitor.cr | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/s_exp_visitor.cr b/test/s_exp_visitor.cr index a4df8d4..61afbce 100644 --- a/test/s_exp_visitor.cr +++ b/test/s_exp_visitor.cr @@ -1438,6 +1438,29 @@ class SExpVisitor < Crystal::Visitor false end + def visit(node : ExternalVar) + in_node("global_var") do + field "name" do + print_node("identifier") + end + + field "real_name" do + next unless (real_name = node.real_name) + if real_name.starts_with?(/[A-Z]/) + print_node("constant") + else + print_node("identifier") + end + end + + field "type" do + node.type_spec.accept(self) + end + end + + false + end + def visit(node : VisibilityModifier) @visibility = node.modifier true From 27b4a731a25ea56aba52aa25b85f4ab922e7cfaa Mon Sep 17 00:00:00 2001 From: Margret Riegert Date: Wed, 8 Jan 2025 11:06:25 -0500 Subject: [PATCH 03/13] Add s_exp support for extend, not, pointerof, ReadInstanceVar --- test/corpus/expressions.txt | 44 +++++++++++++++++++------------------ test/s_exp_visitor.cr | 40 ++++++++++++++++++++++++++++++++- 2 files changed, 62 insertions(+), 22 deletions(-) diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt index 592c0e0..4c12ed0 100644 --- a/test/corpus/expressions.txt +++ b/test/corpus/expressions.txt @@ -4031,6 +4031,7 @@ end ================= read instance var +:language(crystal) ================= object.@ivar @@ -4607,6 +4608,7 @@ nil?( ============== pseudo methods +:language(crystal) ============== class ClassName @@ -4616,7 +4618,7 @@ class ClassName typeof(self, other) # works sizeof(self.class) # works instance_sizeof(self.class) # works - pointerof(self) + pointerof(123) offsetof(self.class, 1) # works self.as(Object) self.as?(Object) @@ -4629,19 +4631,19 @@ end (expressions (class_def - (constant) - (expressions + name: (constant) + body: (expressions (method_def - (identifier) - (expressions + name: (identifier) + body: (expressions (call - (self) - (identifier) - (argument_list + receiver: (self) + method: (identifier) + arguments: (argument_list (constant))) (call - (self) - (identifier)) + receiver: (self) + method: (identifier)) (typeof (self) (identifier)) @@ -4655,26 +4657,26 @@ end (self))) (comment) (pointerof - (self)) + (integer)) (offsetof (class_type (self)) (integer)) (comment) (call - (self) - (identifier) - (argument_list + receiver: (self) + method: (identifier) + arguments: (argument_list (constant))) (call - (self) - (identifier) - (argument_list + receiver: (self) + method: (identifier) + arguments: (argument_list (constant))) (call - (identifier) - (argument_list + method: (identifier) + arguments: (argument_list (symbol))) (call - (self) - (operator))))))) + receiver: (self) + method: (operator))))))) diff --git a/test/s_exp_visitor.cr b/test/s_exp_visitor.cr index 61afbce..9f7b1d0 100644 --- a/test/s_exp_visitor.cr +++ b/test/s_exp_visitor.cr @@ -1381,6 +1381,8 @@ class SExpVisitor < Crystal::Visitor def visit(node : RespondsTo) in_node("call") do field "receiver" do + next if node.obj.is_a?(Self) || + ((var = node.obj).is_a?(Var) && var.name == "self") node.obj.accept(self) end @@ -1399,11 +1401,47 @@ class SExpVisitor < Crystal::Visitor end visit_basic(Include) + visit_basic(Extend) visit_basic(Yield) visit_basic(Require) - visit_basic(Not) visit_basic(Out) + def visit(node : Not) + in_node("call") do + field "receiver" do + node.exp.accept(self) + end + + field "method" do + print_node("operator") + end + end + + false + end + + def visit(node : PointerOf) + enter_node("pointerof") + end + + def end_visit(node : PointerOf) + exit_node + end + + def visit(node : ReadInstanceVar) + in_node("call") do + field "receiver" do + node.obj.try &.accept(self) + end + + field "method" do + print_node("instance_var") + end + end + + false + end + def visit(node : Annotation) in_node("annotation") do node.path.accept self From 3e921394d3ce050390827267d6e66779647351b2 Mon Sep 17 00:00:00 2001 From: Margret Riegert Date: Wed, 8 Jan 2025 11:06:53 -0500 Subject: [PATCH 04/13] Add s_exp support for cstruct/union def & typedef --- test/crystal_parse_stdlib_fail.txt | 71 ------------------------------ test/s_exp_visitor.cr | 68 +++++++++++++++++++++++++++- 2 files changed, 67 insertions(+), 72 deletions(-) diff --git a/test/crystal_parse_stdlib_fail.txt b/test/crystal_parse_stdlib_fail.txt index fe62cf3..ed86e84 100644 --- a/test/crystal_parse_stdlib_fail.txt +++ b/test/crystal_parse_stdlib_fail.txt @@ -468,13 +468,11 @@ lib_c/aarch64-android/c/link.cr lib_c/aarch64-android/c/netdb.cr lib_c/aarch64-android/c/netinet/in.cr lib_c/aarch64-android/c/pthread.cr -lib_c/aarch64-android/c/pwd.cr lib_c/aarch64-android/c/signal.cr lib_c/aarch64-android/c/stdio.cr lib_c/aarch64-android/c/stdlib.cr lib_c/aarch64-android/c/string.cr lib_c/aarch64-android/c/sys/mman.cr -lib_c/aarch64-android/c/sys/resource.cr lib_c/aarch64-android/c/sys/select.cr lib_c/aarch64-android/c/sys/socket.cr lib_c/aarch64-android/c/sys/stat.cr @@ -488,15 +486,11 @@ lib_c/aarch64-android/c/time.cr lib_c/aarch64-android/c/unistd.cr lib_c/aarch64-darwin/c/arpa/inet.cr lib_c/aarch64-darwin/c/dirent.cr -lib_c/aarch64-darwin/c/dlfcn.cr lib_c/aarch64-darwin/c/fcntl.cr -lib_c/aarch64-darwin/c/grp.cr lib_c/aarch64-darwin/c/iconv.cr -lib_c/aarch64-darwin/c/mach/mach_time.cr lib_c/aarch64-darwin/c/netdb.cr lib_c/aarch64-darwin/c/netinet/in.cr lib_c/aarch64-darwin/c/pthread.cr -lib_c/aarch64-darwin/c/pwd.cr lib_c/aarch64-darwin/c/signal.cr lib_c/aarch64-darwin/c/stdio.cr lib_c/aarch64-darwin/c/stdlib.cr @@ -518,20 +512,16 @@ lib_c/aarch64-linux-gnu/c/dirent.cr lib_c/aarch64-linux-gnu/c/dlfcn.cr lib_c/aarch64-linux-gnu/c/elf.cr lib_c/aarch64-linux-gnu/c/fcntl.cr -lib_c/aarch64-linux-gnu/c/grp.cr lib_c/aarch64-linux-gnu/c/iconv.cr lib_c/aarch64-linux-gnu/c/link.cr lib_c/aarch64-linux-gnu/c/netdb.cr lib_c/aarch64-linux-gnu/c/netinet/in.cr lib_c/aarch64-linux-gnu/c/pthread.cr -lib_c/aarch64-linux-gnu/c/pwd.cr lib_c/aarch64-linux-gnu/c/signal.cr -lib_c/aarch64-linux-gnu/c/stdarg.cr lib_c/aarch64-linux-gnu/c/stdio.cr lib_c/aarch64-linux-gnu/c/stdlib.cr lib_c/aarch64-linux-gnu/c/string.cr lib_c/aarch64-linux-gnu/c/sys/mman.cr -lib_c/aarch64-linux-gnu/c/sys/resource.cr lib_c/aarch64-linux-gnu/c/sys/select.cr lib_c/aarch64-linux-gnu/c/sys/socket.cr lib_c/aarch64-linux-gnu/c/sys/stat.cr @@ -544,18 +534,14 @@ lib_c/aarch64-linux-gnu/c/time.cr lib_c/aarch64-linux-gnu/c/unistd.cr lib_c/aarch64-linux-musl/c/arpa/inet.cr lib_c/aarch64-linux-musl/c/dirent.cr -lib_c/aarch64-linux-musl/c/dlfcn.cr lib_c/aarch64-linux-musl/c/elf.cr lib_c/aarch64-linux-musl/c/fcntl.cr -lib_c/aarch64-linux-musl/c/grp.cr lib_c/aarch64-linux-musl/c/iconv.cr lib_c/aarch64-linux-musl/c/link.cr lib_c/aarch64-linux-musl/c/netdb.cr lib_c/aarch64-linux-musl/c/netinet/in.cr lib_c/aarch64-linux-musl/c/pthread.cr -lib_c/aarch64-linux-musl/c/pwd.cr lib_c/aarch64-linux-musl/c/signal.cr -lib_c/aarch64-linux-musl/c/stdarg.cr lib_c/aarch64-linux-musl/c/stdio.cr lib_c/aarch64-linux-musl/c/stdlib.cr lib_c/aarch64-linux-musl/c/string.cr @@ -576,20 +562,16 @@ lib_c/arm-linux-gnueabihf/c/dirent.cr lib_c/arm-linux-gnueabihf/c/dlfcn.cr lib_c/arm-linux-gnueabihf/c/elf.cr lib_c/arm-linux-gnueabihf/c/fcntl.cr -lib_c/arm-linux-gnueabihf/c/grp.cr lib_c/arm-linux-gnueabihf/c/iconv.cr lib_c/arm-linux-gnueabihf/c/link.cr lib_c/arm-linux-gnueabihf/c/netdb.cr lib_c/arm-linux-gnueabihf/c/netinet/in.cr lib_c/arm-linux-gnueabihf/c/pthread.cr -lib_c/arm-linux-gnueabihf/c/pwd.cr lib_c/arm-linux-gnueabihf/c/signal.cr -lib_c/arm-linux-gnueabihf/c/stdarg.cr lib_c/arm-linux-gnueabihf/c/stdio.cr lib_c/arm-linux-gnueabihf/c/stdlib.cr lib_c/arm-linux-gnueabihf/c/string.cr lib_c/arm-linux-gnueabihf/c/sys/mman.cr -lib_c/arm-linux-gnueabihf/c/sys/resource.cr lib_c/arm-linux-gnueabihf/c/sys/select.cr lib_c/arm-linux-gnueabihf/c/sys/socket.cr lib_c/arm-linux-gnueabihf/c/sys/stat.cr @@ -605,20 +587,16 @@ lib_c/i386-linux-gnu/c/dirent.cr lib_c/i386-linux-gnu/c/dlfcn.cr lib_c/i386-linux-gnu/c/elf.cr lib_c/i386-linux-gnu/c/fcntl.cr -lib_c/i386-linux-gnu/c/grp.cr lib_c/i386-linux-gnu/c/iconv.cr lib_c/i386-linux-gnu/c/link.cr lib_c/i386-linux-gnu/c/netdb.cr lib_c/i386-linux-gnu/c/netinet/in.cr lib_c/i386-linux-gnu/c/pthread.cr -lib_c/i386-linux-gnu/c/pwd.cr lib_c/i386-linux-gnu/c/signal.cr -lib_c/i386-linux-gnu/c/stdarg.cr lib_c/i386-linux-gnu/c/stdio.cr lib_c/i386-linux-gnu/c/stdlib.cr lib_c/i386-linux-gnu/c/string.cr lib_c/i386-linux-gnu/c/sys/mman.cr -lib_c/i386-linux-gnu/c/sys/resource.cr lib_c/i386-linux-gnu/c/sys/select.cr lib_c/i386-linux-gnu/c/sys/socket.cr lib_c/i386-linux-gnu/c/sys/stat.cr @@ -631,18 +609,14 @@ lib_c/i386-linux-gnu/c/time.cr lib_c/i386-linux-gnu/c/unistd.cr lib_c/i386-linux-musl/c/arpa/inet.cr lib_c/i386-linux-musl/c/dirent.cr -lib_c/i386-linux-musl/c/dlfcn.cr lib_c/i386-linux-musl/c/elf.cr lib_c/i386-linux-musl/c/fcntl.cr -lib_c/i386-linux-musl/c/grp.cr lib_c/i386-linux-musl/c/iconv.cr lib_c/i386-linux-musl/c/link.cr lib_c/i386-linux-musl/c/netdb.cr lib_c/i386-linux-musl/c/netinet/in.cr lib_c/i386-linux-musl/c/pthread.cr -lib_c/i386-linux-musl/c/pwd.cr lib_c/i386-linux-musl/c/signal.cr -lib_c/i386-linux-musl/c/stdarg.cr lib_c/i386-linux-musl/c/stdio.cr lib_c/i386-linux-musl/c/stdlib.cr lib_c/i386-linux-musl/c/string.cr @@ -663,12 +637,10 @@ lib_c/wasm32-wasi/c/fcntl.cr lib_c/wasm32-wasi/c/iconv.cr lib_c/wasm32-wasi/c/netdb.cr lib_c/wasm32-wasi/c/netinet/in.cr -lib_c/wasm32-wasi/c/stdarg.cr lib_c/wasm32-wasi/c/stdio.cr lib_c/wasm32-wasi/c/stdlib.cr lib_c/wasm32-wasi/c/string.cr lib_c/wasm32-wasi/c/sys/file.cr -lib_c/wasm32-wasi/c/sys/resource.cr lib_c/wasm32-wasi/c/sys/select.cr lib_c/wasm32-wasi/c/sys/socket.cr lib_c/wasm32-wasi/c/sys/stat.cr @@ -680,17 +652,12 @@ lib_c/wasm32-wasi/c/time.cr lib_c/wasm32-wasi/c/unistd.cr lib_c/x86_64-darwin/c/arpa/inet.cr lib_c/x86_64-darwin/c/dirent.cr -lib_c/x86_64-darwin/c/dlfcn.cr lib_c/x86_64-darwin/c/fcntl.cr -lib_c/x86_64-darwin/c/grp.cr lib_c/x86_64-darwin/c/iconv.cr -lib_c/x86_64-darwin/c/mach/mach_time.cr lib_c/x86_64-darwin/c/netdb.cr lib_c/x86_64-darwin/c/netinet/in.cr lib_c/x86_64-darwin/c/pthread.cr -lib_c/x86_64-darwin/c/pwd.cr lib_c/x86_64-darwin/c/signal.cr -lib_c/x86_64-darwin/c/stdarg.cr lib_c/x86_64-darwin/c/stdio.cr lib_c/x86_64-darwin/c/stdlib.cr lib_c/x86_64-darwin/c/string.cr @@ -708,23 +675,18 @@ lib_c/x86_64-darwin/c/time.cr lib_c/x86_64-darwin/c/unistd.cr lib_c/x86_64-dragonfly/c/arpa/inet.cr lib_c/x86_64-dragonfly/c/dirent.cr -lib_c/x86_64-dragonfly/c/dlfcn.cr lib_c/x86_64-dragonfly/c/elf.cr lib_c/x86_64-dragonfly/c/fcntl.cr -lib_c/x86_64-dragonfly/c/grp.cr lib_c/x86_64-dragonfly/c/iconv.cr lib_c/x86_64-dragonfly/c/link.cr lib_c/x86_64-dragonfly/c/netdb.cr lib_c/x86_64-dragonfly/c/netinet/in.cr lib_c/x86_64-dragonfly/c/pthread.cr -lib_c/x86_64-dragonfly/c/pwd.cr lib_c/x86_64-dragonfly/c/signal.cr -lib_c/x86_64-dragonfly/c/stdarg.cr lib_c/x86_64-dragonfly/c/stdio.cr lib_c/x86_64-dragonfly/c/stdlib.cr lib_c/x86_64-dragonfly/c/string.cr lib_c/x86_64-dragonfly/c/sys/mman.cr -lib_c/x86_64-dragonfly/c/sys/resource.cr lib_c/x86_64-dragonfly/c/sys/select.cr lib_c/x86_64-dragonfly/c/sys/socket.cr lib_c/x86_64-dragonfly/c/sys/stat.cr @@ -737,23 +699,18 @@ lib_c/x86_64-dragonfly/c/time.cr lib_c/x86_64-dragonfly/c/unistd.cr lib_c/x86_64-freebsd/c/arpa/inet.cr lib_c/x86_64-freebsd/c/dirent.cr -lib_c/x86_64-freebsd/c/dlfcn.cr lib_c/x86_64-freebsd/c/elf.cr lib_c/x86_64-freebsd/c/fcntl.cr -lib_c/x86_64-freebsd/c/grp.cr lib_c/x86_64-freebsd/c/iconv.cr lib_c/x86_64-freebsd/c/link.cr lib_c/x86_64-freebsd/c/netdb.cr lib_c/x86_64-freebsd/c/netinet/in.cr lib_c/x86_64-freebsd/c/pthread.cr -lib_c/x86_64-freebsd/c/pwd.cr lib_c/x86_64-freebsd/c/signal.cr -lib_c/x86_64-freebsd/c/stdarg.cr lib_c/x86_64-freebsd/c/stdio.cr lib_c/x86_64-freebsd/c/stdlib.cr lib_c/x86_64-freebsd/c/string.cr lib_c/x86_64-freebsd/c/sys/mman.cr -lib_c/x86_64-freebsd/c/sys/resource.cr lib_c/x86_64-freebsd/c/sys/select.cr lib_c/x86_64-freebsd/c/sys/socket.cr lib_c/x86_64-freebsd/c/sys/stat.cr @@ -769,20 +726,16 @@ lib_c/x86_64-linux-gnu/c/dirent.cr lib_c/x86_64-linux-gnu/c/dlfcn.cr lib_c/x86_64-linux-gnu/c/elf.cr lib_c/x86_64-linux-gnu/c/fcntl.cr -lib_c/x86_64-linux-gnu/c/grp.cr lib_c/x86_64-linux-gnu/c/iconv.cr lib_c/x86_64-linux-gnu/c/link.cr lib_c/x86_64-linux-gnu/c/netdb.cr lib_c/x86_64-linux-gnu/c/netinet/in.cr lib_c/x86_64-linux-gnu/c/pthread.cr -lib_c/x86_64-linux-gnu/c/pwd.cr lib_c/x86_64-linux-gnu/c/signal.cr -lib_c/x86_64-linux-gnu/c/stdarg.cr lib_c/x86_64-linux-gnu/c/stdio.cr lib_c/x86_64-linux-gnu/c/stdlib.cr lib_c/x86_64-linux-gnu/c/string.cr lib_c/x86_64-linux-gnu/c/sys/mman.cr -lib_c/x86_64-linux-gnu/c/sys/resource.cr lib_c/x86_64-linux-gnu/c/sys/select.cr lib_c/x86_64-linux-gnu/c/sys/socket.cr lib_c/x86_64-linux-gnu/c/sys/stat.cr @@ -795,18 +748,14 @@ lib_c/x86_64-linux-gnu/c/time.cr lib_c/x86_64-linux-gnu/c/unistd.cr lib_c/x86_64-linux-musl/c/arpa/inet.cr lib_c/x86_64-linux-musl/c/dirent.cr -lib_c/x86_64-linux-musl/c/dlfcn.cr lib_c/x86_64-linux-musl/c/elf.cr lib_c/x86_64-linux-musl/c/fcntl.cr -lib_c/x86_64-linux-musl/c/grp.cr lib_c/x86_64-linux-musl/c/iconv.cr lib_c/x86_64-linux-musl/c/link.cr lib_c/x86_64-linux-musl/c/netdb.cr lib_c/x86_64-linux-musl/c/netinet/in.cr lib_c/x86_64-linux-musl/c/pthread.cr -lib_c/x86_64-linux-musl/c/pwd.cr lib_c/x86_64-linux-musl/c/signal.cr -lib_c/x86_64-linux-musl/c/stdarg.cr lib_c/x86_64-linux-musl/c/stdio.cr lib_c/x86_64-linux-musl/c/stdlib.cr lib_c/x86_64-linux-musl/c/string.cr @@ -824,23 +773,18 @@ lib_c/x86_64-linux-musl/c/time.cr lib_c/x86_64-linux-musl/c/unistd.cr lib_c/x86_64-netbsd/c/arpa/inet.cr lib_c/x86_64-netbsd/c/dirent.cr -lib_c/x86_64-netbsd/c/dlfcn.cr lib_c/x86_64-netbsd/c/elf.cr lib_c/x86_64-netbsd/c/fcntl.cr -lib_c/x86_64-netbsd/c/grp.cr lib_c/x86_64-netbsd/c/iconv.cr lib_c/x86_64-netbsd/c/link.cr lib_c/x86_64-netbsd/c/netdb.cr lib_c/x86_64-netbsd/c/netinet/in.cr lib_c/x86_64-netbsd/c/pthread.cr -lib_c/x86_64-netbsd/c/pwd.cr lib_c/x86_64-netbsd/c/signal.cr -lib_c/x86_64-netbsd/c/stdarg.cr lib_c/x86_64-netbsd/c/stdio.cr lib_c/x86_64-netbsd/c/stdlib.cr lib_c/x86_64-netbsd/c/string.cr lib_c/x86_64-netbsd/c/sys/mman.cr -lib_c/x86_64-netbsd/c/sys/resource.cr lib_c/x86_64-netbsd/c/sys/select.cr lib_c/x86_64-netbsd/c/sys/socket.cr lib_c/x86_64-netbsd/c/sys/stat.cr @@ -853,23 +797,18 @@ lib_c/x86_64-netbsd/c/time.cr lib_c/x86_64-netbsd/c/unistd.cr lib_c/x86_64-openbsd/c/arpa/inet.cr lib_c/x86_64-openbsd/c/dirent.cr -lib_c/x86_64-openbsd/c/dlfcn.cr lib_c/x86_64-openbsd/c/elf.cr lib_c/x86_64-openbsd/c/fcntl.cr -lib_c/x86_64-openbsd/c/grp.cr lib_c/x86_64-openbsd/c/iconv.cr lib_c/x86_64-openbsd/c/link.cr lib_c/x86_64-openbsd/c/netdb.cr lib_c/x86_64-openbsd/c/netinet/in.cr lib_c/x86_64-openbsd/c/pthread.cr -lib_c/x86_64-openbsd/c/pwd.cr lib_c/x86_64-openbsd/c/signal.cr -lib_c/x86_64-openbsd/c/stdarg.cr lib_c/x86_64-openbsd/c/stdio.cr lib_c/x86_64-openbsd/c/stdlib.cr lib_c/x86_64-openbsd/c/string.cr lib_c/x86_64-openbsd/c/sys/mman.cr -lib_c/x86_64-openbsd/c/sys/resource.cr lib_c/x86_64-openbsd/c/sys/select.cr lib_c/x86_64-openbsd/c/sys/socket.cr lib_c/x86_64-openbsd/c/sys/stat.cr @@ -882,23 +821,18 @@ lib_c/x86_64-openbsd/c/time.cr lib_c/x86_64-openbsd/c/unistd.cr lib_c/x86_64-solaris/c/arpa/inet.cr lib_c/x86_64-solaris/c/dirent.cr -lib_c/x86_64-solaris/c/dlfcn.cr lib_c/x86_64-solaris/c/elf.cr lib_c/x86_64-solaris/c/fcntl.cr -lib_c/x86_64-solaris/c/grp.cr lib_c/x86_64-solaris/c/iconv.cr lib_c/x86_64-solaris/c/link.cr lib_c/x86_64-solaris/c/netdb.cr lib_c/x86_64-solaris/c/netinet/in.cr lib_c/x86_64-solaris/c/pthread.cr -lib_c/x86_64-solaris/c/pwd.cr lib_c/x86_64-solaris/c/signal.cr -lib_c/x86_64-solaris/c/stdarg.cr lib_c/x86_64-solaris/c/stdio.cr lib_c/x86_64-solaris/c/stdlib.cr lib_c/x86_64-solaris/c/string.cr lib_c/x86_64-solaris/c/sys/mman.cr -lib_c/x86_64-solaris/c/sys/resource.cr lib_c/x86_64-solaris/c/sys/select.cr lib_c/x86_64-solaris/c/sys/socket.cr lib_c/x86_64-solaris/c/sys/stat.cr @@ -931,7 +865,6 @@ lib_c/x86_64-windows-msvc/c/knownfolders.cr lib_c/x86_64-windows-msvc/c/libloaderapi.cr lib_c/x86_64-windows-msvc/c/lm.cr lib_c/x86_64-windows-msvc/c/memoryapi.cr -lib_c/x86_64-windows-msvc/c/minwinbase.cr lib_c/x86_64-windows-msvc/c/mswsock.cr lib_c/x86_64-windows-msvc/c/ntifs.cr lib_c/x86_64-windows-msvc/c/ntsecapi.cr @@ -940,12 +873,10 @@ lib_c/x86_64-windows-msvc/c/process.cr lib_c/x86_64-windows-msvc/c/processenv.cr lib_c/x86_64-windows-msvc/c/processthreadsapi.cr lib_c/x86_64-windows-msvc/c/profileapi.cr -lib_c/x86_64-windows-msvc/c/regapix.cr lib_c/x86_64-windows-msvc/c/sddl.cr lib_c/x86_64-windows-msvc/c/sdkddkver.cr lib_c/x86_64-windows-msvc/c/security.cr lib_c/x86_64-windows-msvc/c/shlobj_core.cr -lib_c/x86_64-windows-msvc/c/stdarg.cr lib_c/x86_64-windows-msvc/c/stdio.cr lib_c/x86_64-windows-msvc/c/stdlib.cr lib_c/x86_64-windows-msvc/c/string.cr @@ -964,7 +895,6 @@ lib_c/x86_64-windows-msvc/c/winnls.cr lib_c/x86_64-windows-msvc/c/winnt.cr lib_c/x86_64-windows-msvc/c/winreg.cr lib_c/x86_64-windows-msvc/c/winsock2.cr -lib_c/x86_64-windows-msvc/c/ws2def.cr lib_c/x86_64-windows-msvc/c/ws2ipdef.cr lib_c/x86_64-windows-msvc/c/ws2tcpip.cr lib_c/x86_64-windows-msvc/c/wtypesbase.cr @@ -995,7 +925,6 @@ llvm/lib_llvm/bit_reader.cr llvm/lib_llvm/bit_writer.cr llvm/lib_llvm/core.cr llvm/lib_llvm/debug_info.cr -llvm/lib_llvm/error.cr llvm/lib_llvm/execution_engine.cr llvm/lib_llvm/initialization.cr llvm/lib_llvm/ir_reader.cr diff --git a/test/s_exp_visitor.cr b/test/s_exp_visitor.cr index 9f7b1d0..12aaee5 100644 --- a/test/s_exp_visitor.cr +++ b/test/s_exp_visitor.cr @@ -45,6 +45,7 @@ class SExpVisitor < Crystal::Visitor yield ensure exit_node + false end # Force the next node to be printed with the given `alias_name` @@ -622,6 +623,53 @@ class SExpVisitor < Crystal::Visitor false end + def visit(node : CStructOrUnionDef) + node_type = if node.union? + "union_def" + else + "c_struct_def" + end + + in_node(node_type) do + visibility_field(node) + + field "name" do + print_node("constant") + end + + field "body" do + if (body = node.body).is_a?(Expressions) + in_node("expressions") do + field_name = if node.union? + "union_fields" + else + "c_struct_fields" + end + + body.expressions.each do |member| + case member + when TypeDeclaration + in_node(field_name) do + field "name" do + print_node("identifier") + end + + field "type" do + member.declared_type.accept(self) + end + end + else + member.accept(self) + end + end + end + end + end + end + + false + end + def visit(node : Block) enter_node("block") # TODO @@ -640,7 +688,11 @@ class SExpVisitor < Crystal::Visitor field "real_name" do next if node.real_name == node.name - print_node("identifier") + if node.real_name.starts_with?(/[A-Z]/) + print_node("constant") + else + print_node("identifier") + end end # TODO varargs @@ -666,6 +718,20 @@ class SExpVisitor < Crystal::Visitor false end + def visit(node : TypeDef) + in_node("type_def") do + field "name" do + print_node("constant") + end + + field "type" do + node.type_spec.accept(self) + end + end + + false + end + ############## # Control flow ############## From 9e3c5bcc0ca8a272f2217ca7086e5f25906d4f25 Mon Sep 17 00:00:00 2001 From: Margret Riegert Date: Wed, 8 Jan 2025 14:55:37 -0500 Subject: [PATCH 05/13] Add s_exp support for {modifier_,}{rescue,ensure}, block params, & ExceptionHandler --- grammar.js | 5 +- src/grammar.json | 34 ++- src/node-types.json | 341 +---------------------------- src/parser.c | 2 +- test/corpus/expressions.txt | 56 +++-- test/corpus/statements.txt | 7 + test/crystal_parse_stdlib_fail.txt | 7 - test/s_exp_visitor.cr | 186 ++++++++++++++-- 8 files changed, 251 insertions(+), 387 deletions(-) diff --git a/grammar.js b/grammar.js index f1be8bc..4d76184 100644 --- a/grammar.js +++ b/grammar.js @@ -2743,7 +2743,10 @@ module.exports = grammar({ ) }, - ensure: $ => seq(alias($._regular_ensure_keyword, 'ensure'), optional($._statements)), + ensure: $ => seq( + alias($._regular_ensure_keyword, 'ensure'), + field('body', seq(optional(alias($._statements, $.expressions)))), + ), modifier_rescue: $ => seq( $._statement, diff --git a/src/grammar.json b/src/grammar.json index 2a73059..62303b8 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -13317,16 +13317,30 @@ "value": "ensure" }, { - "type": "CHOICE", - "members": [ - { - "type": "SYMBOL", - "name": "_statements" - }, - { - "type": "BLANK" - } - ] + "type": "FIELD", + "name": "body", + "content": { + "type": "SEQ", + "members": [ + { + "type": "CHOICE", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "SYMBOL", + "name": "_statements" + }, + "named": true, + "value": "expressions" + }, + { + "type": "BLANK" + } + ] + } + ] + } } ] }, diff --git a/src/node-types.json b/src/node-types.json index 982e8c3..7d8b5e2 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -5757,336 +5757,17 @@ { "type": "ensure", "named": true, - "fields": {}, - "children": { - "multiple": true, - "required": false, - "types": [ - { - "type": "abstract_method_def", - "named": true - }, - { - "type": "alias", - "named": true - }, - { - "type": "alignof", - "named": true - }, - { - "type": "and", - "named": true - }, - { - "type": "annotation", - "named": true - }, - { - "type": "annotation_def", - "named": true - }, - { - "type": "array", - "named": true - }, - { - "type": "array_like", - "named": true - }, - { - "type": "asm", - "named": true - }, - { - "type": "assign", - "named": true - }, - { - "type": "begin", - "named": true - }, - { - "type": "break", - "named": true - }, - { - "type": "call", - "named": true - }, - { - "type": "case", - "named": true - }, - { - "type": "chained_string", - "named": true - }, - { - "type": "char", - "named": true - }, - { - "type": "class_def", - "named": true - }, - { - "type": "class_var", - "named": true - }, - { - "type": "command", - "named": true - }, - { - "type": "conditional", - "named": true - }, - { - "type": "const_assign", - "named": true - }, - { - "type": "constant", - "named": true - }, - { - "type": "enum_def", - "named": true - }, - { - "type": "expressions", - "named": true - }, - { - "type": "extend", - "named": true - }, - { - "type": "false", - "named": true - }, - { - "type": "float", - "named": true - }, - { - "type": "fun_def", - "named": true - }, - { - "type": "generic_instance_type", - "named": true - }, - { - "type": "hash", - "named": true - }, - { - "type": "hash_like", - "named": true - }, - { - "type": "heredoc_start", - "named": true - }, - { - "type": "identifier", - "named": true - }, - { - "type": "if", - "named": true - }, - { - "type": "include", - "named": true - }, - { - "type": "index_call", - "named": true - }, - { - "type": "instance_alignof", - "named": true - }, - { - "type": "instance_sizeof", - "named": true - }, - { - "type": "instance_var", - "named": true - }, - { - "type": "integer", - "named": true - }, - { - "type": "lib_def", - "named": true - }, - { - "type": "macro_def", - "named": true - }, - { - "type": "macro_expression", - "named": true - }, - { - "type": "macro_var", - "named": true - }, - { - "type": "method_def", - "named": true - }, - { - "type": "method_proc", - "named": true - }, - { - "type": "modifier_ensure", - "named": true - }, - { - "type": "modifier_if", - "named": true - }, - { - "type": "modifier_rescue", - "named": true - }, - { - "type": "modifier_unless", - "named": true - }, - { - "type": "module_def", - "named": true - }, - { - "type": "named_tuple", - "named": true - }, - { - "type": "next", - "named": true - }, - { - "type": "nil", - "named": true - }, - { - "type": "nilable_constant", - "named": true - }, - { - "type": "not", - "named": true - }, - { - "type": "offsetof", - "named": true - }, - { - "type": "op_assign", - "named": true - }, - { - "type": "or", - "named": true - }, - { - "type": "pointerof", - "named": true - }, - { - "type": "proc", - "named": true - }, - { - "type": "pseudo_constant", - "named": true - }, - { - "type": "range", - "named": true - }, - { - "type": "regex", - "named": true - }, - { - "type": "require", - "named": true - }, - { - "type": "return", - "named": true - }, - { - "type": "select", - "named": true - }, - { - "type": "self", - "named": true - }, - { - "type": "sizeof", - "named": true - }, - { - "type": "special_variable", - "named": true - }, - { - "type": "string", - "named": true - }, - { - "type": "struct_def", - "named": true - }, - { - "type": "symbol", - "named": true - }, - { - "type": "true", - "named": true - }, - { - "type": "tuple", - "named": true - }, - { - "type": "type_declaration", - "named": true - }, - { - "type": "typeof", - "named": true - }, - { - "type": "unless", - "named": true - }, - { - "type": "until", - "named": true - }, - { - "type": "while", - "named": true - }, - { - "type": "yield", - "named": true - } - ] + "fields": { + "body": { + "multiple": false, + "required": false, + "types": [ + { + "type": "expressions", + "named": true + } + ] + } } }, { diff --git a/src/parser.c b/src/parser.c index ddc5ac9..5225da1 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1523617,7 +1523617,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [29244] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6462), [29246] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6463), [29248] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6464), - [29250] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_ensure, 2, 0, 0), + [29250] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_ensure, 2, 0, 42), [29252] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14103), [29254] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1005), [29256] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4640), diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt index 4c12ed0..935665c 100644 --- a/test/corpus/expressions.txt +++ b/test/corpus/expressions.txt @@ -899,6 +899,7 @@ begin begin end end ================================================================================ begin blocks with rescue +:language(crystal) ================================================================================ begin 1 @@ -972,6 +973,7 @@ end ================================================================================ begin blocks with ensure +:language(crystal) ================================================================================ begin 1 @@ -990,14 +992,16 @@ puts begin 1 body: (expressions (integer)) ensure: (ensure - (integer))) + body: (expressions + (integer)))) (begin body: (expressions (modifier_ensure (identifier) ensure: (identifier))) ensure: (ensure - (identifier))) + body: (expressions + (identifier)))) (call method: (identifier) arguments: (argument_list @@ -1007,13 +1011,15 @@ puts begin 1 (integer) (integer)) ensure: (ensure - (call - method: (identifier) - arguments: (argument_list - (integer)))))))) + body: (expressions + (call + method: (identifier) + arguments: (argument_list + (integer))))))))) ================================================================================ begin blocks with rescue, else, and ensure +:language(crystal) ================================================================================ begin 1 rescue a : ArgumentError @@ -1047,7 +1053,8 @@ begin :a; rescue; :b else :c; ensure p! :d end body: (expressions (integer))) ensure: (ensure - (integer))) + body: (expressions + (integer)))) (begin body: (expressions (symbol)) @@ -1072,13 +1079,15 @@ begin :a; rescue; :b else :c; ensure p! :d end body: (expressions (symbol))) ensure: (ensure - (call - method: (identifier) - arguments: (argument_list - (symbol)))))) + body: (expressions + (call + method: (identifier) + arguments: (argument_list + (symbol))))))) ================================================================================ rescue modifiers +:language(crystal) ================================================================================ puts 7 rescue ArgumentError puts (7 rescue ArgumentError) @@ -1108,8 +1117,9 @@ do_stuff rescue do_stuff rescue 7 ================================================================================ ensure modifiers +:language(crystal) ================================================================================ -puts (4 ensure (puts 3)) +puts (4 ensure puts 3) def foo a; b @@ -1125,22 +1135,22 @@ end (expressions (modifier_ensure (integer) - ensure: (expressions - (call - method: (identifier) - arguments: (argument_list - (integer)))))))) + ensure: (call + method: (identifier) + arguments: (argument_list + (integer))))))) (method_def name: (identifier) body: (expressions (identifier) (identifier)) ensure: (ensure - (identifier) - (modifier_ensure + body: (expressions (identifier) - ensure: (identifier)) - (identifier)))) + (modifier_ensure + (identifier) + ensure: (identifier)) + (identifier))))) ================================================================================ binary additive operators @@ -2312,6 +2322,7 @@ a (b do 1 end) do 2 end ================================================================================ do/end blocks with rescue, else, and ensure +:language(crystal) ================================================================================ a do rescue e ; end b do ensure bar end @@ -2334,7 +2345,8 @@ end method: (identifier) block: (block ensure: (ensure - (identifier)))) + body: (expressions + (identifier))))) (call receiver: (expressions (range diff --git a/test/corpus/statements.txt b/test/corpus/statements.txt index 6e4bef5..14632f8 100644 --- a/test/corpus/statements.txt +++ b/test/corpus/statements.txt @@ -749,8 +749,10 @@ end ================================================================================ method definitions with rescue, else, and ensure +:language(crystal) ================================================================================ def foo +puts "hello" rescue e1 : SpecificError | OtherError rescue e2 : GeneralError else @@ -761,6 +763,11 @@ end (expressions (method_def name: (identifier) + body: (expressions + (call + method: (identifier) + arguments: (argument_list + (string)))) rescue: (rescue variable: (identifier) type: (union_type diff --git a/test/crystal_parse_stdlib_fail.txt b/test/crystal_parse_stdlib_fail.txt index ed86e84..b87f4f2 100644 --- a/test/crystal_parse_stdlib_fail.txt +++ b/test/crystal_parse_stdlib_fail.txt @@ -156,12 +156,10 @@ compiler/crystal/tools/doc.cr compiler/crystal/tools/doc/constant.cr compiler/crystal/tools/doc/generator.cr compiler/crystal/tools/doc/macro.cr -compiler/crystal/tools/doc/main.cr compiler/crystal/tools/doc/method.cr compiler/crystal/tools/doc/project_info.cr compiler/crystal/tools/doc/relative_location.cr compiler/crystal/tools/doc/templates.cr -compiler/crystal/tools/doc/to_json.cr compiler/crystal/tools/doc/type.cr compiler/crystal/tools/expand.cr compiler/crystal/tools/flags.cr @@ -242,7 +240,6 @@ crystal/system/file_descriptor.cr crystal/system/file_info.cr crystal/system/group.cr crystal/system/mime.cr -crystal/system/panic.cr crystal/system/path.cr crystal/system/print_error.cr crystal/system/process.cr @@ -268,7 +265,6 @@ crystal/system/unix/getrandom.cr crystal/system/unix/group.cr crystal/system/unix/hostname.cr crystal/system/unix/lib_event2.cr -crystal/system/unix/mime.cr crystal/system/unix/path.cr crystal/system/unix/process.cr crystal/system/unix/pthread.cr @@ -453,7 +449,6 @@ json/lexer/string_based.cr json/parser.cr json/pull_parser.cr json/to_json.cr -json/token.cr kernel.cr levenshtein.cr lib_c.cr @@ -1090,7 +1085,6 @@ time/format.cr time/format/custom/http_date.cr time/format/custom/iso_8601.cr time/format/custom/rfc_2822.cr -time/format/custom/rfc_3339.cr time/format/custom/yaml_date.cr time/format/formatter.cr time/format/parser.cr @@ -1123,7 +1117,6 @@ xml/namespace.cr xml/node.cr xml/node_set.cr xml/reader.cr -xml/xpath_context.cr yaml.cr yaml/any.cr yaml/lib_yaml.cr diff --git a/test/s_exp_visitor.cr b/test/s_exp_visitor.cr index 12aaee5..b03a51e 100644 --- a/test/s_exp_visitor.cr +++ b/test/s_exp_visitor.cr @@ -99,18 +99,114 @@ class SExpVisitor < Crystal::Visitor @fields.pop end - def body_field(body : ASTNode?) - field "body" do - case body - when Nop, nil - break - when Expressions - # keep it - else - body = Expressions.new([body]) + def handle_exception_handler(node : ExceptionHandler) + if node.suffix + field "body" do + in_node("expressions") do + handle_exception_suffix(node) + end + end + return + end + + body_field(node.body) + + node.rescues.try &.each do |rescue_| + field "rescue" do + rescue_.accept(self) + end + end + + field "else" do + if (else_ = node.else) && !else_.is_a?(Nop) + in_node("else") do + field "body" do + if else_.is_a?(Expressions) + else_.accept(self) + else + in_node("expressions") do + else_.accept(self) + end + end + end + end + elsif node.else_location + print_node("else") + end + end + + field "ensure" do + if (ensure_ = node.ensure) && !ensure_.is_a?(Nop) + in_node("ensure") do + field "body" do + if ensure_.is_a?(Expressions) + ensure_.accept(self) + else + in_node("expressions") do + ensure_.accept(self) + end + end + end + end + elsif node.ensure_location + print_node("ensure") + end + end + end + + def handle_exception_suffix(node : ExceptionHandler) + case + when (rescue_ = node.rescues.try(&.first)) + in_node("modifier_rescue") do + if (body = node.body).is_a?(Expressions) + body.expressions.each &.accept(self) + else + body.accept(self) + end + + field "rescue" do + rescue_.body.accept(self) + end end + when (ensure_ = node.ensure) + in_node("modifier_ensure") do + if (body = node.body).is_a?(Expressions) + body.expressions.each &.accept(self) + else + body.accept(self) + end - body.accept self + field "ensure" do + if ensure_.is_a?(Expressions) + ensure_.expressions.each &.accept(self) + else + ensure_.accept(self) + end + end + end + else + raise NotImplementedError.new(node.class) + end + end + + def body_field(body : ASTNode?) + if body.is_a?(ExceptionHandler) + handle_exception_handler(body) + else + field "body" do + case body + when Nop, nil + break + when Expressions + # keep it + when ASTNode + body = Expressions.new([body] of ASTNode) + else + return + end + + body.accept self + end end end @@ -671,13 +767,30 @@ class SExpVisitor < Crystal::Visitor end def visit(node : Block) - enter_node("block") - # TODO - true - end + in_node("block") do + field "params" do + if node.args.size > 0 + in_node("param_list") do + splat_index = node.splat_index || -1 - def end_visit(node : Block) - exit_node + node.args.each_with_index do |arg, i| + if i == splat_index + alias_next_node!("splat_param") + end + in_node("param") do + field "name" do + arg.accept self + end + end + end + end + end + end + + body_field(node.body) + end + + false end def visit(node : FunDef) @@ -1582,6 +1695,7 @@ class SExpVisitor < Crystal::Visitor end end end + false end @@ -1589,6 +1703,46 @@ class SExpVisitor < Crystal::Visitor true end + def visit(node : ExceptionHandler) + if node.suffix + handle_exception_suffix(node) + else + in_node("begin") do + handle_exception_handler(node) + end + end + + false + end + + def visit(node : Rescue) + in_node("rescue") do + field "variable" do + if node.name + print_node("identifier") + end + end + + if (types = node.types) + if types.size == 1 + field "type" do + types.first.accept(self) + end + else + field "type" do + in_node("union_type") do + types.each &.accept(self) + end + end + end + end + + body_field(node.body) + end + + false + end + ########## # Fallback ########## From 718c5a424257e420db0931476e7a92589387133f Mon Sep 17 00:00:00 2001 From: Margret Riegert Date: Wed, 8 Jan 2025 15:41:53 -0500 Subject: [PATCH 06/13] Fix s_exp for require --- test/crystal_parse_stdlib_fail.txt | 347 ----------------------------- test/s_exp_visitor.cr | 9 +- 2 files changed, 8 insertions(+), 348 deletions(-) diff --git a/test/crystal_parse_stdlib_fail.txt b/test/crystal_parse_stdlib_fail.txt index b87f4f2..1c2a8fc 100644 --- a/test/crystal_parse_stdlib_fail.txt +++ b/test/crystal_parse_stdlib_fail.txt @@ -4,14 +4,11 @@ base64.cr benchmark.cr benchmark/bm.cr benchmark/ips.cr -big.cr big/big_decimal.cr big/big_float.cr big/big_rational.cr -big/json.cr big/lib_gmp.cr big/number.cr -big/yaml.cr bit_array.cr box.cr channel.cr @@ -68,19 +65,16 @@ compiler/crystal/ffi/closure.cr compiler/crystal/ffi/ffi.cr compiler/crystal/ffi/lib_ffi.cr compiler/crystal/ffi/type.cr -compiler/crystal/formatter.cr compiler/crystal/interpreter.cr compiler/crystal/interpreter/c.cr compiler/crystal/interpreter/cast.cr compiler/crystal/interpreter/class_vars.cr -compiler/crystal/interpreter/closure.cr compiler/crystal/interpreter/closure_context.cr compiler/crystal/interpreter/compiled_block.cr compiler/crystal/interpreter/compiled_def.cr compiler/crystal/interpreter/compiled_instructions.cr compiler/crystal/interpreter/constants.cr compiler/crystal/interpreter/context.cr -compiler/crystal/interpreter/debug.cr compiler/crystal/interpreter/escaping_exception.cr compiler/crystal/interpreter/ffi_closure_context.cr compiler/crystal/interpreter/lib_function.cr @@ -89,7 +83,6 @@ compiler/crystal/interpreter/local_vars_gatherer.cr compiler/crystal/interpreter/multidispatch.cr compiler/crystal/interpreter/primitives.cr compiler/crystal/interpreter/repl.cr -compiler/crystal/interpreter/to_bool.cr compiler/crystal/interpreter/value.cr compiler/crystal/loader.cr compiler/crystal/loader/msvc.cr @@ -99,7 +92,6 @@ compiler/crystal/macros/interpreter.cr compiler/crystal/macros/macros.cr compiler/crystal/macros/types.cr compiler/crystal/progress_tracker.cr -compiler/crystal/semantic.cr compiler/crystal/semantic/abstract_def_checker.cr compiler/crystal/semantic/ast.cr compiler/crystal/semantic/bindings.cr @@ -132,7 +124,6 @@ compiler/crystal/semantic/semantic_visitor.cr compiler/crystal/semantic/suggestions.cr compiler/crystal/semantic/to_s.cr compiler/crystal/semantic/top_level_visitor.cr -compiler/crystal/semantic/transformer.cr compiler/crystal/semantic/type_declaration_processor.cr compiler/crystal/semantic/type_declaration_visitor.cr compiler/crystal/semantic/type_guess_visitor.cr @@ -141,7 +132,6 @@ compiler/crystal/semantic/type_lookup.cr compiler/crystal/semantic/type_merge.cr compiler/crystal/semantic/type_to_restriction.cr compiler/crystal/semantic/warnings.cr -compiler/crystal/syntax.cr compiler/crystal/syntax/exception.cr compiler/crystal/syntax/location.cr compiler/crystal/syntax/parser.cr @@ -152,7 +142,6 @@ compiler/crystal/syntax/virtual_file.cr compiler/crystal/syntax/visitor.cr compiler/crystal/tools/context.cr compiler/crystal/tools/dependencies.cr -compiler/crystal/tools/doc.cr compiler/crystal/tools/doc/constant.cr compiler/crystal/tools/doc/generator.cr compiler/crystal/tools/doc/macro.cr @@ -178,7 +167,6 @@ compiler/crystal/tools/typed_def_processor.cr compiler/crystal/tools/unreachable.cr compiler/crystal/util.cr compiler/crystal/warnings.cr -compiler/requires.cr complex.cr compress/deflate/deflate.cr compress/deflate/reader.cr @@ -193,10 +181,8 @@ compress/zip/file.cr compress/zip/file_info.cr compress/zip/reader.cr compress/zip/writer.cr -compress/zip/zip.cr compress/zlib/reader.cr compress/zlib/writer.cr -compress/zlib/zlib.cr crypto/bcrypt.cr crypto/bcrypt/base64.cr crypto/bcrypt/blowfish.cr @@ -263,7 +249,6 @@ crystal/system/unix/file.cr crystal/system/unix/file_info.cr crystal/system/unix/getrandom.cr crystal/system/unix/group.cr -crystal/system/unix/hostname.cr crystal/system/unix/lib_event2.cr crystal/system/unix/path.cr crystal/system/unix/process.cr @@ -284,9 +269,7 @@ crystal/system/wasi/dir.cr crystal/system/wasi/event_loop.cr crystal/system/wasi/file.cr crystal/system/wasi/lib_wasi.cr -crystal/system/wasi/main.cr crystal/system/wasi/process.cr -crystal/system/wasi/random.cr crystal/system/wasi/socket.cr crystal/system/wasi/thread.cr crystal/system/wasi/thread_condition_variable.cr @@ -294,7 +277,6 @@ crystal/system/wasi/thread_mutex.cr crystal/system/wasi/wasi.cr crystal/system/win32/addrinfo.cr crystal/system/win32/addrinfo_win7.cr -crystal/system/win32/cpucount.cr crystal/system/win32/crypto.cr crystal/system/win32/dir.cr crystal/system/win32/env.cr @@ -304,14 +286,11 @@ crystal/system/win32/file.cr crystal/system/win32/file_descriptor.cr crystal/system/win32/file_info.cr crystal/system/win32/group.cr -crystal/system/win32/hostname.cr crystal/system/win32/iocp.cr crystal/system/win32/library_archive.cr crystal/system/win32/mime.cr crystal/system/win32/path.cr crystal/system/win32/process.cr -crystal/system/win32/random.cr -crystal/system/win32/signal.cr crystal/system/win32/socket.cr crystal/system/win32/thread.cr crystal/system/win32/thread_condition_variable.cr @@ -320,7 +299,6 @@ crystal/system/win32/time.cr crystal/system/win32/user.cr crystal/system/win32/visual_studio.cr crystal/system/win32/windows_registry.cr -crystal/system/win32/windows_sdk.cr crystal/system/win32/wmain.cr crystal/system/win32/zone_names.cr crystal/system/windows.cr @@ -333,9 +311,7 @@ csv/lexer.cr csv/lexer/io_based.cr csv/lexer/string_based.cr csv/parser.cr -csv/token.cr deque.cr -digest.cr digest/adler32.cr digest/crc32.cr digest/digest.cr @@ -346,11 +322,8 @@ digest/sha256.cr digest/sha512.cr dir.cr dir/glob.cr -docs_main.cr docs_pseudo_methods.cr -ecr.cr ecr/lexer.cr -ecr/process.cr ecr/processor.cr empty.cr env.cr @@ -375,7 +348,6 @@ fiber/context/x86_64-sysv.cr fiber/stack_pool.cr file.cr file/error.cr -file/info.cr file/preader.cr file/tempfile.cr file_utils.cr @@ -394,7 +366,6 @@ gc/boehm.cr gc/none.cr hash.cr html.cr -http.cr http/client/response.cr http/common.cr http/content.cr @@ -405,11 +376,9 @@ http/formdata/parser.cr http/formdata/part.cr http/headers.cr http/log.cr -http/params.cr http/request.cr http/server.cr http/server/context.cr -http/server/handler.cr http/server/handlers/compress_handler.cr http/server/handlers/error_handler.cr http/server/handlers/log_handler.cr @@ -453,399 +422,116 @@ kernel.cr levenshtein.cr lib_c.cr lib_c/aarch64-android/c/arpa/inet.cr -lib_c/aarch64-android/c/dirent.cr lib_c/aarch64-android/c/dlfcn.cr -lib_c/aarch64-android/c/elf.cr -lib_c/aarch64-android/c/fcntl.cr lib_c/aarch64-android/c/grp.cr lib_c/aarch64-android/c/iconv.cr -lib_c/aarch64-android/c/link.cr -lib_c/aarch64-android/c/netdb.cr lib_c/aarch64-android/c/netinet/in.cr lib_c/aarch64-android/c/pthread.cr lib_c/aarch64-android/c/signal.cr lib_c/aarch64-android/c/stdio.cr lib_c/aarch64-android/c/stdlib.cr lib_c/aarch64-android/c/string.cr -lib_c/aarch64-android/c/sys/mman.cr lib_c/aarch64-android/c/sys/select.cr -lib_c/aarch64-android/c/sys/socket.cr -lib_c/aarch64-android/c/sys/stat.cr lib_c/aarch64-android/c/sys/system_properties.cr lib_c/aarch64-android/c/sys/time.cr lib_c/aarch64-android/c/sys/types.cr -lib_c/aarch64-android/c/sys/un.cr -lib_c/aarch64-android/c/sys/wait.cr lib_c/aarch64-android/c/termios.cr -lib_c/aarch64-android/c/time.cr lib_c/aarch64-android/c/unistd.cr -lib_c/aarch64-darwin/c/arpa/inet.cr -lib_c/aarch64-darwin/c/dirent.cr -lib_c/aarch64-darwin/c/fcntl.cr -lib_c/aarch64-darwin/c/iconv.cr -lib_c/aarch64-darwin/c/netdb.cr lib_c/aarch64-darwin/c/netinet/in.cr lib_c/aarch64-darwin/c/pthread.cr lib_c/aarch64-darwin/c/signal.cr -lib_c/aarch64-darwin/c/stdio.cr lib_c/aarch64-darwin/c/stdlib.cr lib_c/aarch64-darwin/c/string.cr -lib_c/aarch64-darwin/c/sys/mman.cr lib_c/aarch64-darwin/c/sys/resource.cr lib_c/aarch64-darwin/c/sys/select.cr -lib_c/aarch64-darwin/c/sys/socket.cr -lib_c/aarch64-darwin/c/sys/stat.cr -lib_c/aarch64-darwin/c/sys/time.cr -lib_c/aarch64-darwin/c/sys/types.cr -lib_c/aarch64-darwin/c/sys/un.cr -lib_c/aarch64-darwin/c/sys/wait.cr -lib_c/aarch64-darwin/c/termios.cr -lib_c/aarch64-darwin/c/time.cr -lib_c/aarch64-darwin/c/unistd.cr -lib_c/aarch64-linux-gnu/c/arpa/inet.cr -lib_c/aarch64-linux-gnu/c/dirent.cr lib_c/aarch64-linux-gnu/c/dlfcn.cr -lib_c/aarch64-linux-gnu/c/elf.cr -lib_c/aarch64-linux-gnu/c/fcntl.cr -lib_c/aarch64-linux-gnu/c/iconv.cr -lib_c/aarch64-linux-gnu/c/link.cr -lib_c/aarch64-linux-gnu/c/netdb.cr lib_c/aarch64-linux-gnu/c/netinet/in.cr lib_c/aarch64-linux-gnu/c/pthread.cr lib_c/aarch64-linux-gnu/c/signal.cr -lib_c/aarch64-linux-gnu/c/stdio.cr -lib_c/aarch64-linux-gnu/c/stdlib.cr lib_c/aarch64-linux-gnu/c/string.cr -lib_c/aarch64-linux-gnu/c/sys/mman.cr lib_c/aarch64-linux-gnu/c/sys/select.cr -lib_c/aarch64-linux-gnu/c/sys/socket.cr -lib_c/aarch64-linux-gnu/c/sys/stat.cr -lib_c/aarch64-linux-gnu/c/sys/time.cr -lib_c/aarch64-linux-gnu/c/sys/types.cr -lib_c/aarch64-linux-gnu/c/sys/un.cr -lib_c/aarch64-linux-gnu/c/sys/wait.cr -lib_c/aarch64-linux-gnu/c/termios.cr -lib_c/aarch64-linux-gnu/c/time.cr -lib_c/aarch64-linux-gnu/c/unistd.cr -lib_c/aarch64-linux-musl/c/arpa/inet.cr -lib_c/aarch64-linux-musl/c/dirent.cr -lib_c/aarch64-linux-musl/c/elf.cr -lib_c/aarch64-linux-musl/c/fcntl.cr -lib_c/aarch64-linux-musl/c/iconv.cr -lib_c/aarch64-linux-musl/c/link.cr -lib_c/aarch64-linux-musl/c/netdb.cr lib_c/aarch64-linux-musl/c/netinet/in.cr lib_c/aarch64-linux-musl/c/pthread.cr lib_c/aarch64-linux-musl/c/signal.cr -lib_c/aarch64-linux-musl/c/stdio.cr -lib_c/aarch64-linux-musl/c/stdlib.cr lib_c/aarch64-linux-musl/c/string.cr -lib_c/aarch64-linux-musl/c/sys/mman.cr lib_c/aarch64-linux-musl/c/sys/resource.cr lib_c/aarch64-linux-musl/c/sys/select.cr -lib_c/aarch64-linux-musl/c/sys/socket.cr -lib_c/aarch64-linux-musl/c/sys/stat.cr -lib_c/aarch64-linux-musl/c/sys/time.cr lib_c/aarch64-linux-musl/c/sys/types.cr -lib_c/aarch64-linux-musl/c/sys/un.cr -lib_c/aarch64-linux-musl/c/sys/wait.cr -lib_c/aarch64-linux-musl/c/termios.cr -lib_c/aarch64-linux-musl/c/time.cr -lib_c/aarch64-linux-musl/c/unistd.cr -lib_c/arm-linux-gnueabihf/c/arpa/inet.cr -lib_c/arm-linux-gnueabihf/c/dirent.cr lib_c/arm-linux-gnueabihf/c/dlfcn.cr -lib_c/arm-linux-gnueabihf/c/elf.cr -lib_c/arm-linux-gnueabihf/c/fcntl.cr -lib_c/arm-linux-gnueabihf/c/iconv.cr -lib_c/arm-linux-gnueabihf/c/link.cr -lib_c/arm-linux-gnueabihf/c/netdb.cr lib_c/arm-linux-gnueabihf/c/netinet/in.cr lib_c/arm-linux-gnueabihf/c/pthread.cr lib_c/arm-linux-gnueabihf/c/signal.cr -lib_c/arm-linux-gnueabihf/c/stdio.cr -lib_c/arm-linux-gnueabihf/c/stdlib.cr lib_c/arm-linux-gnueabihf/c/string.cr -lib_c/arm-linux-gnueabihf/c/sys/mman.cr lib_c/arm-linux-gnueabihf/c/sys/select.cr -lib_c/arm-linux-gnueabihf/c/sys/socket.cr -lib_c/arm-linux-gnueabihf/c/sys/stat.cr -lib_c/arm-linux-gnueabihf/c/sys/time.cr -lib_c/arm-linux-gnueabihf/c/sys/types.cr -lib_c/arm-linux-gnueabihf/c/sys/un.cr -lib_c/arm-linux-gnueabihf/c/sys/wait.cr -lib_c/arm-linux-gnueabihf/c/termios.cr -lib_c/arm-linux-gnueabihf/c/time.cr -lib_c/arm-linux-gnueabihf/c/unistd.cr -lib_c/i386-linux-gnu/c/arpa/inet.cr -lib_c/i386-linux-gnu/c/dirent.cr lib_c/i386-linux-gnu/c/dlfcn.cr -lib_c/i386-linux-gnu/c/elf.cr -lib_c/i386-linux-gnu/c/fcntl.cr -lib_c/i386-linux-gnu/c/iconv.cr -lib_c/i386-linux-gnu/c/link.cr -lib_c/i386-linux-gnu/c/netdb.cr lib_c/i386-linux-gnu/c/netinet/in.cr lib_c/i386-linux-gnu/c/pthread.cr lib_c/i386-linux-gnu/c/signal.cr -lib_c/i386-linux-gnu/c/stdio.cr -lib_c/i386-linux-gnu/c/stdlib.cr lib_c/i386-linux-gnu/c/string.cr -lib_c/i386-linux-gnu/c/sys/mman.cr lib_c/i386-linux-gnu/c/sys/select.cr -lib_c/i386-linux-gnu/c/sys/socket.cr -lib_c/i386-linux-gnu/c/sys/stat.cr -lib_c/i386-linux-gnu/c/sys/time.cr -lib_c/i386-linux-gnu/c/sys/types.cr -lib_c/i386-linux-gnu/c/sys/un.cr -lib_c/i386-linux-gnu/c/sys/wait.cr -lib_c/i386-linux-gnu/c/termios.cr -lib_c/i386-linux-gnu/c/time.cr -lib_c/i386-linux-gnu/c/unistd.cr -lib_c/i386-linux-musl/c/arpa/inet.cr -lib_c/i386-linux-musl/c/dirent.cr -lib_c/i386-linux-musl/c/elf.cr -lib_c/i386-linux-musl/c/fcntl.cr -lib_c/i386-linux-musl/c/iconv.cr -lib_c/i386-linux-musl/c/link.cr -lib_c/i386-linux-musl/c/netdb.cr lib_c/i386-linux-musl/c/netinet/in.cr lib_c/i386-linux-musl/c/pthread.cr lib_c/i386-linux-musl/c/signal.cr -lib_c/i386-linux-musl/c/stdio.cr -lib_c/i386-linux-musl/c/stdlib.cr lib_c/i386-linux-musl/c/string.cr -lib_c/i386-linux-musl/c/sys/mman.cr lib_c/i386-linux-musl/c/sys/resource.cr lib_c/i386-linux-musl/c/sys/select.cr -lib_c/i386-linux-musl/c/sys/socket.cr -lib_c/i386-linux-musl/c/sys/stat.cr -lib_c/i386-linux-musl/c/sys/time.cr lib_c/i386-linux-musl/c/sys/types.cr -lib_c/i386-linux-musl/c/sys/un.cr -lib_c/i386-linux-musl/c/sys/wait.cr -lib_c/i386-linux-musl/c/termios.cr -lib_c/i386-linux-musl/c/time.cr -lib_c/i386-linux-musl/c/unistd.cr -lib_c/wasm32-wasi/c/arpa/inet.cr -lib_c/wasm32-wasi/c/fcntl.cr -lib_c/wasm32-wasi/c/iconv.cr -lib_c/wasm32-wasi/c/netdb.cr lib_c/wasm32-wasi/c/netinet/in.cr -lib_c/wasm32-wasi/c/stdio.cr -lib_c/wasm32-wasi/c/stdlib.cr lib_c/wasm32-wasi/c/string.cr lib_c/wasm32-wasi/c/sys/file.cr -lib_c/wasm32-wasi/c/sys/select.cr -lib_c/wasm32-wasi/c/sys/socket.cr -lib_c/wasm32-wasi/c/sys/stat.cr -lib_c/wasm32-wasi/c/sys/time.cr -lib_c/wasm32-wasi/c/sys/times.cr lib_c/wasm32-wasi/c/sys/types.cr -lib_c/wasm32-wasi/c/termios.cr -lib_c/wasm32-wasi/c/time.cr -lib_c/wasm32-wasi/c/unistd.cr -lib_c/x86_64-darwin/c/arpa/inet.cr lib_c/x86_64-darwin/c/dirent.cr -lib_c/x86_64-darwin/c/fcntl.cr -lib_c/x86_64-darwin/c/iconv.cr -lib_c/x86_64-darwin/c/netdb.cr lib_c/x86_64-darwin/c/netinet/in.cr lib_c/x86_64-darwin/c/pthread.cr lib_c/x86_64-darwin/c/signal.cr -lib_c/x86_64-darwin/c/stdio.cr lib_c/x86_64-darwin/c/stdlib.cr lib_c/x86_64-darwin/c/string.cr -lib_c/x86_64-darwin/c/sys/mman.cr lib_c/x86_64-darwin/c/sys/resource.cr lib_c/x86_64-darwin/c/sys/select.cr -lib_c/x86_64-darwin/c/sys/socket.cr -lib_c/x86_64-darwin/c/sys/stat.cr -lib_c/x86_64-darwin/c/sys/time.cr -lib_c/x86_64-darwin/c/sys/types.cr -lib_c/x86_64-darwin/c/sys/un.cr -lib_c/x86_64-darwin/c/sys/wait.cr -lib_c/x86_64-darwin/c/termios.cr -lib_c/x86_64-darwin/c/time.cr -lib_c/x86_64-darwin/c/unistd.cr -lib_c/x86_64-dragonfly/c/arpa/inet.cr -lib_c/x86_64-dragonfly/c/dirent.cr -lib_c/x86_64-dragonfly/c/elf.cr -lib_c/x86_64-dragonfly/c/fcntl.cr -lib_c/x86_64-dragonfly/c/iconv.cr -lib_c/x86_64-dragonfly/c/link.cr -lib_c/x86_64-dragonfly/c/netdb.cr lib_c/x86_64-dragonfly/c/netinet/in.cr lib_c/x86_64-dragonfly/c/pthread.cr lib_c/x86_64-dragonfly/c/signal.cr -lib_c/x86_64-dragonfly/c/stdio.cr -lib_c/x86_64-dragonfly/c/stdlib.cr lib_c/x86_64-dragonfly/c/string.cr -lib_c/x86_64-dragonfly/c/sys/mman.cr lib_c/x86_64-dragonfly/c/sys/select.cr -lib_c/x86_64-dragonfly/c/sys/socket.cr -lib_c/x86_64-dragonfly/c/sys/stat.cr -lib_c/x86_64-dragonfly/c/sys/time.cr -lib_c/x86_64-dragonfly/c/sys/types.cr -lib_c/x86_64-dragonfly/c/sys/un.cr -lib_c/x86_64-dragonfly/c/sys/wait.cr -lib_c/x86_64-dragonfly/c/termios.cr -lib_c/x86_64-dragonfly/c/time.cr -lib_c/x86_64-dragonfly/c/unistd.cr -lib_c/x86_64-freebsd/c/arpa/inet.cr -lib_c/x86_64-freebsd/c/dirent.cr -lib_c/x86_64-freebsd/c/elf.cr -lib_c/x86_64-freebsd/c/fcntl.cr -lib_c/x86_64-freebsd/c/iconv.cr -lib_c/x86_64-freebsd/c/link.cr -lib_c/x86_64-freebsd/c/netdb.cr lib_c/x86_64-freebsd/c/netinet/in.cr lib_c/x86_64-freebsd/c/pthread.cr lib_c/x86_64-freebsd/c/signal.cr -lib_c/x86_64-freebsd/c/stdio.cr -lib_c/x86_64-freebsd/c/stdlib.cr lib_c/x86_64-freebsd/c/string.cr -lib_c/x86_64-freebsd/c/sys/mman.cr lib_c/x86_64-freebsd/c/sys/select.cr -lib_c/x86_64-freebsd/c/sys/socket.cr -lib_c/x86_64-freebsd/c/sys/stat.cr -lib_c/x86_64-freebsd/c/sys/time.cr -lib_c/x86_64-freebsd/c/sys/types.cr -lib_c/x86_64-freebsd/c/sys/un.cr -lib_c/x86_64-freebsd/c/sys/wait.cr -lib_c/x86_64-freebsd/c/termios.cr -lib_c/x86_64-freebsd/c/time.cr -lib_c/x86_64-freebsd/c/unistd.cr -lib_c/x86_64-linux-gnu/c/arpa/inet.cr -lib_c/x86_64-linux-gnu/c/dirent.cr lib_c/x86_64-linux-gnu/c/dlfcn.cr -lib_c/x86_64-linux-gnu/c/elf.cr -lib_c/x86_64-linux-gnu/c/fcntl.cr -lib_c/x86_64-linux-gnu/c/iconv.cr -lib_c/x86_64-linux-gnu/c/link.cr -lib_c/x86_64-linux-gnu/c/netdb.cr lib_c/x86_64-linux-gnu/c/netinet/in.cr lib_c/x86_64-linux-gnu/c/pthread.cr lib_c/x86_64-linux-gnu/c/signal.cr -lib_c/x86_64-linux-gnu/c/stdio.cr -lib_c/x86_64-linux-gnu/c/stdlib.cr lib_c/x86_64-linux-gnu/c/string.cr -lib_c/x86_64-linux-gnu/c/sys/mman.cr lib_c/x86_64-linux-gnu/c/sys/select.cr -lib_c/x86_64-linux-gnu/c/sys/socket.cr -lib_c/x86_64-linux-gnu/c/sys/stat.cr -lib_c/x86_64-linux-gnu/c/sys/time.cr -lib_c/x86_64-linux-gnu/c/sys/types.cr -lib_c/x86_64-linux-gnu/c/sys/un.cr -lib_c/x86_64-linux-gnu/c/sys/wait.cr -lib_c/x86_64-linux-gnu/c/termios.cr -lib_c/x86_64-linux-gnu/c/time.cr -lib_c/x86_64-linux-gnu/c/unistd.cr -lib_c/x86_64-linux-musl/c/arpa/inet.cr -lib_c/x86_64-linux-musl/c/dirent.cr -lib_c/x86_64-linux-musl/c/elf.cr -lib_c/x86_64-linux-musl/c/fcntl.cr -lib_c/x86_64-linux-musl/c/iconv.cr -lib_c/x86_64-linux-musl/c/link.cr -lib_c/x86_64-linux-musl/c/netdb.cr lib_c/x86_64-linux-musl/c/netinet/in.cr lib_c/x86_64-linux-musl/c/pthread.cr lib_c/x86_64-linux-musl/c/signal.cr -lib_c/x86_64-linux-musl/c/stdio.cr -lib_c/x86_64-linux-musl/c/stdlib.cr lib_c/x86_64-linux-musl/c/string.cr -lib_c/x86_64-linux-musl/c/sys/mman.cr lib_c/x86_64-linux-musl/c/sys/resource.cr lib_c/x86_64-linux-musl/c/sys/select.cr -lib_c/x86_64-linux-musl/c/sys/socket.cr -lib_c/x86_64-linux-musl/c/sys/stat.cr -lib_c/x86_64-linux-musl/c/sys/time.cr lib_c/x86_64-linux-musl/c/sys/types.cr -lib_c/x86_64-linux-musl/c/sys/un.cr -lib_c/x86_64-linux-musl/c/sys/wait.cr -lib_c/x86_64-linux-musl/c/termios.cr -lib_c/x86_64-linux-musl/c/time.cr -lib_c/x86_64-linux-musl/c/unistd.cr -lib_c/x86_64-netbsd/c/arpa/inet.cr -lib_c/x86_64-netbsd/c/dirent.cr -lib_c/x86_64-netbsd/c/elf.cr -lib_c/x86_64-netbsd/c/fcntl.cr -lib_c/x86_64-netbsd/c/iconv.cr -lib_c/x86_64-netbsd/c/link.cr -lib_c/x86_64-netbsd/c/netdb.cr lib_c/x86_64-netbsd/c/netinet/in.cr lib_c/x86_64-netbsd/c/pthread.cr lib_c/x86_64-netbsd/c/signal.cr -lib_c/x86_64-netbsd/c/stdio.cr -lib_c/x86_64-netbsd/c/stdlib.cr lib_c/x86_64-netbsd/c/string.cr -lib_c/x86_64-netbsd/c/sys/mman.cr lib_c/x86_64-netbsd/c/sys/select.cr -lib_c/x86_64-netbsd/c/sys/socket.cr -lib_c/x86_64-netbsd/c/sys/stat.cr -lib_c/x86_64-netbsd/c/sys/time.cr -lib_c/x86_64-netbsd/c/sys/types.cr -lib_c/x86_64-netbsd/c/sys/un.cr -lib_c/x86_64-netbsd/c/sys/wait.cr -lib_c/x86_64-netbsd/c/termios.cr -lib_c/x86_64-netbsd/c/time.cr -lib_c/x86_64-netbsd/c/unistd.cr -lib_c/x86_64-openbsd/c/arpa/inet.cr -lib_c/x86_64-openbsd/c/dirent.cr -lib_c/x86_64-openbsd/c/elf.cr -lib_c/x86_64-openbsd/c/fcntl.cr -lib_c/x86_64-openbsd/c/iconv.cr -lib_c/x86_64-openbsd/c/link.cr -lib_c/x86_64-openbsd/c/netdb.cr lib_c/x86_64-openbsd/c/netinet/in.cr lib_c/x86_64-openbsd/c/pthread.cr lib_c/x86_64-openbsd/c/signal.cr -lib_c/x86_64-openbsd/c/stdio.cr -lib_c/x86_64-openbsd/c/stdlib.cr lib_c/x86_64-openbsd/c/string.cr -lib_c/x86_64-openbsd/c/sys/mman.cr lib_c/x86_64-openbsd/c/sys/select.cr -lib_c/x86_64-openbsd/c/sys/socket.cr -lib_c/x86_64-openbsd/c/sys/stat.cr -lib_c/x86_64-openbsd/c/sys/time.cr -lib_c/x86_64-openbsd/c/sys/types.cr -lib_c/x86_64-openbsd/c/sys/un.cr -lib_c/x86_64-openbsd/c/sys/wait.cr -lib_c/x86_64-openbsd/c/termios.cr -lib_c/x86_64-openbsd/c/time.cr -lib_c/x86_64-openbsd/c/unistd.cr -lib_c/x86_64-solaris/c/arpa/inet.cr -lib_c/x86_64-solaris/c/dirent.cr -lib_c/x86_64-solaris/c/elf.cr -lib_c/x86_64-solaris/c/fcntl.cr -lib_c/x86_64-solaris/c/iconv.cr -lib_c/x86_64-solaris/c/link.cr -lib_c/x86_64-solaris/c/netdb.cr lib_c/x86_64-solaris/c/netinet/in.cr lib_c/x86_64-solaris/c/pthread.cr lib_c/x86_64-solaris/c/signal.cr -lib_c/x86_64-solaris/c/stdio.cr -lib_c/x86_64-solaris/c/stdlib.cr lib_c/x86_64-solaris/c/string.cr -lib_c/x86_64-solaris/c/sys/mman.cr lib_c/x86_64-solaris/c/sys/select.cr -lib_c/x86_64-solaris/c/sys/socket.cr -lib_c/x86_64-solaris/c/sys/stat.cr -lib_c/x86_64-solaris/c/sys/time.cr lib_c/x86_64-solaris/c/sys/types.cr -lib_c/x86_64-solaris/c/sys/un.cr -lib_c/x86_64-solaris/c/sys/wait.cr -lib_c/x86_64-solaris/c/termios.cr -lib_c/x86_64-solaris/c/time.cr -lib_c/x86_64-solaris/c/unistd.cr -lib_c/x86_64-windows-msvc/c/afunix.cr lib_c/x86_64-windows-msvc/c/basetsd.cr lib_c/x86_64-windows-msvc/c/combaseapi.cr lib_c/x86_64-windows-msvc/c/consoleapi.cr lib_c/x86_64-windows-msvc/c/consoleapi2.cr lib_c/x86_64-windows-msvc/c/dbghelp.cr -lib_c/x86_64-windows-msvc/c/delayimp.cr -lib_c/x86_64-windows-msvc/c/direct.cr lib_c/x86_64-windows-msvc/c/errhandlingapi.cr lib_c/x86_64-windows-msvc/c/fileapi.cr lib_c/x86_64-windows-msvc/c/guiddef.cr @@ -853,18 +539,13 @@ lib_c/x86_64-windows-msvc/c/handleapi.cr lib_c/x86_64-windows-msvc/c/heapapi.cr lib_c/x86_64-windows-msvc/c/in6addr.cr lib_c/x86_64-windows-msvc/c/inaddr.cr -lib_c/x86_64-windows-msvc/c/io.cr lib_c/x86_64-windows-msvc/c/ioapiset.cr lib_c/x86_64-windows-msvc/c/jobapi2.cr -lib_c/x86_64-windows-msvc/c/knownfolders.cr lib_c/x86_64-windows-msvc/c/libloaderapi.cr lib_c/x86_64-windows-msvc/c/lm.cr lib_c/x86_64-windows-msvc/c/memoryapi.cr -lib_c/x86_64-windows-msvc/c/mswsock.cr lib_c/x86_64-windows-msvc/c/ntifs.cr lib_c/x86_64-windows-msvc/c/ntsecapi.cr -lib_c/x86_64-windows-msvc/c/ntstatus.cr -lib_c/x86_64-windows-msvc/c/process.cr lib_c/x86_64-windows-msvc/c/processenv.cr lib_c/x86_64-windows-msvc/c/processthreadsapi.cr lib_c/x86_64-windows-msvc/c/profileapi.cr @@ -872,34 +553,25 @@ lib_c/x86_64-windows-msvc/c/sddl.cr lib_c/x86_64-windows-msvc/c/sdkddkver.cr lib_c/x86_64-windows-msvc/c/security.cr lib_c/x86_64-windows-msvc/c/shlobj_core.cr -lib_c/x86_64-windows-msvc/c/stdio.cr -lib_c/x86_64-windows-msvc/c/stdlib.cr -lib_c/x86_64-windows-msvc/c/string.cr lib_c/x86_64-windows-msvc/c/stringapiset.cr lib_c/x86_64-windows-msvc/c/synchapi.cr -lib_c/x86_64-windows-msvc/c/sys/stat.cr -lib_c/x86_64-windows-msvc/c/sys/utime.cr lib_c/x86_64-windows-msvc/c/sysinfoapi.cr lib_c/x86_64-windows-msvc/c/timezoneapi.cr lib_c/x86_64-windows-msvc/c/tlhelp32.cr lib_c/x86_64-windows-msvc/c/userenv.cr lib_c/x86_64-windows-msvc/c/winbase.cr lib_c/x86_64-windows-msvc/c/wincrypt.cr -lib_c/x86_64-windows-msvc/c/windows.cr lib_c/x86_64-windows-msvc/c/winnls.cr lib_c/x86_64-windows-msvc/c/winnt.cr lib_c/x86_64-windows-msvc/c/winreg.cr lib_c/x86_64-windows-msvc/c/winsock2.cr -lib_c/x86_64-windows-msvc/c/ws2ipdef.cr lib_c/x86_64-windows-msvc/c/ws2tcpip.cr -lib_c/x86_64-windows-msvc/c/wtypesbase.cr lib_z/lib_z.cr llvm.cr llvm/abi.cr llvm/abi/aarch64.cr llvm/abi/arm.cr llvm/abi/avr.cr -llvm/abi/wasm32.cr llvm/abi/x86.cr llvm/abi/x86_64.cr llvm/abi/x86_win64.cr @@ -915,17 +587,11 @@ llvm/generic_value.cr llvm/global_collection.cr llvm/instruction_collection.cr llvm/jit_compiler.cr -llvm/lib_llvm/analysis.cr -llvm/lib_llvm/bit_reader.cr -llvm/lib_llvm/bit_writer.cr llvm/lib_llvm/core.cr llvm/lib_llvm/debug_info.cr -llvm/lib_llvm/execution_engine.cr llvm/lib_llvm/initialization.cr -llvm/lib_llvm/ir_reader.cr llvm/lib_llvm/lljit.cr llvm/lib_llvm/orc.cr -llvm/lib_llvm/target.cr llvm/lib_llvm/target_machine.cr llvm/lib_llvm/transforms/pass_builder.cr llvm/lib_llvm/transforms/pass_manager_builder.cr @@ -948,9 +614,7 @@ llvm/target.cr llvm/target_data.cr llvm/target_machine.cr llvm/type.cr -llvm/value.cr llvm/value_methods.cr -log.cr log/backend.cr log/broadcast_backend.cr log/builder.cr @@ -974,26 +638,21 @@ mime/multipart/parser.cr mime/multipart/state.cr mutex.cr nil.cr -oauth.cr oauth/access_token.cr oauth/consumer.cr oauth/oauth.cr oauth/params.cr oauth/request_token.cr oauth/signature.cr -oauth2.cr oauth2/access_token/access_token.cr oauth2/access_token/bearer.cr oauth2/access_token/mac.cr oauth2/client.cr oauth2/session.cr openssl.cr -openssl/algorithm.cr openssl/bio.cr -openssl/cipher.cr openssl/digest.cr openssl/error.cr -openssl/hmac.cr openssl/lib_crypto.cr openssl/lib_ssl.cr openssl/md5.cr @@ -1005,8 +664,6 @@ openssl/ssl/server.cr openssl/ssl/socket.cr openssl/x509/certificate.cr openssl/x509/extension.cr -openssl/x509/name.cr -openssl/x509/x509.cr option_parser.cr path.cr pointer.cr @@ -1076,7 +733,6 @@ syscall/aarch64-linux.cr syscall/arm-linux.cr syscall/i386-linux.cr syscall/x86_64-linux.cr -system.cr system/group.cr system/user.cr system_error.cr @@ -1097,14 +753,11 @@ unicode/data.cr unicode/unicode.cr uri.cr uri/encoding.cr -uri/json.cr uri/params.cr uri/params/from_www_form.cr uri/params/to_www_form.cr uri/punycode.cr uri/uri_parser.cr -uri/yaml.cr -uuid/json.cr uuid/yaml.cr wait_group.cr wasi_error.cr diff --git a/test/s_exp_visitor.cr b/test/s_exp_visitor.cr index b03a51e..e070f5d 100644 --- a/test/s_exp_visitor.cr +++ b/test/s_exp_visitor.cr @@ -1582,7 +1582,6 @@ class SExpVisitor < Crystal::Visitor visit_basic(Include) visit_basic(Extend) visit_basic(Yield) - visit_basic(Require) visit_basic(Out) def visit(node : Not) @@ -1743,6 +1742,14 @@ class SExpVisitor < Crystal::Visitor false end + def visit(node : Require) + in_node("require") do + print_node("string") + end + + false + end + ########## # Fallback ########## From 82a7c6d0aa3f451601380235682b5295b1d09cc8 Mon Sep 17 00:00:00 2001 From: Margret Riegert Date: Wed, 8 Jan 2025 16:10:50 -0500 Subject: [PATCH 07/13] Fix visibility bug --- test/corpus/statements.txt | 26 ++++++++++++++++++++++++++ test/crystal_parse_stdlib_fail.txt | 15 --------------- test/s_exp_visitor.cr | 1 + 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/test/corpus/statements.txt b/test/corpus/statements.txt index 14632f8..b51abfd 100644 --- a/test/corpus/statements.txt +++ b/test/corpus/statements.txt @@ -1611,3 +1611,29 @@ end params: (param_list (param name: (identifier))))) + +======================== +method in private module +:language(crystal) +======================== + +private module MyMod + def my_method + puts "hello" + end +end + +--- + +(expressions + (module_def + visibility: (private) + name: (constant) + body: (expressions + (method_def + name: (identifier) + body: (expressions + (call + method: (identifier) + arguments: (argument_list + (string)))))))) diff --git a/test/crystal_parse_stdlib_fail.txt b/test/crystal_parse_stdlib_fail.txt index 1c2a8fc..f31ce7d 100644 --- a/test/crystal_parse_stdlib_fail.txt +++ b/test/crystal_parse_stdlib_fail.txt @@ -38,22 +38,18 @@ compiler/crystal/codegen/link.cr compiler/crystal/codegen/llvm_builder_helper.cr compiler/crystal/codegen/llvm_id.cr compiler/crystal/codegen/llvm_typer.cr -compiler/crystal/codegen/match.cr compiler/crystal/codegen/once.cr compiler/crystal/codegen/phi.cr compiler/crystal/codegen/primitives.cr compiler/crystal/codegen/target.cr -compiler/crystal/codegen/type_id.cr compiler/crystal/codegen/types.cr compiler/crystal/codegen/unions.cr compiler/crystal/command.cr -compiler/crystal/command/clear_cache.cr compiler/crystal/command/cursor.cr compiler/crystal/command/docs.cr compiler/crystal/command/env.cr compiler/crystal/command/eval.cr compiler/crystal/command/format.cr -compiler/crystal/command/playground.cr compiler/crystal/command/repl.cr compiler/crystal/command/spec.cr compiler/crystal/compiler.cr @@ -82,7 +78,6 @@ compiler/crystal/interpreter/local_vars.cr compiler/crystal/interpreter/local_vars_gatherer.cr compiler/crystal/interpreter/multidispatch.cr compiler/crystal/interpreter/primitives.cr -compiler/crystal/interpreter/repl.cr compiler/crystal/interpreter/value.cr compiler/crystal/loader.cr compiler/crystal/loader/msvc.cr @@ -171,7 +166,6 @@ complex.cr compress/deflate/deflate.cr compress/deflate/reader.cr compress/deflate/writer.cr -compress/gzip/gzip.cr compress/gzip/header.cr compress/gzip/reader.cr compress/gzip/writer.cr @@ -208,7 +202,6 @@ crystal/lib_iconv.cr crystal/main.cr crystal/once.cr crystal/pointer_linked_list.cr -crystal/rw_lock.cr crystal/scheduler.cr crystal/small_deque.cr crystal/spin_lock.cr @@ -264,14 +257,12 @@ crystal/system/unix/time.cr crystal/system/unix/urandom.cr crystal/system/unix/user.cr crystal/system/user.cr -crystal/system/wasi/addrinfo.cr crystal/system/wasi/dir.cr crystal/system/wasi/event_loop.cr crystal/system/wasi/file.cr crystal/system/wasi/lib_wasi.cr crystal/system/wasi/process.cr crystal/system/wasi/socket.cr -crystal/system/wasi/thread.cr crystal/system/wasi/thread_condition_variable.cr crystal/system/wasi/thread_mutex.cr crystal/system/wasi/wasi.cr @@ -316,10 +307,6 @@ digest/adler32.cr digest/crc32.cr digest/digest.cr digest/io_digest.cr -digest/md5.cr -digest/sha1.cr -digest/sha256.cr -digest/sha512.cr dir.cr dir/glob.cr docs_pseudo_methods.cr @@ -574,7 +561,6 @@ llvm/abi/arm.cr llvm/abi/avr.cr llvm/abi/x86.cr llvm/abi/x86_64.cr -llvm/abi/x86_win64.cr llvm/basic_block.cr llvm/basic_block_collection.cr llvm/context.cr @@ -677,7 +663,6 @@ raise.cr random/isaac.cr random/pcg32.cr random/secure.cr -reference_storage.cr regex.cr regex/engine.cr regex/lib_pcre.cr diff --git a/test/s_exp_visitor.cr b/test/s_exp_visitor.cr index e070f5d..a1b3ea2 100644 --- a/test/s_exp_visitor.cr +++ b/test/s_exp_visitor.cr @@ -222,6 +222,7 @@ class SExpVisitor < Crystal::Visitor in .private? then print_node("private") end end + @visibility = nil in .protected? then print_node("protected") in .private? then print_node("private") end From 8e4c49bf72c0e44579dae0ed346babfe255cfc0d Mon Sep 17 00:00:00 2001 From: Margret Riegert Date: Wed, 8 Jan 2025 16:16:18 -0500 Subject: [PATCH 08/13] Helper script to test individual files against s_exp_visitor --- test/s_exp_parser.cr | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/s_exp_parser.cr diff --git a/test/s_exp_parser.cr b/test/s_exp_parser.cr new file mode 100644 index 0000000..5ece20a --- /dev/null +++ b/test/s_exp_parser.cr @@ -0,0 +1,22 @@ +#!/bin/env crystal + +require "./util" + +file = ARGV[0] + +expected_output = `tree-sitter parse "#{file}" --no-ranges`.strip + +exit 1 unless $?.success? + +test = CorpusTest.new( + File.basename(file), + [":language(crystal)"], + File.read(file), + expected_output, + true +) + +if test.run +else + exit 1 +end From 2f51f43723277b34c0afca01c8f27ed8d7857d5f Mon Sep 17 00:00:00 2001 From: Margret Riegert Date: Wed, 8 Jan 2025 16:18:27 -0500 Subject: [PATCH 09/13] Private enums --- test/corpus/statements.txt | 1 + test/crystal_parse_stdlib_fail.txt | 1 - test/s_exp_visitor.cr | 2 ++ 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/test/corpus/statements.txt b/test/corpus/statements.txt index b51abfd..c2bdbd7 100644 --- a/test/corpus/statements.txt +++ b/test/corpus/statements.txt @@ -1091,6 +1091,7 @@ end ============= private enums +:language(crystal) ============= module MyModule diff --git a/test/crystal_parse_stdlib_fail.txt b/test/crystal_parse_stdlib_fail.txt index f31ce7d..124a92f 100644 --- a/test/crystal_parse_stdlib_fail.txt +++ b/test/crystal_parse_stdlib_fail.txt @@ -621,7 +621,6 @@ mime/media_type.cr mime/multipart.cr mime/multipart/builder.cr mime/multipart/parser.cr -mime/multipart/state.cr mutex.cr nil.cr oauth/access_token.cr diff --git a/test/s_exp_visitor.cr b/test/s_exp_visitor.cr index a1b3ea2..8a71c2d 100644 --- a/test/s_exp_visitor.cr +++ b/test/s_exp_visitor.cr @@ -681,6 +681,8 @@ class SExpVisitor < Crystal::Visitor def visit(node : EnumDef) in_node("enum_def") do + visibility_field(node) + field "name" do node.name.accept self end From ef1ded237c6b3cec2d4b83de80979518e6c14a87 Mon Sep 17 00:00:00 2001 From: Margret Riegert Date: Wed, 8 Jan 2025 16:25:35 -0500 Subject: [PATCH 10/13] Basic s_exp macro expression support --- test/corpus/macros.txt | 11 ++++++----- test/s_exp_visitor.cr | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/test/corpus/macros.txt b/test/corpus/macros.txt index fdebc53..47579af 100644 --- a/test/corpus/macros.txt +++ b/test/corpus/macros.txt @@ -72,6 +72,7 @@ macro for ================ macro expression +:language(crystal) ================ {{ puts "hello" }} @@ -83,16 +84,16 @@ macro expression (expressions (macro_expression (call - (identifier) - (argument_list + method: (identifier) + arguments: (argument_list (string)))) (macro_expression (assign - (identifier) - (integer))) + lhs: (identifier) + rhs: (integer))) (named_tuple (named_expr - (identifier) + name: (identifier) (identifier)))) ================= diff --git a/test/s_exp_visitor.cr b/test/s_exp_visitor.cr index 8a71c2d..0ea0f83 100644 --- a/test/s_exp_visitor.cr +++ b/test/s_exp_visitor.cr @@ -1586,6 +1586,7 @@ class SExpVisitor < Crystal::Visitor visit_basic(Extend) visit_basic(Yield) visit_basic(Out) + visit_basic(MacroExpression) def visit(node : Not) in_node("call") do From 8b41ae8576a2e22c5335e1f25da9c7fa54269734 Mon Sep 17 00:00:00 2001 From: Margret Riegert Date: Wed, 8 Jan 2025 16:34:13 -0500 Subject: [PATCH 11/13] Fix s_exp then expressions --- test/corpus/statements.txt | 55 ++++++++++++++++++++++++++++++ test/crystal_parse_stdlib_fail.txt | 15 -------- test/s_exp_visitor.cr | 9 +++-- 3 files changed, 62 insertions(+), 17 deletions(-) diff --git a/test/corpus/statements.txt b/test/corpus/statements.txt index c2bdbd7..de250fc 100644 --- a/test/corpus/statements.txt +++ b/test/corpus/statements.txt @@ -1638,3 +1638,58 @@ end method: (identifier) arguments: (argument_list (string)))))))) + +=================== +if then expressions +:language(crystal) +=================== + +def self.init(load_defaults : Bool = true) : Nil + @@initialized = true + + if load_defaults + DEFAULT_TYPES.each do |ext, type| + register ext, type + end + + Crystal::System::MIME.load + end +end + +--- + +(expressions + (method_def + class: (self) + name: (identifier) + params: (param_list + (param + name: (identifier) + type: (constant) + default: (true))) + type: (constant) + body: (expressions + (assign + lhs: (class_var) + rhs: (true)) + (if + cond: (identifier) + then: (then + (call + receiver: (constant) + method: (identifier) + block: (block + params: (param_list + (param + name: (identifier)) + (param + name: (identifier))) + body: (expressions + (call + method: (identifier) + arguments: (argument_list + (identifier) + (identifier)))))) + (call + receiver: (constant) + method: (identifier))))))) diff --git a/test/crystal_parse_stdlib_fail.txt b/test/crystal_parse_stdlib_fail.txt index 124a92f..ebcf7e4 100644 --- a/test/crystal_parse_stdlib_fail.txt +++ b/test/crystal_parse_stdlib_fail.txt @@ -20,7 +20,6 @@ class.cr comparable.cr compiler/crystal.cr compiler/crystal/annotatable.cr -compiler/crystal/codegen/asm.cr compiler/crystal/codegen/ast.cr compiler/crystal/codegen/cache_dir.cr compiler/crystal/codegen/call.cr @@ -48,7 +47,6 @@ compiler/crystal/command.cr compiler/crystal/command/cursor.cr compiler/crystal/command/docs.cr compiler/crystal/command/env.cr -compiler/crystal/command/eval.cr compiler/crystal/command/format.cr compiler/crystal/command/repl.cr compiler/crystal/command/spec.cr @@ -134,7 +132,6 @@ compiler/crystal/syntax/to_s.cr compiler/crystal/syntax/token.cr compiler/crystal/syntax/transformer.cr compiler/crystal/syntax/virtual_file.cr -compiler/crystal/syntax/visitor.cr compiler/crystal/tools/context.cr compiler/crystal/tools/dependencies.cr compiler/crystal/tools/doc/constant.cr @@ -162,8 +159,6 @@ compiler/crystal/tools/typed_def_processor.cr compiler/crystal/tools/unreachable.cr compiler/crystal/util.cr compiler/crystal/warnings.cr -complex.cr -compress/deflate/deflate.cr compress/deflate/reader.cr compress/deflate/writer.cr compress/gzip/header.cr @@ -272,7 +267,6 @@ crystal/system/win32/crypto.cr crystal/system/win32/dir.cr crystal/system/win32/env.cr crystal/system/win32/event_loop_iocp.cr -crystal/system/win32/fiber.cr crystal/system/win32/file.cr crystal/system/win32/file_descriptor.cr crystal/system/win32/file_info.cr @@ -311,7 +305,6 @@ dir.cr dir/glob.cr docs_pseudo_methods.cr ecr/lexer.cr -ecr/processor.cr empty.cr env.cr exception.cr @@ -345,7 +338,6 @@ float/printer/diy_fp.cr float/printer/dragonbox_cache.cr float/printer/grisu3.cr float/printer/hexfloat.cr -float/printer/ieee.cr float/printer/ryu_printf.cr float/printer/ryu_printf_table.cr gc.cr @@ -604,7 +596,6 @@ llvm/value_methods.cr log/backend.cr log/broadcast_backend.cr log/builder.cr -log/dispatch.cr log/entry.cr log/format.cr log/io_backend.cr @@ -648,7 +639,6 @@ openssl/ssl/hostname_validation.cr openssl/ssl/server.cr openssl/ssl/socket.cr openssl/x509/certificate.cr -openssl/x509/extension.cr option_parser.cr path.cr pointer.cr @@ -681,7 +671,6 @@ socket/ip_socket.cr socket/server.cr socket/tcp_server.cr socket/tcp_socket.cr -socket/udp_socket.cr socket/unix_server.cr socket/unix_socket.cr spec.cr @@ -724,8 +713,6 @@ termios.cr time/format.cr time/format/custom/http_date.cr time/format/custom/iso_8601.cr -time/format/custom/rfc_2822.cr -time/format/custom/yaml_date.cr time/format/formatter.cr time/format/parser.cr time/format/pattern.cr @@ -742,7 +729,6 @@ uri/params/from_www_form.cr uri/params/to_www_form.cr uri/punycode.cr uri/uri_parser.cr -uuid/yaml.cr wait_group.cr wasi_error.cr weak_ref.cr @@ -754,7 +740,6 @@ xml/namespace.cr xml/node.cr xml/node_set.cr xml/reader.cr -yaml.cr yaml/any.cr yaml/lib_yaml.cr yaml/nodes.cr diff --git a/test/s_exp_visitor.cr b/test/s_exp_visitor.cr index 0ea0f83..2cf9e2d 100644 --- a/test/s_exp_visitor.cr +++ b/test/s_exp_visitor.cr @@ -895,9 +895,14 @@ class SExpVisitor < Crystal::Visitor end field "then" do - if !is_ternary && !node.then.is_a?(Nop) + then_ = node.then + if !is_ternary && !(then_).is_a?(Nop) in_node("then") do - node.then.accept self + if then_ && then_.is_a?(Expressions) + then_.expressions.each &.accept(self) + else + then_.accept self + end end else node.then.accept self From cbd7cbd9d1afb4140ad9dda2915a7bb3a99e48e5 Mon Sep 17 00:00:00 2001 From: Margret Riegert Date: Wed, 8 Jan 2025 20:06:27 -0500 Subject: [PATCH 12/13] Updates from review --- grammar.js | 2 +- src/grammar.json | 27 +++++++++++---------------- test/corpus/statements.txt | 6 ------ test/s_exp_visitor.cr | 1 + 4 files changed, 13 insertions(+), 23 deletions(-) diff --git a/grammar.js b/grammar.js index 4d76184..58782c0 100644 --- a/grammar.js +++ b/grammar.js @@ -2745,7 +2745,7 @@ module.exports = grammar({ ensure: $ => seq( alias($._regular_ensure_keyword, 'ensure'), - field('body', seq(optional(alias($._statements, $.expressions)))), + field('body', optional(alias($._statements, $.expressions))), ), modifier_rescue: $ => seq( diff --git a/src/grammar.json b/src/grammar.json index 62303b8..6bc03b0 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -13320,24 +13320,19 @@ "type": "FIELD", "name": "body", "content": { - "type": "SEQ", + "type": "CHOICE", "members": [ { - "type": "CHOICE", - "members": [ - { - "type": "ALIAS", - "content": { - "type": "SYMBOL", - "name": "_statements" - }, - "named": true, - "value": "expressions" - }, - { - "type": "BLANK" - } - ] + "type": "ALIAS", + "content": { + "type": "SYMBOL", + "name": "_statements" + }, + "named": true, + "value": "expressions" + }, + { + "type": "BLANK" } ] } diff --git a/test/corpus/statements.txt b/test/corpus/statements.txt index de250fc..8f659e5 100644 --- a/test/corpus/statements.txt +++ b/test/corpus/statements.txt @@ -752,7 +752,6 @@ method definitions with rescue, else, and ensure :language(crystal) ================================================================================ def foo -puts "hello" rescue e1 : SpecificError | OtherError rescue e2 : GeneralError else @@ -763,11 +762,6 @@ end (expressions (method_def name: (identifier) - body: (expressions - (call - method: (identifier) - arguments: (argument_list - (string)))) rescue: (rescue variable: (identifier) type: (union_type diff --git a/test/s_exp_visitor.cr b/test/s_exp_visitor.cr index 2cf9e2d..fbb28eb 100644 --- a/test/s_exp_visitor.cr +++ b/test/s_exp_visitor.cr @@ -1609,6 +1609,7 @@ class SExpVisitor < Crystal::Visitor def visit(node : PointerOf) enter_node("pointerof") + true end def end_visit(node : PointerOf) From 35f2ac733168aa5d85482843913ad7ad309129f1 Mon Sep 17 00:00:00 2001 From: Margret Riegert Date: Wed, 8 Jan 2025 20:10:23 -0500 Subject: [PATCH 13/13] Add crystal_parse_stdlib to CI --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e7ca22..f6e2495 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,9 +30,12 @@ jobs: - name: Run stdlib coverage run: crystal run test/stdlib_coverage.cr - - name: Run compiler verification tests + - name: Run compiler verification tests (corpus) run: crystal run test/crystal_parse_corpus.cr + - name: Run compiler verification tests (stdlib) + run: crystal run test/crystal_parse_stdlib.cr + generate: runs-on: ubuntu-latest steps: