diff --git a/binding.gyp b/binding.gyp index 7480a49..557b277 100644 --- a/binding.gyp +++ b/binding.gyp @@ -1,7 +1,7 @@ { "targets": [ { - "target_name": "tree_sitter_Dust_binding", + "target_name": "tree_sitter_dust_binding", "include_dirs": [ " prec.right(seq('#', /.*/, optional('#'))), + comment: $ => prec.left(seq(token('#'), /.*/, optional(token('#')))), statement: $ => choice( $.closed_statement, @@ -16,12 +16,13 @@ module.exports = grammar({ closed_statement: $ => seq($.expression, $.close), - open_statement: $ => seq($.expression), + open_statement: $ => prec.left(seq($.expression)), expression: $ => choice( prec(0, $.value), prec(1, $.identifier), prec(2, $.operation), + prec(3, $.control_flow), ), close: $ => ";", @@ -59,16 +60,24 @@ module.exports = grammar({ ')' ), - operator: $ => choice( + operator: $ => token(choice( '+', '-', '=', - ), + )), operation: $ => prec.left(seq( $.expression, $.operator, $.expression, )), + + control_flow: $ => prec.right(seq( + 'if', + $.expression, + 'then', + $.statement, + optional(seq('else', $.statement)) + )), } }); diff --git a/src/grammar.json b/src/grammar.json index 9801b0b..898b8b3 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -18,14 +18,17 @@ } }, "comment": { - "type": "PREC_RIGHT", + "type": "PREC_LEFT", "value": 0, "content": { "type": "SEQ", "members": [ { - "type": "STRING", - "value": "#" + "type": "TOKEN", + "content": { + "type": "STRING", + "value": "#" + } }, { "type": "PATTERN", @@ -35,8 +38,11 @@ "type": "CHOICE", "members": [ { - "type": "STRING", - "value": "#" + "type": "TOKEN", + "content": { + "type": "STRING", + "value": "#" + } }, { "type": "BLANK" @@ -73,13 +79,17 @@ ] }, "open_statement": { - "type": "SEQ", - "members": [ - { - "type": "SYMBOL", - "name": "expression" - } - ] + "type": "PREC_LEFT", + "value": 0, + "content": { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "expression" + } + ] + } }, "expression": { "type": "CHOICE", @@ -107,6 +117,14 @@ "type": "SYMBOL", "name": "operation" } + }, + { + "type": "PREC", + "value": 3, + "content": { + "type": "SYMBOL", + "name": "control_flow" + } } ] }, @@ -222,21 +240,24 @@ ] }, "operator": { - "type": "CHOICE", - "members": [ - { - "type": "STRING", - "value": "+" - }, - { - "type": "STRING", - "value": "-" - }, - { - "type": "STRING", - "value": "=" - } - ] + "type": "TOKEN", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "+" + }, + { + "type": "STRING", + "value": "-" + }, + { + "type": "STRING", + "value": "=" + } + ] + } }, "operation": { "type": "PREC_LEFT", @@ -258,6 +279,52 @@ } ] } + }, + "control_flow": { + "type": "PREC_RIGHT", + "value": 0, + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "if" + }, + { + "type": "SYMBOL", + "name": "expression" + }, + { + "type": "STRING", + "value": "then" + }, + { + "type": "SYMBOL", + "name": "statement" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "else" + }, + { + "type": "SYMBOL", + "name": "statement" + } + ] + }, + { + "type": "BLANK" + } + ] + } + ] + } } }, "extras": [ diff --git a/src/node-types.json b/src/node-types.json index 8aa0cb3..6082977 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -28,6 +28,25 @@ "named": true, "fields": {} }, + { + "type": "control_flow", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "expression", + "named": true + }, + { + "type": "statement", + "named": true + } + ] + } + }, { "type": "expression", "named": true, @@ -36,6 +55,10 @@ "multiple": false, "required": true, "types": [ + { + "type": "control_flow", + "named": true + }, { "type": "identifier", "named": true @@ -100,11 +123,6 @@ ] } }, - { - "type": "operator", - "named": true, - "fields": {} - }, { "type": "source", "named": true, @@ -194,26 +212,18 @@ "type": ")", "named": false }, - { - "type": "+", - "named": false - }, { "type": ",", "named": false }, - { - "type": "-", - "named": false - }, - { - "type": "=", - "named": false - }, { "type": "close", "named": true }, + { + "type": "else", + "named": false + }, { "type": "empty", "named": true @@ -234,14 +244,26 @@ "type": "identifier", "named": true }, + { + "type": "if", + "named": false + }, { "type": "integer", "named": true }, + { + "type": "operator", + "named": true + }, { "type": "string", "named": true }, + { + "type": "then", + "named": false + }, { "type": "true", "named": false diff --git a/src/parser.c b/src/parser.c index 2675ba4..3e7df30 100644 --- a/src/parser.c +++ b/src/parser.c @@ -6,14 +6,14 @@ #endif #define LANGUAGE_VERSION 14 -#define STATE_COUNT 30 -#define LARGE_STATE_COUNT 6 -#define SYMBOL_COUNT 31 +#define STATE_COUNT 75 +#define LARGE_STATE_COUNT 12 +#define SYMBOL_COUNT 32 #define ALIAS_COUNT 0 -#define TOKEN_COUNT 18 +#define TOKEN_COUNT 19 #define EXTERNAL_TOKEN_COUNT 0 #define FIELD_COUNT 0 -#define MAX_ALIAS_SEQUENCE_LENGTH 3 +#define MAX_ALIAS_SEQUENCE_LENGTH 6 #define PRODUCTION_ID_COUNT 1 enum { @@ -31,22 +31,23 @@ enum { anon_sym_LPAREN = 12, anon_sym_COMMA = 13, anon_sym_RPAREN = 14, - anon_sym_PLUS = 15, - anon_sym_DASH = 16, - anon_sym_EQ = 17, - sym_source = 18, - sym_comment = 19, - sym_statement = 20, - sym_closed_statement = 21, - sym_open_statement = 22, - sym_expression = 23, - sym_value = 24, - sym_boolean = 25, - sym_list = 26, - sym_operator = 27, + sym_operator = 15, + anon_sym_if = 16, + anon_sym_then = 17, + anon_sym_else = 18, + sym_source = 19, + sym_comment = 20, + sym_statement = 21, + sym_closed_statement = 22, + sym_open_statement = 23, + sym_expression = 24, + sym_value = 25, + sym_boolean = 26, + sym_list = 27, sym_operation = 28, - aux_sym_source_repeat1 = 29, - aux_sym_list_repeat1 = 30, + sym_control_flow = 29, + aux_sym_source_repeat1 = 30, + aux_sym_list_repeat1 = 31, }; static const char * const ts_symbol_names[] = { @@ -65,9 +66,10 @@ static const char * const ts_symbol_names[] = { [anon_sym_LPAREN] = "(", [anon_sym_COMMA] = ",", [anon_sym_RPAREN] = ")", - [anon_sym_PLUS] = "+", - [anon_sym_DASH] = "-", - [anon_sym_EQ] = "=", + [sym_operator] = "operator", + [anon_sym_if] = "if", + [anon_sym_then] = "then", + [anon_sym_else] = "else", [sym_source] = "source", [sym_comment] = "comment", [sym_statement] = "statement", @@ -77,8 +79,8 @@ static const char * const ts_symbol_names[] = { [sym_value] = "value", [sym_boolean] = "boolean", [sym_list] = "list", - [sym_operator] = "operator", [sym_operation] = "operation", + [sym_control_flow] = "control_flow", [aux_sym_source_repeat1] = "source_repeat1", [aux_sym_list_repeat1] = "list_repeat1", }; @@ -99,9 +101,10 @@ static const TSSymbol ts_symbol_map[] = { [anon_sym_LPAREN] = anon_sym_LPAREN, [anon_sym_COMMA] = anon_sym_COMMA, [anon_sym_RPAREN] = anon_sym_RPAREN, - [anon_sym_PLUS] = anon_sym_PLUS, - [anon_sym_DASH] = anon_sym_DASH, - [anon_sym_EQ] = anon_sym_EQ, + [sym_operator] = sym_operator, + [anon_sym_if] = anon_sym_if, + [anon_sym_then] = anon_sym_then, + [anon_sym_else] = anon_sym_else, [sym_source] = sym_source, [sym_comment] = sym_comment, [sym_statement] = sym_statement, @@ -111,8 +114,8 @@ static const TSSymbol ts_symbol_map[] = { [sym_value] = sym_value, [sym_boolean] = sym_boolean, [sym_list] = sym_list, - [sym_operator] = sym_operator, [sym_operation] = sym_operation, + [sym_control_flow] = sym_control_flow, [aux_sym_source_repeat1] = aux_sym_source_repeat1, [aux_sym_list_repeat1] = aux_sym_list_repeat1, }; @@ -178,15 +181,19 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = false, }, - [anon_sym_PLUS] = { + [sym_operator] = { + .visible = true, + .named = true, + }, + [anon_sym_if] = { .visible = true, .named = false, }, - [anon_sym_DASH] = { + [anon_sym_then] = { .visible = true, .named = false, }, - [anon_sym_EQ] = { + [anon_sym_else] = { .visible = true, .named = false, }, @@ -226,11 +233,11 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, - [sym_operator] = { + [sym_operation] = { .visible = true, .named = true, }, - [sym_operation] = { + [sym_control_flow] = { .visible = true, .named = true, }, @@ -258,31 +265,76 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [2] = 2, [3] = 3, [4] = 4, - [5] = 5, - [6] = 6, - [7] = 7, + [5] = 4, + [6] = 4, + [7] = 4, [8] = 8, - [9] = 9, - [10] = 10, - [11] = 11, + [9] = 8, + [10] = 8, + [11] = 8, [12] = 12, [13] = 13, - [14] = 14, - [15] = 13, - [16] = 16, - [17] = 16, + [14] = 12, + [15] = 12, + [16] = 12, + [17] = 13, [18] = 18, [19] = 19, [20] = 20, [21] = 21, [22] = 22, - [23] = 6, - [24] = 7, - [25] = 8, + [23] = 23, + [24] = 24, + [25] = 25, [26] = 26, - [27] = 27, + [27] = 22, [28] = 28, [29] = 29, + [30] = 30, + [31] = 28, + [32] = 24, + [33] = 20, + [34] = 25, + [35] = 30, + [36] = 18, + [37] = 29, + [38] = 24, + [39] = 19, + [40] = 25, + [41] = 30, + [42] = 21, + [43] = 23, + [44] = 26, + [45] = 19, + [46] = 46, + [47] = 47, + [48] = 47, + [49] = 47, + [50] = 50, + [51] = 51, + [52] = 51, + [53] = 53, + [54] = 51, + [55] = 55, + [56] = 56, + [57] = 18, + [58] = 30, + [59] = 26, + [60] = 23, + [61] = 21, + [62] = 20, + [63] = 46, + [64] = 30, + [65] = 29, + [66] = 22, + [67] = 28, + [68] = 22, + [69] = 69, + [70] = 69, + [71] = 69, + [72] = 69, + [73] = 73, + [74] = 74, }; static bool ts_lex(TSLexer *lexer, TSStateId state) { @@ -290,246 +342,352 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { eof = lexer->eof(lexer); switch (state) { case 0: - if (eof) ADVANCE(11); + if (eof) ADVANCE(18); if (lookahead == '"' || lookahead == '\'' || - lookahead == '`') ADVANCE(10); - if (lookahead == '#') ADVANCE(12); - 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(16); - if (lookahead == 't') ADVANCE(20); - if (lookahead == '{') ADVANCE(8); + lookahead == '`') ADVANCE(15); + if (lookahead == '#') ADVANCE(19); + if (lookahead == '(') ADVANCE(45); + if (lookahead == ')') ADVANCE(47); + if (lookahead == '+' || + lookahead == '-' || + lookahead == '=') ADVANCE(48); + if (lookahead == ',') ADVANCE(46); + if (lookahead == ';') ADVANCE(22); + if (lookahead == 'e') ADVANCE(8); + if (lookahead == 'f') ADVANCE(1); + if (lookahead == 'i') ADVANCE(6); + if (lookahead == 't') ADVANCE(7); + if (lookahead == '{') ADVANCE(14); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') SKIP(0) - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(26); - if (lookahead == '.' || - ('A' <= lookahead && lookahead <= 'Z') || - ('_' <= lookahead && lookahead <= '|')) ADVANCE(24); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(37); END_STATE(); case 1: - if (lookahead == 'a') ADVANCE(4); + if (lookahead == 'a') ADVANCE(9); END_STATE(); case 2: - if (lookahead == 'e') ADVANCE(30); + if (lookahead == 'e') ADVANCE(10); END_STATE(); case 3: - if (lookahead == 'e') ADVANCE(32); + if (lookahead == 'e') ADVANCE(52); END_STATE(); case 4: - if (lookahead == 'l') ADVANCE(6); + if (lookahead == 'e') ADVANCE(41); END_STATE(); case 5: - if (lookahead == 'r') ADVANCE(7); + if (lookahead == 'e') ADVANCE(43); END_STATE(); case 6: - if (lookahead == 's') ADVANCE(3); + if (lookahead == 'f') ADVANCE(49); END_STATE(); case 7: - if (lookahead == 'u') ADVANCE(2); + if (lookahead == 'h') ADVANCE(2); + if (lookahead == 'r') ADVANCE(13); END_STATE(); case 8: - if (lookahead == '}') ADVANCE(28); - if (lookahead != 0 && - lookahead != '\n') ADVANCE(8); + if (lookahead == 'l') ADVANCE(11); END_STATE(); case 9: - if (lookahead == '"' || - lookahead == '\'' || - lookahead == '`') ADVANCE(10); - if (lookahead == '(') ADVANCE(34); - if (lookahead == ')') ADVANCE(36); - if (lookahead == ',') ADVANCE(35); - if (lookahead == 'f') ADVANCE(1); - if (lookahead == 't') ADVANCE(5); - if (lookahead == '{') ADVANCE(8); - if (lookahead == '\t' || - lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') SKIP(9) - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(26); + if (lookahead == 'l') ADVANCE(12); END_STATE(); case 10: - if (lookahead == '"' || - lookahead == '\'' || - lookahead == '`') ADVANCE(27); - if (lookahead != 0 && - lookahead != '\n') ADVANCE(10); + if (lookahead == 'n') ADVANCE(51); END_STATE(); case 11: - ACCEPT_TOKEN(ts_builtin_sym_end); + if (lookahead == 's') ADVANCE(3); END_STATE(); case 12: - ACCEPT_TOKEN(anon_sym_POUND); + if (lookahead == 's') ADVANCE(5); END_STATE(); case 13: - ACCEPT_TOKEN(aux_sym_comment_token1); - if (lookahead == '\t' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(13); - if (lookahead != 0 && - lookahead != '\n') ADVANCE(14); + if (lookahead == 'u') ADVANCE(4); END_STATE(); case 14: - ACCEPT_TOKEN(aux_sym_comment_token1); + if (lookahead == '}') ADVANCE(39); if (lookahead != 0 && lookahead != '\n') ADVANCE(14); END_STATE(); case 15: - ACCEPT_TOKEN(sym_close); + if (lookahead == '"' || + lookahead == '\'' || + lookahead == '`') ADVANCE(38); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(15); END_STATE(); case 16: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(23); - if (lookahead == 'a') ADVANCE(19); + if (eof) ADVANCE(18); + if (lookahead == '"' || + lookahead == '\'' || + lookahead == '`') ADVANCE(15); + if (lookahead == '#') ADVANCE(19); + if (lookahead == '(') ADVANCE(45); + if (lookahead == '+' || + lookahead == '-' || + lookahead == '=') ADVANCE(48); + if (lookahead == ';') ADVANCE(22); + if (lookahead == 'e') ADVANCE(29); + if (lookahead == 'f') ADVANCE(23); + if (lookahead == 'i') ADVANCE(27); + if (lookahead == 't') ADVANCE(30); + if (lookahead == '{') ADVANCE(14); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') SKIP(16) + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(37); if (lookahead == '.' || ('A' <= lookahead && lookahead <= 'Z') || - ('b' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(24); + ('_' <= lookahead && lookahead <= '|')) ADVANCE(35); END_STATE(); case 17: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(23); - if (lookahead == 'e') ADVANCE(31); + if (eof) ADVANCE(18); + if (lookahead == '"' || + lookahead == '\'' || + lookahead == '`') ADVANCE(15); + if (lookahead == '#') ADVANCE(19); + if (lookahead == '(') ADVANCE(45); + if (lookahead == '+' || + lookahead == '-' || + lookahead == '=') ADVANCE(48); + if (lookahead == ';') ADVANCE(22); + if (lookahead == 'f') ADVANCE(23); + if (lookahead == 'i') ADVANCE(27); + if (lookahead == 't') ADVANCE(30); + if (lookahead == '{') ADVANCE(14); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') SKIP(17) + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(37); if (lookahead == '.' || ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(24); + ('_' <= lookahead && lookahead <= '|')) ADVANCE(35); END_STATE(); case 18: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(23); - if (lookahead == 'e') ADVANCE(33); - if (lookahead == '.' || - ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(24); + ACCEPT_TOKEN(ts_builtin_sym_end); END_STATE(); case 19: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(23); - if (lookahead == 'l') ADVANCE(21); - if (lookahead == '.' || - ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(24); + ACCEPT_TOKEN(anon_sym_POUND); END_STATE(); case 20: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(23); - if (lookahead == 'r') ADVANCE(22); - if (lookahead == '.' || - ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(24); + ACCEPT_TOKEN(aux_sym_comment_token1); + if (lookahead == '\t' || + lookahead == '\r' || + lookahead == ' ') ADVANCE(20); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(21); END_STATE(); case 21: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(23); - if (lookahead == 's') ADVANCE(18); - if (lookahead == '.' || - ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(24); + ACCEPT_TOKEN(aux_sym_comment_token1); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(21); END_STATE(); case 22: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(23); - if (lookahead == 'u') ADVANCE(17); - if (lookahead == '.' || - ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(24); + ACCEPT_TOKEN(sym_close); END_STATE(); case 23: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(23); + if (lookahead == '_') ADVANCE(34); + if (lookahead == 'a') ADVANCE(28); if (lookahead == '.' || - lookahead == '|') ADVANCE(24); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(23); + ('A' <= lookahead && lookahead <= 'Z') || + ('b' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(35); END_STATE(); case 24: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(23); + if (lookahead == '_') ADVANCE(34); + if (lookahead == 'e') ADVANCE(42); if (lookahead == '.' || ('A' <= lookahead && lookahead <= 'Z') || ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(24); + lookahead == '|') ADVANCE(35); END_STATE(); case 25: - ACCEPT_TOKEN(sym_float); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(25); + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(34); + if (lookahead == 'e') ADVANCE(44); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(35); END_STATE(); case 26: - ACCEPT_TOKEN(sym_integer); - if (lookahead == '.') ADVANCE(25); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(26); + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(34); + if (lookahead == 'e') ADVANCE(53); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(35); END_STATE(); case 27: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(34); + if (lookahead == 'f') ADVANCE(50); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(35); + END_STATE(); + case 28: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(34); + if (lookahead == 'l') ADVANCE(31); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(35); + END_STATE(); + case 29: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(34); + if (lookahead == 'l') ADVANCE(32); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(35); + END_STATE(); + case 30: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(34); + if (lookahead == 'r') ADVANCE(33); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(35); + END_STATE(); + case 31: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(34); + if (lookahead == 's') ADVANCE(25); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(35); + END_STATE(); + case 32: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(34); + if (lookahead == 's') ADVANCE(26); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(35); + END_STATE(); + case 33: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(34); + if (lookahead == 'u') ADVANCE(24); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(35); + END_STATE(); + case 34: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(34); + if (lookahead == '.' || + lookahead == '|') ADVANCE(35); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(34); + END_STATE(); + case 35: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(34); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(35); + END_STATE(); + case 36: + ACCEPT_TOKEN(sym_float); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(36); + END_STATE(); + case 37: + ACCEPT_TOKEN(sym_integer); + if (lookahead == '.') ADVANCE(36); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(37); + END_STATE(); + case 38: ACCEPT_TOKEN(sym_string); if (lookahead == '"' || lookahead == '\'' || - lookahead == '`') ADVANCE(27); + lookahead == '`') ADVANCE(38); if (lookahead != 0 && - lookahead != '\n') ADVANCE(10); - END_STATE(); - case 28: - ACCEPT_TOKEN(sym_function); - if (lookahead == '}') ADVANCE(28); - if (lookahead != 0 && - lookahead != '\n') ADVANCE(8); - END_STATE(); - case 29: - ACCEPT_TOKEN(sym_empty); - END_STATE(); - case 30: - ACCEPT_TOKEN(anon_sym_true); - END_STATE(); - case 31: - ACCEPT_TOKEN(anon_sym_true); - if (lookahead == '_') ADVANCE(23); - if (lookahead == '.' || - ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(24); - END_STATE(); - case 32: - ACCEPT_TOKEN(anon_sym_false); - END_STATE(); - case 33: - ACCEPT_TOKEN(anon_sym_false); - if (lookahead == '_') ADVANCE(23); - if (lookahead == '.' || - ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(24); - END_STATE(); - case 34: - ACCEPT_TOKEN(anon_sym_LPAREN); - if (lookahead == ')') ADVANCE(29); - END_STATE(); - case 35: - ACCEPT_TOKEN(anon_sym_COMMA); - END_STATE(); - case 36: - ACCEPT_TOKEN(anon_sym_RPAREN); - END_STATE(); - case 37: - ACCEPT_TOKEN(anon_sym_PLUS); - END_STATE(); - case 38: - ACCEPT_TOKEN(anon_sym_DASH); + lookahead != '\n') ADVANCE(15); END_STATE(); case 39: - ACCEPT_TOKEN(anon_sym_EQ); + ACCEPT_TOKEN(sym_function); + if (lookahead == '}') ADVANCE(39); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(14); + END_STATE(); + case 40: + ACCEPT_TOKEN(sym_empty); + END_STATE(); + case 41: + ACCEPT_TOKEN(anon_sym_true); + END_STATE(); + case 42: + ACCEPT_TOKEN(anon_sym_true); + if (lookahead == '_') ADVANCE(34); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(35); + END_STATE(); + case 43: + ACCEPT_TOKEN(anon_sym_false); + END_STATE(); + case 44: + ACCEPT_TOKEN(anon_sym_false); + if (lookahead == '_') ADVANCE(34); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(35); + END_STATE(); + case 45: + ACCEPT_TOKEN(anon_sym_LPAREN); + if (lookahead == ')') ADVANCE(40); + END_STATE(); + case 46: + ACCEPT_TOKEN(anon_sym_COMMA); + END_STATE(); + case 47: + ACCEPT_TOKEN(anon_sym_RPAREN); + END_STATE(); + case 48: + ACCEPT_TOKEN(sym_operator); + END_STATE(); + case 49: + ACCEPT_TOKEN(anon_sym_if); + END_STATE(); + case 50: + ACCEPT_TOKEN(anon_sym_if); + if (lookahead == '_') ADVANCE(34); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(35); + END_STATE(); + case 51: + ACCEPT_TOKEN(anon_sym_then); + END_STATE(); + case 52: + ACCEPT_TOKEN(anon_sym_else); + END_STATE(); + case 53: + ACCEPT_TOKEN(anon_sym_else); + if (lookahead == '_') ADVANCE(34); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(35); END_STATE(); default: return false; @@ -538,35 +696,80 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { static const TSLexMode ts_lex_modes[STATE_COUNT] = { [0] = {.lex_state = 0}, - [1] = {.lex_state = 0}, - [2] = {.lex_state = 0}, - [3] = {.lex_state = 0}, - [4] = {.lex_state = 0}, - [5] = {.lex_state = 0}, - [6] = {.lex_state = 0}, - [7] = {.lex_state = 0}, - [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 = 9}, - [15] = {.lex_state = 9}, - [16] = {.lex_state = 9}, - [17] = {.lex_state = 9}, - [18] = {.lex_state = 0}, - [19] = {.lex_state = 0}, - [20] = {.lex_state = 0}, - [21] = {.lex_state = 0}, - [22] = {.lex_state = 9}, - [23] = {.lex_state = 9}, - [24] = {.lex_state = 9}, - [25] = {.lex_state = 9}, - [26] = {.lex_state = 9}, - [27] = {.lex_state = 0}, - [28] = {.lex_state = 13}, - [29] = {.lex_state = 0}, + [1] = {.lex_state = 17}, + [2] = {.lex_state = 17}, + [3] = {.lex_state = 17}, + [4] = {.lex_state = 17}, + [5] = {.lex_state = 17}, + [6] = {.lex_state = 17}, + [7] = {.lex_state = 17}, + [8] = {.lex_state = 17}, + [9] = {.lex_state = 17}, + [10] = {.lex_state = 17}, + [11] = {.lex_state = 17}, + [12] = {.lex_state = 17}, + [13] = {.lex_state = 17}, + [14] = {.lex_state = 17}, + [15] = {.lex_state = 17}, + [16] = {.lex_state = 17}, + [17] = {.lex_state = 17}, + [18] = {.lex_state = 16}, + [19] = {.lex_state = 16}, + [20] = {.lex_state = 16}, + [21] = {.lex_state = 16}, + [22] = {.lex_state = 16}, + [23] = {.lex_state = 16}, + [24] = {.lex_state = 16}, + [25] = {.lex_state = 16}, + [26] = {.lex_state = 16}, + [27] = {.lex_state = 16}, + [28] = {.lex_state = 16}, + [29] = {.lex_state = 16}, + [30] = {.lex_state = 16}, + [31] = {.lex_state = 17}, + [32] = {.lex_state = 0}, + [33] = {.lex_state = 17}, + [34] = {.lex_state = 0}, + [35] = {.lex_state = 17}, + [36] = {.lex_state = 17}, + [37] = {.lex_state = 17}, + [38] = {.lex_state = 17}, + [39] = {.lex_state = 0}, + [40] = {.lex_state = 17}, + [41] = {.lex_state = 17}, + [42] = {.lex_state = 17}, + [43] = {.lex_state = 17}, + [44] = {.lex_state = 17}, + [45] = {.lex_state = 17}, + [46] = {.lex_state = 17}, + [47] = {.lex_state = 0}, + [48] = {.lex_state = 0}, + [49] = {.lex_state = 0}, + [50] = {.lex_state = 0}, + [51] = {.lex_state = 0}, + [52] = {.lex_state = 0}, + [53] = {.lex_state = 17}, + [54] = {.lex_state = 0}, + [55] = {.lex_state = 0}, + [56] = {.lex_state = 0}, + [57] = {.lex_state = 0}, + [58] = {.lex_state = 0}, + [59] = {.lex_state = 0}, + [60] = {.lex_state = 0}, + [61] = {.lex_state = 0}, + [62] = {.lex_state = 0}, + [63] = {.lex_state = 0}, + [64] = {.lex_state = 0}, + [65] = {.lex_state = 0}, + [66] = {.lex_state = 0}, + [67] = {.lex_state = 0}, + [68] = {.lex_state = 0}, + [69] = {.lex_state = 0}, + [70] = {.lex_state = 0}, + [71] = {.lex_state = 0}, + [72] = {.lex_state = 0}, + [73] = {.lex_state = 0}, + [74] = {.lex_state = 20}, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { @@ -574,7 +777,6 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [ts_builtin_sym_end] = ACTIONS(1), [anon_sym_POUND] = ACTIONS(1), [sym_close] = ACTIONS(1), - [sym_identifier] = ACTIONS(1), [sym_float] = ACTIONS(1), [sym_integer] = ACTIONS(1), [sym_string] = ACTIONS(1), @@ -585,21 +787,23 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_LPAREN] = ACTIONS(1), [anon_sym_COMMA] = ACTIONS(1), [anon_sym_RPAREN] = ACTIONS(1), - [anon_sym_PLUS] = ACTIONS(1), - [anon_sym_DASH] = ACTIONS(1), - [anon_sym_EQ] = ACTIONS(1), + [sym_operator] = ACTIONS(1), + [anon_sym_if] = ACTIONS(1), + [anon_sym_then] = ACTIONS(1), + [anon_sym_else] = ACTIONS(1), }, [1] = { - [sym_source] = STATE(29), + [sym_source] = STATE(73), [sym_comment] = STATE(3), [sym_statement] = STATE(3), - [sym_closed_statement] = STATE(18), - [sym_open_statement] = STATE(18), - [sym_expression] = STATE(5), - [sym_value] = STATE(9), - [sym_boolean] = STATE(7), - [sym_list] = STATE(7), - [sym_operation] = STATE(10), + [sym_closed_statement] = STATE(36), + [sym_open_statement] = STATE(36), + [sym_expression] = STATE(41), + [sym_value] = STATE(43), + [sym_boolean] = STATE(40), + [sym_list] = STATE(40), + [sym_operation] = STATE(42), + [sym_control_flow] = STATE(33), [aux_sym_source_repeat1] = STATE(3), [ts_builtin_sym_end] = ACTIONS(3), [anon_sym_POUND] = ACTIONS(5), @@ -612,42 +816,46 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_true] = ACTIONS(13), [anon_sym_false] = ACTIONS(13), [anon_sym_LPAREN] = ACTIONS(15), + [anon_sym_if] = ACTIONS(17), }, [2] = { [sym_comment] = STATE(2), [sym_statement] = STATE(2), - [sym_closed_statement] = STATE(18), - [sym_open_statement] = STATE(18), - [sym_expression] = STATE(5), - [sym_value] = STATE(9), - [sym_boolean] = STATE(7), - [sym_list] = STATE(7), - [sym_operation] = STATE(10), + [sym_closed_statement] = STATE(36), + [sym_open_statement] = STATE(36), + [sym_expression] = STATE(41), + [sym_value] = STATE(43), + [sym_boolean] = STATE(40), + [sym_list] = STATE(40), + [sym_operation] = STATE(42), + [sym_control_flow] = STATE(33), [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), + [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), + [anon_sym_if] = ACTIONS(39), }, [3] = { [sym_comment] = STATE(2), [sym_statement] = STATE(2), - [sym_closed_statement] = STATE(18), - [sym_open_statement] = STATE(18), - [sym_expression] = STATE(5), - [sym_value] = STATE(9), - [sym_boolean] = STATE(7), - [sym_list] = STATE(7), - [sym_operation] = STATE(10), + [sym_closed_statement] = STATE(36), + [sym_open_statement] = STATE(36), + [sym_expression] = STATE(41), + [sym_value] = STATE(43), + [sym_boolean] = STATE(40), + [sym_list] = STATE(40), + [sym_operation] = STATE(42), + [sym_control_flow] = STATE(33), [aux_sym_source_repeat1] = STATE(2), - [ts_builtin_sym_end] = ACTIONS(37), + [ts_builtin_sym_end] = ACTIONS(42), [anon_sym_POUND] = ACTIONS(5), [sym_identifier] = ACTIONS(7), [sym_float] = ACTIONS(9), @@ -658,171 +866,340 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_true] = ACTIONS(13), [anon_sym_false] = ACTIONS(13), [anon_sym_LPAREN] = ACTIONS(15), + [anon_sym_if] = ACTIONS(17), }, [4] = { - [sym_operator] = STATE(12), - [ts_builtin_sym_end] = ACTIONS(39), - [anon_sym_POUND] = ACTIONS(39), - [sym_close] = ACTIONS(39), - [sym_identifier] = ACTIONS(41), - [sym_float] = ACTIONS(39), - [sym_integer] = ACTIONS(41), - [sym_string] = ACTIONS(39), - [sym_function] = ACTIONS(39), - [sym_empty] = ACTIONS(39), - [anon_sym_true] = ACTIONS(41), - [anon_sym_false] = ACTIONS(41), - [anon_sym_LPAREN] = ACTIONS(41), - [anon_sym_PLUS] = ACTIONS(39), - [anon_sym_DASH] = ACTIONS(39), - [anon_sym_EQ] = ACTIONS(39), + [sym_statement] = STATE(65), + [sym_closed_statement] = STATE(57), + [sym_open_statement] = STATE(57), + [sym_expression] = STATE(58), + [sym_value] = STATE(60), + [sym_boolean] = STATE(34), + [sym_list] = STATE(34), + [sym_operation] = STATE(61), + [sym_control_flow] = STATE(62), + [sym_identifier] = ACTIONS(44), + [sym_float] = ACTIONS(46), + [sym_integer] = ACTIONS(48), + [sym_string] = ACTIONS(46), + [sym_function] = ACTIONS(46), + [sym_empty] = ACTIONS(46), + [anon_sym_true] = ACTIONS(50), + [anon_sym_false] = ACTIONS(50), + [anon_sym_LPAREN] = ACTIONS(52), + [anon_sym_if] = ACTIONS(54), }, [5] = { - [sym_operator] = STATE(12), - [ts_builtin_sym_end] = ACTIONS(43), - [anon_sym_POUND] = ACTIONS(43), - [sym_close] = ACTIONS(45), - [sym_identifier] = ACTIONS(47), - [sym_float] = ACTIONS(43), - [sym_integer] = ACTIONS(47), - [sym_string] = ACTIONS(43), - [sym_function] = ACTIONS(43), - [sym_empty] = ACTIONS(43), - [anon_sym_true] = ACTIONS(47), - [anon_sym_false] = ACTIONS(47), - [anon_sym_LPAREN] = ACTIONS(47), - [anon_sym_PLUS] = ACTIONS(49), - [anon_sym_DASH] = ACTIONS(49), - [anon_sym_EQ] = ACTIONS(49), + [sym_statement] = STATE(65), + [sym_closed_statement] = STATE(57), + [sym_open_statement] = STATE(57), + [sym_expression] = STATE(64), + [sym_value] = STATE(60), + [sym_boolean] = STATE(34), + [sym_list] = STATE(34), + [sym_operation] = STATE(61), + [sym_control_flow] = STATE(62), + [sym_identifier] = ACTIONS(44), + [sym_float] = ACTIONS(46), + [sym_integer] = ACTIONS(48), + [sym_string] = ACTIONS(46), + [sym_function] = ACTIONS(46), + [sym_empty] = ACTIONS(46), + [anon_sym_true] = ACTIONS(50), + [anon_sym_false] = ACTIONS(50), + [anon_sym_LPAREN] = ACTIONS(52), + [anon_sym_if] = ACTIONS(54), + }, + [6] = { + [sym_statement] = STATE(29), + [sym_closed_statement] = STATE(18), + [sym_open_statement] = STATE(18), + [sym_expression] = STATE(30), + [sym_value] = STATE(23), + [sym_boolean] = STATE(25), + [sym_list] = STATE(25), + [sym_operation] = STATE(21), + [sym_control_flow] = STATE(20), + [sym_identifier] = ACTIONS(56), + [sym_float] = ACTIONS(58), + [sym_integer] = ACTIONS(60), + [sym_string] = ACTIONS(58), + [sym_function] = ACTIONS(58), + [sym_empty] = ACTIONS(58), + [anon_sym_true] = ACTIONS(62), + [anon_sym_false] = ACTIONS(62), + [anon_sym_LPAREN] = ACTIONS(64), + [anon_sym_if] = ACTIONS(66), + }, + [7] = { + [sym_statement] = STATE(37), + [sym_closed_statement] = STATE(36), + [sym_open_statement] = STATE(36), + [sym_expression] = STATE(35), + [sym_value] = STATE(43), + [sym_boolean] = STATE(40), + [sym_list] = STATE(40), + [sym_operation] = STATE(42), + [sym_control_flow] = STATE(33), + [sym_identifier] = ACTIONS(7), + [sym_float] = ACTIONS(9), + [sym_integer] = ACTIONS(11), + [sym_string] = ACTIONS(9), + [sym_function] = ACTIONS(9), + [sym_empty] = ACTIONS(9), + [anon_sym_true] = ACTIONS(13), + [anon_sym_false] = ACTIONS(13), + [anon_sym_LPAREN] = ACTIONS(15), + [anon_sym_if] = ACTIONS(17), + }, + [8] = { + [sym_statement] = STATE(27), + [sym_closed_statement] = STATE(18), + [sym_open_statement] = STATE(18), + [sym_expression] = STATE(30), + [sym_value] = STATE(23), + [sym_boolean] = STATE(25), + [sym_list] = STATE(25), + [sym_operation] = STATE(21), + [sym_control_flow] = STATE(20), + [sym_identifier] = ACTIONS(56), + [sym_float] = ACTIONS(58), + [sym_integer] = ACTIONS(60), + [sym_string] = ACTIONS(58), + [sym_function] = ACTIONS(58), + [sym_empty] = ACTIONS(58), + [anon_sym_true] = ACTIONS(62), + [anon_sym_false] = ACTIONS(62), + [anon_sym_LPAREN] = ACTIONS(64), + [anon_sym_if] = ACTIONS(66), + }, + [9] = { + [sym_statement] = STATE(68), + [sym_closed_statement] = STATE(57), + [sym_open_statement] = STATE(57), + [sym_expression] = STATE(64), + [sym_value] = STATE(60), + [sym_boolean] = STATE(34), + [sym_list] = STATE(34), + [sym_operation] = STATE(61), + [sym_control_flow] = STATE(62), + [sym_identifier] = ACTIONS(44), + [sym_float] = ACTIONS(46), + [sym_integer] = ACTIONS(48), + [sym_string] = ACTIONS(46), + [sym_function] = ACTIONS(46), + [sym_empty] = ACTIONS(46), + [anon_sym_true] = ACTIONS(50), + [anon_sym_false] = ACTIONS(50), + [anon_sym_LPAREN] = ACTIONS(52), + [anon_sym_if] = ACTIONS(54), + }, + [10] = { + [sym_statement] = STATE(22), + [sym_closed_statement] = STATE(18), + [sym_open_statement] = STATE(18), + [sym_expression] = STATE(30), + [sym_value] = STATE(23), + [sym_boolean] = STATE(25), + [sym_list] = STATE(25), + [sym_operation] = STATE(21), + [sym_control_flow] = STATE(20), + [sym_identifier] = ACTIONS(56), + [sym_float] = ACTIONS(58), + [sym_integer] = ACTIONS(60), + [sym_string] = ACTIONS(58), + [sym_function] = ACTIONS(58), + [sym_empty] = ACTIONS(58), + [anon_sym_true] = ACTIONS(62), + [anon_sym_false] = ACTIONS(62), + [anon_sym_LPAREN] = ACTIONS(64), + [anon_sym_if] = ACTIONS(66), + }, + [11] = { + [sym_statement] = STATE(66), + [sym_closed_statement] = STATE(57), + [sym_open_statement] = STATE(57), + [sym_expression] = STATE(58), + [sym_value] = STATE(60), + [sym_boolean] = STATE(34), + [sym_list] = STATE(34), + [sym_operation] = STATE(61), + [sym_control_flow] = STATE(62), + [sym_identifier] = ACTIONS(44), + [sym_float] = ACTIONS(46), + [sym_integer] = ACTIONS(48), + [sym_string] = ACTIONS(46), + [sym_function] = ACTIONS(46), + [sym_empty] = ACTIONS(46), + [anon_sym_true] = ACTIONS(50), + [anon_sym_false] = ACTIONS(50), + [anon_sym_LPAREN] = ACTIONS(52), + [anon_sym_if] = ACTIONS(54), }, }; static const uint16_t ts_small_parse_table[] = { - [0] = 2, - ACTIONS(53), 5, + [0] = 11, + ACTIONS(44), 1, sym_identifier, + ACTIONS(48), 1, sym_integer, + ACTIONS(52), 1, + anon_sym_LPAREN, + ACTIONS(68), 1, + anon_sym_if, + STATE(60), 1, + sym_value, + STATE(61), 1, + sym_operation, + STATE(62), 1, + sym_control_flow, + STATE(72), 1, + sym_expression, + ACTIONS(50), 2, anon_sym_true, anon_sym_false, - anon_sym_LPAREN, - ACTIONS(51), 10, - ts_builtin_sym_end, - anon_sym_POUND, - sym_close, + STATE(34), 2, + sym_boolean, + sym_list, + ACTIONS(46), 4, sym_float, sym_string, sym_function, sym_empty, - anon_sym_PLUS, - anon_sym_DASH, - anon_sym_EQ, - [20] = 2, - ACTIONS(57), 5, + [39] = 11, + ACTIONS(44), 1, sym_identifier, + ACTIONS(48), 1, sym_integer, + ACTIONS(52), 1, + anon_sym_LPAREN, + ACTIONS(68), 1, + anon_sym_if, + STATE(60), 1, + sym_value, + STATE(61), 1, + sym_operation, + STATE(62), 1, + sym_control_flow, + STATE(67), 1, + sym_expression, + ACTIONS(50), 2, anon_sym_true, anon_sym_false, - anon_sym_LPAREN, - ACTIONS(55), 10, - ts_builtin_sym_end, - anon_sym_POUND, - sym_close, + STATE(34), 2, + sym_boolean, + sym_list, + ACTIONS(46), 4, sym_float, sym_string, sym_function, sym_empty, - anon_sym_PLUS, - anon_sym_DASH, - anon_sym_EQ, - [40] = 2, - ACTIONS(61), 5, + [78] = 11, + ACTIONS(44), 1, sym_identifier, + ACTIONS(48), 1, sym_integer, + ACTIONS(52), 1, + anon_sym_LPAREN, + ACTIONS(68), 1, + anon_sym_if, + STATE(60), 1, + sym_value, + STATE(61), 1, + sym_operation, + STATE(62), 1, + sym_control_flow, + STATE(70), 1, + sym_expression, + ACTIONS(50), 2, anon_sym_true, anon_sym_false, - anon_sym_LPAREN, - ACTIONS(59), 10, - ts_builtin_sym_end, - anon_sym_POUND, - sym_close, + STATE(34), 2, + sym_boolean, + sym_list, + ACTIONS(46), 4, sym_float, sym_string, sym_function, sym_empty, - anon_sym_PLUS, - anon_sym_DASH, - anon_sym_EQ, - [60] = 2, - ACTIONS(65), 5, + [117] = 11, + ACTIONS(44), 1, sym_identifier, + ACTIONS(48), 1, sym_integer, + ACTIONS(52), 1, + anon_sym_LPAREN, + ACTIONS(68), 1, + anon_sym_if, + STATE(60), 1, + sym_value, + STATE(61), 1, + sym_operation, + STATE(62), 1, + sym_control_flow, + STATE(71), 1, + sym_expression, + ACTIONS(50), 2, anon_sym_true, anon_sym_false, - anon_sym_LPAREN, - ACTIONS(63), 10, - ts_builtin_sym_end, - anon_sym_POUND, - sym_close, + STATE(34), 2, + sym_boolean, + sym_list, + ACTIONS(46), 4, sym_float, sym_string, sym_function, sym_empty, - anon_sym_PLUS, - anon_sym_DASH, - anon_sym_EQ, - [80] = 2, - ACTIONS(65), 5, + [156] = 11, + ACTIONS(44), 1, sym_identifier, + ACTIONS(48), 1, sym_integer, + ACTIONS(52), 1, + anon_sym_LPAREN, + ACTIONS(68), 1, + anon_sym_if, + STATE(60), 1, + sym_value, + STATE(61), 1, + sym_operation, + STATE(62), 1, + sym_control_flow, + STATE(69), 1, + sym_expression, + ACTIONS(50), 2, anon_sym_true, anon_sym_false, - anon_sym_LPAREN, - ACTIONS(63), 10, - ts_builtin_sym_end, - anon_sym_POUND, - sym_close, + STATE(34), 2, + sym_boolean, + sym_list, + ACTIONS(46), 4, 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, + [195] = 11, ACTIONS(7), 1, sym_identifier, ACTIONS(11), 1, sym_integer, ACTIONS(15), 1, anon_sym_LPAREN, - STATE(4), 1, + ACTIONS(17), 1, + anon_sym_if, + STATE(31), 1, sym_expression, - STATE(9), 1, - sym_value, - STATE(10), 1, + STATE(33), 1, + sym_control_flow, + STATE(42), 1, sym_operation, + STATE(43), 1, + sym_value, ACTIONS(13), 2, anon_sym_true, anon_sym_false, - STATE(7), 2, + STATE(40), 2, sym_boolean, sym_list, ACTIONS(9), 4, @@ -830,188 +1207,265 @@ static const uint16_t ts_small_parse_table[] = { sym_string, sym_function, sym_empty, - [153] = 8, - ACTIONS(69), 1, + [234] = 2, + ACTIONS(72), 7, + sym_identifier, sym_integer, - ACTIONS(73), 1, - anon_sym_LPAREN, - ACTIONS(75), 1, - anon_sym_RPAREN, - STATE(14), 1, - aux_sym_list_repeat1, - STATE(22), 1, - sym_value, - ACTIONS(71), 2, anon_sym_true, anon_sym_false, - STATE(24), 2, - sym_boolean, - sym_list, - ACTIONS(67), 4, + anon_sym_LPAREN, + anon_sym_if, + anon_sym_else, + ACTIONS(70), 8, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, sym_float, sym_string, sym_function, sym_empty, - [183] = 8, - ACTIONS(80), 1, + sym_operator, + [254] = 2, + ACTIONS(76), 7, + sym_identifier, sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + anon_sym_if, + anon_sym_else, + ACTIONS(74), 8, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + sym_operator, + [274] = 2, + ACTIONS(80), 7, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + anon_sym_if, + anon_sym_else, + ACTIONS(78), 8, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + sym_operator, + [294] = 2, + ACTIONS(80), 7, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + anon_sym_if, + anon_sym_else, + ACTIONS(78), 8, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + sym_operator, + [314] = 3, ACTIONS(86), 1, - anon_sym_LPAREN, - ACTIONS(89), 1, - anon_sym_RPAREN, - STATE(14), 1, - aux_sym_list_repeat1, - STATE(22), 1, - sym_value, - ACTIONS(83), 2, - anon_sym_true, - anon_sym_false, - STATE(24), 2, - sym_boolean, - sym_list, - ACTIONS(77), 4, - sym_float, - sym_string, - sym_function, - sym_empty, - [213] = 8, - ACTIONS(69), 1, - sym_integer, - ACTIONS(73), 1, - anon_sym_LPAREN, - ACTIONS(91), 1, - anon_sym_RPAREN, - STATE(14), 1, - aux_sym_list_repeat1, - STATE(22), 1, - sym_value, - ACTIONS(71), 2, - anon_sym_true, - anon_sym_false, - STATE(24), 2, - sym_boolean, - sym_list, - ACTIONS(67), 4, - sym_float, - sym_string, - sym_function, - sym_empty, - [243] = 7, - ACTIONS(69), 1, - sym_integer, - ACTIONS(73), 1, - anon_sym_LPAREN, - STATE(15), 1, - aux_sym_list_repeat1, - STATE(22), 1, - sym_value, - ACTIONS(71), 2, - anon_sym_true, - anon_sym_false, - STATE(24), 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(22), 1, - sym_value, - ACTIONS(71), 2, - anon_sym_true, - anon_sym_false, - STATE(24), 2, - sym_boolean, - sym_list, - ACTIONS(67), 4, - sym_float, - sym_string, - sym_function, - sym_empty, - [297] = 2, - ACTIONS(95), 5, + anon_sym_else, + ACTIONS(84), 6, sym_identifier, sym_integer, anon_sym_true, anon_sym_false, anon_sym_LPAREN, - ACTIONS(93), 6, + anon_sym_if, + ACTIONS(82), 8, ts_builtin_sym_end, anon_sym_POUND, + sym_close, sym_float, sym_string, sym_function, sym_empty, - [313] = 2, - ACTIONS(99), 5, + sym_operator, + [336] = 2, + ACTIONS(80), 7, sym_identifier, sym_integer, anon_sym_true, anon_sym_false, anon_sym_LPAREN, - ACTIONS(97), 6, + anon_sym_if, + anon_sym_else, + ACTIONS(78), 8, ts_builtin_sym_end, anon_sym_POUND, + sym_close, sym_float, sym_string, sym_function, sym_empty, - [329] = 2, - ACTIONS(103), 5, + sym_operator, + [356] = 2, + ACTIONS(90), 7, sym_identifier, sym_integer, anon_sym_true, anon_sym_false, anon_sym_LPAREN, - ACTIONS(101), 6, + anon_sym_if, + anon_sym_else, + ACTIONS(88), 8, ts_builtin_sym_end, anon_sym_POUND, + sym_close, sym_float, sym_string, sym_function, sym_empty, - [345] = 3, - ACTIONS(107), 1, - anon_sym_POUND, - ACTIONS(105), 5, - ts_builtin_sym_end, - sym_float, - sym_string, - sym_function, - sym_empty, - ACTIONS(109), 5, + sym_operator, + [376] = 2, + ACTIONS(94), 7, sym_identifier, sym_integer, anon_sym_true, anon_sym_false, anon_sym_LPAREN, - [363] = 3, - ACTIONS(115), 1, - anon_sym_COMMA, - ACTIONS(113), 2, - sym_integer, - anon_sym_LPAREN, - ACTIONS(111), 7, + anon_sym_if, + anon_sym_else, + ACTIONS(92), 8, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, sym_float, sym_string, sym_function, sym_empty, + sym_operator, + [396] = 2, + ACTIONS(80), 7, + sym_identifier, + sym_integer, anon_sym_true, anon_sym_false, - anon_sym_RPAREN, - [380] = 2, - ACTIONS(53), 2, + anon_sym_LPAREN, + anon_sym_if, + anon_sym_else, + ACTIONS(78), 8, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + sym_operator, + [416] = 3, + ACTIONS(96), 1, + anon_sym_else, + ACTIONS(84), 6, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + anon_sym_if, + ACTIONS(82), 8, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + sym_operator, + [438] = 2, + ACTIONS(100), 7, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + anon_sym_if, + anon_sym_else, + ACTIONS(98), 8, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + sym_operator, + [458] = 2, + ACTIONS(104), 7, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + anon_sym_if, + anon_sym_else, + ACTIONS(102), 8, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + sym_operator, + [478] = 2, + ACTIONS(108), 7, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + anon_sym_if, + anon_sym_else, + ACTIONS(106), 8, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + sym_operator, + [498] = 2, + ACTIONS(100), 6, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + anon_sym_if, + ACTIONS(98), 8, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + sym_operator, + [517] = 2, + ACTIONS(90), 2, sym_integer, anon_sym_LPAREN, - ACTIONS(51), 8, + ACTIONS(88), 12, + sym_close, sym_float, sym_string, sym_function, @@ -1020,151 +1474,688 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_false, anon_sym_COMMA, anon_sym_RPAREN, - [395] = 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, - [410] = 2, - ACTIONS(61), 2, - sym_integer, - anon_sym_LPAREN, - ACTIONS(59), 8, - sym_float, - sym_string, - sym_function, - sym_empty, - anon_sym_true, - anon_sym_false, - anon_sym_COMMA, - anon_sym_RPAREN, - [425] = 2, - ACTIONS(117), 2, - sym_integer, - anon_sym_LPAREN, - ACTIONS(89), 7, - sym_float, - sym_string, - sym_function, - sym_empty, - anon_sym_true, - anon_sym_false, - anon_sym_RPAREN, - [439] = 2, - ACTIONS(121), 4, - sym_float, - sym_string, - sym_function, - sym_empty, - ACTIONS(119), 5, + sym_operator, + anon_sym_then, + anon_sym_else, + [536] = 2, + ACTIONS(80), 6, sym_identifier, sym_integer, anon_sym_true, anon_sym_false, anon_sym_LPAREN, - [453] = 1, - ACTIONS(123), 1, + anon_sym_if, + ACTIONS(78), 8, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + sym_operator, + [555] = 2, + ACTIONS(94), 2, + sym_integer, + anon_sym_LPAREN, + ACTIONS(92), 12, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + anon_sym_true, + anon_sym_false, + anon_sym_COMMA, + anon_sym_RPAREN, + sym_operator, + anon_sym_then, + anon_sym_else, + [574] = 2, + ACTIONS(108), 6, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + anon_sym_if, + ACTIONS(106), 8, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + sym_operator, + [593] = 2, + ACTIONS(72), 6, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + anon_sym_if, + ACTIONS(70), 8, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + sym_operator, + [612] = 2, + ACTIONS(104), 6, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + anon_sym_if, + ACTIONS(102), 8, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + sym_operator, + [631] = 2, + ACTIONS(90), 6, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + anon_sym_if, + ACTIONS(88), 8, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + sym_operator, + [650] = 2, + ACTIONS(76), 2, + sym_integer, + anon_sym_LPAREN, + ACTIONS(74), 12, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + anon_sym_true, + anon_sym_false, + anon_sym_COMMA, + anon_sym_RPAREN, + sym_operator, + anon_sym_then, + anon_sym_else, + [669] = 2, + ACTIONS(94), 6, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + anon_sym_if, + ACTIONS(92), 8, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + sym_operator, + [688] = 4, + ACTIONS(110), 1, + sym_close, + ACTIONS(112), 1, + sym_operator, + ACTIONS(106), 6, + ts_builtin_sym_end, + anon_sym_POUND, + sym_float, + sym_string, + sym_function, + sym_empty, + ACTIONS(108), 6, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + anon_sym_if, + [711] = 2, + ACTIONS(80), 6, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + anon_sym_if, + ACTIONS(78), 8, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + sym_operator, + [730] = 2, + ACTIONS(80), 6, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + anon_sym_if, + ACTIONS(78), 8, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + sym_operator, + [749] = 2, + ACTIONS(80), 6, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + anon_sym_if, + ACTIONS(78), 8, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + sym_operator, + [768] = 2, + ACTIONS(76), 6, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + anon_sym_if, + ACTIONS(74), 8, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + sym_operator, + [787] = 2, + ACTIONS(116), 6, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + anon_sym_if, + ACTIONS(114), 8, + ts_builtin_sym_end, + anon_sym_POUND, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + sym_operator, + [806] = 8, + ACTIONS(48), 1, + sym_integer, + ACTIONS(52), 1, + anon_sym_LPAREN, + ACTIONS(120), 1, + anon_sym_RPAREN, + STATE(50), 1, + aux_sym_list_repeat1, + STATE(55), 1, + sym_value, + ACTIONS(118), 2, + anon_sym_true, + anon_sym_false, + STATE(34), 2, + sym_boolean, + sym_list, + ACTIONS(46), 4, + sym_float, + sym_string, + sym_function, + sym_empty, + [836] = 8, + ACTIONS(48), 1, + sym_integer, + ACTIONS(52), 1, + anon_sym_LPAREN, + ACTIONS(122), 1, + anon_sym_RPAREN, + STATE(50), 1, + aux_sym_list_repeat1, + STATE(55), 1, + sym_value, + ACTIONS(118), 2, + anon_sym_true, + anon_sym_false, + STATE(34), 2, + sym_boolean, + sym_list, + ACTIONS(46), 4, + sym_float, + sym_string, + sym_function, + sym_empty, + [866] = 8, + ACTIONS(48), 1, + sym_integer, + ACTIONS(52), 1, + anon_sym_LPAREN, + ACTIONS(124), 1, + anon_sym_RPAREN, + STATE(50), 1, + aux_sym_list_repeat1, + STATE(55), 1, + sym_value, + ACTIONS(118), 2, + anon_sym_true, + anon_sym_false, + STATE(34), 2, + sym_boolean, + sym_list, + ACTIONS(46), 4, + sym_float, + sym_string, + sym_function, + sym_empty, + [896] = 8, + ACTIONS(129), 1, + sym_integer, + ACTIONS(135), 1, + anon_sym_LPAREN, + ACTIONS(138), 1, + anon_sym_RPAREN, + STATE(50), 1, + aux_sym_list_repeat1, + STATE(55), 1, + sym_value, + ACTIONS(132), 2, + anon_sym_true, + anon_sym_false, + STATE(34), 2, + sym_boolean, + sym_list, + ACTIONS(126), 4, + sym_float, + sym_string, + sym_function, + sym_empty, + [926] = 7, + ACTIONS(48), 1, + sym_integer, + ACTIONS(52), 1, + anon_sym_LPAREN, + STATE(49), 1, + aux_sym_list_repeat1, + STATE(55), 1, + sym_value, + ACTIONS(118), 2, + anon_sym_true, + anon_sym_false, + STATE(34), 2, + sym_boolean, + sym_list, + ACTIONS(46), 4, + sym_float, + sym_string, + sym_function, + sym_empty, + [953] = 7, + ACTIONS(48), 1, + sym_integer, + ACTIONS(52), 1, + anon_sym_LPAREN, + STATE(48), 1, + aux_sym_list_repeat1, + STATE(55), 1, + sym_value, + ACTIONS(118), 2, + anon_sym_true, + anon_sym_false, + STATE(34), 2, + sym_boolean, + sym_list, + ACTIONS(46), 4, + sym_float, + sym_string, + sym_function, + sym_empty, + [980] = 2, + ACTIONS(140), 6, + ts_builtin_sym_end, + anon_sym_POUND, + sym_float, + sym_string, + sym_function, + sym_empty, + ACTIONS(142), 6, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + anon_sym_if, + [997] = 7, + ACTIONS(48), 1, + sym_integer, + ACTIONS(52), 1, + anon_sym_LPAREN, + STATE(47), 1, + aux_sym_list_repeat1, + STATE(55), 1, + sym_value, + ACTIONS(118), 2, + anon_sym_true, + anon_sym_false, + STATE(34), 2, + sym_boolean, + sym_list, + ACTIONS(46), 4, + sym_float, + sym_string, + sym_function, + sym_empty, + [1024] = 3, + ACTIONS(148), 1, + anon_sym_COMMA, + ACTIONS(146), 2, + sym_integer, + anon_sym_LPAREN, + ACTIONS(144), 7, + sym_float, + sym_string, + sym_function, + sym_empty, + anon_sym_true, + anon_sym_false, + anon_sym_RPAREN, + [1041] = 2, + ACTIONS(150), 2, + sym_integer, + anon_sym_LPAREN, + ACTIONS(138), 7, + sym_float, + sym_string, + sym_function, + sym_empty, + anon_sym_true, + anon_sym_false, + anon_sym_RPAREN, + [1055] = 1, + ACTIONS(70), 4, + sym_close, + sym_operator, + anon_sym_then, + anon_sym_else, + [1062] = 1, + ACTIONS(106), 4, + sym_close, + sym_operator, + anon_sym_then, + anon_sym_else, + [1069] = 1, + ACTIONS(78), 4, + sym_close, + sym_operator, + anon_sym_then, + anon_sym_else, + [1076] = 1, + ACTIONS(78), 4, + sym_close, + sym_operator, + anon_sym_then, + anon_sym_else, + [1083] = 1, + ACTIONS(78), 4, + sym_close, + sym_operator, + anon_sym_then, + anon_sym_else, + [1090] = 1, + ACTIONS(78), 4, + sym_close, + sym_operator, + anon_sym_then, + anon_sym_else, + [1097] = 1, + ACTIONS(114), 4, + sym_close, + sym_operator, + anon_sym_then, + anon_sym_else, + [1104] = 2, + ACTIONS(152), 1, + sym_close, + ACTIONS(106), 3, + sym_operator, + anon_sym_then, + anon_sym_else, + [1113] = 1, + ACTIONS(102), 4, + sym_close, + sym_operator, + anon_sym_then, + anon_sym_else, + [1120] = 2, + ACTIONS(154), 1, + anon_sym_else, + ACTIONS(82), 3, + sym_close, + sym_operator, + anon_sym_then, + [1129] = 1, + ACTIONS(98), 4, + sym_close, + sym_operator, + anon_sym_then, + anon_sym_else, + [1136] = 2, + ACTIONS(156), 1, + anon_sym_else, + ACTIONS(82), 2, + sym_operator, + anon_sym_then, + [1144] = 2, + ACTIONS(158), 1, + sym_operator, + ACTIONS(160), 1, + anon_sym_then, + [1151] = 2, + ACTIONS(158), 1, + sym_operator, + ACTIONS(162), 1, + anon_sym_then, + [1158] = 2, + ACTIONS(158), 1, + sym_operator, + ACTIONS(164), 1, + anon_sym_then, + [1165] = 2, + ACTIONS(158), 1, + sym_operator, + ACTIONS(166), 1, + anon_sym_then, + [1172] = 1, + ACTIONS(168), 1, + ts_builtin_sym_end, + [1176] = 1, + ACTIONS(170), 1, aux_sym_comment_token1, - [457] = 1, - ACTIONS(125), 1, - ts_builtin_sym_end, }; static const uint32_t ts_small_parse_table_map[] = { - [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)] = 363, - [SMALL_STATE(23)] = 380, - [SMALL_STATE(24)] = 395, - [SMALL_STATE(25)] = 410, - [SMALL_STATE(26)] = 425, - [SMALL_STATE(27)] = 439, - [SMALL_STATE(28)] = 453, - [SMALL_STATE(29)] = 457, + [SMALL_STATE(12)] = 0, + [SMALL_STATE(13)] = 39, + [SMALL_STATE(14)] = 78, + [SMALL_STATE(15)] = 117, + [SMALL_STATE(16)] = 156, + [SMALL_STATE(17)] = 195, + [SMALL_STATE(18)] = 234, + [SMALL_STATE(19)] = 254, + [SMALL_STATE(20)] = 274, + [SMALL_STATE(21)] = 294, + [SMALL_STATE(22)] = 314, + [SMALL_STATE(23)] = 336, + [SMALL_STATE(24)] = 356, + [SMALL_STATE(25)] = 376, + [SMALL_STATE(26)] = 396, + [SMALL_STATE(27)] = 416, + [SMALL_STATE(28)] = 438, + [SMALL_STATE(29)] = 458, + [SMALL_STATE(30)] = 478, + [SMALL_STATE(31)] = 498, + [SMALL_STATE(32)] = 517, + [SMALL_STATE(33)] = 536, + [SMALL_STATE(34)] = 555, + [SMALL_STATE(35)] = 574, + [SMALL_STATE(36)] = 593, + [SMALL_STATE(37)] = 612, + [SMALL_STATE(38)] = 631, + [SMALL_STATE(39)] = 650, + [SMALL_STATE(40)] = 669, + [SMALL_STATE(41)] = 688, + [SMALL_STATE(42)] = 711, + [SMALL_STATE(43)] = 730, + [SMALL_STATE(44)] = 749, + [SMALL_STATE(45)] = 768, + [SMALL_STATE(46)] = 787, + [SMALL_STATE(47)] = 806, + [SMALL_STATE(48)] = 836, + [SMALL_STATE(49)] = 866, + [SMALL_STATE(50)] = 896, + [SMALL_STATE(51)] = 926, + [SMALL_STATE(52)] = 953, + [SMALL_STATE(53)] = 980, + [SMALL_STATE(54)] = 997, + [SMALL_STATE(55)] = 1024, + [SMALL_STATE(56)] = 1041, + [SMALL_STATE(57)] = 1055, + [SMALL_STATE(58)] = 1062, + [SMALL_STATE(59)] = 1069, + [SMALL_STATE(60)] = 1076, + [SMALL_STATE(61)] = 1083, + [SMALL_STATE(62)] = 1090, + [SMALL_STATE(63)] = 1097, + [SMALL_STATE(64)] = 1104, + [SMALL_STATE(65)] = 1113, + [SMALL_STATE(66)] = 1120, + [SMALL_STATE(67)] = 1129, + [SMALL_STATE(68)] = 1136, + [SMALL_STATE(69)] = 1144, + [SMALL_STATE(70)] = 1151, + [SMALL_STATE(71)] = 1158, + [SMALL_STATE(72)] = 1165, + [SMALL_STATE(73)] = 1172, + [SMALL_STATE(74)] = 1176, }; 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(28), - [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(11), - [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), - [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(7), - [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(28), - [22] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(11), - [25] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(7), - [28] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(7), - [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_operation, 3), - [41] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_operation, 3), - [43] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_open_statement, 1), - [45] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), - [47] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_open_statement, 1), - [49] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), - [51] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_list, 3), - [53] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_list, 3), - [55] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_value, 1), - [57] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_value, 1), - [59] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_boolean, 1), - [61] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_boolean, 1), - [63] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 1), - [65] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 1), - [67] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24), - [69] = {.entry = {.count = 1, .reusable = false}}, SHIFT(24), - [71] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), - [73] = {.entry = {.count = 1, .reusable = false}}, SHIFT(17), - [75] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), - [77] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(24), - [80] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(24), - [83] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(25), - [86] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(17), - [89] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), - [91] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), - [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, 3), - [99] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_comment, 3), - [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(sym_comment, 2), - [107] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), - [109] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_comment, 2), - [111] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 1), - [113] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 1), - [115] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), - [117] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), - [119] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_operator, 1), - [121] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_operator, 1), - [123] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), - [125] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(74), + [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(44), + [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(40), + [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(40), + [13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(38), + [15] = {.entry = {.count = 1, .reusable = false}}, SHIFT(54), + [17] = {.entry = {.count = 1, .reusable = false}}, SHIFT(15), + [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(74), + [24] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(44), + [27] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(40), + [30] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(40), + [33] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(38), + [36] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(54), + [39] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(15), + [42] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source, 1), + [44] = {.entry = {.count = 1, .reusable = false}}, SHIFT(59), + [46] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), + [48] = {.entry = {.count = 1, .reusable = false}}, SHIFT(34), + [50] = {.entry = {.count = 1, .reusable = false}}, SHIFT(32), + [52] = {.entry = {.count = 1, .reusable = false}}, SHIFT(52), + [54] = {.entry = {.count = 1, .reusable = false}}, SHIFT(14), + [56] = {.entry = {.count = 1, .reusable = false}}, SHIFT(26), + [58] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), + [60] = {.entry = {.count = 1, .reusable = false}}, SHIFT(25), + [62] = {.entry = {.count = 1, .reusable = false}}, SHIFT(24), + [64] = {.entry = {.count = 1, .reusable = false}}, SHIFT(51), + [66] = {.entry = {.count = 1, .reusable = false}}, SHIFT(12), + [68] = {.entry = {.count = 1, .reusable = false}}, SHIFT(16), + [70] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_statement, 1), + [72] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_statement, 1), + [74] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_list, 3), + [76] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_list, 3), + [78] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 1), + [80] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 1), + [82] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_control_flow, 4), + [84] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_control_flow, 4), + [86] = {.entry = {.count = 1, .reusable = false}}, SHIFT(6), + [88] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_boolean, 1), + [90] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_boolean, 1), + [92] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_value, 1), + [94] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_value, 1), + [96] = {.entry = {.count = 1, .reusable = false}}, SHIFT(7), + [98] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_operation, 3), + [100] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_operation, 3), + [102] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_control_flow, 6), + [104] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_control_flow, 6), + [106] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_open_statement, 1), + [108] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_open_statement, 1), + [110] = {.entry = {.count = 1, .reusable = true}}, SHIFT(46), + [112] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), + [114] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_closed_statement, 2), + [116] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_closed_statement, 2), + [118] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32), + [120] = {.entry = {.count = 1, .reusable = true}}, SHIFT(45), + [122] = {.entry = {.count = 1, .reusable = true}}, SHIFT(39), + [124] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), + [126] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(34), + [129] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(34), + [132] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(32), + [135] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(52), + [138] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), + [140] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_comment, 2), + [142] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_comment, 2), + [144] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 1), + [146] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 1), + [148] = {.entry = {.count = 1, .reusable = true}}, SHIFT(56), + [150] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), + [152] = {.entry = {.count = 1, .reusable = true}}, SHIFT(63), + [154] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), + [156] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), + [158] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), + [160] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), + [162] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), + [164] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), + [166] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), + [168] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [170] = {.entry = {.count = 1, .reusable = true}}, SHIFT(53), }; #ifdef __cplusplus