From 99381fb6c24de935243f49c001dcf308a372b013 Mon Sep 17 00:00:00 2001 From: Nick Pezza Date: Sat, 23 Jul 2022 09:38:59 -0400 Subject: [PATCH] wrap curly block body --- grammar.js | 2 +- src/grammar.json | 8 +- src/node-types.json | 20 ++-- src/parser.c | 179 ++++++++++++++++++------------------ test/corpus/expressions.txt | 8 +- test/corpus/literals.txt | 2 +- 6 files changed, 112 insertions(+), 107 deletions(-) diff --git a/grammar.js b/grammar.js index b159a7ef..35aff504 100644 --- a/grammar.js +++ b/grammar.js @@ -837,7 +837,7 @@ module.exports = grammar({ block: $ => prec(PREC.CURLY_BLOCK, seq( '{', field('parameters', optional($.block_parameters)), - optional($.block_body), + optional(field('body', $.block_body)), '}' )), diff --git a/src/grammar.json b/src/grammar.json index c46b03e9..ca715fd2 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -4952,8 +4952,12 @@ "type": "CHOICE", "members": [ { - "type": "SYMBOL", - "name": "block_body" + "type": "FIELD", + "name": "body", + "content": { + "type": "SYMBOL", + "name": "block_body" + } }, { "type": "BLANK" diff --git a/src/node-types.json b/src/node-types.json index 0657558f..44ebc6ab 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -1055,6 +1055,16 @@ "type": "block", "named": true, "fields": { + "body": { + "multiple": false, + "required": false, + "types": [ + { + "type": "block_body", + "named": true + } + ] + }, "parameters": { "multiple": false, "required": false, @@ -1065,16 +1075,6 @@ } ] } - }, - "children": { - "multiple": false, - "required": false, - "types": [ - { - "type": "block_body", - "named": true - } - ] } }, { diff --git a/src/parser.c b/src/parser.c index d1c3bed0..f671c917 100644 --- a/src/parser.c +++ b/src/parser.c @@ -22,7 +22,7 @@ #define EXTERNAL_TOKEN_COUNT 29 #define FIELD_COUNT 35 #define MAX_ALIAS_SEQUENCE_LENGTH 8 -#define PRODUCTION_ID_COUNT 118 +#define PRODUCTION_ID_COUNT 119 enum { sym_identifier = 1, @@ -2626,34 +2626,35 @@ static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = { [87] = {.index = 140, .length = 3}, [88] = {.index = 143, .length = 3}, [89] = {.index = 146, .length = 2}, - [90] = {.index = 148, .length = 2}, - [91] = {.index = 150, .length = 1}, - [92] = {.index = 151, .length = 1}, - [93] = {.index = 152, .length = 3}, - [94] = {.index = 155, .length = 4}, - [95] = {.index = 159, .length = 3}, - [96] = {.index = 162, .length = 2}, - [97] = {.index = 164, .length = 3}, - [98] = {.index = 167, .length = 3}, - [99] = {.index = 170, .length = 2}, - [100] = {.index = 172, .length = 2}, - [101] = {.index = 174, .length = 1}, - [102] = {.index = 175, .length = 2}, - [103] = {.index = 177, .length = 1}, - [104] = {.index = 178, .length = 3}, - [105] = {.index = 181, .length = 1}, - [106] = {.index = 182, .length = 2}, - [107] = {.index = 184, .length = 2}, - [108] = {.index = 186, .length = 1}, - [109] = {.index = 187, .length = 1}, - [110] = {.index = 188, .length = 2}, - [111] = {.index = 190, .length = 2}, - [112] = {.index = 192, .length = 2}, - [113] = {.index = 194, .length = 2}, - [114] = {.index = 196, .length = 1}, - [115] = {.index = 197, .length = 2}, - [116] = {.index = 199, .length = 1}, - [117] = {.index = 200, .length = 2}, + [90] = {.index = 43, .length = 2}, + [91] = {.index = 148, .length = 2}, + [92] = {.index = 150, .length = 1}, + [93] = {.index = 151, .length = 1}, + [94] = {.index = 152, .length = 3}, + [95] = {.index = 155, .length = 4}, + [96] = {.index = 159, .length = 3}, + [97] = {.index = 162, .length = 2}, + [98] = {.index = 164, .length = 3}, + [99] = {.index = 167, .length = 3}, + [100] = {.index = 170, .length = 2}, + [101] = {.index = 172, .length = 2}, + [102] = {.index = 174, .length = 1}, + [103] = {.index = 175, .length = 2}, + [104] = {.index = 177, .length = 1}, + [105] = {.index = 178, .length = 3}, + [106] = {.index = 181, .length = 1}, + [107] = {.index = 182, .length = 2}, + [108] = {.index = 184, .length = 2}, + [109] = {.index = 186, .length = 1}, + [110] = {.index = 187, .length = 1}, + [111] = {.index = 188, .length = 2}, + [112] = {.index = 190, .length = 2}, + [113] = {.index = 192, .length = 2}, + [114] = {.index = 194, .length = 2}, + [115] = {.index = 196, .length = 1}, + [116] = {.index = 197, .length = 2}, + [117] = {.index = 199, .length = 1}, + [118] = {.index = 200, .length = 2}, }; static const TSFieldMapEntry ts_field_map_entries[] = { @@ -447783,7 +447784,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [1335] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1635), [1337] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1108), [1339] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4852), - [1341] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_in_clause, 4, .production_id = 99), + [1341] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_in_clause, 4, .production_id = 100), [1343] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_when, 4, .production_id = 82), [1345] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2870), [1347] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_ensure, 1), @@ -448519,32 +448520,32 @@ static const TSParseActionEntry ts_parse_actions[] = { [2808] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_element_reference, 4, .production_id = 41), [2810] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_parameters, 2), [2812] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parameters, 2), - [2814] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block_parameters, 7, .production_id = 115), - [2816] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block_parameters, 7, .production_id = 115), - [2818] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block_parameters, 4, .production_id = 105), - [2820] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block_parameters, 4, .production_id = 105), + [2814] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block_parameters, 7, .production_id = 116), + [2816] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block_parameters, 7, .production_id = 116), + [2818] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block_parameters, 4, .production_id = 106), + [2820] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block_parameters, 4, .production_id = 106), [2822] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block_parameters, 5), [2824] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block_parameters, 5), - [2826] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block_parameters, 6, .production_id = 113), - [2828] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block_parameters, 6, .production_id = 113), + [2826] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block_parameters, 6, .production_id = 114), + [2828] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block_parameters, 6, .production_id = 114), [2830] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__primary, 1), [2832] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__primary, 1), [2834] = {.entry = {.count = 1, .reusable = false}}, SHIFT(776), [2836] = {.entry = {.count = 1, .reusable = true}}, SHIFT(908), [2838] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block_parameters, 3), [2840] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block_parameters, 3), - [2842] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block_parameters, 8, .production_id = 117), - [2844] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block_parameters, 8, .production_id = 117), - [2846] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block_parameters, 5, .production_id = 110), - [2848] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block_parameters, 5, .production_id = 110), - [2850] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block_parameters, 6, .production_id = 114), - [2852] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block_parameters, 6, .production_id = 114), - [2854] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block_parameters, 7, .production_id = 116), - [2856] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block_parameters, 7, .production_id = 116), + [2842] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block_parameters, 8, .production_id = 118), + [2844] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block_parameters, 8, .production_id = 118), + [2846] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block_parameters, 5, .production_id = 111), + [2848] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block_parameters, 5, .production_id = 111), + [2850] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block_parameters, 6, .production_id = 115), + [2852] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block_parameters, 6, .production_id = 115), + [2854] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block_parameters, 7, .production_id = 117), + [2856] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block_parameters, 7, .production_id = 117), [2858] = {.entry = {.count = 1, .reusable = false}}, SHIFT(446), [2860] = {.entry = {.count = 1, .reusable = true}}, SHIFT(468), - [2862] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block_parameters, 5, .production_id = 108), - [2864] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block_parameters, 5, .production_id = 108), + [2862] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block_parameters, 5, .production_id = 109), + [2864] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block_parameters, 5, .production_id = 109), [2866] = {.entry = {.count = 1, .reusable = false}}, SHIFT(818), [2868] = {.entry = {.count = 1, .reusable = true}}, SHIFT(867), [2870] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block_parameters, 4), @@ -448676,12 +448677,12 @@ static const TSParseActionEntry ts_parse_actions[] = { [3123] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_hash, 2), [3125] = {.entry = {.count = 1, .reusable = false}}, SHIFT(786), [3127] = {.entry = {.count = 1, .reusable = true}}, SHIFT(868), - [3129] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_do_block, 5, .production_id = 106), - [3131] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_do_block, 5, .production_id = 106), + [3129] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_do_block, 5, .production_id = 107), + [3131] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_do_block, 5, .production_id = 107), [3133] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__body_statement, 2), [3135] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__body_statement, 2), - [3137] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_do_block, 5, .production_id = 107), - [3139] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_do_block, 5, .production_id = 107), + [3137] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_do_block, 5, .production_id = 108), + [3139] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_do_block, 5, .production_id = 108), [3141] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__method_rest, 3, .production_id = 53), [3143] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__method_rest, 3, .production_id = 53), [3145] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_do_block, 2), @@ -448694,14 +448695,14 @@ static const TSParseActionEntry ts_parse_actions[] = { [3159] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_class, 4, .production_id = 14), [3161] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module, 4, .production_id = 14), [3163] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_module, 4, .production_id = 14), - [3165] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_do_block, 5, .production_id = 91), - [3167] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_do_block, 5, .production_id = 91), + [3165] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_do_block, 5, .production_id = 92), + [3167] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_do_block, 5, .production_id = 92), [3169] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_argument_list, 3), [3171] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_argument_list, 3), [3173] = {.entry = {.count = 1, .reusable = false}}, SHIFT(424), [3175] = {.entry = {.count = 1, .reusable = true}}, SHIFT(478), - [3177] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class, 6, .production_id = 97), - [3179] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_class, 6, .production_id = 97), + [3177] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class, 6, .production_id = 98), + [3179] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_class, 6, .production_id = 98), [3181] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__arg, 1, .production_id = 1), [3183] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__arg, 1, .production_id = 1), [3185] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__arg, 1), @@ -448718,10 +448719,10 @@ static const TSParseActionEntry ts_parse_actions[] = { [3207] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_string_array, 4, .production_id = 26), [3209] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__primary, 1, .production_id = 5), [3211] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__primary, 1, .production_id = 5), - [3213] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_singleton_class, 6, .production_id = 96), - [3215] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_singleton_class, 6, .production_id = 96), - [3217] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__method_rest, 5, .production_id = 95), - [3219] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__method_rest, 5, .production_id = 95), + [3213] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_singleton_class, 6, .production_id = 97), + [3215] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_singleton_class, 6, .production_id = 97), + [3217] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__method_rest, 5, .production_id = 96), + [3219] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__method_rest, 5, .production_id = 96), [3221] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_regex, 2, .production_id = 10), [3223] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_regex, 2, .production_id = 10), [3225] = {.entry = {.count = 1, .reusable = false}}, SHIFT(808), @@ -448732,8 +448733,8 @@ static const TSParseActionEntry ts_parse_actions[] = { [3235] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_unless, 5, .production_id = 80), [3237] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_string_array, 4, .production_id = 48), [3239] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_string_array, 4, .production_id = 48), - [3241] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_singleton_method, 6, .production_id = 94), - [3243] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_singleton_method, 6, .production_id = 94), + [3241] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_singleton_method, 6, .production_id = 95), + [3243] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_singleton_method, 6, .production_id = 95), [3245] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_string_array, 4), [3247] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_string_array, 4), [3249] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_begin, 3), @@ -448842,8 +448843,8 @@ static const TSParseActionEntry ts_parse_actions[] = { [3455] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_do, 2), [3457] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_argument_list, 2), [3459] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_argument_list, 2), - [3461] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block, 4, .production_id = 70), - [3463] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block, 4, .production_id = 70), + [3461] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block, 4, .production_id = 90), + [3463] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block, 4, .production_id = 90), [3465] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_lambda, 3, .production_id = 36), [3467] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_lambda, 3, .production_id = 36), [3469] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_call, 4, .production_id = 73), @@ -448880,29 +448881,29 @@ static const TSParseActionEntry ts_parse_actions[] = { [3531] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_symbol_array, 3), [3533] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_rational, 2), [3535] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_rational, 2), - [3537] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_do_block, 6, .production_id = 112), - [3539] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_do_block, 6, .production_id = 112), + [3537] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_do_block, 6, .production_id = 113), + [3539] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_do_block, 6, .production_id = 113), [3541] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_hash, 4), [3543] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_hash, 4), [3545] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_do_block, 3), [3547] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_do_block, 3), [3549] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parenthesized_statements, 2), [3551] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_parenthesized_statements, 2), - [3553] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_case_match, 6, .production_id = 104), - [3555] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_case_match, 6, .production_id = 104), - [3557] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_do_block, 4, .production_id = 92), - [3559] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_do_block, 4, .production_id = 92), + [3553] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_case_match, 6, .production_id = 105), + [3555] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_case_match, 6, .production_id = 105), + [3557] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_do_block, 4, .production_id = 93), + [3559] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_do_block, 4, .production_id = 93), [3561] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_call, 3, .production_id = 45), [3563] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_call, 3, .production_id = 45), - [3565] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_do_block, 4, .production_id = 91), - [3567] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_do_block, 4, .production_id = 91), + [3565] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_do_block, 4, .production_id = 92), + [3567] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_do_block, 4, .production_id = 92), [3569] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_do_block, 4, .production_id = 70), [3571] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_do_block, 4, .production_id = 70), [3573] = {.entry = {.count = 1, .reusable = false}}, SHIFT(1265), [3575] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_lambda, 2, .production_id = 16), [3577] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_lambda, 2, .production_id = 16), - [3579] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_do_block, 4, .production_id = 90), - [3581] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_do_block, 4, .production_id = 90), + [3579] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_do_block, 4, .production_id = 91), + [3581] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_do_block, 4, .production_id = 91), [3583] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_method, 2, .production_id = 13), [3585] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_method, 2, .production_id = 13), [3587] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parenthesized_unary, 2, .production_id = 11), @@ -448921,8 +448922,8 @@ static const TSParseActionEntry ts_parse_actions[] = { [3613] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_case_match, 5, .production_id = 87), [3615] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_case, 5), [3617] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_case, 5), - [3619] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block, 3), - [3621] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block, 3), + [3619] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block, 3, .production_id = 16), + [3621] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block, 3, .production_id = 16), [3623] = {.entry = {.count = 1, .reusable = false}}, SHIFT(420), [3625] = {.entry = {.count = 1, .reusable = true}}, SHIFT(494), [3627] = {.entry = {.count = 1, .reusable = false}}, SHIFT(432), @@ -449020,8 +449021,8 @@ static const TSParseActionEntry ts_parse_actions[] = { [3812] = {.entry = {.count = 1, .reusable = true}}, SHIFT(493), [3814] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1651), [3816] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1285), - [3818] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_conditional, 5, .production_id = 93), - [3820] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_conditional, 5, .production_id = 93), + [3818] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_conditional, 5, .production_id = 94), + [3820] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_conditional, 5, .production_id = 94), [3822] = {.entry = {.count = 1, .reusable = false}}, SHIFT(3052), [3824] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3042), [3826] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3052), @@ -450365,8 +450366,8 @@ static const TSParseActionEntry ts_parse_actions[] = { [6539] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2083), [6541] = {.entry = {.count = 1, .reusable = true}}, SHIFT(403), [6543] = {.entry = {.count = 1, .reusable = true}}, SHIFT(406), - [6545] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_alternative_pattern_repeat1, 2, .production_id = 102), - [6547] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_alternative_pattern_repeat1, 2, .production_id = 102), SHIFT_REPEAT(2166), + [6545] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_alternative_pattern_repeat1, 2, .production_id = 103), + [6547] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_alternative_pattern_repeat1, 2, .production_id = 103), SHIFT_REPEAT(2166), [6550] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_command_argument_list_repeat1, 2), SHIFT_REPEAT(403), [6553] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2297), [6555] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5596), @@ -450442,8 +450443,8 @@ static const TSParseActionEntry ts_parse_actions[] = { [6699] = {.entry = {.count = 1, .reusable = false}}, SHIFT(4997), [6701] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5139), [6703] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_command_argument_list_repeat1, 2), SHIFT_REPEAT(400), - [6706] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_hash_pattern, 4, .production_id = 103), - [6708] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_find_pattern, 4, .production_id = 103), + [6706] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_hash_pattern, 4, .production_id = 104), + [6708] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_find_pattern, 4, .production_id = 104), [6710] = {.entry = {.count = 1, .reusable = true}}, SHIFT(407), [6712] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression_reference_pattern, 4, .production_id = 76), [6714] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_command_argument_list_repeat1, 2), SHIFT_REPEAT(407), @@ -450467,13 +450468,13 @@ static const TSParseActionEntry ts_parse_actions[] = { [6751] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parenthesized_pattern, 3), [6753] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_array_pattern, 3), [6755] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_find_pattern, 3), - [6757] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_array_pattern, 4, .production_id = 103), - [6759] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_array_pattern, 3, .production_id = 103), + [6757] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_array_pattern, 4, .production_id = 104), + [6759] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_array_pattern, 3, .production_id = 104), [6761] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__pattern_range, 3, .production_id = 40), - [6763] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_alternative_pattern_repeat1, 2, .production_id = 101), + [6763] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_alternative_pattern_repeat1, 2, .production_id = 102), [6765] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym__hash_pattern_body_repeat1, 2), SHIFT_REPEAT(4438), [6768] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym__hash_pattern_body_repeat1, 2), - [6770] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_as_pattern, 3, .production_id = 100), + [6770] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_as_pattern, 3, .production_id = 101), [6772] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2073), [6774] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__array_pattern_n, 3), [6776] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5517), @@ -450547,7 +450548,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [6916] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block_parameter, 1), [6918] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block_parameter, 1), [6920] = {.entry = {.count = 1, .reusable = false}}, SHIFT(4907), - [6922] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_alternative_pattern_repeat1, 2, .production_id = 102), SHIFT_REPEAT(2167), + [6922] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_alternative_pattern_repeat1, 2, .production_id = 103), SHIFT_REPEAT(2167), [6925] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2167), [6927] = {.entry = {.count = 1, .reusable = false}}, SHIFT(5657), [6929] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2355), @@ -450794,8 +450795,8 @@ static const TSParseActionEntry ts_parse_actions[] = { [7431] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2842), [7433] = {.entry = {.count = 1, .reusable = true}}, SHIFT(765), [7435] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2157), - [7437] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_block_parameters_repeat1, 2, .production_id = 111), SHIFT_REPEAT(5489), - [7440] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_block_parameters_repeat1, 2, .production_id = 111), + [7437] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_block_parameters_repeat1, 2, .production_id = 112), SHIFT_REPEAT(5489), + [7440] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_block_parameters_repeat1, 2, .production_id = 112), [7442] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5025), [7444] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2156), [7446] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2152), @@ -450807,7 +450808,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [7458] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2331), [7460] = {.entry = {.count = 1, .reusable = true}}, SHIFT(771), [7462] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5009), - [7464] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_in_clause, 4, .production_id = 98), + [7464] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_in_clause, 4, .production_id = 99), [7466] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4703), [7468] = {.entry = {.count = 1, .reusable = true}}, SHIFT(528), [7470] = {.entry = {.count = 1, .reusable = true}}, SHIFT(763), @@ -450921,7 +450922,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [7689] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2615), [7691] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5088), [7693] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2614), - [7695] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_block_parameters_repeat1, 2, .production_id = 109), + [7695] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_block_parameters_repeat1, 2, .production_id = 110), [7697] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2611), [7699] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2956), [7701] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4740), diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt index 896a21f8..fa5ea6c7 100644 --- a/test/corpus/expressions.txt +++ b/test/corpus/expressions.txt @@ -1219,7 +1219,7 @@ end method: (identifier) block: (block parameters: (block_parameters (identifier)) - (block_body (identifier)))) + body: (block_body (identifier)))) method: (identifier) block: (do_block do_block_body: (body_statement (identifier))))))) @@ -1408,7 +1408,7 @@ foo(bar, baz) { quux } method: (identifier) block: (block parameters: (block_parameters (identifier)) - (block_body (identifier)))) + body: (block_body (identifier)))) (call method: (identifier) arguments: (argument_list (call @@ -1416,11 +1416,11 @@ foo(bar, baz) { quux } method: (identifier) block: (block parameters: (block_parameters (identifier)) - (block_body (binary left: (identifier) right: (integer))))))) + body: (block_body (binary left: (identifier) right: (integer))))))) (call method: (identifier) arguments: (argument_list (identifier) (identifier)) - block: (block (block_body (identifier))))) + block: (block body: (block_body (identifier))))) =============================== method call with block shadow arguments diff --git a/test/corpus/literals.txt b/test/corpus/literals.txt index 75a76968..e2a452d2 100644 --- a/test/corpus/literals.txt +++ b/test/corpus/literals.txt @@ -1166,7 +1166,7 @@ array as object method: (identifier) block: (block parameters: (block_parameters (identifier)) - (block_body (binary left: (identifier) right: (integer)))))) + body: (block_body (binary left: (identifier) right: (integer)))))) ========================= array with trailing comma