Implement closed and open statements

This commit is contained in:
Jeff 2023-09-29 00:17:16 -04:00
parent 19e1316508
commit faec13438e
5 changed files with 507 additions and 249 deletions

@ -1 +1 @@
Subproject commit adbd69b17ced1fb95282032211ac6dd0d7591943 Subproject commit cdf79f87638100c641ff76fdb21294eadf3a32b0

View File

@ -9,7 +9,14 @@ module.exports = grammar({
comment: $ => seq('#', /.*/), comment: $ => seq('#', /.*/),
statement: $ => seq($.expression, $.close), statement: $ => choice(
$.closed_statement,
$.open_statement,
),
closed_statement: $ => seq($.expression, $.close),
open_statement: $ => seq($.expression),
expression: $ => choice( expression: $ => choice(
prec(0, $.value), prec(0, $.value),

View File

@ -31,6 +31,19 @@
] ]
}, },
"statement": { "statement": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "closed_statement"
},
{
"type": "SYMBOL",
"name": "open_statement"
}
]
},
"closed_statement": {
"type": "SEQ", "type": "SEQ",
"members": [ "members": [
{ {
@ -43,6 +56,15 @@
} }
] ]
}, },
"open_statement": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "expression"
}
]
},
"expression": { "expression": {
"type": "CHOICE", "type": "CHOICE",
"members": [ "members": [

View File

@ -4,6 +4,25 @@
"named": true, "named": true,
"fields": {} "fields": {}
}, },
{
"type": "closed_statement",
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "close",
"named": true
},
{
"type": "expression",
"named": true
}
]
}
},
{ {
"type": "comment", "type": "comment",
"named": true, "named": true,
@ -47,6 +66,21 @@
] ]
} }
}, },
{
"type": "open_statement",
"named": true,
"fields": {},
"children": {
"multiple": false,
"required": true,
"types": [
{
"type": "expression",
"named": true
}
]
}
},
{ {
"type": "operation", "type": "operation",
"named": true, "named": true,
@ -95,15 +129,15 @@
"named": true, "named": true,
"fields": {}, "fields": {},
"children": { "children": {
"multiple": true, "multiple": false,
"required": true, "required": true,
"types": [ "types": [
{ {
"type": "close", "type": "closed_statement",
"named": true "named": true
}, },
{ {
"type": "expression", "type": "open_statement",
"named": true "named": true
} }
] ]

View File

@ -6,9 +6,9 @@
#endif #endif
#define LANGUAGE_VERSION 14 #define LANGUAGE_VERSION 14
#define STATE_COUNT 23 #define STATE_COUNT 29
#define LARGE_STATE_COUNT 4 #define LARGE_STATE_COUNT 6
#define SYMBOL_COUNT 29 #define SYMBOL_COUNT 31
#define ALIAS_COUNT 0 #define ALIAS_COUNT 0
#define TOKEN_COUNT 18 #define TOKEN_COUNT 18
#define EXTERNAL_TOKEN_COUNT 0 #define EXTERNAL_TOKEN_COUNT 0
@ -37,14 +37,16 @@ enum {
sym_source = 18, sym_source = 18,
sym_comment = 19, sym_comment = 19,
sym_statement = 20, sym_statement = 20,
sym_expression = 21, sym_closed_statement = 21,
sym_value = 22, sym_open_statement = 22,
sym_boolean = 23, sym_expression = 23,
sym_list = 24, sym_value = 24,
sym_operator = 25, sym_boolean = 25,
sym_operation = 26, sym_list = 26,
aux_sym_source_repeat1 = 27, sym_operator = 27,
aux_sym_list_repeat1 = 28, sym_operation = 28,
aux_sym_source_repeat1 = 29,
aux_sym_list_repeat1 = 30,
}; };
static const char * const ts_symbol_names[] = { static const char * const ts_symbol_names[] = {
@ -69,6 +71,8 @@ static const char * const ts_symbol_names[] = {
[sym_source] = "source", [sym_source] = "source",
[sym_comment] = "comment", [sym_comment] = "comment",
[sym_statement] = "statement", [sym_statement] = "statement",
[sym_closed_statement] = "closed_statement",
[sym_open_statement] = "open_statement",
[sym_expression] = "expression", [sym_expression] = "expression",
[sym_value] = "value", [sym_value] = "value",
[sym_boolean] = "boolean", [sym_boolean] = "boolean",
@ -101,6 +105,8 @@ static const TSSymbol ts_symbol_map[] = {
[sym_source] = sym_source, [sym_source] = sym_source,
[sym_comment] = sym_comment, [sym_comment] = sym_comment,
[sym_statement] = sym_statement, [sym_statement] = sym_statement,
[sym_closed_statement] = sym_closed_statement,
[sym_open_statement] = sym_open_statement,
[sym_expression] = sym_expression, [sym_expression] = sym_expression,
[sym_value] = sym_value, [sym_value] = sym_value,
[sym_boolean] = sym_boolean, [sym_boolean] = sym_boolean,
@ -196,6 +202,14 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
.visible = true, .visible = true,
.named = true, .named = true,
}, },
[sym_closed_statement] = {
.visible = true,
.named = true,
},
[sym_open_statement] = {
.visible = true,
.named = true,
},
[sym_expression] = { [sym_expression] = {
.visible = true, .visible = true,
.named = true, .named = true,
@ -253,15 +267,21 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = {
[11] = 11, [11] = 11,
[12] = 12, [12] = 12,
[13] = 13, [13] = 13,
[14] = 14, [14] = 13,
[15] = 15, [15] = 15,
[16] = 16, [16] = 16,
[17] = 17, [17] = 16,
[18] = 18, [18] = 18,
[19] = 19, [19] = 19,
[20] = 20, [20] = 20,
[21] = 21, [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) { static bool ts_lex(TSLexer *lexer, TSStateId state) {
@ -325,11 +345,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
lookahead == '`') ADVANCE(10); lookahead == '`') ADVANCE(10);
if (lookahead == '(') ADVANCE(34); if (lookahead == '(') ADVANCE(34);
if (lookahead == ')') ADVANCE(36); if (lookahead == ')') ADVANCE(36);
if (lookahead == '+') ADVANCE(37);
if (lookahead == ',') ADVANCE(35); if (lookahead == ',') ADVANCE(35);
if (lookahead == '-') ADVANCE(38);
if (lookahead == ';') ADVANCE(15);
if (lookahead == '=') ADVANCE(39);
if (lookahead == 'f') ADVANCE(1); if (lookahead == 'f') ADVANCE(1);
if (lookahead == 't') ADVANCE(5); if (lookahead == 't') ADVANCE(5);
if (lookahead == '{') ADVANCE(8); if (lookahead == '{') ADVANCE(8);
@ -524,25 +540,31 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = {
[1] = {.lex_state = 0}, [1] = {.lex_state = 0},
[2] = {.lex_state = 0}, [2] = {.lex_state = 0},
[3] = {.lex_state = 0}, [3] = {.lex_state = 0},
[4] = {.lex_state = 9}, [4] = {.lex_state = 0},
[5] = {.lex_state = 9}, [5] = {.lex_state = 0},
[6] = {.lex_state = 9}, [6] = {.lex_state = 0},
[7] = {.lex_state = 0}, [7] = {.lex_state = 0},
[8] = {.lex_state = 9}, [8] = {.lex_state = 0},
[9] = {.lex_state = 9}, [9] = {.lex_state = 0},
[10] = {.lex_state = 9}, [10] = {.lex_state = 0},
[11] = {.lex_state = 0}, [11] = {.lex_state = 0},
[12] = {.lex_state = 0}, [12] = {.lex_state = 0},
[13] = {.lex_state = 9}, [13] = {.lex_state = 9},
[14] = {.lex_state = 0}, [14] = {.lex_state = 9},
[15] = {.lex_state = 9}, [15] = {.lex_state = 9},
[16] = {.lex_state = 0}, [16] = {.lex_state = 9},
[17] = {.lex_state = 0}, [17] = {.lex_state = 9},
[18] = {.lex_state = 0}, [18] = {.lex_state = 0},
[19] = {.lex_state = 0}, [19] = {.lex_state = 0},
[20] = {.lex_state = 0}, [20] = {.lex_state = 0},
[21] = {.lex_state = 13}, [21] = {.lex_state = 9},
[22] = {.lex_state = 0}, [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] = { 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), [anon_sym_EQ] = ACTIONS(1),
}, },
[1] = { [1] = {
[sym_source] = STATE(22), [sym_source] = STATE(28),
[sym_comment] = STATE(2), [sym_comment] = STATE(3),
[sym_statement] = STATE(2), [sym_statement] = STATE(3),
[sym_expression] = STATE(16), [sym_closed_statement] = STATE(18),
[sym_value] = STATE(19), [sym_open_statement] = STATE(18),
[sym_boolean] = STATE(5), [sym_expression] = STATE(4),
[sym_list] = STATE(5), [sym_value] = STATE(6),
[sym_operation] = STATE(18), [sym_boolean] = STATE(9),
[aux_sym_source_repeat1] = STATE(2), [sym_list] = STATE(9),
[sym_operation] = STATE(7),
[aux_sym_source_repeat1] = STATE(3),
[ts_builtin_sym_end] = ACTIONS(3), [ts_builtin_sym_end] = ACTIONS(3),
[anon_sym_POUND] = ACTIONS(5), [anon_sym_POUND] = ACTIONS(5),
[sym_identifier] = ACTIONS(7), [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), [anon_sym_LPAREN] = ACTIONS(15),
}, },
[2] = { [2] = {
[sym_comment] = STATE(3), [sym_comment] = STATE(2),
[sym_statement] = STATE(3), [sym_statement] = STATE(2),
[sym_expression] = STATE(16), [sym_closed_statement] = STATE(18),
[sym_value] = STATE(19), [sym_open_statement] = STATE(18),
[sym_boolean] = STATE(5), [sym_expression] = STATE(4),
[sym_list] = STATE(5), [sym_value] = STATE(6),
[sym_operation] = STATE(18), [sym_boolean] = STATE(9),
[aux_sym_source_repeat1] = STATE(3), [sym_list] = STATE(9),
[sym_operation] = STATE(7),
[aux_sym_source_repeat1] = STATE(2),
[ts_builtin_sym_end] = ACTIONS(17), [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), [anon_sym_POUND] = ACTIONS(5),
[sym_identifier] = ACTIONS(7), [sym_identifier] = ACTIONS(7),
[sym_float] = ACTIONS(9), [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_false] = ACTIONS(13),
[anon_sym_LPAREN] = ACTIONS(15), [anon_sym_LPAREN] = ACTIONS(15),
}, },
[3] = { [4] = {
[sym_comment] = STATE(3), [sym_operator] = STATE(12),
[sym_statement] = STATE(3), [ts_builtin_sym_end] = ACTIONS(39),
[sym_expression] = STATE(16), [anon_sym_POUND] = ACTIONS(39),
[sym_value] = STATE(19), [sym_close] = ACTIONS(41),
[sym_boolean] = STATE(5), [sym_identifier] = ACTIONS(43),
[sym_list] = STATE(5), [sym_float] = ACTIONS(39),
[sym_operation] = STATE(18), [sym_integer] = ACTIONS(43),
[aux_sym_source_repeat1] = STATE(3), [sym_string] = ACTIONS(39),
[ts_builtin_sym_end] = ACTIONS(19), [sym_function] = ACTIONS(39),
[anon_sym_POUND] = ACTIONS(21), [sym_empty] = ACTIONS(39),
[sym_identifier] = ACTIONS(24), [anon_sym_true] = ACTIONS(43),
[sym_float] = ACTIONS(27), [anon_sym_false] = ACTIONS(43),
[sym_integer] = ACTIONS(30), [anon_sym_LPAREN] = ACTIONS(43),
[sym_string] = ACTIONS(27), [anon_sym_PLUS] = ACTIONS(45),
[sym_function] = ACTIONS(27), [anon_sym_DASH] = ACTIONS(45),
[sym_empty] = ACTIONS(27), [anon_sym_EQ] = ACTIONS(45),
[anon_sym_true] = ACTIONS(33), },
[anon_sym_false] = ACTIONS(33), [5] = {
[anon_sym_LPAREN] = ACTIONS(36), [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[] = { static const uint16_t ts_small_parse_table[] = {
[0] = 2, [0] = 2,
ACTIONS(41), 2, ACTIONS(53), 5,
sym_identifier,
sym_integer, sym_integer,
anon_sym_true,
anon_sym_false,
anon_sym_LPAREN, anon_sym_LPAREN,
ACTIONS(39), 12, ACTIONS(51), 10,
ts_builtin_sym_end,
anon_sym_POUND,
sym_close, sym_close,
sym_float, sym_float,
sym_string, sym_string,
sym_function, sym_function,
sym_empty, sym_empty,
anon_sym_true,
anon_sym_false,
anon_sym_COMMA,
anon_sym_RPAREN,
anon_sym_PLUS, anon_sym_PLUS,
anon_sym_DASH, anon_sym_DASH,
anon_sym_EQ, anon_sym_EQ,
[19] = 2, [20] = 2,
ACTIONS(45), 2, ACTIONS(53), 5,
sym_identifier,
sym_integer, sym_integer,
anon_sym_true,
anon_sym_false,
anon_sym_LPAREN, anon_sym_LPAREN,
ACTIONS(43), 12, ACTIONS(51), 10,
ts_builtin_sym_end,
anon_sym_POUND,
sym_close, sym_close,
sym_float, sym_float,
sym_string, sym_string,
sym_function, sym_function,
sym_empty, sym_empty,
anon_sym_true,
anon_sym_false,
anon_sym_COMMA,
anon_sym_RPAREN,
anon_sym_PLUS, anon_sym_PLUS,
anon_sym_DASH, anon_sym_DASH,
anon_sym_EQ, anon_sym_EQ,
[38] = 2, [40] = 2,
ACTIONS(49), 2, ACTIONS(57), 5,
sym_identifier,
sym_integer, sym_integer,
anon_sym_true,
anon_sym_false,
anon_sym_LPAREN, anon_sym_LPAREN,
ACTIONS(47), 12, ACTIONS(55), 10,
ts_builtin_sym_end,
anon_sym_POUND,
sym_close, sym_close,
sym_float, sym_float,
sym_string, sym_string,
sym_function, sym_function,
sym_empty, sym_empty,
anon_sym_true,
anon_sym_false,
anon_sym_COMMA,
anon_sym_RPAREN,
anon_sym_PLUS, anon_sym_PLUS,
anon_sym_DASH, anon_sym_DASH,
anon_sym_EQ, 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, ACTIONS(7), 1,
sym_identifier, sym_identifier,
ACTIONS(11), 1, ACTIONS(11), 1,
sym_integer, sym_integer,
ACTIONS(15), 1, ACTIONS(15), 1,
anon_sym_LPAREN, anon_sym_LPAREN,
STATE(17), 1, STATE(5), 1,
sym_expression, sym_expression,
STATE(18), 1, STATE(6), 1,
sym_operation,
STATE(19), 1,
sym_value, sym_value,
STATE(7), 1,
sym_operation,
ACTIONS(13), 2, ACTIONS(13), 2,
anon_sym_true, anon_sym_true,
anon_sym_false, anon_sym_false,
STATE(5), 2, STATE(9), 2,
sym_boolean, sym_boolean,
sym_list, sym_list,
ACTIONS(9), 4, ACTIONS(9), 4,
@ -707,105 +828,161 @@ static const uint16_t ts_small_parse_table[] = {
sym_string, sym_string,
sym_function, sym_function,
sym_empty, sym_empty,
[90] = 8, [153] = 8,
ACTIONS(54), 1, ACTIONS(69), 1,
sym_integer, sym_integer,
ACTIONS(60), 1, ACTIONS(73), 1,
anon_sym_LPAREN, anon_sym_LPAREN,
ACTIONS(63), 1, ACTIONS(75), 1,
anon_sym_RPAREN, anon_sym_RPAREN,
STATE(8), 1, STATE(15), 1,
aux_sym_list_repeat1, aux_sym_list_repeat1,
STATE(13), 1, STATE(21), 1,
sym_value, sym_value,
ACTIONS(57), 2, ACTIONS(71), 2,
anon_sym_true, anon_sym_true,
anon_sym_false, anon_sym_false,
STATE(5), 2, STATE(22), 2,
sym_boolean, sym_boolean,
sym_list, sym_list,
ACTIONS(51), 4, ACTIONS(67), 4,
sym_float, sym_float,
sym_string, sym_string,
sym_function, sym_function,
sym_empty, sym_empty,
[120] = 8, [183] = 8,
ACTIONS(11), 1, ACTIONS(69), 1,
sym_integer, sym_integer,
ACTIONS(15), 1, ACTIONS(73), 1,
anon_sym_LPAREN, anon_sym_LPAREN,
ACTIONS(67), 1, ACTIONS(77), 1,
anon_sym_RPAREN, anon_sym_RPAREN,
STATE(8), 1, STATE(15), 1,
aux_sym_list_repeat1, aux_sym_list_repeat1,
STATE(13), 1, STATE(21), 1,
sym_value, sym_value,
ACTIONS(65), 2, ACTIONS(71), 2,
anon_sym_true, anon_sym_true,
anon_sym_false, anon_sym_false,
STATE(5), 2, STATE(22), 2,
sym_boolean, sym_boolean,
sym_list, sym_list,
ACTIONS(9), 4, ACTIONS(67), 4,
sym_float, sym_float,
sym_string, sym_string,
sym_function, sym_function,
sym_empty, sym_empty,
[150] = 7, [213] = 8,
ACTIONS(11), 1, ACTIONS(82), 1,
sym_integer, sym_integer,
ACTIONS(15), 1, ACTIONS(88), 1,
anon_sym_LPAREN, anon_sym_LPAREN,
STATE(9), 1, ACTIONS(91), 1,
anon_sym_RPAREN,
STATE(15), 1,
aux_sym_list_repeat1, aux_sym_list_repeat1,
STATE(13), 1, STATE(21), 1,
sym_value, sym_value,
ACTIONS(65), 2, ACTIONS(85), 2,
anon_sym_true, anon_sym_true,
anon_sym_false, anon_sym_false,
STATE(5), 2, STATE(22), 2,
sym_boolean, sym_boolean,
sym_list, sym_list,
ACTIONS(9), 4, ACTIONS(79), 4,
sym_float, sym_float,
sym_string, sym_string,
sym_function, sym_function,
sym_empty, sym_empty,
[177] = 2, [243] = 7,
ACTIONS(71), 5, 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_identifier,
sym_integer, sym_integer,
anon_sym_true, anon_sym_true,
anon_sym_false, anon_sym_false,
anon_sym_LPAREN, anon_sym_LPAREN,
ACTIONS(69), 6, ACTIONS(93), 6,
ts_builtin_sym_end, ts_builtin_sym_end,
anon_sym_POUND, anon_sym_POUND,
sym_float, sym_float,
sym_string, sym_string,
sym_function, sym_function,
sym_empty, sym_empty,
[193] = 2, [313] = 2,
ACTIONS(75), 5, ACTIONS(99), 5,
sym_identifier, sym_identifier,
sym_integer, sym_integer,
anon_sym_true, anon_sym_true,
anon_sym_false, anon_sym_false,
anon_sym_LPAREN, anon_sym_LPAREN,
ACTIONS(73), 6, ACTIONS(97), 6,
ts_builtin_sym_end, ts_builtin_sym_end,
anon_sym_POUND, anon_sym_POUND,
sym_float, sym_float,
sym_string, sym_string,
sym_function, sym_function,
sym_empty, sym_empty,
[209] = 3, [329] = 2,
ACTIONS(81), 1, 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, anon_sym_COMMA,
ACTIONS(79), 2, ACTIONS(107), 2,
sym_integer, sym_integer,
anon_sym_LPAREN, anon_sym_LPAREN,
ACTIONS(77), 7, ACTIONS(105), 7,
sym_float, sym_float,
sym_string, sym_string,
sym_function, sym_function,
@ -813,142 +990,160 @@ static const uint16_t ts_small_parse_table[] = {
anon_sym_true, anon_sym_true,
anon_sym_false, anon_sym_false,
anon_sym_RPAREN, anon_sym_RPAREN,
[226] = 2, [362] = 2,
ACTIONS(85), 4, ACTIONS(61), 2,
sym_integer,
anon_sym_LPAREN,
ACTIONS(59), 8,
sym_float, sym_float,
sym_string, sym_string,
sym_function, sym_function,
sym_empty, 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_identifier,
sym_integer, sym_integer,
anon_sym_true, anon_sym_true,
anon_sym_false, anon_sym_false,
anon_sym_LPAREN, anon_sym_LPAREN,
[240] = 2, [435] = 1,
ACTIONS(87), 2, ACTIONS(117), 1,
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,
aux_sym_comment_token1, aux_sym_comment_token1,
[301] = 1, [439] = 1,
ACTIONS(99), 1, ACTIONS(119), 1,
ts_builtin_sym_end, ts_builtin_sym_end,
}; };
static const uint32_t ts_small_parse_table_map[] = { static const uint32_t ts_small_parse_table_map[] = {
[SMALL_STATE(4)] = 0, [SMALL_STATE(6)] = 0,
[SMALL_STATE(5)] = 19, [SMALL_STATE(7)] = 20,
[SMALL_STATE(6)] = 38, [SMALL_STATE(8)] = 40,
[SMALL_STATE(7)] = 57, [SMALL_STATE(9)] = 60,
[SMALL_STATE(8)] = 90, [SMALL_STATE(10)] = 80,
[SMALL_STATE(9)] = 120, [SMALL_STATE(11)] = 100,
[SMALL_STATE(10)] = 150, [SMALL_STATE(12)] = 120,
[SMALL_STATE(11)] = 177, [SMALL_STATE(13)] = 153,
[SMALL_STATE(12)] = 193, [SMALL_STATE(14)] = 183,
[SMALL_STATE(13)] = 209, [SMALL_STATE(15)] = 213,
[SMALL_STATE(14)] = 226, [SMALL_STATE(16)] = 243,
[SMALL_STATE(15)] = 240, [SMALL_STATE(17)] = 270,
[SMALL_STATE(16)] = 254, [SMALL_STATE(18)] = 297,
[SMALL_STATE(17)] = 266, [SMALL_STATE(19)] = 313,
[SMALL_STATE(18)] = 276, [SMALL_STATE(20)] = 329,
[SMALL_STATE(19)] = 283, [SMALL_STATE(21)] = 345,
[SMALL_STATE(20)] = 290, [SMALL_STATE(22)] = 362,
[SMALL_STATE(21)] = 297, [SMALL_STATE(23)] = 377,
[SMALL_STATE(22)] = 301, [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[] = { static const TSParseActionEntry ts_parse_actions[] = {
[0] = {.entry = {.count = 0, .reusable = false}}, [0] = {.entry = {.count = 0, .reusable = false}},
[1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(), [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(),
[3] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source, 0), [3] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source, 0),
[5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27),
[7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(20), [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10),
[9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9),
[11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(5), [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9),
[13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(6), [13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8),
[15] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10), [15] = {.entry = {.count = 1, .reusable = false}}, SHIFT(16),
[17] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source, 1), [17] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2),
[19] = {.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),
[21] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(21), [22] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(10),
[24] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(20), [25] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(9),
[27] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(5), [28] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(9),
[30] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(5), [31] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(8),
[33] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(6), [34] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(16),
[36] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(10), [37] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source, 1),
[39] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_list, 3), [39] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_open_statement, 1),
[41] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_list, 3), [41] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20),
[43] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_value, 1), [43] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_open_statement, 1),
[45] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_value, 1), [45] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26),
[47] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_boolean, 1), [47] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_operation, 3),
[49] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_boolean, 1), [49] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_operation, 3),
[51] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(5), [51] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 1),
[54] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(5), [53] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 1),
[57] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(6), [55] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_boolean, 1),
[60] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(10), [57] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_boolean, 1),
[63] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), [59] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_value, 1),
[65] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), [61] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_value, 1),
[67] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), [63] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_list, 3),
[69] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_statement, 2), [65] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_list, 3),
[71] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_statement, 2), [67] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22),
[73] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_comment, 2), [69] = {.entry = {.count = 1, .reusable = false}}, SHIFT(22),
[75] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_comment, 2), [71] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23),
[77] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 1), [73] = {.entry = {.count = 1, .reusable = false}}, SHIFT(17),
[79] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 1), [75] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24),
[81] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), [77] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11),
[83] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_operator, 1), [79] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(22),
[85] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_operator, 1), [82] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(22),
[87] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), [85] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(23),
[89] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), [88] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(17),
[91] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), [91] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2),
[93] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_operation, 3), [93] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_statement, 1),
[95] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 1), [95] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_statement, 1),
[97] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), [97] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_comment, 2),
[99] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), [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 #ifdef __cplusplus