From 012efffa2e46e1d160b4c63fa58578091ce9ab24 Mon Sep 17 00:00:00 2001 From: Jeff Date: Thu, 24 Aug 2023 12:53:42 -0400 Subject: [PATCH] Resolve grammar bugs; Pass tests --- corpus/tests.txt | 56 +- grammar.js | 15 +- src/grammar.json | 62 +- src/node-types.json | 21 +- src/parser.c | 1622 ++++++++++++++++++++----------------------- 5 files changed, 872 insertions(+), 904 deletions(-) diff --git a/corpus/tests.txt b/corpus/tests.txt index 45766e8..154af2f 100644 --- a/corpus/tests.txt +++ b/corpus/tests.txt @@ -70,8 +70,9 @@ String --- (source_file - (value - (string))) + (expression + (value + (string)))) ================== Integer @@ -82,8 +83,9 @@ Integer --- (source_file - (value - (integer))) + (expression + (value + (integer)))) ================== Float @@ -94,8 +96,9 @@ Float --- (source_file - (value - (float))) + (expression + (value + (float)))) ================== @@ -107,12 +110,15 @@ List --- (source_file - (value - (list - (value - (integer))) - (value - (integer)))) + (expression + (value + (list + (expression + (value + (integer))) + (expression + (value + (integer))))))) ================== Empty @@ -123,8 +129,9 @@ Empty --- (source_file - (value - (empty))) + (expression + (value + (empty)))) ================== Tool @@ -137,8 +144,23 @@ random_boolean(); (source_file (expression (tool)) - (value - (empty)) - (chain)) + (expression + (value + (empty))) + (chain)) +================== +Boolean +================== +true false + +--- + +(source_file + (expression + (value + (boolean))) + (expression + (value + (boolean)))) diff --git a/grammar.js b/grammar.js index 2b1050e..c22c20e 100644 --- a/grammar.js +++ b/grammar.js @@ -5,18 +5,15 @@ module.exports = grammar({ source_file: $ => repeat(choice( $.comment, $.expression, - $.value, $.yield, $.chain )), - comment: $ => /(#)(.+?)([\n\r])/, - expression: $ => choice( - $.identifier, + prec(2, $.value), + prec(1, $.identifier), $.tool, seq($.identifier, $.operator, $.expression), - seq($.value, $.operator, $.value) ), value: $ => choice( @@ -25,7 +22,10 @@ module.exports = grammar({ $.string, $.list, $.empty, + $.boolean, ), + + comment: $ => /(#)(.+?)([\n\r])/, yield: $ => "->", @@ -60,6 +60,11 @@ module.exports = grammar({ empty: $ => "()", + boolean: $ => choice( + "true", + "false" + ), + list: $ => seq( '(', repeat1(seq($.expression, optional(','))), diff --git a/src/grammar.json b/src/grammar.json index e066f1b..1f9fcb1 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -14,10 +14,6 @@ "type": "SYMBOL", "name": "expression" }, - { - "type": "SYMBOL", - "name": "value" - }, { "type": "SYMBOL", "name": "yield" @@ -29,16 +25,24 @@ ] } }, - "comment": { - "type": "PATTERN", - "value": "(#)(.+?)([\\n\\r])" - }, "expression": { "type": "CHOICE", "members": [ { - "type": "SYMBOL", - "name": "identifier" + "type": "PREC", + "value": 2, + "content": { + "type": "SYMBOL", + "name": "value" + } + }, + { + "type": "PREC", + "value": 1, + "content": { + "type": "SYMBOL", + "name": "identifier" + } }, { "type": "SYMBOL", @@ -60,23 +64,6 @@ "name": "expression" } ] - }, - { - "type": "SEQ", - "members": [ - { - "type": "SYMBOL", - "name": "value" - }, - { - "type": "SYMBOL", - "name": "operator" - }, - { - "type": "SYMBOL", - "name": "value" - } - ] } ] }, @@ -102,9 +89,17 @@ { "type": "SYMBOL", "name": "empty" + }, + { + "type": "SYMBOL", + "name": "boolean" } ] }, + "comment": { + "type": "PATTERN", + "value": "(#)(.+?)([\\n\\r])" + }, "yield": { "type": "STRING", "value": "->" @@ -191,6 +186,19 @@ "type": "STRING", "value": "()" }, + "boolean": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "true" + }, + { + "type": "STRING", + "value": "false" + } + ] + }, "list": { "type": "SEQ", "members": [ diff --git a/src/node-types.json b/src/node-types.json index 870f972..95bb999 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -1,4 +1,9 @@ [ + { + "type": "boolean", + "named": true, + "fields": {} + }, { "type": "expression", "named": true, @@ -70,10 +75,6 @@ "type": "expression", "named": true }, - { - "type": "value", - "named": true - }, { "type": "yield", "named": true @@ -94,6 +95,10 @@ "multiple": false, "required": true, "types": [ + { + "type": "boolean", + "named": true + }, { "type": "empty", "named": true @@ -161,6 +166,10 @@ "type": "empty", "named": true }, + { + "type": "false", + "named": false + }, { "type": "float", "named": true @@ -197,6 +206,10 @@ "type": "string", "named": true }, + { + "type": "true", + "named": false + }, { "type": "yield", "named": true diff --git a/src/parser.c b/src/parser.c index 51e5a29..c525245 100644 --- a/src/parser.c +++ b/src/parser.c @@ -6,11 +6,11 @@ #endif #define LANGUAGE_VERSION 14 -#define STATE_COUNT 29 -#define LARGE_STATE_COUNT 17 -#define SYMBOL_COUNT 32 +#define STATE_COUNT 20 +#define LARGE_STATE_COUNT 16 +#define SYMBOL_COUNT 35 #define ALIAS_COUNT 0 -#define TOKEN_COUNT 24 +#define TOKEN_COUNT 26 #define EXTERNAL_TOKEN_COUNT 0 #define FIELD_COUNT 0 #define MAX_ALIAS_SEQUENCE_LENGTH 3 @@ -37,17 +37,20 @@ enum { sym_string = 18, sym_function = 19, sym_empty = 20, - anon_sym_LPAREN = 21, - anon_sym_COMMA = 22, - anon_sym_RPAREN = 23, - sym_source_file = 24, - sym_expression = 25, - sym_value = 26, - sym_operator = 27, - sym_tool = 28, - sym_list = 29, - aux_sym_source_file_repeat1 = 30, - aux_sym_list_repeat1 = 31, + anon_sym_true = 21, + anon_sym_false = 22, + anon_sym_LPAREN = 23, + anon_sym_COMMA = 24, + anon_sym_RPAREN = 25, + sym_source_file = 26, + sym_expression = 27, + sym_value = 28, + sym_operator = 29, + sym_tool = 30, + sym_boolean = 31, + sym_list = 32, + aux_sym_source_file_repeat1 = 33, + aux_sym_list_repeat1 = 34, }; static const char * const ts_symbol_names[] = { @@ -72,6 +75,8 @@ static const char * const ts_symbol_names[] = { [sym_string] = "string", [sym_function] = "function", [sym_empty] = "empty", + [anon_sym_true] = "true", + [anon_sym_false] = "false", [anon_sym_LPAREN] = "(", [anon_sym_COMMA] = ",", [anon_sym_RPAREN] = ")", @@ -80,6 +85,7 @@ static const char * const ts_symbol_names[] = { [sym_value] = "value", [sym_operator] = "operator", [sym_tool] = "tool", + [sym_boolean] = "boolean", [sym_list] = "list", [aux_sym_source_file_repeat1] = "source_file_repeat1", [aux_sym_list_repeat1] = "list_repeat1", @@ -107,6 +113,8 @@ static const TSSymbol ts_symbol_map[] = { [sym_string] = sym_string, [sym_function] = sym_function, [sym_empty] = sym_empty, + [anon_sym_true] = anon_sym_true, + [anon_sym_false] = anon_sym_false, [anon_sym_LPAREN] = anon_sym_LPAREN, [anon_sym_COMMA] = anon_sym_COMMA, [anon_sym_RPAREN] = anon_sym_RPAREN, @@ -115,6 +123,7 @@ static const TSSymbol ts_symbol_map[] = { [sym_value] = sym_value, [sym_operator] = sym_operator, [sym_tool] = sym_tool, + [sym_boolean] = sym_boolean, [sym_list] = sym_list, [aux_sym_source_file_repeat1] = aux_sym_source_file_repeat1, [aux_sym_list_repeat1] = aux_sym_list_repeat1, @@ -205,6 +214,14 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, + [anon_sym_true] = { + .visible = true, + .named = false, + }, + [anon_sym_false] = { + .visible = true, + .named = false, + }, [anon_sym_LPAREN] = { .visible = true, .named = false, @@ -237,6 +254,10 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, + [sym_boolean] = { + .visible = true, + .named = true, + }, [sym_list] = { .visible = true, .named = true, @@ -273,22 +294,13 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [10] = 10, [11] = 11, [12] = 12, - [13] = 5, - [14] = 4, - [15] = 8, - [16] = 8, + [13] = 13, + [14] = 14, + [15] = 15, + [16] = 16, [17] = 17, - [18] = 17, - [19] = 17, - [20] = 20, - [21] = 21, - [22] = 22, - [23] = 23, - [24] = 24, - [25] = 25, - [26] = 5, - [27] = 4, - [28] = 28, + [18] = 18, + [19] = 19, }; static bool ts_lex(TSLexer *lexer, TSStateId state) { @@ -296,468 +308,533 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { eof = lexer->eof(lexer); switch (state) { case 0: - if (eof) ADVANCE(8); + if (eof) ADVANCE(7); if (lookahead == '"') ADVANCE(2); - if (lookahead == '#') ADVANCE(6); - if (lookahead == '&') ADVANCE(49); - if (lookahead == '\'') ADVANCE(4); - if (lookahead == '(') ADVANCE(60); - if (lookahead == ')') ADVANCE(62); - if (lookahead == '+') ADVANCE(45); - if (lookahead == ',') ADVANCE(61); - if (lookahead == '-') ADVANCE(44); - if (lookahead == '/') ADVANCE(46); - if (lookahead == ';') ADVANCE(12); - if (lookahead == '=') ADVANCE(42); + if (lookahead == '#') ADVANCE(5); + if (lookahead == '&') ADVANCE(53); + if (lookahead == '\'') ADVANCE(3); + if (lookahead == '(') ADVANCE(66); + if (lookahead == ')') ADVANCE(68); + if (lookahead == '+') ADVANCE(50); + if (lookahead == ',') ADVANCE(67); + if (lookahead == '-') ADVANCE(49); + if (lookahead == '/') ADVANCE(51); + if (lookahead == ';') ADVANCE(11); + if (lookahead == '=') ADVANCE(48); + if (lookahead == 'f') ADVANCE(12); if (lookahead == 'r') ADVANCE(13); - if (lookahead == '|') ADVANCE(48); + if (lookahead == 't') ADVANCE(38); + if (lookahead == '|') ADVANCE(52); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') SKIP(0) - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(56); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(60); if (lookahead == '.' || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(41); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(47); END_STATE(); case 1: - if (lookahead == '\n') ADVANCE(9); - if (lookahead == '\r') ADVANCE(10); + if (lookahead == '\n') ADVANCE(8); + if (lookahead == '\r') ADVANCE(9); if (lookahead != 0) ADVANCE(1); END_STATE(); case 2: - if (lookahead == '"') ADVANCE(57); + if (lookahead == '"') ADVANCE(61); if (lookahead != 0 && lookahead != '\n') ADVANCE(2); END_STATE(); case 3: - if (lookahead == '&') ADVANCE(49); - if (lookahead == '+') ADVANCE(45); - if (lookahead == '-') ADVANCE(43); - if (lookahead == '/') ADVANCE(46); - if (lookahead == '=') ADVANCE(42); - if (lookahead == '|') ADVANCE(47); - if (lookahead == '\t' || - lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') SKIP(3) + if (lookahead == '\'') ADVANCE(62); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(3); END_STATE(); case 4: - if (lookahead == '\'') ADVANCE(58); - if (lookahead != 0 && - lookahead != '\n') ADVANCE(4); + if (lookahead == '>') ADVANCE(10); END_STATE(); case 5: - if (lookahead == '>') ADVANCE(11); - END_STATE(); - case 6: if (lookahead != 0 && lookahead != '\n') ADVANCE(1); END_STATE(); - case 7: - if (eof) ADVANCE(8); + case 6: + if (eof) ADVANCE(7); if (lookahead == '"') ADVANCE(2); - if (lookahead == '#') ADVANCE(6); - if (lookahead == '(') ADVANCE(60); - if (lookahead == ')') ADVANCE(62); - if (lookahead == ',') ADVANCE(61); - if (lookahead == '-') ADVANCE(5); - if (lookahead == ';') ADVANCE(12); + if (lookahead == '#') ADVANCE(5); + if (lookahead == '(') ADVANCE(66); + if (lookahead == ')') ADVANCE(68); + if (lookahead == ',') ADVANCE(67); + if (lookahead == '-') ADVANCE(4); + if (lookahead == ';') ADVANCE(11); + if (lookahead == 'f') ADVANCE(12); if (lookahead == 'r') ADVANCE(13); + if (lookahead == 't') ADVANCE(38); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || - lookahead == ' ') SKIP(7) - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(56); + lookahead == ' ') SKIP(6) + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(60); if (lookahead == '.' || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(41); + lookahead == '|') ADVANCE(47); + END_STATE(); + case 7: + ACCEPT_TOKEN(ts_builtin_sym_end); END_STATE(); case 8: - ACCEPT_TOKEN(ts_builtin_sym_end); + ACCEPT_TOKEN(sym_comment); END_STATE(); case 9: ACCEPT_TOKEN(sym_comment); - END_STATE(); - case 10: - ACCEPT_TOKEN(sym_comment); - if (lookahead == '\n') ADVANCE(9); - if (lookahead == '\r') ADVANCE(10); + if (lookahead == '\n') ADVANCE(8); + if (lookahead == '\r') ADVANCE(9); if (lookahead != 0) ADVANCE(1); END_STATE(); - case 11: + case 10: ACCEPT_TOKEN(sym_yield); END_STATE(); - case 12: + case 11: ACCEPT_TOKEN(sym_chain); END_STATE(); - case 13: + case 12: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 'a') ADVANCE(27); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'a') ADVANCE(26); if (lookahead == '.' || ('A' <= lookahead && lookahead <= 'Z') || ('b' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(41); + lookahead == '|') ADVANCE(47); + END_STATE(); + case 13: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'a') ADVANCE(30); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('b' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(47); END_STATE(); case 14: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 'a') ADVANCE(28); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'a') ADVANCE(31); if (lookahead == '.' || - lookahead == '|') ADVANCE(41); + lookahead == '|') ADVANCE(47); if (('A' <= lookahead && lookahead <= 'Z') || - ('b' <= lookahead && lookahead <= 'z')) ADVANCE(40); + ('b' <= lookahead && lookahead <= 'z')) ADVANCE(46); END_STATE(); case 15: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 'a') ADVANCE(39); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'a') ADVANCE(44); if (lookahead == '.' || - lookahead == '|') ADVANCE(41); + lookahead == '|') ADVANCE(47); if (('A' <= lookahead && lookahead <= 'Z') || - ('b' <= lookahead && lookahead <= 'z')) ADVANCE(40); + ('b' <= lookahead && lookahead <= 'z')) ADVANCE(46); END_STATE(); case 16: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 'b') ADVANCE(33); - if (lookahead == 'f') ADVANCE(25); - if (lookahead == 'i') ADVANCE(29); - if (lookahead == 's') ADVANCE(37); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'b') ADVANCE(36); + if (lookahead == 'f') ADVANCE(28); + if (lookahead == 'i') ADVANCE(32); + if (lookahead == 's') ADVANCE(42); if (lookahead == '.' || - lookahead == '|') ADVANCE(41); + lookahead == '|') ADVANCE(47); if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); END_STATE(); case 17: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 'd') ADVANCE(31); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'd') ADVANCE(34); if (lookahead == '.' || ('A' <= lookahead && lookahead <= 'Z') || ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(41); + lookahead == '|') ADVANCE(47); END_STATE(); case 18: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 'e') ADVANCE(22); - if (lookahead == '.' || - lookahead == '|') ADVANCE(41); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); - END_STATE(); - case 19: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 'e') ADVANCE(36); - if (lookahead == '.' || - lookahead == '|') ADVANCE(41); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); - END_STATE(); - case 20: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 'e') ADVANCE(14); - if (lookahead == '.' || - lookahead == '|') ADVANCE(41); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); - END_STATE(); - case 21: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 'g') ADVANCE(53); - if (lookahead == '.' || - lookahead == '|') ADVANCE(41); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); - END_STATE(); - case 22: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 'g') ADVANCE(19); - if (lookahead == '.' || - lookahead == '|') ADVANCE(41); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); - END_STATE(); - case 23: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 'i') ADVANCE(30); - if (lookahead == '.' || - lookahead == '|') ADVANCE(41); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); - END_STATE(); - case 24: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 'l') ADVANCE(20); - if (lookahead == '.' || - lookahead == '|') ADVANCE(41); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); - END_STATE(); - case 25: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 'l') ADVANCE(32); - if (lookahead == '.' || - lookahead == '|') ADVANCE(41); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); - END_STATE(); - case 26: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 'm') ADVANCE(50); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'e') ADVANCE(64); if (lookahead == '.' || ('A' <= lookahead && lookahead <= 'Z') || ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(41); + lookahead == '|') ADVANCE(47); + END_STATE(); + case 19: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'e') ADVANCE(65); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(47); + END_STATE(); + case 20: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'e') ADVANCE(24); + if (lookahead == '.' || + lookahead == '|') ADVANCE(47); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); + END_STATE(); + case 21: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'e') ADVANCE(40); + if (lookahead == '.' || + lookahead == '|') ADVANCE(47); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); + END_STATE(); + case 22: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'e') ADVANCE(14); + if (lookahead == '.' || + lookahead == '|') ADVANCE(47); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); + END_STATE(); + case 23: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'g') ADVANCE(57); + if (lookahead == '.' || + lookahead == '|') ADVANCE(47); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); + END_STATE(); + case 24: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'g') ADVANCE(21); + if (lookahead == '.' || + lookahead == '|') ADVANCE(47); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); + END_STATE(); + case 25: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'i') ADVANCE(33); + if (lookahead == '.' || + lookahead == '|') ADVANCE(47); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); + END_STATE(); + case 26: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'l') ADVANCE(41); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(47); END_STATE(); case 27: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'l') ADVANCE(22); + if (lookahead == '.' || + lookahead == '|') ADVANCE(47); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); + END_STATE(); + case 28: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'l') ADVANCE(35); + if (lookahead == '.' || + lookahead == '|') ADVANCE(47); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); + END_STATE(); + case 29: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'm') ADVANCE(54); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(47); + END_STATE(); + case 30: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(46); if (lookahead == 'n') ADVANCE(17); if (lookahead == '.' || ('A' <= lookahead && lookahead <= 'Z') || ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(41); - END_STATE(); - case 28: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 'n') ADVANCE(51); - if (lookahead == '.' || - lookahead == '|') ADVANCE(41); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); - END_STATE(); - case 29: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 'n') ADVANCE(38); - if (lookahead == '.' || - lookahead == '|') ADVANCE(41); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); - END_STATE(); - case 30: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 'n') ADVANCE(21); - if (lookahead == '.' || - lookahead == '|') ADVANCE(41); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); + lookahead == '|') ADVANCE(47); END_STATE(); case 31: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 'o') ADVANCE(26); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'n') ADVANCE(55); if (lookahead == '.' || - ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(41); + lookahead == '|') ADVANCE(47); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); END_STATE(); case 32: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 'o') ADVANCE(15); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'n') ADVANCE(43); if (lookahead == '.' || - lookahead == '|') ADVANCE(41); + lookahead == '|') ADVANCE(47); if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); END_STATE(); case 33: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 'o') ADVANCE(34); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'n') ADVANCE(23); if (lookahead == '.' || - lookahead == '|') ADVANCE(41); + lookahead == '|') ADVANCE(47); if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); END_STATE(); case 34: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 'o') ADVANCE(24); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'o') ADVANCE(29); if (lookahead == '.' || - lookahead == '|') ADVANCE(41); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(47); END_STATE(); case 35: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 'r') ADVANCE(23); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'o') ADVANCE(15); if (lookahead == '.' || - lookahead == '|') ADVANCE(41); + lookahead == '|') ADVANCE(47); if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); END_STATE(); case 36: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 'r') ADVANCE(52); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'o') ADVANCE(37); if (lookahead == '.' || - lookahead == '|') ADVANCE(41); + lookahead == '|') ADVANCE(47); if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); END_STATE(); case 37: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 't') ADVANCE(35); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'o') ADVANCE(27); if (lookahead == '.' || - lookahead == '|') ADVANCE(41); + lookahead == '|') ADVANCE(47); if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); END_STATE(); case 38: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 't') ADVANCE(18); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'r') ADVANCE(45); if (lookahead == '.' || - lookahead == '|') ADVANCE(41); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(47); END_STATE(); case 39: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); - if (lookahead == 't') ADVANCE(54); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'r') ADVANCE(25); if (lookahead == '.' || - lookahead == '|') ADVANCE(41); + lookahead == '|') ADVANCE(47); if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); END_STATE(); case 40: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'r') ADVANCE(56); if (lookahead == '.' || - lookahead == '|') ADVANCE(41); + lookahead == '|') ADVANCE(47); if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); END_STATE(); case 41: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(40); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 's') ADVANCE(19); if (lookahead == '.' || ('A' <= lookahead && lookahead <= 'Z') || ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(41); + lookahead == '|') ADVANCE(47); END_STATE(); case 42: - ACCEPT_TOKEN(anon_sym_EQ); + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 't') ADVANCE(39); + if (lookahead == '.' || + lookahead == '|') ADVANCE(47); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); END_STATE(); case 43: - ACCEPT_TOKEN(anon_sym_DASH); + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 't') ADVANCE(20); + if (lookahead == '.' || + lookahead == '|') ADVANCE(47); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); END_STATE(); case 44: - ACCEPT_TOKEN(anon_sym_DASH); - if (lookahead == '>') ADVANCE(11); + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 't') ADVANCE(58); + if (lookahead == '.' || + lookahead == '|') ADVANCE(47); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); END_STATE(); case 45: - ACCEPT_TOKEN(anon_sym_PLUS); - END_STATE(); - case 46: - ACCEPT_TOKEN(anon_sym_SLASH); - END_STATE(); - case 47: - ACCEPT_TOKEN(anon_sym_PIPE); - END_STATE(); - case 48: - ACCEPT_TOKEN(anon_sym_PIPE); - if (lookahead == '_') ADVANCE(40); + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(46); + if (lookahead == 'u') ADVANCE(18); if (lookahead == '.' || ('A' <= lookahead && lookahead <= 'Z') || ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(41); + lookahead == '|') ADVANCE(47); + END_STATE(); + case 46: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(46); + if (lookahead == '.' || + lookahead == '|') ADVANCE(47); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); + END_STATE(); + case 47: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(46); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(47); + END_STATE(); + case 48: + ACCEPT_TOKEN(anon_sym_EQ); END_STATE(); case 49: - ACCEPT_TOKEN(anon_sym_AMP); + ACCEPT_TOKEN(anon_sym_DASH); + if (lookahead == '>') ADVANCE(10); END_STATE(); case 50: + ACCEPT_TOKEN(anon_sym_PLUS); + END_STATE(); + case 51: + ACCEPT_TOKEN(anon_sym_SLASH); + END_STATE(); + case 52: + ACCEPT_TOKEN(anon_sym_PIPE); + if (lookahead == '_') ADVANCE(46); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(47); + END_STATE(); + case 53: + ACCEPT_TOKEN(anon_sym_AMP); + END_STATE(); + case 54: ACCEPT_TOKEN(anon_sym_random); if (lookahead == '_') ADVANCE(16); if (lookahead == '.' || ('A' <= lookahead && lookahead <= 'Z') || ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(41); - END_STATE(); - case 51: - ACCEPT_TOKEN(anon_sym_random_boolean); - if (lookahead == '_') ADVANCE(40); - if (lookahead == '.' || - lookahead == '|') ADVANCE(41); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); - END_STATE(); - case 52: - ACCEPT_TOKEN(anon_sym_random_integer); - if (lookahead == '_') ADVANCE(40); - if (lookahead == '.' || - lookahead == '|') ADVANCE(41); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); - END_STATE(); - case 53: - ACCEPT_TOKEN(anon_sym_random_string); - if (lookahead == '_') ADVANCE(40); - if (lookahead == '.' || - lookahead == '|') ADVANCE(41); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); - END_STATE(); - case 54: - ACCEPT_TOKEN(anon_sym_random_float); - if (lookahead == '_') ADVANCE(40); - if (lookahead == '.' || - lookahead == '|') ADVANCE(41); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(40); + lookahead == '|') ADVANCE(47); END_STATE(); case 55: - ACCEPT_TOKEN(sym_float); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(55); + ACCEPT_TOKEN(anon_sym_random_boolean); + if (lookahead == '_') ADVANCE(46); + if (lookahead == '.' || + lookahead == '|') ADVANCE(47); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); END_STATE(); case 56: - ACCEPT_TOKEN(sym_integer); - if (lookahead == '.') ADVANCE(55); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(56); + ACCEPT_TOKEN(anon_sym_random_integer); + if (lookahead == '_') ADVANCE(46); + if (lookahead == '.' || + lookahead == '|') ADVANCE(47); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); END_STATE(); case 57: + ACCEPT_TOKEN(anon_sym_random_string); + if (lookahead == '_') ADVANCE(46); + if (lookahead == '.' || + lookahead == '|') ADVANCE(47); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); + END_STATE(); + case 58: + ACCEPT_TOKEN(anon_sym_random_float); + if (lookahead == '_') ADVANCE(46); + if (lookahead == '.' || + lookahead == '|') ADVANCE(47); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(46); + END_STATE(); + case 59: + ACCEPT_TOKEN(sym_float); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(59); + END_STATE(); + case 60: + ACCEPT_TOKEN(sym_integer); + if (lookahead == '.') ADVANCE(59); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(60); + END_STATE(); + case 61: ACCEPT_TOKEN(sym_string); - if (lookahead == '"') ADVANCE(57); + if (lookahead == '"') ADVANCE(61); if (lookahead != 0 && lookahead != '\n') ADVANCE(2); END_STATE(); - case 58: + case 62: ACCEPT_TOKEN(sym_function); - if (lookahead == '\'') ADVANCE(58); + if (lookahead == '\'') ADVANCE(62); if (lookahead != 0 && - lookahead != '\n') ADVANCE(4); + lookahead != '\n') ADVANCE(3); END_STATE(); - case 59: + case 63: ACCEPT_TOKEN(sym_empty); END_STATE(); - case 60: - ACCEPT_TOKEN(anon_sym_LPAREN); - if (lookahead == ')') ADVANCE(59); + case 64: + ACCEPT_TOKEN(anon_sym_true); + if (lookahead == '_') ADVANCE(46); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(47); END_STATE(); - case 61: + case 65: + ACCEPT_TOKEN(anon_sym_false); + if (lookahead == '_') ADVANCE(46); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(47); + END_STATE(); + case 66: + ACCEPT_TOKEN(anon_sym_LPAREN); + if (lookahead == ')') ADVANCE(63); + END_STATE(); + case 67: ACCEPT_TOKEN(anon_sym_COMMA); END_STATE(); - case 62: + case 68: ACCEPT_TOKEN(anon_sym_RPAREN); END_STATE(); default: @@ -767,34 +844,25 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { static const TSLexMode ts_lex_modes[STATE_COUNT] = { [0] = {.lex_state = 0}, - [1] = {.lex_state = 7}, + [1] = {.lex_state = 6}, [2] = {.lex_state = 0}, - [3] = {.lex_state = 0}, - [4] = {.lex_state = 0}, - [5] = {.lex_state = 0}, - [6] = {.lex_state = 7}, - [7] = {.lex_state = 7}, - [8] = {.lex_state = 7}, - [9] = {.lex_state = 7}, - [10] = {.lex_state = 7}, - [11] = {.lex_state = 7}, - [12] = {.lex_state = 7}, - [13] = {.lex_state = 7}, - [14] = {.lex_state = 7}, - [15] = {.lex_state = 7}, - [16] = {.lex_state = 7}, - [17] = {.lex_state = 7}, - [18] = {.lex_state = 7}, - [19] = {.lex_state = 7}, - [20] = {.lex_state = 7}, - [21] = {.lex_state = 7}, - [22] = {.lex_state = 7}, - [23] = {.lex_state = 7}, - [24] = {.lex_state = 3}, - [25] = {.lex_state = 0}, - [26] = {.lex_state = 3}, - [27] = {.lex_state = 3}, - [28] = {.lex_state = 0}, + [3] = {.lex_state = 6}, + [4] = {.lex_state = 6}, + [5] = {.lex_state = 6}, + [6] = {.lex_state = 6}, + [7] = {.lex_state = 6}, + [8] = {.lex_state = 6}, + [9] = {.lex_state = 6}, + [10] = {.lex_state = 6}, + [11] = {.lex_state = 6}, + [12] = {.lex_state = 6}, + [13] = {.lex_state = 6}, + [14] = {.lex_state = 6}, + [15] = {.lex_state = 6}, + [16] = {.lex_state = 6}, + [17] = {.lex_state = 6}, + [18] = {.lex_state = 6}, + [19] = {.lex_state = 0}, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { @@ -820,17 +888,20 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [sym_string] = ACTIONS(1), [sym_function] = ACTIONS(1), [sym_empty] = ACTIONS(1), + [anon_sym_true] = ACTIONS(1), + [anon_sym_false] = ACTIONS(1), [anon_sym_LPAREN] = ACTIONS(1), [anon_sym_COMMA] = ACTIONS(1), [anon_sym_RPAREN] = ACTIONS(1), }, [1] = { - [sym_source_file] = STATE(28), - [sym_expression] = STATE(6), - [sym_value] = STATE(3), - [sym_tool] = STATE(9), - [sym_list] = STATE(5), - [aux_sym_source_file_repeat1] = STATE(6), + [sym_source_file] = STATE(19), + [sym_expression] = STATE(3), + [sym_value] = STATE(11), + [sym_tool] = STATE(12), + [sym_boolean] = STATE(8), + [sym_list] = STATE(8), + [aux_sym_source_file_repeat1] = STATE(3), [ts_builtin_sym_end] = ACTIONS(3), [sym_comment] = ACTIONS(5), [sym_yield] = ACTIONS(5), @@ -845,114 +916,49 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [sym_integer] = ACTIONS(13), [sym_string] = ACTIONS(11), [sym_empty] = ACTIONS(11), - [anon_sym_LPAREN] = ACTIONS(15), + [anon_sym_true] = ACTIONS(15), + [anon_sym_false] = ACTIONS(15), + [anon_sym_LPAREN] = ACTIONS(17), }, [2] = { - [sym_operator] = STATE(20), - [ts_builtin_sym_end] = ACTIONS(17), - [sym_comment] = ACTIONS(17), - [sym_yield] = ACTIONS(17), - [sym_chain] = ACTIONS(17), - [sym_identifier] = ACTIONS(19), - [anon_sym_EQ] = ACTIONS(21), - [anon_sym_DASH] = ACTIONS(23), - [anon_sym_PLUS] = ACTIONS(21), - [anon_sym_SLASH] = ACTIONS(21), - [anon_sym_PIPE] = ACTIONS(23), - [anon_sym_AMP] = ACTIONS(21), - [anon_sym_random] = ACTIONS(19), - [anon_sym_random_boolean] = ACTIONS(19), - [anon_sym_random_integer] = ACTIONS(19), - [anon_sym_random_string] = ACTIONS(19), - [anon_sym_random_float] = ACTIONS(19), - [sym_float] = ACTIONS(17), - [sym_integer] = ACTIONS(19), - [sym_string] = ACTIONS(17), - [sym_empty] = ACTIONS(17), - [anon_sym_LPAREN] = ACTIONS(19), - [anon_sym_COMMA] = ACTIONS(17), - [anon_sym_RPAREN] = ACTIONS(17), + [sym_operator] = STATE(15), + [ts_builtin_sym_end] = ACTIONS(19), + [sym_comment] = ACTIONS(19), + [sym_yield] = ACTIONS(19), + [sym_chain] = ACTIONS(19), + [sym_identifier] = ACTIONS(21), + [anon_sym_EQ] = ACTIONS(23), + [anon_sym_DASH] = ACTIONS(25), + [anon_sym_PLUS] = ACTIONS(23), + [anon_sym_SLASH] = ACTIONS(23), + [anon_sym_PIPE] = ACTIONS(25), + [anon_sym_AMP] = ACTIONS(23), + [anon_sym_random] = ACTIONS(21), + [anon_sym_random_boolean] = ACTIONS(21), + [anon_sym_random_integer] = ACTIONS(21), + [anon_sym_random_string] = ACTIONS(21), + [anon_sym_random_float] = ACTIONS(21), + [sym_float] = ACTIONS(19), + [sym_integer] = ACTIONS(21), + [sym_string] = ACTIONS(19), + [sym_empty] = ACTIONS(19), + [anon_sym_true] = ACTIONS(21), + [anon_sym_false] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(21), + [anon_sym_COMMA] = ACTIONS(19), + [anon_sym_RPAREN] = ACTIONS(19), }, [3] = { - [sym_operator] = STATE(25), - [ts_builtin_sym_end] = ACTIONS(25), - [sym_comment] = ACTIONS(25), - [sym_yield] = ACTIONS(25), - [sym_chain] = ACTIONS(25), - [sym_identifier] = ACTIONS(27), - [anon_sym_EQ] = ACTIONS(21), - [anon_sym_DASH] = ACTIONS(23), - [anon_sym_PLUS] = ACTIONS(21), - [anon_sym_SLASH] = ACTIONS(21), - [anon_sym_PIPE] = ACTIONS(23), - [anon_sym_AMP] = ACTIONS(21), - [anon_sym_random] = ACTIONS(27), - [anon_sym_random_boolean] = ACTIONS(27), - [anon_sym_random_integer] = ACTIONS(27), - [anon_sym_random_string] = ACTIONS(27), - [anon_sym_random_float] = ACTIONS(27), - [sym_float] = ACTIONS(25), - [sym_integer] = ACTIONS(27), - [sym_string] = ACTIONS(25), - [sym_empty] = ACTIONS(25), - [anon_sym_LPAREN] = ACTIONS(27), - }, - [4] = { - [ts_builtin_sym_end] = ACTIONS(29), + [sym_expression] = STATE(4), + [sym_value] = STATE(11), + [sym_tool] = STATE(12), + [sym_boolean] = STATE(8), + [sym_list] = STATE(8), + [aux_sym_source_file_repeat1] = STATE(4), + [ts_builtin_sym_end] = ACTIONS(27), [sym_comment] = ACTIONS(29), [sym_yield] = ACTIONS(29), [sym_chain] = ACTIONS(29), - [sym_identifier] = ACTIONS(31), - [anon_sym_EQ] = ACTIONS(29), - [anon_sym_DASH] = ACTIONS(31), - [anon_sym_PLUS] = ACTIONS(29), - [anon_sym_SLASH] = ACTIONS(29), - [anon_sym_PIPE] = ACTIONS(31), - [anon_sym_AMP] = ACTIONS(29), - [anon_sym_random] = ACTIONS(31), - [anon_sym_random_boolean] = ACTIONS(31), - [anon_sym_random_integer] = ACTIONS(31), - [anon_sym_random_string] = ACTIONS(31), - [anon_sym_random_float] = ACTIONS(31), - [sym_float] = ACTIONS(29), - [sym_integer] = ACTIONS(31), - [sym_string] = ACTIONS(29), - [sym_empty] = ACTIONS(29), - [anon_sym_LPAREN] = ACTIONS(31), - }, - [5] = { - [ts_builtin_sym_end] = ACTIONS(33), - [sym_comment] = ACTIONS(33), - [sym_yield] = ACTIONS(33), - [sym_chain] = ACTIONS(33), - [sym_identifier] = ACTIONS(35), - [anon_sym_EQ] = ACTIONS(33), - [anon_sym_DASH] = ACTIONS(35), - [anon_sym_PLUS] = ACTIONS(33), - [anon_sym_SLASH] = ACTIONS(33), - [anon_sym_PIPE] = ACTIONS(35), - [anon_sym_AMP] = ACTIONS(33), - [anon_sym_random] = ACTIONS(35), - [anon_sym_random_boolean] = ACTIONS(35), - [anon_sym_random_integer] = ACTIONS(35), - [anon_sym_random_string] = ACTIONS(35), - [anon_sym_random_float] = ACTIONS(35), - [sym_float] = ACTIONS(33), - [sym_integer] = ACTIONS(35), - [sym_string] = ACTIONS(33), - [sym_empty] = ACTIONS(33), - [anon_sym_LPAREN] = ACTIONS(35), - }, - [6] = { - [sym_expression] = STATE(7), - [sym_value] = STATE(3), - [sym_tool] = STATE(9), - [sym_list] = STATE(5), - [aux_sym_source_file_repeat1] = STATE(7), - [ts_builtin_sym_end] = ACTIONS(37), - [sym_comment] = ACTIONS(39), - [sym_yield] = ACTIONS(39), - [sym_chain] = ACTIONS(39), [sym_identifier] = ACTIONS(7), [anon_sym_random] = ACTIONS(9), [anon_sym_random_boolean] = ACTIONS(9), @@ -963,319 +969,279 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [sym_integer] = ACTIONS(13), [sym_string] = ACTIONS(11), [sym_empty] = ACTIONS(11), - [anon_sym_LPAREN] = ACTIONS(15), + [anon_sym_true] = ACTIONS(15), + [anon_sym_false] = ACTIONS(15), + [anon_sym_LPAREN] = ACTIONS(17), }, - [7] = { - [sym_expression] = STATE(7), - [sym_value] = STATE(3), - [sym_tool] = STATE(9), - [sym_list] = STATE(5), - [aux_sym_source_file_repeat1] = STATE(7), - [ts_builtin_sym_end] = ACTIONS(41), - [sym_comment] = ACTIONS(43), - [sym_yield] = ACTIONS(43), - [sym_chain] = ACTIONS(43), - [sym_identifier] = ACTIONS(46), - [anon_sym_random] = ACTIONS(49), - [anon_sym_random_boolean] = ACTIONS(49), - [anon_sym_random_integer] = ACTIONS(49), - [anon_sym_random_string] = ACTIONS(49), - [anon_sym_random_float] = ACTIONS(49), - [sym_float] = ACTIONS(52), - [sym_integer] = ACTIONS(55), - [sym_string] = ACTIONS(52), - [sym_empty] = ACTIONS(52), - [anon_sym_LPAREN] = ACTIONS(58), - }, - [8] = { - [sym_expression] = STATE(21), - [sym_value] = STATE(24), - [sym_tool] = STATE(9), - [sym_list] = STATE(26), - [aux_sym_list_repeat1] = STATE(12), - [sym_identifier] = ACTIONS(7), - [anon_sym_random] = ACTIONS(9), - [anon_sym_random_boolean] = ACTIONS(9), - [anon_sym_random_integer] = ACTIONS(9), - [anon_sym_random_string] = ACTIONS(9), - [anon_sym_random_float] = ACTIONS(9), - [sym_float] = ACTIONS(61), - [sym_integer] = ACTIONS(63), - [sym_string] = ACTIONS(61), - [sym_empty] = ACTIONS(61), - [anon_sym_LPAREN] = ACTIONS(65), - [anon_sym_RPAREN] = ACTIONS(67), - }, - [9] = { - [ts_builtin_sym_end] = ACTIONS(17), - [sym_comment] = ACTIONS(17), - [sym_yield] = ACTIONS(17), - [sym_chain] = ACTIONS(17), - [sym_identifier] = ACTIONS(19), - [anon_sym_random] = ACTIONS(19), - [anon_sym_random_boolean] = ACTIONS(19), - [anon_sym_random_integer] = ACTIONS(19), - [anon_sym_random_string] = ACTIONS(19), - [anon_sym_random_float] = ACTIONS(19), - [sym_float] = ACTIONS(17), - [sym_integer] = ACTIONS(19), - [sym_string] = ACTIONS(17), - [sym_empty] = ACTIONS(17), - [anon_sym_LPAREN] = ACTIONS(19), - [anon_sym_COMMA] = ACTIONS(17), - [anon_sym_RPAREN] = ACTIONS(17), - }, - [10] = { - [ts_builtin_sym_end] = ACTIONS(69), - [sym_comment] = ACTIONS(69), - [sym_yield] = ACTIONS(69), - [sym_chain] = ACTIONS(69), - [sym_identifier] = ACTIONS(71), - [anon_sym_random] = ACTIONS(71), - [anon_sym_random_boolean] = ACTIONS(71), - [anon_sym_random_integer] = ACTIONS(71), - [anon_sym_random_string] = ACTIONS(71), - [anon_sym_random_float] = ACTIONS(71), - [sym_float] = ACTIONS(69), - [sym_integer] = ACTIONS(71), - [sym_string] = ACTIONS(69), - [sym_empty] = ACTIONS(69), - [anon_sym_LPAREN] = ACTIONS(71), - [anon_sym_COMMA] = ACTIONS(69), - [anon_sym_RPAREN] = ACTIONS(69), - }, - [11] = { - [ts_builtin_sym_end] = ACTIONS(73), - [sym_comment] = ACTIONS(73), - [sym_yield] = ACTIONS(73), - [sym_chain] = ACTIONS(73), - [sym_identifier] = ACTIONS(75), - [anon_sym_random] = ACTIONS(75), - [anon_sym_random_boolean] = ACTIONS(75), - [anon_sym_random_integer] = ACTIONS(75), - [anon_sym_random_string] = ACTIONS(75), - [anon_sym_random_float] = ACTIONS(75), - [sym_float] = ACTIONS(73), - [sym_integer] = ACTIONS(75), - [sym_string] = ACTIONS(73), - [sym_empty] = ACTIONS(73), - [anon_sym_LPAREN] = ACTIONS(75), - [anon_sym_COMMA] = ACTIONS(73), - [anon_sym_RPAREN] = ACTIONS(73), - }, - [12] = { - [sym_expression] = STATE(21), - [sym_value] = STATE(24), - [sym_tool] = STATE(9), - [sym_list] = STATE(26), - [aux_sym_list_repeat1] = STATE(12), - [sym_identifier] = ACTIONS(77), - [anon_sym_random] = ACTIONS(80), - [anon_sym_random_boolean] = ACTIONS(80), - [anon_sym_random_integer] = ACTIONS(80), - [anon_sym_random_string] = ACTIONS(80), - [anon_sym_random_float] = ACTIONS(80), - [sym_float] = ACTIONS(83), - [sym_integer] = ACTIONS(86), - [sym_string] = ACTIONS(83), - [sym_empty] = ACTIONS(83), - [anon_sym_LPAREN] = ACTIONS(89), - [anon_sym_RPAREN] = ACTIONS(92), - }, - [13] = { - [ts_builtin_sym_end] = ACTIONS(33), + [4] = { + [sym_expression] = STATE(4), + [sym_value] = STATE(11), + [sym_tool] = STATE(12), + [sym_boolean] = STATE(8), + [sym_list] = STATE(8), + [aux_sym_source_file_repeat1] = STATE(4), + [ts_builtin_sym_end] = ACTIONS(31), [sym_comment] = ACTIONS(33), [sym_yield] = ACTIONS(33), [sym_chain] = ACTIONS(33), - [sym_identifier] = ACTIONS(35), - [anon_sym_random] = ACTIONS(35), - [anon_sym_random_boolean] = ACTIONS(35), - [anon_sym_random_integer] = ACTIONS(35), - [anon_sym_random_string] = ACTIONS(35), - [anon_sym_random_float] = ACTIONS(35), - [sym_float] = ACTIONS(33), - [sym_integer] = ACTIONS(35), - [sym_string] = ACTIONS(33), - [sym_empty] = ACTIONS(33), - [anon_sym_LPAREN] = ACTIONS(35), - [anon_sym_COMMA] = ACTIONS(33), - [anon_sym_RPAREN] = ACTIONS(33), + [sym_identifier] = ACTIONS(36), + [anon_sym_random] = ACTIONS(39), + [anon_sym_random_boolean] = ACTIONS(39), + [anon_sym_random_integer] = ACTIONS(39), + [anon_sym_random_string] = ACTIONS(39), + [anon_sym_random_float] = ACTIONS(39), + [sym_float] = ACTIONS(42), + [sym_integer] = ACTIONS(45), + [sym_string] = ACTIONS(42), + [sym_empty] = ACTIONS(42), + [anon_sym_true] = ACTIONS(48), + [anon_sym_false] = ACTIONS(48), + [anon_sym_LPAREN] = ACTIONS(51), + }, + [5] = { + [sym_expression] = STATE(16), + [sym_value] = STATE(11), + [sym_tool] = STATE(12), + [sym_boolean] = STATE(8), + [sym_list] = STATE(8), + [aux_sym_list_repeat1] = STATE(6), + [sym_identifier] = ACTIONS(7), + [anon_sym_random] = ACTIONS(9), + [anon_sym_random_boolean] = ACTIONS(9), + [anon_sym_random_integer] = ACTIONS(9), + [anon_sym_random_string] = ACTIONS(9), + [anon_sym_random_float] = ACTIONS(9), + [sym_float] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_string] = ACTIONS(11), + [sym_empty] = ACTIONS(11), + [anon_sym_true] = ACTIONS(15), + [anon_sym_false] = ACTIONS(15), + [anon_sym_LPAREN] = ACTIONS(17), + [anon_sym_RPAREN] = ACTIONS(54), + }, + [6] = { + [sym_expression] = STATE(16), + [sym_value] = STATE(11), + [sym_tool] = STATE(12), + [sym_boolean] = STATE(8), + [sym_list] = STATE(8), + [aux_sym_list_repeat1] = STATE(6), + [sym_identifier] = ACTIONS(56), + [anon_sym_random] = ACTIONS(59), + [anon_sym_random_boolean] = ACTIONS(59), + [anon_sym_random_integer] = ACTIONS(59), + [anon_sym_random_string] = ACTIONS(59), + [anon_sym_random_float] = ACTIONS(59), + [sym_float] = ACTIONS(62), + [sym_integer] = ACTIONS(65), + [sym_string] = ACTIONS(62), + [sym_empty] = ACTIONS(62), + [anon_sym_true] = ACTIONS(68), + [anon_sym_false] = ACTIONS(68), + [anon_sym_LPAREN] = ACTIONS(71), + [anon_sym_RPAREN] = ACTIONS(74), + }, + [7] = { + [ts_builtin_sym_end] = ACTIONS(76), + [sym_comment] = ACTIONS(76), + [sym_yield] = ACTIONS(76), + [sym_chain] = ACTIONS(76), + [sym_identifier] = ACTIONS(78), + [anon_sym_random] = ACTIONS(78), + [anon_sym_random_boolean] = ACTIONS(78), + [anon_sym_random_integer] = ACTIONS(78), + [anon_sym_random_string] = ACTIONS(78), + [anon_sym_random_float] = ACTIONS(78), + [sym_float] = ACTIONS(76), + [sym_integer] = ACTIONS(78), + [sym_string] = ACTIONS(76), + [sym_empty] = ACTIONS(76), + [anon_sym_true] = ACTIONS(78), + [anon_sym_false] = ACTIONS(78), + [anon_sym_LPAREN] = ACTIONS(78), + [anon_sym_COMMA] = ACTIONS(76), + [anon_sym_RPAREN] = ACTIONS(76), + }, + [8] = { + [ts_builtin_sym_end] = ACTIONS(80), + [sym_comment] = ACTIONS(80), + [sym_yield] = ACTIONS(80), + [sym_chain] = ACTIONS(80), + [sym_identifier] = ACTIONS(82), + [anon_sym_random] = ACTIONS(82), + [anon_sym_random_boolean] = ACTIONS(82), + [anon_sym_random_integer] = ACTIONS(82), + [anon_sym_random_string] = ACTIONS(82), + [anon_sym_random_float] = ACTIONS(82), + [sym_float] = ACTIONS(80), + [sym_integer] = ACTIONS(82), + [sym_string] = ACTIONS(80), + [sym_empty] = ACTIONS(80), + [anon_sym_true] = ACTIONS(82), + [anon_sym_false] = ACTIONS(82), + [anon_sym_LPAREN] = ACTIONS(82), + [anon_sym_COMMA] = ACTIONS(80), + [anon_sym_RPAREN] = ACTIONS(80), + }, + [9] = { + [ts_builtin_sym_end] = ACTIONS(84), + [sym_comment] = ACTIONS(84), + [sym_yield] = ACTIONS(84), + [sym_chain] = ACTIONS(84), + [sym_identifier] = ACTIONS(86), + [anon_sym_random] = ACTIONS(86), + [anon_sym_random_boolean] = ACTIONS(86), + [anon_sym_random_integer] = ACTIONS(86), + [anon_sym_random_string] = ACTIONS(86), + [anon_sym_random_float] = ACTIONS(86), + [sym_float] = ACTIONS(84), + [sym_integer] = ACTIONS(86), + [sym_string] = ACTIONS(84), + [sym_empty] = ACTIONS(84), + [anon_sym_true] = ACTIONS(86), + [anon_sym_false] = ACTIONS(86), + [anon_sym_LPAREN] = ACTIONS(86), + [anon_sym_COMMA] = ACTIONS(84), + [anon_sym_RPAREN] = ACTIONS(84), + }, + [10] = { + [sym_expression] = STATE(16), + [sym_value] = STATE(11), + [sym_tool] = STATE(12), + [sym_boolean] = STATE(8), + [sym_list] = STATE(8), + [aux_sym_list_repeat1] = STATE(5), + [sym_identifier] = ACTIONS(7), + [anon_sym_random] = ACTIONS(9), + [anon_sym_random_boolean] = ACTIONS(9), + [anon_sym_random_integer] = ACTIONS(9), + [anon_sym_random_string] = ACTIONS(9), + [anon_sym_random_float] = ACTIONS(9), + [sym_float] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_string] = ACTIONS(11), + [sym_empty] = ACTIONS(11), + [anon_sym_true] = ACTIONS(15), + [anon_sym_false] = ACTIONS(15), + [anon_sym_LPAREN] = ACTIONS(17), + }, + [11] = { + [ts_builtin_sym_end] = ACTIONS(19), + [sym_comment] = ACTIONS(19), + [sym_yield] = ACTIONS(19), + [sym_chain] = ACTIONS(19), + [sym_identifier] = ACTIONS(21), + [anon_sym_random] = ACTIONS(21), + [anon_sym_random_boolean] = ACTIONS(21), + [anon_sym_random_integer] = ACTIONS(21), + [anon_sym_random_string] = ACTIONS(21), + [anon_sym_random_float] = ACTIONS(21), + [sym_float] = ACTIONS(19), + [sym_integer] = ACTIONS(21), + [sym_string] = ACTIONS(19), + [sym_empty] = ACTIONS(19), + [anon_sym_true] = ACTIONS(21), + [anon_sym_false] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(21), + [anon_sym_COMMA] = ACTIONS(19), + [anon_sym_RPAREN] = ACTIONS(19), + }, + [12] = { + [ts_builtin_sym_end] = ACTIONS(19), + [sym_comment] = ACTIONS(19), + [sym_yield] = ACTIONS(19), + [sym_chain] = ACTIONS(19), + [sym_identifier] = ACTIONS(21), + [anon_sym_random] = ACTIONS(21), + [anon_sym_random_boolean] = ACTIONS(21), + [anon_sym_random_integer] = ACTIONS(21), + [anon_sym_random_string] = ACTIONS(21), + [anon_sym_random_float] = ACTIONS(21), + [sym_float] = ACTIONS(19), + [sym_integer] = ACTIONS(21), + [sym_string] = ACTIONS(19), + [sym_empty] = ACTIONS(19), + [anon_sym_true] = ACTIONS(21), + [anon_sym_false] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(21), + [anon_sym_COMMA] = ACTIONS(19), + [anon_sym_RPAREN] = ACTIONS(19), + }, + [13] = { + [ts_builtin_sym_end] = ACTIONS(88), + [sym_comment] = ACTIONS(88), + [sym_yield] = ACTIONS(88), + [sym_chain] = ACTIONS(88), + [sym_identifier] = ACTIONS(90), + [anon_sym_random] = ACTIONS(90), + [anon_sym_random_boolean] = ACTIONS(90), + [anon_sym_random_integer] = ACTIONS(90), + [anon_sym_random_string] = ACTIONS(90), + [anon_sym_random_float] = ACTIONS(90), + [sym_float] = ACTIONS(88), + [sym_integer] = ACTIONS(90), + [sym_string] = ACTIONS(88), + [sym_empty] = ACTIONS(88), + [anon_sym_true] = ACTIONS(90), + [anon_sym_false] = ACTIONS(90), + [anon_sym_LPAREN] = ACTIONS(90), + [anon_sym_COMMA] = ACTIONS(88), + [anon_sym_RPAREN] = ACTIONS(88), }, [14] = { - [ts_builtin_sym_end] = ACTIONS(29), - [sym_comment] = ACTIONS(29), - [sym_yield] = ACTIONS(29), - [sym_chain] = ACTIONS(29), - [sym_identifier] = ACTIONS(31), - [anon_sym_random] = ACTIONS(31), - [anon_sym_random_boolean] = ACTIONS(31), - [anon_sym_random_integer] = ACTIONS(31), - [anon_sym_random_string] = ACTIONS(31), - [anon_sym_random_float] = ACTIONS(31), - [sym_float] = ACTIONS(29), - [sym_integer] = ACTIONS(31), - [sym_string] = ACTIONS(29), - [sym_empty] = ACTIONS(29), - [anon_sym_LPAREN] = ACTIONS(31), - [anon_sym_COMMA] = ACTIONS(29), - [anon_sym_RPAREN] = ACTIONS(29), + [ts_builtin_sym_end] = ACTIONS(92), + [sym_comment] = ACTIONS(92), + [sym_yield] = ACTIONS(92), + [sym_chain] = ACTIONS(92), + [sym_identifier] = ACTIONS(94), + [anon_sym_random] = ACTIONS(94), + [anon_sym_random_boolean] = ACTIONS(94), + [anon_sym_random_integer] = ACTIONS(94), + [anon_sym_random_string] = ACTIONS(94), + [anon_sym_random_float] = ACTIONS(94), + [sym_float] = ACTIONS(92), + [sym_integer] = ACTIONS(94), + [sym_string] = ACTIONS(92), + [sym_empty] = ACTIONS(92), + [anon_sym_true] = ACTIONS(94), + [anon_sym_false] = ACTIONS(94), + [anon_sym_LPAREN] = ACTIONS(94), + [anon_sym_COMMA] = ACTIONS(92), + [anon_sym_RPAREN] = ACTIONS(92), }, [15] = { - [sym_expression] = STATE(21), - [sym_value] = STATE(24), - [sym_tool] = STATE(9), - [sym_list] = STATE(26), - [aux_sym_list_repeat1] = STATE(12), + [sym_expression] = STATE(13), + [sym_value] = STATE(11), + [sym_tool] = STATE(12), + [sym_boolean] = STATE(8), + [sym_list] = STATE(8), [sym_identifier] = ACTIONS(7), [anon_sym_random] = ACTIONS(9), [anon_sym_random_boolean] = ACTIONS(9), [anon_sym_random_integer] = ACTIONS(9), [anon_sym_random_string] = ACTIONS(9), [anon_sym_random_float] = ACTIONS(9), - [sym_float] = ACTIONS(61), - [sym_integer] = ACTIONS(63), - [sym_string] = ACTIONS(61), - [sym_empty] = ACTIONS(61), - [anon_sym_LPAREN] = ACTIONS(65), - [anon_sym_RPAREN] = ACTIONS(94), - }, - [16] = { - [sym_expression] = STATE(21), - [sym_value] = STATE(24), - [sym_tool] = STATE(9), - [sym_list] = STATE(26), - [aux_sym_list_repeat1] = STATE(12), - [sym_identifier] = ACTIONS(7), - [anon_sym_random] = ACTIONS(9), - [anon_sym_random_boolean] = ACTIONS(9), - [anon_sym_random_integer] = ACTIONS(9), - [anon_sym_random_string] = ACTIONS(9), - [anon_sym_random_float] = ACTIONS(9), - [sym_float] = ACTIONS(61), - [sym_integer] = ACTIONS(63), - [sym_string] = ACTIONS(61), - [sym_empty] = ACTIONS(61), - [anon_sym_LPAREN] = ACTIONS(65), - [anon_sym_RPAREN] = ACTIONS(96), + [sym_float] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_string] = ACTIONS(11), + [sym_empty] = ACTIONS(11), + [anon_sym_true] = ACTIONS(15), + [anon_sym_false] = ACTIONS(15), + [anon_sym_LPAREN] = ACTIONS(17), }, }; static const uint16_t ts_small_parse_table[] = { - [0] = 10, - ACTIONS(7), 1, - sym_identifier, - ACTIONS(63), 1, - sym_integer, - ACTIONS(65), 1, - anon_sym_LPAREN, - STATE(8), 1, - aux_sym_list_repeat1, - STATE(9), 1, - sym_tool, - STATE(21), 1, - sym_expression, - STATE(24), 1, - sym_value, - STATE(26), 1, - sym_list, - ACTIONS(61), 3, - sym_float, - sym_string, - sym_empty, - ACTIONS(9), 5, - anon_sym_random, - anon_sym_random_boolean, - anon_sym_random_integer, - anon_sym_random_string, - anon_sym_random_float, - [37] = 10, - ACTIONS(7), 1, - sym_identifier, - ACTIONS(63), 1, - sym_integer, - ACTIONS(65), 1, - anon_sym_LPAREN, - STATE(9), 1, - sym_tool, - STATE(15), 1, - aux_sym_list_repeat1, - STATE(21), 1, - sym_expression, - STATE(24), 1, - sym_value, - STATE(26), 1, - sym_list, - ACTIONS(61), 3, - sym_float, - sym_string, - sym_empty, - ACTIONS(9), 5, - anon_sym_random, - anon_sym_random_boolean, - anon_sym_random_integer, - anon_sym_random_string, - anon_sym_random_float, - [74] = 10, - ACTIONS(7), 1, - sym_identifier, - ACTIONS(63), 1, - sym_integer, - ACTIONS(65), 1, - anon_sym_LPAREN, - STATE(9), 1, - sym_tool, - STATE(16), 1, - aux_sym_list_repeat1, - STATE(21), 1, - sym_expression, - STATE(24), 1, - sym_value, - STATE(26), 1, - sym_list, - ACTIONS(61), 3, - sym_float, - sym_string, - sym_empty, - ACTIONS(9), 5, - anon_sym_random, - anon_sym_random_boolean, - anon_sym_random_integer, - anon_sym_random_string, - anon_sym_random_float, - [111] = 9, - ACTIONS(7), 1, - sym_identifier, - ACTIONS(63), 1, - sym_integer, - ACTIONS(65), 1, - anon_sym_LPAREN, - STATE(9), 1, - sym_tool, - STATE(11), 1, - sym_expression, - STATE(24), 1, - sym_value, - STATE(26), 1, - sym_list, - ACTIONS(61), 3, - sym_float, - sym_string, - sym_empty, - ACTIONS(9), 5, - anon_sym_random, - anon_sym_random_boolean, - anon_sym_random_integer, - anon_sym_random_string, - anon_sym_random_float, - [145] = 3, - ACTIONS(102), 1, + [0] = 3, + ACTIONS(100), 1, anon_sym_COMMA, - ACTIONS(100), 4, + ACTIONS(98), 4, sym_float, sym_string, sym_empty, anon_sym_RPAREN, - ACTIONS(98), 8, + ACTIONS(96), 10, sym_identifier, anon_sym_random, anon_sym_random_boolean, @@ -1283,14 +1249,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_random_string, anon_sym_random_float, sym_integer, + anon_sym_true, + anon_sym_false, anon_sym_LPAREN, - [165] = 2, - ACTIONS(92), 4, + [22] = 2, + ACTIONS(74), 4, sym_float, sym_string, sym_empty, anon_sym_RPAREN, - ACTIONS(104), 8, + ACTIONS(102), 10, sym_identifier, anon_sym_random, anon_sym_random_boolean, @@ -1298,13 +1266,15 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_random_string, anon_sym_random_float, sym_integer, + anon_sym_true, + anon_sym_false, anon_sym_LPAREN, - [182] = 2, - ACTIONS(108), 3, + [41] = 2, + ACTIONS(106), 3, sym_float, sym_string, sym_empty, - ACTIONS(106), 8, + ACTIONS(104), 10, sym_identifier, anon_sym_random, anon_sym_random_boolean, @@ -1312,121 +1282,71 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_random_string, anon_sym_random_float, sym_integer, + anon_sym_true, + anon_sym_false, anon_sym_LPAREN, - [198] = 2, - STATE(25), 1, - sym_operator, - ACTIONS(21), 6, - anon_sym_EQ, - anon_sym_DASH, - anon_sym_PLUS, - anon_sym_SLASH, - anon_sym_PIPE, - anon_sym_AMP, - [210] = 5, - ACTIONS(112), 1, - sym_integer, - ACTIONS(114), 1, - anon_sym_LPAREN, - STATE(11), 1, - sym_value, - STATE(13), 1, - sym_list, - ACTIONS(110), 3, - sym_float, - sym_string, - sym_empty, - [228] = 1, - ACTIONS(33), 6, - anon_sym_EQ, - anon_sym_DASH, - anon_sym_PLUS, - anon_sym_SLASH, - anon_sym_PIPE, - anon_sym_AMP, - [237] = 1, - ACTIONS(29), 6, - anon_sym_EQ, - anon_sym_DASH, - anon_sym_PLUS, - anon_sym_SLASH, - anon_sym_PIPE, - anon_sym_AMP, - [246] = 1, - ACTIONS(116), 1, + [59] = 1, + ACTIONS(108), 1, ts_builtin_sym_end, }; static const uint32_t ts_small_parse_table_map[] = { - [SMALL_STATE(17)] = 0, - [SMALL_STATE(18)] = 37, - [SMALL_STATE(19)] = 74, - [SMALL_STATE(20)] = 111, - [SMALL_STATE(21)] = 145, - [SMALL_STATE(22)] = 165, - [SMALL_STATE(23)] = 182, - [SMALL_STATE(24)] = 198, - [SMALL_STATE(25)] = 210, - [SMALL_STATE(26)] = 228, - [SMALL_STATE(27)] = 237, - [SMALL_STATE(28)] = 246, + [SMALL_STATE(16)] = 0, + [SMALL_STATE(17)] = 22, + [SMALL_STATE(18)] = 41, + [SMALL_STATE(19)] = 59, }; 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_file, 0), - [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), + [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3), [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(2), - [9] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10), - [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), - [13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(5), - [15] = {.entry = {.count = 1, .reusable = false}}, SHIFT(17), - [17] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 1), - [19] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 1), - [21] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), - [23] = {.entry = {.count = 1, .reusable = false}}, SHIFT(23), - [25] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 1), - [27] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 1), - [29] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_list, 3), - [31] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_list, 3), - [33] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_value, 1), - [35] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_value, 1), - [37] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1), - [39] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), - [41] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), - [43] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(7), - [46] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(2), - [49] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(10), - [52] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(5), - [55] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(5), - [58] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(17), - [61] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), - [63] = {.entry = {.count = 1, .reusable = false}}, SHIFT(26), - [65] = {.entry = {.count = 1, .reusable = false}}, SHIFT(18), - [67] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), - [69] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tool, 1), - [71] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tool, 1), - [73] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 3), - [75] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 3), - [77] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(2), - [80] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(10), - [83] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(26), - [86] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(26), - [89] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(18), - [92] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), - [94] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), - [96] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), - [98] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 1), - [100] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 1), - [102] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), - [104] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), - [106] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_operator, 1), - [108] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_operator, 1), - [110] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), - [112] = {.entry = {.count = 1, .reusable = false}}, SHIFT(13), - [114] = {.entry = {.count = 1, .reusable = false}}, SHIFT(19), - [116] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [9] = {.entry = {.count = 1, .reusable = false}}, SHIFT(7), + [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), + [13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8), + [15] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9), + [17] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10), + [19] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 1), + [21] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 1), + [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), + [25] = {.entry = {.count = 1, .reusable = false}}, SHIFT(18), + [27] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1), + [29] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), + [31] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), + [33] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(4), + [36] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(2), + [39] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(7), + [42] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(8), + [45] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(8), + [48] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(9), + [51] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(10), + [54] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), + [56] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(2), + [59] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(7), + [62] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(8), + [65] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(8), + [68] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(9), + [71] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(10), + [74] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), + [76] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tool, 1), + [78] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tool, 1), + [80] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_value, 1), + [82] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_value, 1), + [84] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_boolean, 1), + [86] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_boolean, 1), + [88] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 3), + [90] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 3), + [92] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_list, 3), + [94] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_list, 3), + [96] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 1), + [98] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 1), + [100] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), + [102] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), + [104] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_operator, 1), + [106] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_operator, 1), + [108] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), }; #ifdef __cplusplus