From 6e1878db5de9907ce2ef430a72f4df7f024fc5ef Mon Sep 17 00:00:00 2001 From: William Ball Date: Sat, 23 Nov 2024 10:39:33 -0800 Subject: [PATCH] support functions in `let` --- grammar.js | 3 +- src/grammar.json | 9 +- src/node-types.json | 6 +- src/parser.c | 1116 ++++++++++++++++++++++--------------------- test/corpus/let.txt | 15 + 5 files changed, 592 insertions(+), 557 deletions(-) diff --git a/grammar.js b/grammar.js index 3536731..00b9826 100644 --- a/grammar.js +++ b/grammar.js @@ -38,7 +38,7 @@ module.exports = grammar({ param_block : $ => seq( '(', - field('param', repeat($.identifier)), + field('param', repeat1($.identifier)), ':', field('type', $.expr), ')' @@ -71,6 +71,7 @@ module.exports = grammar({ binding : $ => seq( '(', $.identifier, + repeat($.param_block), ':=', $.expr, ')', diff --git a/src/grammar.json b/src/grammar.json index 67c06b9..f318b76 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -92,7 +92,7 @@ "type": "FIELD", "name": "param", "content": { - "type": "REPEAT", + "type": "REPEAT1", "content": { "type": "SYMBOL", "name": "identifier" @@ -254,6 +254,13 @@ "type": "SYMBOL", "name": "identifier" }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "param_block" + } + }, { "type": "STRING", "value": ":=" diff --git a/src/node-types.json b/src/node-types.json index 03942ae..8ca0e6c 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -91,6 +91,10 @@ { "type": "identifier", "named": true + }, + { + "type": "param_block", + "named": true } ] } @@ -215,7 +219,7 @@ "fields": { "param": { "multiple": true, - "required": false, + "required": true, "types": [ { "type": "identifier", diff --git a/src/parser.c b/src/parser.c index 82b0c03..3920c52 100644 --- a/src/parser.c +++ b/src/parser.c @@ -5,7 +5,7 @@ #endif #define LANGUAGE_VERSION 14 -#define STATE_COUNT 78 +#define STATE_COUNT 79 #define LARGE_STATE_COUNT 2 #define SYMBOL_COUNT 47 #define ALIAS_COUNT 0 @@ -13,7 +13,7 @@ #define EXTERNAL_TOKEN_COUNT 0 #define FIELD_COUNT 3 #define MAX_ALIAS_SEQUENCE_LENGTH 6 -#define PRODUCTION_ID_COUNT 5 +#define PRODUCTION_ID_COUNT 4 enum ts_symbol_identifiers { sym_identifier = 1, @@ -371,8 +371,7 @@ static const char * const ts_field_names[] = { static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = { [1] = {.index = 0, .length = 1}, [2] = {.index = 1, .length = 1}, - [3] = {.index = 2, .length = 1}, - [4] = {.index = 3, .length = 2}, + [3] = {.index = 2, .length = 2}, }; static const TSFieldMapEntry ts_field_map_entries[] = { @@ -381,8 +380,6 @@ static const TSFieldMapEntry ts_field_map_entries[] = { [1] = {field_name, 0}, [2] = - {field_type, 2}, - [3] = {field_param, 1}, {field_type, 3}, }; @@ -410,21 +407,21 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [11] = 11, [12] = 12, [13] = 13, - [14] = 8, - [15] = 12, - [16] = 10, - [17] = 7, + [14] = 10, + [15] = 9, + [16] = 5, + [17] = 8, [18] = 18, [19] = 19, - [20] = 19, - [21] = 18, + [20] = 18, + [21] = 19, [22] = 22, [23] = 23, [24] = 24, - [25] = 25, - [26] = 24, - [27] = 22, - [28] = 23, + [25] = 24, + [26] = 26, + [27] = 23, + [28] = 22, [29] = 29, [30] = 30, [31] = 31, @@ -438,25 +435,25 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [39] = 39, [40] = 40, [41] = 41, - [42] = 42, - [43] = 41, + [42] = 40, + [43] = 43, [44] = 44, [45] = 45, [46] = 46, - [47] = 44, - [48] = 48, + [47] = 47, + [48] = 43, [49] = 49, [50] = 50, - [51] = 51, + [51] = 41, [52] = 52, [53] = 53, [54] = 54, [55] = 55, - [56] = 56, - [57] = 42, + [56] = 50, + [57] = 57, [58] = 58, - [59] = 54, - [60] = 48, + [59] = 59, + [60] = 54, [61] = 61, [62] = 62, [63] = 63, @@ -469,11 +466,12 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [70] = 70, [71] = 71, [72] = 72, - [73] = 73, - [74] = 68, + [73] = 67, + [74] = 74, [75] = 75, [76] = 76, [77] = 77, + [78] = 78, }; static bool ts_lex(TSLexer *lexer, TSStateId state) { @@ -1002,19 +1000,19 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [22] = {.lex_state = 34}, [23] = {.lex_state = 34}, [24] = {.lex_state = 34}, - [25] = {.lex_state = 0}, - [26] = {.lex_state = 2}, + [25] = {.lex_state = 2}, + [26] = {.lex_state = 0}, [27] = {.lex_state = 2}, [28] = {.lex_state = 2}, [29] = {.lex_state = 34}, [30] = {.lex_state = 0}, [31] = {.lex_state = 0}, - [32] = {.lex_state = 0}, + [32] = {.lex_state = 34}, [33] = {.lex_state = 0}, [34] = {.lex_state = 0}, [35] = {.lex_state = 0}, [36] = {.lex_state = 0}, - [37] = {.lex_state = 34}, + [37] = {.lex_state = 0}, [38] = {.lex_state = 0}, [39] = {.lex_state = 0}, [40] = {.lex_state = 0}, @@ -1027,34 +1025,35 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [47] = {.lex_state = 0}, [48] = {.lex_state = 0}, [49] = {.lex_state = 34}, - [50] = {.lex_state = 34}, - [51] = {.lex_state = 34}, + [50] = {.lex_state = 0}, + [51] = {.lex_state = 0}, [52] = {.lex_state = 34}, [53] = {.lex_state = 34}, [54] = {.lex_state = 0}, [55] = {.lex_state = 34}, - [56] = {.lex_state = 34}, - [57] = {.lex_state = 0}, - [58] = {.lex_state = 0}, + [56] = {.lex_state = 0}, + [57] = {.lex_state = 34}, + [58] = {.lex_state = 34}, [59] = {.lex_state = 0}, [60] = {.lex_state = 0}, [61] = {.lex_state = 0}, - [62] = {.lex_state = 0}, + [62] = {.lex_state = 34}, [63] = {.lex_state = 0}, - [64] = {.lex_state = 34}, + [64] = {.lex_state = 0}, [65] = {.lex_state = 0}, [66] = {.lex_state = 0}, [67] = {.lex_state = 0}, [68] = {.lex_state = 0}, - [69] = {.lex_state = 0}, + [69] = {.lex_state = 1}, [70] = {.lex_state = 0}, - [71] = {.lex_state = 0}, - [72] = {.lex_state = 1}, + [71] = {.lex_state = 34}, + [72] = {.lex_state = 0}, [73] = {.lex_state = 0}, [74] = {.lex_state = 0}, [75] = {.lex_state = 0}, [76] = {.lex_state = 0}, [77] = {.lex_state = 0}, + [78] = {.lex_state = 0}, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { @@ -1087,9 +1086,9 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { }, [1] = { [sym_program] = STATE(75), - [sym_definition] = STATE(37), - [sym_preprocess] = STATE(37), - [aux_sym_program_repeat1] = STATE(37), + [sym_definition] = STATE(32), + [sym_preprocess] = STATE(32), + [aux_sym_program_repeat1] = STATE(32), [ts_builtin_sym_end] = ACTIONS(5), [sym_identifier] = ACTIONS(7), [sym_comment] = ACTIONS(3), @@ -1118,13 +1117,13 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_let, ACTIONS(29), 1, sym_axiom, - STATE(24), 1, + STATE(23), 1, sym_square, - STATE(30), 1, + STATE(35), 1, sym_arrow, - STATE(42), 1, + STATE(41), 1, sym_app_term, - STATE(71), 1, + STATE(76), 1, sym_expr, ACTIONS(3), 2, sym_comment, @@ -1132,10 +1131,10 @@ static const uint16_t ts_small_parse_table[] = { ACTIONS(17), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, - STATE(18), 2, + STATE(19), 2, sym_term, aux_sym_app_repeat1, - STATE(40), 4, + STATE(39), 4, sym_labs, sym_pabs, sym_let, @@ -1159,13 +1158,13 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_let, ACTIONS(31), 1, sym_axiom, - STATE(24), 1, + STATE(23), 1, sym_square, - STATE(30), 1, + STATE(35), 1, sym_arrow, - STATE(42), 1, + STATE(41), 1, sym_app_term, - STATE(66), 1, + STATE(72), 1, sym_expr, ACTIONS(3), 2, sym_comment, @@ -1173,10 +1172,10 @@ static const uint16_t ts_small_parse_table[] = { ACTIONS(17), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, - STATE(18), 2, + STATE(19), 2, sym_term, aux_sym_app_repeat1, - STATE(40), 4, + STATE(39), 4, sym_labs, sym_pabs, sym_let, @@ -1200,13 +1199,13 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_let, ACTIONS(33), 1, sym_axiom, - STATE(24), 1, + STATE(23), 1, sym_square, - STATE(30), 1, + STATE(35), 1, sym_arrow, - STATE(42), 1, + STATE(41), 1, sym_app_term, - STATE(62), 1, + STATE(64), 1, sym_expr, ACTIONS(3), 2, sym_comment, @@ -1214,10 +1213,10 @@ static const uint16_t ts_small_parse_table[] = { ACTIONS(17), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, - STATE(18), 2, + STATE(19), 2, sym_term, aux_sym_app_repeat1, - STATE(40), 4, + STATE(39), 4, sym_labs, sym_pabs, sym_let, @@ -1239,24 +1238,24 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_forall, ACTIONS(27), 1, anon_sym_let, - STATE(24), 1, + STATE(23), 1, sym_square, - STATE(30), 1, + STATE(35), 1, sym_arrow, - STATE(42), 1, - sym_app_term, - STATE(76), 1, + STATE(36), 1, sym_expr, + STATE(41), 1, + sym_app_term, ACTIONS(3), 2, sym_comment, sym_block_comment, ACTIONS(17), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, - STATE(18), 2, + STATE(19), 2, sym_term, aux_sym_app_repeat1, - STATE(40), 4, + STATE(39), 4, sym_labs, sym_pabs, sym_let, @@ -1278,13 +1277,13 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_forall, ACTIONS(27), 1, anon_sym_let, - STATE(24), 1, + STATE(23), 1, sym_square, - STATE(30), 1, + STATE(35), 1, sym_arrow, - STATE(42), 1, + STATE(41), 1, sym_app_term, - STATE(63), 1, + STATE(70), 1, sym_expr, ACTIONS(3), 2, sym_comment, @@ -1292,10 +1291,10 @@ static const uint16_t ts_small_parse_table[] = { ACTIONS(17), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, - STATE(18), 2, + STATE(19), 2, sym_term, aux_sym_app_repeat1, - STATE(40), 4, + STATE(39), 4, sym_labs, sym_pabs, sym_let, @@ -1317,13 +1316,13 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_forall, ACTIONS(27), 1, anon_sym_let, - STATE(24), 1, + STATE(23), 1, sym_square, - STATE(30), 1, + STATE(35), 1, sym_arrow, - STATE(42), 1, + STATE(41), 1, sym_app_term, - STATE(68), 1, + STATE(77), 1, sym_expr, ACTIONS(3), 2, sym_comment, @@ -1331,10 +1330,10 @@ static const uint16_t ts_small_parse_table[] = { ACTIONS(17), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, - STATE(18), 2, + STATE(19), 2, sym_term, aux_sym_app_repeat1, - STATE(40), 4, + STATE(39), 4, sym_labs, sym_pabs, sym_let, @@ -1356,24 +1355,24 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_forall, ACTIONS(27), 1, anon_sym_let, - STATE(24), 1, + STATE(23), 1, sym_square, - STATE(30), 1, + STATE(35), 1, sym_arrow, - STATE(33), 1, - sym_expr, - STATE(42), 1, + STATE(41), 1, sym_app_term, + STATE(67), 1, + sym_expr, ACTIONS(3), 2, sym_comment, sym_block_comment, ACTIONS(17), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, - STATE(18), 2, + STATE(19), 2, sym_term, aux_sym_app_repeat1, - STATE(40), 4, + STATE(39), 4, sym_labs, sym_pabs, sym_let, @@ -1395,24 +1394,24 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_forall, ACTIONS(27), 1, anon_sym_let, - STATE(24), 1, + STATE(23), 1, sym_square, - STATE(30), 1, - sym_arrow, - STATE(42), 1, - sym_app_term, - STATE(73), 1, + STATE(33), 1, sym_expr, + STATE(35), 1, + sym_arrow, + STATE(41), 1, + sym_app_term, ACTIONS(3), 2, sym_comment, sym_block_comment, ACTIONS(17), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, - STATE(18), 2, + STATE(19), 2, sym_term, aux_sym_app_repeat1, - STATE(40), 4, + STATE(39), 4, sym_labs, sym_pabs, sym_let, @@ -1434,13 +1433,13 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_forall, ACTIONS(27), 1, anon_sym_let, - STATE(24), 1, + STATE(23), 1, sym_square, - STATE(30), 1, + STATE(35), 1, sym_arrow, STATE(38), 1, sym_expr, - STATE(42), 1, + STATE(41), 1, sym_app_term, ACTIONS(3), 2, sym_comment, @@ -1448,10 +1447,10 @@ static const uint16_t ts_small_parse_table[] = { ACTIONS(17), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, - STATE(18), 2, + STATE(19), 2, sym_term, aux_sym_app_repeat1, - STATE(40), 4, + STATE(39), 4, sym_labs, sym_pabs, sym_let, @@ -1473,13 +1472,13 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_u220f, ACTIONS(49), 1, anon_sym_forall, - STATE(26), 1, + STATE(27), 1, sym_square, - STATE(30), 1, + STATE(35), 1, sym_arrow, - STATE(57), 1, + STATE(51), 1, sym_app_term, - STATE(67), 1, + STATE(66), 1, sym_expr, ACTIONS(3), 2, sym_comment, @@ -1490,7 +1489,7 @@ static const uint16_t ts_small_parse_table[] = { STATE(21), 2, sym_term, aux_sym_app_repeat1, - STATE(40), 4, + STATE(39), 4, sym_labs, sym_pabs, sym_let, @@ -1512,24 +1511,24 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_forall, ACTIONS(27), 1, anon_sym_let, - STATE(24), 1, + STATE(23), 1, sym_square, - STATE(30), 1, + STATE(35), 1, sym_arrow, - STATE(39), 1, - sym_expr, - STATE(42), 1, + STATE(41), 1, sym_app_term, + STATE(68), 1, + sym_expr, ACTIONS(3), 2, sym_comment, sym_block_comment, ACTIONS(17), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, - STATE(18), 2, + STATE(19), 2, sym_term, aux_sym_app_repeat1, - STATE(40), 4, + STATE(39), 4, sym_labs, sym_pabs, sym_let, @@ -1551,13 +1550,13 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_forall, ACTIONS(27), 1, anon_sym_let, - STATE(24), 1, + STATE(23), 1, sym_square, - STATE(30), 1, + STATE(35), 1, sym_arrow, - STATE(42), 1, + STATE(41), 1, sym_app_term, - STATE(70), 1, + STATE(74), 1, sym_expr, ACTIONS(3), 2, sym_comment, @@ -1565,10 +1564,10 @@ static const uint16_t ts_small_parse_table[] = { ACTIONS(17), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, - STATE(18), 2, + STATE(19), 2, sym_term, aux_sym_app_repeat1, - STATE(40), 4, + STATE(39), 4, sym_labs, sym_pabs, sym_let, @@ -1590,13 +1589,13 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_u220f, ACTIONS(49), 1, anon_sym_forall, - STATE(26), 1, + STATE(27), 1, sym_square, - STATE(30), 1, + STATE(35), 1, sym_arrow, - STATE(33), 1, + STATE(38), 1, sym_expr, - STATE(57), 1, + STATE(51), 1, sym_app_term, ACTIONS(3), 2, sym_comment, @@ -1607,7 +1606,7 @@ static const uint16_t ts_small_parse_table[] = { STATE(21), 2, sym_term, aux_sym_app_repeat1, - STATE(40), 4, + STATE(39), 4, sym_labs, sym_pabs, sym_let, @@ -1629,13 +1628,13 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_u220f, ACTIONS(49), 1, anon_sym_forall, - STATE(26), 1, + STATE(27), 1, sym_square, - STATE(30), 1, - sym_arrow, - STATE(39), 1, + STATE(33), 1, sym_expr, - STATE(57), 1, + STATE(35), 1, + sym_arrow, + STATE(51), 1, sym_app_term, ACTIONS(3), 2, sym_comment, @@ -1646,7 +1645,7 @@ static const uint16_t ts_small_parse_table[] = { STATE(21), 2, sym_term, aux_sym_app_repeat1, - STATE(40), 4, + STATE(39), 4, sym_labs, sym_pabs, sym_let, @@ -1668,13 +1667,13 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_u220f, ACTIONS(49), 1, anon_sym_forall, - STATE(26), 1, + STATE(27), 1, sym_square, - STATE(30), 1, + STATE(35), 1, sym_arrow, - STATE(38), 1, + STATE(36), 1, sym_expr, - STATE(57), 1, + STATE(51), 1, sym_app_term, ACTIONS(3), 2, sym_comment, @@ -1685,7 +1684,7 @@ static const uint16_t ts_small_parse_table[] = { STATE(21), 2, sym_term, aux_sym_app_repeat1, - STATE(40), 4, + STATE(39), 4, sym_labs, sym_pabs, sym_let, @@ -1707,13 +1706,13 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_forall, ACTIONS(27), 1, anon_sym_let, - STATE(24), 1, + STATE(23), 1, sym_square, - STATE(30), 1, + STATE(35), 1, sym_arrow, - STATE(42), 1, + STATE(41), 1, sym_app_term, - STATE(74), 1, + STATE(73), 1, sym_expr, ACTIONS(3), 2, sym_comment, @@ -1721,18 +1720,41 @@ static const uint16_t ts_small_parse_table[] = { ACTIONS(17), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, - STATE(18), 2, + STATE(19), 2, sym_term, aux_sym_app_repeat1, - STATE(40), 4, + STATE(39), 4, sym_labs, sym_pabs, sym_let, sym_app, [889] = 7, + ACTIONS(54), 1, + anon_sym_LPAREN, + STATE(23), 1, + sym_square, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + ACTIONS(51), 2, + sym_identifier, + sym_star, + ACTIONS(59), 2, + anon_sym_u25a1, + anon_sym_LBRACK_RBRACK, + STATE(18), 2, + sym_term, + aux_sym_app_repeat1, + ACTIONS(57), 5, + anon_sym_RPAREN, + anon_sym_COLON_EQ, + anon_sym_DASH_GT, + anon_sym_u2192, + anon_sym_SEMI, + [919] = 7, ACTIONS(13), 1, anon_sym_LPAREN, - STATE(24), 1, + STATE(23), 1, sym_square, ACTIONS(3), 2, sym_comment, @@ -1743,33 +1765,10 @@ static const uint16_t ts_small_parse_table[] = { ACTIONS(17), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, - STATE(19), 2, + STATE(18), 2, sym_term, aux_sym_app_repeat1, - ACTIONS(51), 5, - anon_sym_RPAREN, - anon_sym_COLON_EQ, - anon_sym_DASH_GT, - anon_sym_u2192, - anon_sym_SEMI, - [919] = 7, - ACTIONS(56), 1, - anon_sym_LPAREN, - STATE(24), 1, - sym_square, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - ACTIONS(53), 2, - sym_identifier, - sym_star, - ACTIONS(61), 2, - anon_sym_u25a1, - anon_sym_LBRACK_RBRACK, - STATE(19), 2, - sym_term, - aux_sym_app_repeat1, - ACTIONS(59), 5, + ACTIONS(62), 5, anon_sym_RPAREN, anon_sym_COLON_EQ, anon_sym_DASH_GT, @@ -1784,12 +1783,12 @@ static const uint16_t ts_small_parse_table[] = { sym_star, ACTIONS(76), 1, anon_sym_end, - STATE(26), 1, + STATE(27), 1, sym_square, ACTIONS(3), 2, sym_comment, sym_block_comment, - ACTIONS(59), 2, + ACTIONS(57), 2, anon_sym_DASH_GT, anon_sym_u2192, ACTIONS(73), 2, @@ -1807,7 +1806,7 @@ static const uint16_t ts_small_parse_table[] = { sym_star, ACTIONS(78), 1, anon_sym_end, - STATE(26), 1, + STATE(27), 1, sym_square, ACTIONS(3), 2, sym_comment, @@ -1815,7 +1814,7 @@ static const uint16_t ts_small_parse_table[] = { ACTIONS(41), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, - ACTIONS(51), 2, + ACTIONS(62), 2, anon_sym_DASH_GT, anon_sym_u2192, STATE(20), 2, @@ -1866,27 +1865,11 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_DASH_GT, anon_sym_u2192, anon_sym_SEMI, - [1064] = 5, - ACTIONS(86), 1, - anon_sym_LPAREN, - ACTIONS(89), 1, - anon_sym_COLON, + [1064] = 3, ACTIONS(3), 2, sym_comment, sym_block_comment, - STATE(25), 2, - sym_param_block, - aux_sym_labs_repeat1, - ACTIONS(91), 4, - anon_sym_EQ_GT, - anon_sym_u21d2, - anon_sym_COMMA, - anon_sym_COLON_EQ, - [1085] = 3, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - ACTIONS(93), 2, + ACTIONS(86), 2, sym_identifier, anon_sym_end, ACTIONS(84), 6, @@ -1896,6 +1879,22 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_LBRACK_RBRACK, anon_sym_DASH_GT, anon_sym_u2192, + [1081] = 5, + ACTIONS(88), 1, + anon_sym_LPAREN, + ACTIONS(91), 1, + anon_sym_COLON, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + STATE(26), 2, + sym_param_block, + aux_sym_labs_repeat1, + ACTIONS(93), 4, + anon_sym_EQ_GT, + anon_sym_u21d2, + anon_sym_COMMA, + anon_sym_COLON_EQ, [1102] = 3, ACTIONS(3), 2, sym_comment, @@ -1903,7 +1902,7 @@ static const uint16_t ts_small_parse_table[] = { ACTIONS(95), 2, sym_identifier, anon_sym_end, - ACTIONS(80), 6, + ACTIONS(82), 6, anon_sym_LPAREN, sym_star, anon_sym_u25a1, @@ -1917,7 +1916,7 @@ static const uint16_t ts_small_parse_table[] = { ACTIONS(97), 2, sym_identifier, anon_sym_end, - ACTIONS(82), 6, + ACTIONS(80), 6, anon_sym_LPAREN, sym_star, anon_sym_u25a1, @@ -1938,71 +1937,74 @@ static const uint16_t ts_small_parse_table[] = { sym_definition, sym_preprocess, aux_sym_program_repeat1, - [1155] = 2, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - ACTIONS(107), 6, - anon_sym_RPAREN, - anon_sym_COLON_EQ, - anon_sym_end, - anon_sym_DASH_GT, - anon_sym_u2192, - anon_sym_SEMI, - [1168] = 3, + [1155] = 6, + ACTIONS(107), 1, + anon_sym_LPAREN, + ACTIONS(109), 1, + anon_sym_COLON, ACTIONS(111), 1, - anon_sym_COLON, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - ACTIONS(109), 5, - anon_sym_LPAREN, - anon_sym_EQ_GT, - anon_sym_u21d2, - anon_sym_COMMA, anon_sym_COLON_EQ, - [1183] = 6, - ACTIONS(113), 1, - anon_sym_LPAREN, - ACTIONS(115), 1, - anon_sym_COLON, - ACTIONS(117), 1, - anon_sym_COLON_EQ, - STATE(69), 1, + STATE(78), 1, sym_ascription, ACTIONS(3), 2, sym_comment, sym_block_comment, - STATE(34), 2, + STATE(31), 2, sym_param_block, aux_sym_labs_repeat1, - [1204] = 2, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - ACTIONS(119), 6, - anon_sym_RPAREN, - anon_sym_COLON_EQ, - anon_sym_end, - anon_sym_DASH_GT, - anon_sym_u2192, - anon_sym_SEMI, - [1217] = 6, - ACTIONS(113), 1, + [1176] = 6, + ACTIONS(107), 1, anon_sym_LPAREN, - ACTIONS(115), 1, + ACTIONS(109), 1, anon_sym_COLON, - ACTIONS(121), 1, + ACTIONS(113), 1, anon_sym_COLON_EQ, STATE(65), 1, sym_ascription, ACTIONS(3), 2, sym_comment, sym_block_comment, - STATE(25), 2, + STATE(26), 2, sym_param_block, aux_sym_labs_repeat1, - [1238] = 2, + [1197] = 5, + ACTIONS(7), 1, + sym_identifier, + ACTIONS(9), 1, + sym_command, + ACTIONS(115), 1, + ts_builtin_sym_end, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + STATE(29), 3, + sym_definition, + sym_preprocess, + aux_sym_program_repeat1, + [1216] = 2, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + ACTIONS(117), 6, + anon_sym_RPAREN, + anon_sym_COLON_EQ, + anon_sym_end, + anon_sym_DASH_GT, + anon_sym_u2192, + anon_sym_SEMI, + [1229] = 3, + ACTIONS(121), 1, + anon_sym_COLON, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + ACTIONS(119), 5, + anon_sym_LPAREN, + anon_sym_EQ_GT, + anon_sym_u21d2, + anon_sym_COMMA, + anon_sym_COLON_EQ, + [1244] = 2, ACTIONS(3), 2, sym_comment, sym_block_comment, @@ -2013,33 +2015,40 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_DASH_GT, anon_sym_u2192, anon_sym_SEMI, - [1251] = 3, - ACTIONS(127), 1, - anon_sym_COLON, + [1257] = 2, ACTIONS(3), 2, sym_comment, sym_block_comment, - ACTIONS(125), 5, - anon_sym_LPAREN, - anon_sym_EQ_GT, - anon_sym_u21d2, - anon_sym_COMMA, + ACTIONS(125), 6, + anon_sym_RPAREN, anon_sym_COLON_EQ, - [1266] = 5, - ACTIONS(7), 1, - sym_identifier, - ACTIONS(9), 1, - sym_command, - ACTIONS(129), 1, - ts_builtin_sym_end, + anon_sym_end, + anon_sym_DASH_GT, + anon_sym_u2192, + anon_sym_SEMI, + [1270] = 2, ACTIONS(3), 2, sym_comment, sym_block_comment, - STATE(29), 3, - sym_definition, - sym_preprocess, - aux_sym_program_repeat1, - [1285] = 2, + ACTIONS(127), 6, + anon_sym_RPAREN, + anon_sym_COLON_EQ, + anon_sym_end, + anon_sym_DASH_GT, + anon_sym_u2192, + anon_sym_SEMI, + [1283] = 2, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + ACTIONS(129), 6, + anon_sym_RPAREN, + anon_sym_COLON_EQ, + anon_sym_end, + anon_sym_DASH_GT, + anon_sym_u2192, + anon_sym_SEMI, + [1296] = 2, ACTIONS(3), 2, sym_comment, sym_block_comment, @@ -2050,30 +2059,31 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_DASH_GT, anon_sym_u2192, anon_sym_SEMI, - [1298] = 2, + [1309] = 4, + ACTIONS(107), 1, + anon_sym_LPAREN, ACTIONS(3), 2, sym_comment, sym_block_comment, - ACTIONS(133), 6, - anon_sym_RPAREN, - anon_sym_COLON_EQ, - anon_sym_end, - anon_sym_DASH_GT, - anon_sym_u2192, - anon_sym_SEMI, - [1311] = 2, + ACTIONS(133), 2, + anon_sym_EQ_GT, + anon_sym_u21d2, + STATE(26), 2, + sym_param_block, + aux_sym_labs_repeat1, + [1325] = 3, ACTIONS(3), 2, sym_comment, sym_block_comment, - ACTIONS(135), 6, - anon_sym_RPAREN, - anon_sym_COLON_EQ, - anon_sym_end, + ACTIONS(135), 2, anon_sym_DASH_GT, anon_sym_u2192, + ACTIONS(123), 3, + anon_sym_RPAREN, + anon_sym_COLON_EQ, anon_sym_SEMI, - [1324] = 4, - ACTIONS(113), 1, + [1339] = 4, + ACTIONS(107), 1, anon_sym_LPAREN, ACTIONS(3), 2, sym_comment, @@ -2081,47 +2091,24 @@ static const uint16_t ts_small_parse_table[] = { ACTIONS(137), 2, anon_sym_EQ_GT, anon_sym_u21d2, - STATE(25), 2, + STATE(26), 2, sym_param_block, aux_sym_labs_repeat1, - [1340] = 3, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - ACTIONS(139), 2, - anon_sym_DASH_GT, - anon_sym_u2192, - ACTIONS(107), 3, - anon_sym_RPAREN, - anon_sym_COLON_EQ, - anon_sym_SEMI, - [1354] = 4, - ACTIONS(113), 1, + [1355] = 4, + ACTIONS(107), 1, anon_sym_LPAREN, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - ACTIONS(141), 2, - anon_sym_EQ_GT, - anon_sym_u21d2, - STATE(25), 2, - sym_param_block, - aux_sym_labs_repeat1, - [1370] = 4, - ACTIONS(113), 1, - anon_sym_LPAREN, - ACTIONS(143), 1, + ACTIONS(139), 1, anon_sym_COMMA, ACTIONS(3), 2, sym_comment, sym_block_comment, - STATE(25), 2, + STATE(26), 2, sym_param_block, aux_sym_labs_repeat1, - [1385] = 4, - ACTIONS(145), 1, + [1370] = 4, + ACTIONS(141), 1, anon_sym_LPAREN, - ACTIONS(147), 1, + ACTIONS(143), 1, anon_sym_in, ACTIONS(3), 2, sym_comment, @@ -2129,10 +2116,21 @@ static const uint16_t ts_small_parse_table[] = { STATE(46), 2, sym_binding, aux_sym_let_repeat1, - [1400] = 4, - ACTIONS(149), 1, + [1385] = 4, + ACTIONS(107), 1, anon_sym_LPAREN, - ACTIONS(152), 1, + ACTIONS(145), 1, + anon_sym_COLON_EQ, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + STATE(47), 2, + sym_param_block, + aux_sym_labs_repeat1, + [1400] = 4, + ACTIONS(147), 1, + anon_sym_LPAREN, + ACTIONS(150), 1, anon_sym_in, ACTIONS(3), 2, sym_comment, @@ -2141,36 +2139,54 @@ static const uint16_t ts_small_parse_table[] = { sym_binding, aux_sym_let_repeat1, [1415] = 4, - ACTIONS(113), 1, + ACTIONS(107), 1, + anon_sym_LPAREN, + ACTIONS(152), 1, + anon_sym_COLON_EQ, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + STATE(26), 2, + sym_param_block, + aux_sym_labs_repeat1, + [1430] = 4, + ACTIONS(107), 1, anon_sym_LPAREN, ACTIONS(154), 1, anon_sym_COMMA, ACTIONS(3), 2, sym_comment, sym_block_comment, - STATE(25), 2, + STATE(26), 2, sym_param_block, aux_sym_labs_repeat1, - [1430] = 3, - ACTIONS(113), 1, + [1445] = 2, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + ACTIONS(156), 3, + ts_builtin_sym_end, + sym_identifier, + sym_command, + [1455] = 3, + ACTIONS(107), 1, anon_sym_LPAREN, ACTIONS(3), 2, sym_comment, sym_block_comment, - STATE(44), 2, + STATE(48), 2, sym_param_block, aux_sym_labs_repeat1, - [1442] = 4, - ACTIONS(156), 1, - sym_identifier, - ACTIONS(158), 1, - anon_sym_COLON, - STATE(56), 1, - aux_sym_param_block_repeat1, + [1467] = 3, + ACTIONS(123), 1, + anon_sym_end, ACTIONS(3), 2, sym_comment, sym_block_comment, - [1456] = 2, + ACTIONS(158), 2, + anon_sym_DASH_GT, + anon_sym_u2192, + [1479] = 2, ACTIONS(3), 2, sym_comment, sym_block_comment, @@ -2178,7 +2194,7 @@ static const uint16_t ts_small_parse_table[] = { ts_builtin_sym_end, sym_identifier, sym_command, - [1466] = 2, + [1489] = 2, ACTIONS(3), 2, sym_comment, sym_block_comment, @@ -2186,71 +2202,27 @@ static const uint16_t ts_small_parse_table[] = { ts_builtin_sym_end, sym_identifier, sym_command, - [1476] = 4, + [1499] = 3, + ACTIONS(107), 1, + anon_sym_LPAREN, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + STATE(40), 2, + sym_param_block, + aux_sym_labs_repeat1, + [1511] = 4, ACTIONS(164), 1, sym_identifier, ACTIONS(166), 1, anon_sym_COLON, - STATE(49), 1, + STATE(57), 1, aux_sym_param_block_repeat1, ACTIONS(3), 2, sym_comment, sym_block_comment, - [1490] = 2, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - ACTIONS(168), 3, - ts_builtin_sym_end, - sym_identifier, - sym_command, - [1500] = 3, - ACTIONS(113), 1, - anon_sym_LPAREN, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - STATE(41), 2, - sym_param_block, - aux_sym_labs_repeat1, - [1512] = 2, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - ACTIONS(170), 3, - ts_builtin_sym_end, - sym_identifier, - sym_command, - [1522] = 4, - ACTIONS(172), 1, - sym_identifier, - ACTIONS(175), 1, - anon_sym_COLON, - STATE(56), 1, - aux_sym_param_block_repeat1, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - [1536] = 3, + [1525] = 3, ACTIONS(107), 1, - anon_sym_end, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - ACTIONS(177), 2, - anon_sym_DASH_GT, - anon_sym_u2192, - [1548] = 3, - ACTIONS(145), 1, - anon_sym_LPAREN, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - STATE(45), 2, - sym_binding, - aux_sym_let_repeat1, - [1560] = 3, - ACTIONS(113), 1, anon_sym_LPAREN, ACTIONS(3), 2, sym_comment, @@ -2258,114 +2230,150 @@ static const uint16_t ts_small_parse_table[] = { STATE(43), 2, sym_param_block, aux_sym_labs_repeat1, - [1572] = 3, - ACTIONS(113), 1, + [1537] = 4, + ACTIONS(168), 1, + sym_identifier, + ACTIONS(171), 1, + anon_sym_COLON, + STATE(57), 1, + aux_sym_param_block_repeat1, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + [1551] = 2, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + ACTIONS(173), 3, + ts_builtin_sym_end, + sym_identifier, + sym_command, + [1561] = 3, + ACTIONS(141), 1, anon_sym_LPAREN, ACTIONS(3), 2, sym_comment, sym_block_comment, - STATE(47), 2, + STATE(44), 2, + sym_binding, + aux_sym_let_repeat1, + [1573] = 3, + ACTIONS(107), 1, + anon_sym_LPAREN, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + STATE(42), 2, sym_param_block, aux_sym_labs_repeat1, - [1584] = 2, + [1585] = 2, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + ACTIONS(175), 2, + anon_sym_LPAREN, + anon_sym_in, + [1594] = 3, + ACTIONS(177), 1, + sym_identifier, + STATE(55), 1, + aux_sym_param_block_repeat1, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + [1605] = 2, ACTIONS(3), 2, sym_comment, sym_block_comment, ACTIONS(179), 2, anon_sym_LPAREN, anon_sym_in, - [1593] = 2, + [1614] = 2, ACTIONS(181), 1, anon_sym_SEMI, ACTIONS(3), 2, sym_comment, sym_block_comment, - [1601] = 2, + [1622] = 2, ACTIONS(183), 1, anon_sym_COLON_EQ, ACTIONS(3), 2, sym_comment, sym_block_comment, - [1609] = 2, + [1630] = 2, ACTIONS(185), 1, - sym_identifier, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - [1617] = 2, - ACTIONS(187), 1, - anon_sym_COLON_EQ, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - [1625] = 2, - ACTIONS(189), 1, - anon_sym_SEMI, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - [1633] = 2, - ACTIONS(191), 1, anon_sym_end, ACTIONS(3), 2, sym_comment, sym_block_comment, - [1641] = 2, - ACTIONS(193), 1, + [1638] = 2, + ACTIONS(187), 1, anon_sym_RPAREN, ACTIONS(3), 2, sym_comment, sym_block_comment, - [1649] = 2, - ACTIONS(121), 1, + [1646] = 2, + ACTIONS(189), 1, + anon_sym_RPAREN, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + [1654] = 2, + ACTIONS(193), 1, + sym_post_command, + ACTIONS(191), 2, + sym_comment, + sym_block_comment, + [1662] = 2, + ACTIONS(195), 1, anon_sym_COLON_EQ, ACTIONS(3), 2, sym_comment, sym_block_comment, - [1657] = 2, - ACTIONS(195), 1, - anon_sym_RPAREN, + [1670] = 2, + ACTIONS(197), 1, + sym_identifier, ACTIONS(3), 2, sym_comment, sym_block_comment, - [1665] = 2, - ACTIONS(197), 1, + [1678] = 2, + ACTIONS(199), 1, anon_sym_SEMI, ACTIONS(3), 2, sym_comment, sym_block_comment, - [1673] = 2, + [1686] = 2, ACTIONS(201), 1, - sym_post_command, - ACTIONS(199), 2, + anon_sym_RPAREN, + ACTIONS(3), 2, sym_comment, sym_block_comment, - [1681] = 2, + [1694] = 2, ACTIONS(203), 1, anon_sym_RPAREN, ACTIONS(3), 2, sym_comment, sym_block_comment, - [1689] = 2, + [1702] = 2, ACTIONS(205), 1, - anon_sym_RPAREN, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - [1697] = 2, - ACTIONS(207), 1, ts_builtin_sym_end, ACTIONS(3), 2, sym_comment, sym_block_comment, - [1705] = 2, + [1710] = 2, + ACTIONS(207), 1, + anon_sym_SEMI, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + [1718] = 2, ACTIONS(209), 1, anon_sym_RPAREN, ACTIONS(3), 2, sym_comment, sym_block_comment, - [1713] = 2, - ACTIONS(211), 1, + [1726] = 2, + ACTIONS(113), 1, anon_sym_COLON_EQ, ACTIONS(3), 2, sym_comment, @@ -2397,58 +2405,59 @@ static const uint32_t ts_small_parse_table_map[] = { [SMALL_STATE(23)] = 1030, [SMALL_STATE(24)] = 1047, [SMALL_STATE(25)] = 1064, - [SMALL_STATE(26)] = 1085, + [SMALL_STATE(26)] = 1081, [SMALL_STATE(27)] = 1102, [SMALL_STATE(28)] = 1119, [SMALL_STATE(29)] = 1136, [SMALL_STATE(30)] = 1155, - [SMALL_STATE(31)] = 1168, - [SMALL_STATE(32)] = 1183, - [SMALL_STATE(33)] = 1204, - [SMALL_STATE(34)] = 1217, - [SMALL_STATE(35)] = 1238, - [SMALL_STATE(36)] = 1251, - [SMALL_STATE(37)] = 1266, - [SMALL_STATE(38)] = 1285, - [SMALL_STATE(39)] = 1298, - [SMALL_STATE(40)] = 1311, - [SMALL_STATE(41)] = 1324, - [SMALL_STATE(42)] = 1340, - [SMALL_STATE(43)] = 1354, + [SMALL_STATE(31)] = 1176, + [SMALL_STATE(32)] = 1197, + [SMALL_STATE(33)] = 1216, + [SMALL_STATE(34)] = 1229, + [SMALL_STATE(35)] = 1244, + [SMALL_STATE(36)] = 1257, + [SMALL_STATE(37)] = 1270, + [SMALL_STATE(38)] = 1283, + [SMALL_STATE(39)] = 1296, + [SMALL_STATE(40)] = 1309, + [SMALL_STATE(41)] = 1325, + [SMALL_STATE(42)] = 1339, + [SMALL_STATE(43)] = 1355, [SMALL_STATE(44)] = 1370, [SMALL_STATE(45)] = 1385, [SMALL_STATE(46)] = 1400, [SMALL_STATE(47)] = 1415, [SMALL_STATE(48)] = 1430, - [SMALL_STATE(49)] = 1442, - [SMALL_STATE(50)] = 1456, - [SMALL_STATE(51)] = 1466, - [SMALL_STATE(52)] = 1476, - [SMALL_STATE(53)] = 1490, - [SMALL_STATE(54)] = 1500, - [SMALL_STATE(55)] = 1512, - [SMALL_STATE(56)] = 1522, - [SMALL_STATE(57)] = 1536, - [SMALL_STATE(58)] = 1548, - [SMALL_STATE(59)] = 1560, - [SMALL_STATE(60)] = 1572, - [SMALL_STATE(61)] = 1584, - [SMALL_STATE(62)] = 1593, - [SMALL_STATE(63)] = 1601, - [SMALL_STATE(64)] = 1609, - [SMALL_STATE(65)] = 1617, - [SMALL_STATE(66)] = 1625, - [SMALL_STATE(67)] = 1633, - [SMALL_STATE(68)] = 1641, - [SMALL_STATE(69)] = 1649, - [SMALL_STATE(70)] = 1657, - [SMALL_STATE(71)] = 1665, - [SMALL_STATE(72)] = 1673, - [SMALL_STATE(73)] = 1681, - [SMALL_STATE(74)] = 1689, - [SMALL_STATE(75)] = 1697, - [SMALL_STATE(76)] = 1705, - [SMALL_STATE(77)] = 1713, + [SMALL_STATE(49)] = 1445, + [SMALL_STATE(50)] = 1455, + [SMALL_STATE(51)] = 1467, + [SMALL_STATE(52)] = 1479, + [SMALL_STATE(53)] = 1489, + [SMALL_STATE(54)] = 1499, + [SMALL_STATE(55)] = 1511, + [SMALL_STATE(56)] = 1525, + [SMALL_STATE(57)] = 1537, + [SMALL_STATE(58)] = 1551, + [SMALL_STATE(59)] = 1561, + [SMALL_STATE(60)] = 1573, + [SMALL_STATE(61)] = 1585, + [SMALL_STATE(62)] = 1594, + [SMALL_STATE(63)] = 1605, + [SMALL_STATE(64)] = 1614, + [SMALL_STATE(65)] = 1622, + [SMALL_STATE(66)] = 1630, + [SMALL_STATE(67)] = 1638, + [SMALL_STATE(68)] = 1646, + [SMALL_STATE(69)] = 1654, + [SMALL_STATE(70)] = 1662, + [SMALL_STATE(71)] = 1670, + [SMALL_STATE(72)] = 1678, + [SMALL_STATE(73)] = 1686, + [SMALL_STATE(74)] = 1694, + [SMALL_STATE(75)] = 1702, + [SMALL_STATE(76)] = 1710, + [SMALL_STATE(77)] = 1718, + [SMALL_STATE(78)] = 1726, }; static const TSParseActionEntry ts_parse_actions[] = { @@ -2456,103 +2465,102 @@ static const TSParseActionEntry ts_parse_actions[] = { [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(), [3] = {.entry = {.count = 1, .reusable = true}}, SHIFT_EXTRA(), [5] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_program, 0, 0, 0), - [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32), - [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(72), - [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(24), - [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), - [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24), - [17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), + [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30), + [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(69), + [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(23), + [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), + [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), + [17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), [19] = {.entry = {.count = 1, .reusable = true}}, SHIFT(54), [21] = {.entry = {.count = 1, .reusable = false}}, SHIFT(54), - [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(48), - [25] = {.entry = {.count = 1, .reusable = false}}, SHIFT(48), - [27] = {.entry = {.count = 1, .reusable = false}}, SHIFT(58), - [29] = {.entry = {.count = 1, .reusable = false}}, SHIFT(71), - [31] = {.entry = {.count = 1, .reusable = false}}, SHIFT(66), - [33] = {.entry = {.count = 1, .reusable = false}}, SHIFT(62), - [35] = {.entry = {.count = 1, .reusable = false}}, SHIFT(26), + [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(56), + [25] = {.entry = {.count = 1, .reusable = false}}, SHIFT(56), + [27] = {.entry = {.count = 1, .reusable = false}}, SHIFT(59), + [29] = {.entry = {.count = 1, .reusable = false}}, SHIFT(76), + [31] = {.entry = {.count = 1, .reusable = false}}, SHIFT(72), + [33] = {.entry = {.count = 1, .reusable = false}}, SHIFT(64), + [35] = {.entry = {.count = 1, .reusable = false}}, SHIFT(27), [37] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), - [39] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), + [39] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), [41] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28), - [43] = {.entry = {.count = 1, .reusable = true}}, SHIFT(59), - [45] = {.entry = {.count = 1, .reusable = false}}, SHIFT(59), - [47] = {.entry = {.count = 1, .reusable = true}}, SHIFT(60), - [49] = {.entry = {.count = 1, .reusable = false}}, SHIFT(60), - [51] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_app, 1, 0, 0), - [53] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_app_repeat1, 2, 0, 0), SHIFT_REPEAT(24), - [56] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_app_repeat1, 2, 0, 0), SHIFT_REPEAT(7), - [59] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_app_repeat1, 2, 0, 0), - [61] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_app_repeat1, 2, 0, 0), SHIFT_REPEAT(23), - [64] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_app_repeat1, 2, 0, 0), SHIFT_REPEAT(26), + [43] = {.entry = {.count = 1, .reusable = true}}, SHIFT(60), + [45] = {.entry = {.count = 1, .reusable = false}}, SHIFT(60), + [47] = {.entry = {.count = 1, .reusable = true}}, SHIFT(50), + [49] = {.entry = {.count = 1, .reusable = false}}, SHIFT(50), + [51] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_app_repeat1, 2, 0, 0), SHIFT_REPEAT(23), + [54] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_app_repeat1, 2, 0, 0), SHIFT_REPEAT(8), + [57] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_app_repeat1, 2, 0, 0), + [59] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_app_repeat1, 2, 0, 0), SHIFT_REPEAT(22), + [62] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_app, 1, 0, 0), + [64] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_app_repeat1, 2, 0, 0), SHIFT_REPEAT(27), [67] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_app_repeat1, 2, 0, 0), SHIFT_REPEAT(17), - [70] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_app_repeat1, 2, 0, 0), SHIFT_REPEAT(26), + [70] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_app_repeat1, 2, 0, 0), SHIFT_REPEAT(27), [73] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_app_repeat1, 2, 0, 0), SHIFT_REPEAT(28), [76] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_app_repeat1, 2, 0, 0), [78] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_app, 1, 0, 0), - [80] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_term, 3, 0, 0), - [82] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_square, 1, 0, 0), - [84] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_term, 1, 0, 0), - [86] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_labs_repeat1, 2, 0, 0), SHIFT_REPEAT(52), - [89] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_labs_repeat1, 2, 0, 0), - [91] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_labs_repeat1, 2, 0, 0), - [93] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_term, 1, 0, 0), - [95] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_term, 3, 0, 0), + [80] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_square, 1, 0, 0), + [82] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_term, 1, 0, 0), + [84] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_term, 3, 0, 0), + [86] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_term, 3, 0, 0), + [88] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_labs_repeat1, 2, 0, 0), SHIFT_REPEAT(62), + [91] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_labs_repeat1, 2, 0, 0), + [93] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_labs_repeat1, 2, 0, 0), + [95] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_term, 1, 0, 0), [97] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_square, 1, 0, 0), [99] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2, 0, 0), - [101] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2, 0, 0), SHIFT_REPEAT(32), - [104] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2, 0, 0), SHIFT_REPEAT(72), - [107] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expr, 1, 0, 0), - [109] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param_block, 4, 0, 3), - [111] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_param_block, 4, 0, 3), - [113] = {.entry = {.count = 1, .reusable = true}}, SHIFT(52), - [115] = {.entry = {.count = 1, .reusable = false}}, SHIFT(6), - [117] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3), - [119] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_arrow, 3, 0, 0), - [121] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2), - [123] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_let, 5, 0, 0), - [125] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param_block, 5, 0, 4), - [127] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_param_block, 5, 0, 4), - [129] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_program, 1, 0, 0), - [131] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pabs, 4, 0, 0), - [133] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_labs, 4, 0, 0), - [135] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_app_term, 1, 0, 0), - [137] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), - [139] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), - [141] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), - [143] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), - [145] = {.entry = {.count = 1, .reusable = true}}, SHIFT(64), - [147] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), - [149] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_let_repeat1, 2, 0, 0), SHIFT_REPEAT(64), - [152] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_let_repeat1, 2, 0, 0), - [154] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), - [156] = {.entry = {.count = 1, .reusable = true}}, SHIFT(56), - [158] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), - [160] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_definition, 6, 0, 2), - [162] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_definition, 5, 0, 2), - [164] = {.entry = {.count = 1, .reusable = true}}, SHIFT(49), - [166] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), - [168] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_definition, 4, 0, 2), - [170] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_preprocess, 2, 0, 0), - [172] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_param_block_repeat1, 2, 0, 0), SHIFT_REPEAT(56), - [175] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_param_block_repeat1, 2, 0, 0), - [177] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), + [101] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2, 0, 0), SHIFT_REPEAT(30), + [104] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2, 0, 0), SHIFT_REPEAT(69), + [107] = {.entry = {.count = 1, .reusable = true}}, SHIFT(62), + [109] = {.entry = {.count = 1, .reusable = false}}, SHIFT(6), + [111] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2), + [113] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3), + [115] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_program, 1, 0, 0), + [117] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_arrow, 3, 0, 0), + [119] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param_block, 5, 0, 3), + [121] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_param_block, 5, 0, 3), + [123] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expr, 1, 0, 0), + [125] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_labs, 4, 0, 0), + [127] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_let, 5, 0, 0), + [129] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pabs, 4, 0, 0), + [131] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_app_term, 1, 0, 0), + [133] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), + [135] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), + [137] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), + [139] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), + [141] = {.entry = {.count = 1, .reusable = true}}, SHIFT(71), + [143] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), + [145] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), + [147] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_let_repeat1, 2, 0, 0), SHIFT_REPEAT(71), + [150] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_let_repeat1, 2, 0, 0), + [152] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), + [154] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), + [156] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_definition, 5, 0, 2), + [158] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), + [160] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_preprocess, 2, 0, 0), + [162] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_definition, 4, 0, 2), + [164] = {.entry = {.count = 1, .reusable = true}}, SHIFT(57), + [166] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), + [168] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_param_block_repeat1, 2, 0, 0), SHIFT_REPEAT(57), + [171] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_param_block_repeat1, 2, 0, 0), + [173] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_definition, 6, 0, 2), + [175] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_binding, 6, 0, 0), + [177] = {.entry = {.count = 1, .reusable = true}}, SHIFT(55), [179] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_binding, 5, 0, 0), - [181] = {.entry = {.count = 1, .reusable = true}}, SHIFT(50), - [183] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_ascription, 2, 0, 1), - [185] = {.entry = {.count = 1, .reusable = true}}, SHIFT(77), - [187] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), - [189] = {.entry = {.count = 1, .reusable = true}}, SHIFT(53), - [191] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35), - [193] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), - [195] = {.entry = {.count = 1, .reusable = true}}, SHIFT(61), - [197] = {.entry = {.count = 1, .reusable = true}}, SHIFT(51), - [199] = {.entry = {.count = 1, .reusable = false}}, SHIFT_EXTRA(), - [201] = {.entry = {.count = 1, .reusable = false}}, SHIFT(55), - [203] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36), - [205] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), - [207] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), - [209] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31), - [211] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), + [181] = {.entry = {.count = 1, .reusable = true}}, SHIFT(58), + [183] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), + [185] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37), + [187] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24), + [189] = {.entry = {.count = 1, .reusable = true}}, SHIFT(63), + [191] = {.entry = {.count = 1, .reusable = false}}, SHIFT_EXTRA(), + [193] = {.entry = {.count = 1, .reusable = false}}, SHIFT(52), + [195] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_ascription, 2, 0, 1), + [197] = {.entry = {.count = 1, .reusable = true}}, SHIFT(45), + [199] = {.entry = {.count = 1, .reusable = true}}, SHIFT(49), + [201] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), + [203] = {.entry = {.count = 1, .reusable = true}}, SHIFT(61), + [205] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [207] = {.entry = {.count = 1, .reusable = true}}, SHIFT(53), + [209] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), }; #ifdef __cplusplus diff --git a/test/corpus/let.txt b/test/corpus/let.txt index bddcb71..acfe6f1 100644 --- a/test/corpus/let.txt +++ b/test/corpus/let.txt @@ -4,6 +4,7 @@ Let foo := let (x := a) (y := x) + (f (x : A) := x) in x end; @@ -30,6 +31,20 @@ foo := let (x := a) (app (term (identifier)))))) + (binding + (identifier) + (param_block + (identifier) + (expr + (app_term + (app + (term + (identifier)))))) + (expr + (app_term + (app + (term + (identifier)))))) (expr (app_term (app