From faec13438ee4a9817ad97e8983a48de3b6bac250 Mon Sep 17 00:00:00 2001 From: Jeff Date: Fri, 29 Sep 2023 00:17:16 -0400 Subject: [PATCH] Implement closed and open statements --- bindings/dust | 2 +- grammar.js | 9 +- src/grammar.json | 22 ++ src/node-types.json | 40 ++- src/parser.c | 683 ++++++++++++++++++++++++++++---------------- 5 files changed, 507 insertions(+), 249 deletions(-) diff --git a/bindings/dust b/bindings/dust index adbd69b..cdf79f8 160000 --- a/bindings/dust +++ b/bindings/dust @@ -1 +1 @@ -Subproject commit adbd69b17ced1fb95282032211ac6dd0d7591943 +Subproject commit cdf79f87638100c641ff76fdb21294eadf3a32b0 diff --git a/grammar.js b/grammar.js index fbb1a4d..1cdcdae 100644 --- a/grammar.js +++ b/grammar.js @@ -9,7 +9,14 @@ module.exports = grammar({ comment: $ => seq('#', /.*/), - statement: $ => seq($.expression, $.close), + statement: $ => choice( + $.closed_statement, + $.open_statement, + ), + + closed_statement: $ => seq($.expression, $.close), + + open_statement: $ => seq($.expression), expression: $ => choice( prec(0, $.value), diff --git a/src/grammar.json b/src/grammar.json index 4708899..555cb9b 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -31,6 +31,19 @@ ] }, "statement": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "closed_statement" + }, + { + "type": "SYMBOL", + "name": "open_statement" + } + ] + }, + "closed_statement": { "type": "SEQ", "members": [ { @@ -43,6 +56,15 @@ } ] }, + "open_statement": { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "expression" + } + ] + }, "expression": { "type": "CHOICE", "members": [ diff --git a/src/node-types.json b/src/node-types.json index d4b7273..8aa0cb3 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -4,6 +4,25 @@ "named": true, "fields": {} }, + { + "type": "closed_statement", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "close", + "named": true + }, + { + "type": "expression", + "named": true + } + ] + } + }, { "type": "comment", "named": true, @@ -47,6 +66,21 @@ ] } }, + { + "type": "open_statement", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + } + }, { "type": "operation", "named": true, @@ -95,15 +129,15 @@ "named": true, "fields": {}, "children": { - "multiple": true, + "multiple": false, "required": true, "types": [ { - "type": "close", + "type": "closed_statement", "named": true }, { - "type": "expression", + "type": "open_statement", "named": true } ] diff --git a/src/parser.c b/src/parser.c index c9cbb33..26a21c5 100644 --- a/src/parser.c +++ b/src/parser.c @@ -6,9 +6,9 @@ #endif #define LANGUAGE_VERSION 14 -#define STATE_COUNT 23 -#define LARGE_STATE_COUNT 4 -#define SYMBOL_COUNT 29 +#define STATE_COUNT 29 +#define LARGE_STATE_COUNT 6 +#define SYMBOL_COUNT 31 #define ALIAS_COUNT 0 #define TOKEN_COUNT 18 #define EXTERNAL_TOKEN_COUNT 0 @@ -37,14 +37,16 @@ enum { sym_source = 18, sym_comment = 19, sym_statement = 20, - sym_expression = 21, - sym_value = 22, - sym_boolean = 23, - sym_list = 24, - sym_operator = 25, - sym_operation = 26, - aux_sym_source_repeat1 = 27, - aux_sym_list_repeat1 = 28, + sym_closed_statement = 21, + sym_open_statement = 22, + sym_expression = 23, + sym_value = 24, + sym_boolean = 25, + sym_list = 26, + sym_operator = 27, + sym_operation = 28, + aux_sym_source_repeat1 = 29, + aux_sym_list_repeat1 = 30, }; static const char * const ts_symbol_names[] = { @@ -69,6 +71,8 @@ static const char * const ts_symbol_names[] = { [sym_source] = "source", [sym_comment] = "comment", [sym_statement] = "statement", + [sym_closed_statement] = "closed_statement", + [sym_open_statement] = "open_statement", [sym_expression] = "expression", [sym_value] = "value", [sym_boolean] = "boolean", @@ -101,6 +105,8 @@ static const TSSymbol ts_symbol_map[] = { [sym_source] = sym_source, [sym_comment] = sym_comment, [sym_statement] = sym_statement, + [sym_closed_statement] = sym_closed_statement, + [sym_open_statement] = sym_open_statement, [sym_expression] = sym_expression, [sym_value] = sym_value, [sym_boolean] = sym_boolean, @@ -196,6 +202,14 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, + [sym_closed_statement] = { + .visible = true, + .named = true, + }, + [sym_open_statement] = { + .visible = true, + .named = true, + }, [sym_expression] = { .visible = true, .named = true, @@ -253,15 +267,21 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [11] = 11, [12] = 12, [13] = 13, - [14] = 14, + [14] = 13, [15] = 15, [16] = 16, - [17] = 17, + [17] = 16, [18] = 18, [19] = 19, [20] = 20, [21] = 21, - [22] = 22, + [22] = 9, + [23] = 8, + [24] = 11, + [25] = 25, + [26] = 26, + [27] = 27, + [28] = 28, }; static bool ts_lex(TSLexer *lexer, TSStateId state) { @@ -325,11 +345,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead == '`') ADVANCE(10); if (lookahead == '(') ADVANCE(34); if (lookahead == ')') ADVANCE(36); - if (lookahead == '+') ADVANCE(37); if (lookahead == ',') ADVANCE(35); - if (lookahead == '-') ADVANCE(38); - if (lookahead == ';') ADVANCE(15); - if (lookahead == '=') ADVANCE(39); if (lookahead == 'f') ADVANCE(1); if (lookahead == 't') ADVANCE(5); if (lookahead == '{') ADVANCE(8); @@ -524,25 +540,31 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [1] = {.lex_state = 0}, [2] = {.lex_state = 0}, [3] = {.lex_state = 0}, - [4] = {.lex_state = 9}, - [5] = {.lex_state = 9}, - [6] = {.lex_state = 9}, + [4] = {.lex_state = 0}, + [5] = {.lex_state = 0}, + [6] = {.lex_state = 0}, [7] = {.lex_state = 0}, - [8] = {.lex_state = 9}, - [9] = {.lex_state = 9}, - [10] = {.lex_state = 9}, + [8] = {.lex_state = 0}, + [9] = {.lex_state = 0}, + [10] = {.lex_state = 0}, [11] = {.lex_state = 0}, [12] = {.lex_state = 0}, [13] = {.lex_state = 9}, - [14] = {.lex_state = 0}, + [14] = {.lex_state = 9}, [15] = {.lex_state = 9}, - [16] = {.lex_state = 0}, - [17] = {.lex_state = 0}, + [16] = {.lex_state = 9}, + [17] = {.lex_state = 9}, [18] = {.lex_state = 0}, [19] = {.lex_state = 0}, [20] = {.lex_state = 0}, - [21] = {.lex_state = 13}, - [22] = {.lex_state = 0}, + [21] = {.lex_state = 9}, + [22] = {.lex_state = 9}, + [23] = {.lex_state = 9}, + [24] = {.lex_state = 9}, + [25] = {.lex_state = 9}, + [26] = {.lex_state = 0}, + [27] = {.lex_state = 13}, + [28] = {.lex_state = 0}, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { @@ -566,15 +588,17 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_EQ] = ACTIONS(1), }, [1] = { - [sym_source] = STATE(22), - [sym_comment] = STATE(2), - [sym_statement] = STATE(2), - [sym_expression] = STATE(16), - [sym_value] = STATE(19), - [sym_boolean] = STATE(5), - [sym_list] = STATE(5), - [sym_operation] = STATE(18), - [aux_sym_source_repeat1] = STATE(2), + [sym_source] = STATE(28), + [sym_comment] = STATE(3), + [sym_statement] = STATE(3), + [sym_closed_statement] = STATE(18), + [sym_open_statement] = STATE(18), + [sym_expression] = STATE(4), + [sym_value] = STATE(6), + [sym_boolean] = STATE(9), + [sym_list] = STATE(9), + [sym_operation] = STATE(7), + [aux_sym_source_repeat1] = STATE(3), [ts_builtin_sym_end] = ACTIONS(3), [anon_sym_POUND] = ACTIONS(5), [sym_identifier] = ACTIONS(7), @@ -588,15 +612,40 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_LPAREN] = ACTIONS(15), }, [2] = { - [sym_comment] = STATE(3), - [sym_statement] = STATE(3), - [sym_expression] = STATE(16), - [sym_value] = STATE(19), - [sym_boolean] = STATE(5), - [sym_list] = STATE(5), - [sym_operation] = STATE(18), - [aux_sym_source_repeat1] = STATE(3), + [sym_comment] = STATE(2), + [sym_statement] = STATE(2), + [sym_closed_statement] = STATE(18), + [sym_open_statement] = STATE(18), + [sym_expression] = STATE(4), + [sym_value] = STATE(6), + [sym_boolean] = STATE(9), + [sym_list] = STATE(9), + [sym_operation] = STATE(7), + [aux_sym_source_repeat1] = STATE(2), [ts_builtin_sym_end] = ACTIONS(17), + [anon_sym_POUND] = ACTIONS(19), + [sym_identifier] = ACTIONS(22), + [sym_float] = ACTIONS(25), + [sym_integer] = ACTIONS(28), + [sym_string] = ACTIONS(25), + [sym_function] = ACTIONS(25), + [sym_empty] = ACTIONS(25), + [anon_sym_true] = ACTIONS(31), + [anon_sym_false] = ACTIONS(31), + [anon_sym_LPAREN] = ACTIONS(34), + }, + [3] = { + [sym_comment] = STATE(2), + [sym_statement] = STATE(2), + [sym_closed_statement] = STATE(18), + [sym_open_statement] = STATE(18), + [sym_expression] = STATE(4), + [sym_value] = STATE(6), + [sym_boolean] = STATE(9), + [sym_list] = STATE(9), + [sym_operation] = STATE(7), + [aux_sym_source_repeat1] = STATE(2), + [ts_builtin_sym_end] = ACTIONS(37), [anon_sym_POUND] = ACTIONS(5), [sym_identifier] = ACTIONS(7), [sym_float] = ACTIONS(9), @@ -608,98 +657,170 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_false] = ACTIONS(13), [anon_sym_LPAREN] = ACTIONS(15), }, - [3] = { - [sym_comment] = STATE(3), - [sym_statement] = STATE(3), - [sym_expression] = STATE(16), - [sym_value] = STATE(19), - [sym_boolean] = STATE(5), - [sym_list] = STATE(5), - [sym_operation] = STATE(18), - [aux_sym_source_repeat1] = STATE(3), - [ts_builtin_sym_end] = ACTIONS(19), - [anon_sym_POUND] = ACTIONS(21), - [sym_identifier] = ACTIONS(24), - [sym_float] = ACTIONS(27), - [sym_integer] = ACTIONS(30), - [sym_string] = ACTIONS(27), - [sym_function] = ACTIONS(27), - [sym_empty] = ACTIONS(27), - [anon_sym_true] = ACTIONS(33), - [anon_sym_false] = ACTIONS(33), - [anon_sym_LPAREN] = ACTIONS(36), + [4] = { + [sym_operator] = STATE(12), + [ts_builtin_sym_end] = ACTIONS(39), + [anon_sym_POUND] = ACTIONS(39), + [sym_close] = ACTIONS(41), + [sym_identifier] = ACTIONS(43), + [sym_float] = ACTIONS(39), + [sym_integer] = ACTIONS(43), + [sym_string] = ACTIONS(39), + [sym_function] = ACTIONS(39), + [sym_empty] = ACTIONS(39), + [anon_sym_true] = ACTIONS(43), + [anon_sym_false] = ACTIONS(43), + [anon_sym_LPAREN] = ACTIONS(43), + [anon_sym_PLUS] = ACTIONS(45), + [anon_sym_DASH] = ACTIONS(45), + [anon_sym_EQ] = ACTIONS(45), + }, + [5] = { + [sym_operator] = STATE(12), + [ts_builtin_sym_end] = ACTIONS(47), + [anon_sym_POUND] = ACTIONS(47), + [sym_close] = ACTIONS(47), + [sym_identifier] = ACTIONS(49), + [sym_float] = ACTIONS(47), + [sym_integer] = ACTIONS(49), + [sym_string] = ACTIONS(47), + [sym_function] = ACTIONS(47), + [sym_empty] = ACTIONS(47), + [anon_sym_true] = ACTIONS(49), + [anon_sym_false] = ACTIONS(49), + [anon_sym_LPAREN] = ACTIONS(49), + [anon_sym_PLUS] = ACTIONS(47), + [anon_sym_DASH] = ACTIONS(47), + [anon_sym_EQ] = ACTIONS(47), }, }; static const uint16_t ts_small_parse_table[] = { [0] = 2, - ACTIONS(41), 2, + ACTIONS(53), 5, + sym_identifier, sym_integer, + anon_sym_true, + anon_sym_false, anon_sym_LPAREN, - ACTIONS(39), 12, + ACTIONS(51), 10, + ts_builtin_sym_end, + anon_sym_POUND, sym_close, sym_float, sym_string, sym_function, sym_empty, - anon_sym_true, - anon_sym_false, - anon_sym_COMMA, - anon_sym_RPAREN, anon_sym_PLUS, anon_sym_DASH, anon_sym_EQ, - [19] = 2, - ACTIONS(45), 2, + [20] = 2, + ACTIONS(53), 5, + sym_identifier, sym_integer, + anon_sym_true, + anon_sym_false, anon_sym_LPAREN, - ACTIONS(43), 12, + ACTIONS(51), 10, + ts_builtin_sym_end, + anon_sym_POUND, sym_close, sym_float, sym_string, sym_function, sym_empty, - anon_sym_true, - anon_sym_false, - anon_sym_COMMA, - anon_sym_RPAREN, anon_sym_PLUS, anon_sym_DASH, anon_sym_EQ, - [38] = 2, - ACTIONS(49), 2, + [40] = 2, + ACTIONS(57), 5, + sym_identifier, sym_integer, + anon_sym_true, + anon_sym_false, anon_sym_LPAREN, - ACTIONS(47), 12, + ACTIONS(55), 10, + ts_builtin_sym_end, + anon_sym_POUND, sym_close, sym_float, sym_string, sym_function, sym_empty, - anon_sym_true, - anon_sym_false, - anon_sym_COMMA, - anon_sym_RPAREN, anon_sym_PLUS, anon_sym_DASH, anon_sym_EQ, - [57] = 9, + [60] = 2, + ACTIONS(61), 5, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + ACTIONS(59), 10, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + anon_sym_PLUS, + anon_sym_DASH, + anon_sym_EQ, + [80] = 2, + ACTIONS(53), 5, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + ACTIONS(51), 10, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + anon_sym_PLUS, + anon_sym_DASH, + anon_sym_EQ, + [100] = 2, + ACTIONS(65), 5, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + ACTIONS(63), 10, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + anon_sym_PLUS, + anon_sym_DASH, + anon_sym_EQ, + [120] = 9, ACTIONS(7), 1, sym_identifier, ACTIONS(11), 1, sym_integer, ACTIONS(15), 1, anon_sym_LPAREN, - STATE(17), 1, + STATE(5), 1, sym_expression, - STATE(18), 1, - sym_operation, - STATE(19), 1, + STATE(6), 1, sym_value, + STATE(7), 1, + sym_operation, ACTIONS(13), 2, anon_sym_true, anon_sym_false, - STATE(5), 2, + STATE(9), 2, sym_boolean, sym_list, ACTIONS(9), 4, @@ -707,105 +828,161 @@ static const uint16_t ts_small_parse_table[] = { sym_string, sym_function, sym_empty, - [90] = 8, - ACTIONS(54), 1, + [153] = 8, + ACTIONS(69), 1, sym_integer, - ACTIONS(60), 1, + ACTIONS(73), 1, anon_sym_LPAREN, - ACTIONS(63), 1, + ACTIONS(75), 1, anon_sym_RPAREN, - STATE(8), 1, + STATE(15), 1, aux_sym_list_repeat1, - STATE(13), 1, + STATE(21), 1, sym_value, - ACTIONS(57), 2, + ACTIONS(71), 2, anon_sym_true, anon_sym_false, - STATE(5), 2, + STATE(22), 2, sym_boolean, sym_list, - ACTIONS(51), 4, + ACTIONS(67), 4, sym_float, sym_string, sym_function, sym_empty, - [120] = 8, - ACTIONS(11), 1, + [183] = 8, + ACTIONS(69), 1, sym_integer, - ACTIONS(15), 1, + ACTIONS(73), 1, anon_sym_LPAREN, - ACTIONS(67), 1, + ACTIONS(77), 1, anon_sym_RPAREN, - STATE(8), 1, + STATE(15), 1, aux_sym_list_repeat1, - STATE(13), 1, + STATE(21), 1, sym_value, - ACTIONS(65), 2, + ACTIONS(71), 2, anon_sym_true, anon_sym_false, - STATE(5), 2, + STATE(22), 2, sym_boolean, sym_list, - ACTIONS(9), 4, + ACTIONS(67), 4, sym_float, sym_string, sym_function, sym_empty, - [150] = 7, - ACTIONS(11), 1, + [213] = 8, + ACTIONS(82), 1, sym_integer, - ACTIONS(15), 1, + ACTIONS(88), 1, anon_sym_LPAREN, - STATE(9), 1, + ACTIONS(91), 1, + anon_sym_RPAREN, + STATE(15), 1, aux_sym_list_repeat1, - STATE(13), 1, + STATE(21), 1, sym_value, - ACTIONS(65), 2, + ACTIONS(85), 2, anon_sym_true, anon_sym_false, - STATE(5), 2, + STATE(22), 2, sym_boolean, sym_list, - ACTIONS(9), 4, + ACTIONS(79), 4, sym_float, sym_string, sym_function, sym_empty, - [177] = 2, - ACTIONS(71), 5, + [243] = 7, + ACTIONS(69), 1, + sym_integer, + ACTIONS(73), 1, + anon_sym_LPAREN, + STATE(14), 1, + aux_sym_list_repeat1, + STATE(21), 1, + sym_value, + ACTIONS(71), 2, + anon_sym_true, + anon_sym_false, + STATE(22), 2, + sym_boolean, + sym_list, + ACTIONS(67), 4, + sym_float, + sym_string, + sym_function, + sym_empty, + [270] = 7, + ACTIONS(69), 1, + sym_integer, + ACTIONS(73), 1, + anon_sym_LPAREN, + STATE(13), 1, + aux_sym_list_repeat1, + STATE(21), 1, + sym_value, + ACTIONS(71), 2, + anon_sym_true, + anon_sym_false, + STATE(22), 2, + sym_boolean, + sym_list, + ACTIONS(67), 4, + sym_float, + sym_string, + sym_function, + sym_empty, + [297] = 2, + ACTIONS(95), 5, sym_identifier, sym_integer, anon_sym_true, anon_sym_false, anon_sym_LPAREN, - ACTIONS(69), 6, + ACTIONS(93), 6, ts_builtin_sym_end, anon_sym_POUND, sym_float, sym_string, sym_function, sym_empty, - [193] = 2, - ACTIONS(75), 5, + [313] = 2, + ACTIONS(99), 5, sym_identifier, sym_integer, anon_sym_true, anon_sym_false, anon_sym_LPAREN, - ACTIONS(73), 6, + ACTIONS(97), 6, ts_builtin_sym_end, anon_sym_POUND, sym_float, sym_string, sym_function, sym_empty, - [209] = 3, - ACTIONS(81), 1, + [329] = 2, + ACTIONS(103), 5, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + ACTIONS(101), 6, + ts_builtin_sym_end, + anon_sym_POUND, + sym_float, + sym_string, + sym_function, + sym_empty, + [345] = 3, + ACTIONS(109), 1, anon_sym_COMMA, - ACTIONS(79), 2, + ACTIONS(107), 2, sym_integer, anon_sym_LPAREN, - ACTIONS(77), 7, + ACTIONS(105), 7, sym_float, sym_string, sym_function, @@ -813,142 +990,160 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_true, anon_sym_false, anon_sym_RPAREN, - [226] = 2, - ACTIONS(85), 4, + [362] = 2, + ACTIONS(61), 2, + sym_integer, + anon_sym_LPAREN, + ACTIONS(59), 8, sym_float, sym_string, sym_function, sym_empty, - ACTIONS(83), 5, + anon_sym_true, + anon_sym_false, + anon_sym_COMMA, + anon_sym_RPAREN, + [377] = 2, + ACTIONS(57), 2, + sym_integer, + anon_sym_LPAREN, + ACTIONS(55), 8, + sym_float, + sym_string, + sym_function, + sym_empty, + anon_sym_true, + anon_sym_false, + anon_sym_COMMA, + anon_sym_RPAREN, + [392] = 2, + ACTIONS(65), 2, + sym_integer, + anon_sym_LPAREN, + ACTIONS(63), 8, + sym_float, + sym_string, + sym_function, + sym_empty, + anon_sym_true, + anon_sym_false, + anon_sym_COMMA, + anon_sym_RPAREN, + [407] = 2, + ACTIONS(111), 2, + sym_integer, + anon_sym_LPAREN, + ACTIONS(91), 7, + sym_float, + sym_string, + sym_function, + sym_empty, + anon_sym_true, + anon_sym_false, + anon_sym_RPAREN, + [421] = 2, + ACTIONS(115), 4, + sym_float, + sym_string, + sym_function, + sym_empty, + ACTIONS(113), 5, sym_identifier, sym_integer, anon_sym_true, anon_sym_false, anon_sym_LPAREN, - [240] = 2, - ACTIONS(87), 2, - sym_integer, - anon_sym_LPAREN, - ACTIONS(63), 7, - sym_float, - sym_string, - sym_function, - sym_empty, - anon_sym_true, - anon_sym_false, - anon_sym_RPAREN, - [254] = 3, - ACTIONS(89), 1, - sym_close, - STATE(7), 1, - sym_operator, - ACTIONS(91), 3, - anon_sym_PLUS, - anon_sym_DASH, - anon_sym_EQ, - [266] = 2, - STATE(7), 1, - sym_operator, - ACTIONS(93), 4, - sym_close, - anon_sym_PLUS, - anon_sym_DASH, - anon_sym_EQ, - [276] = 1, - ACTIONS(95), 4, - sym_close, - anon_sym_PLUS, - anon_sym_DASH, - anon_sym_EQ, - [283] = 1, - ACTIONS(95), 4, - sym_close, - anon_sym_PLUS, - anon_sym_DASH, - anon_sym_EQ, - [290] = 1, - ACTIONS(95), 4, - sym_close, - anon_sym_PLUS, - anon_sym_DASH, - anon_sym_EQ, - [297] = 1, - ACTIONS(97), 1, + [435] = 1, + ACTIONS(117), 1, aux_sym_comment_token1, - [301] = 1, - ACTIONS(99), 1, + [439] = 1, + ACTIONS(119), 1, ts_builtin_sym_end, }; static const uint32_t ts_small_parse_table_map[] = { - [SMALL_STATE(4)] = 0, - [SMALL_STATE(5)] = 19, - [SMALL_STATE(6)] = 38, - [SMALL_STATE(7)] = 57, - [SMALL_STATE(8)] = 90, - [SMALL_STATE(9)] = 120, - [SMALL_STATE(10)] = 150, - [SMALL_STATE(11)] = 177, - [SMALL_STATE(12)] = 193, - [SMALL_STATE(13)] = 209, - [SMALL_STATE(14)] = 226, - [SMALL_STATE(15)] = 240, - [SMALL_STATE(16)] = 254, - [SMALL_STATE(17)] = 266, - [SMALL_STATE(18)] = 276, - [SMALL_STATE(19)] = 283, - [SMALL_STATE(20)] = 290, - [SMALL_STATE(21)] = 297, - [SMALL_STATE(22)] = 301, + [SMALL_STATE(6)] = 0, + [SMALL_STATE(7)] = 20, + [SMALL_STATE(8)] = 40, + [SMALL_STATE(9)] = 60, + [SMALL_STATE(10)] = 80, + [SMALL_STATE(11)] = 100, + [SMALL_STATE(12)] = 120, + [SMALL_STATE(13)] = 153, + [SMALL_STATE(14)] = 183, + [SMALL_STATE(15)] = 213, + [SMALL_STATE(16)] = 243, + [SMALL_STATE(17)] = 270, + [SMALL_STATE(18)] = 297, + [SMALL_STATE(19)] = 313, + [SMALL_STATE(20)] = 329, + [SMALL_STATE(21)] = 345, + [SMALL_STATE(22)] = 362, + [SMALL_STATE(23)] = 377, + [SMALL_STATE(24)] = 392, + [SMALL_STATE(25)] = 407, + [SMALL_STATE(26)] = 421, + [SMALL_STATE(27)] = 435, + [SMALL_STATE(28)] = 439, }; static const TSParseActionEntry ts_parse_actions[] = { [0] = {.entry = {.count = 0, .reusable = false}}, [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(), [3] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source, 0), - [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), - [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(20), - [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), - [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(5), - [13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(6), - [15] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10), - [17] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source, 1), - [19] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), - [21] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(21), - [24] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(20), - [27] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(5), - [30] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(5), - [33] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(6), - [36] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(10), - [39] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_list, 3), - [41] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_list, 3), - [43] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_value, 1), - [45] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_value, 1), - [47] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_boolean, 1), - [49] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_boolean, 1), - [51] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(5), - [54] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(5), - [57] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(6), - [60] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(10), - [63] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), - [65] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), - [67] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), - [69] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_statement, 2), - [71] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_statement, 2), - [73] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_comment, 2), - [75] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_comment, 2), - [77] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 1), - [79] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 1), - [81] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), - [83] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_operator, 1), - [85] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_operator, 1), - [87] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), - [89] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), - [91] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), - [93] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_operation, 3), - [95] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 1), - [97] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), - [99] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), + [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10), + [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), + [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9), + [13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8), + [15] = {.entry = {.count = 1, .reusable = false}}, SHIFT(16), + [17] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), + [19] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(27), + [22] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(10), + [25] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(9), + [28] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(9), + [31] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(8), + [34] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(16), + [37] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source, 1), + [39] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_open_statement, 1), + [41] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), + [43] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_open_statement, 1), + [45] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), + [47] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_operation, 3), + [49] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_operation, 3), + [51] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 1), + [53] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 1), + [55] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_boolean, 1), + [57] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_boolean, 1), + [59] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_value, 1), + [61] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_value, 1), + [63] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_list, 3), + [65] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_list, 3), + [67] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), + [69] = {.entry = {.count = 1, .reusable = false}}, SHIFT(22), + [71] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), + [73] = {.entry = {.count = 1, .reusable = false}}, SHIFT(17), + [75] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24), + [77] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), + [79] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(22), + [82] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(22), + [85] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(23), + [88] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(17), + [91] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), + [93] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_statement, 1), + [95] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_statement, 1), + [97] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_comment, 2), + [99] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_comment, 2), + [101] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_closed_statement, 2), + [103] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_closed_statement, 2), + [105] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 1), + [107] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 1), + [109] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), + [111] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), + [113] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_operator, 1), + [115] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_operator, 1), + [117] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), + [119] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), }; #ifdef __cplusplus