From bb6875a11dfca0a993a308e4db92b2028ce427db Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 1 Jun 2022 20:23:04 +0200 Subject: [PATCH] Add for expressions --- grammar.js | 12 + src/grammar.json | 57 + src/node-types.json | 298 +++++ src/parser.c | 2358 +++++++++++++++++++--------------- test/corpus/control_flow.txt | 58 + 5 files changed, 1777 insertions(+), 1006 deletions(-) diff --git a/grammar.js b/grammar.js index 68ddccd..901bdce 100644 --- a/grammar.js +++ b/grammar.js @@ -50,6 +50,7 @@ module.exports = grammar({ $.if_expression, $.while_expression, + $.for_expression, ), nil_literal: (_) => "nil", @@ -192,6 +193,17 @@ module.exports = grammar({ "do", field("body", $._expr), ), + + for_expression: ($) => seq( + "for", + field("index", $.identifier), + ":=", + field("start", $._expr), + "to", + field("end", $._expr), + "do", + field("body", $._expr), + ), } }); diff --git a/src/grammar.json b/src/grammar.json index db0911b..7fbfe07 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -65,6 +65,10 @@ { "type": "SYMBOL", "name": "while_expression" + }, + { + "type": "SYMBOL", + "name": "for_expression" } ] }, @@ -880,6 +884,59 @@ } } ] + }, + "for_expression": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "for" + }, + { + "type": "FIELD", + "name": "index", + "content": { + "type": "SYMBOL", + "name": "identifier" + } + }, + { + "type": "STRING", + "value": ":=" + }, + { + "type": "FIELD", + "name": "start", + "content": { + "type": "SYMBOL", + "name": "_expr" + } + }, + { + "type": "STRING", + "value": "to" + }, + { + "type": "FIELD", + "name": "end", + "content": { + "type": "SYMBOL", + "name": "_expr" + } + }, + { + "type": "STRING", + "value": "do" + }, + { + "type": "FIELD", + "name": "body", + "content": { + "type": "SYMBOL", + "name": "_expr" + } + } + ] } }, "extras": [ diff --git a/src/node-types.json b/src/node-types.json index fe74fb9..be83076 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -23,6 +23,10 @@ "type": "binary_expression", "named": true }, + { + "type": "for_expression", + "named": true + }, { "type": "function_call", "named": true @@ -89,6 +93,10 @@ "type": "binary_expression", "named": true }, + { + "type": "for_expression", + "named": true + }, { "type": "function_call", "named": true @@ -189,6 +197,10 @@ "type": "binary_expression", "named": true }, + { + "type": "for_expression", + "named": true + }, { "type": "function_call", "named": true @@ -279,6 +291,10 @@ "type": "binary_expression", "named": true }, + { + "type": "for_expression", + "named": true + }, { "type": "function_call", "named": true @@ -351,6 +367,10 @@ "type": "binary_expression", "named": true }, + { + "type": "for_expression", + "named": true + }, { "type": "function_call", "named": true @@ -427,6 +447,236 @@ "type": "binary_expression", "named": true }, + { + "type": "for_expression", + "named": true + }, + { + "type": "function_call", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "if_expression", + "named": true + }, + { + "type": "integer_literal", + "named": true + }, + { + "type": "nil_literal", + "named": true + }, + { + "type": "record_expression", + "named": true + }, + { + "type": "record_value", + "named": true + }, + { + "type": "sequence_expression", + "named": true + }, + { + "type": "string_literal", + "named": true + }, + { + "type": "unary_expression", + "named": true + }, + { + "type": "while_expression", + "named": true + } + ] + } + } + }, + { + "type": "for_expression", + "named": true, + "fields": { + "body": { + "multiple": false, + "required": true, + "types": [ + { + "type": "array_expression", + "named": true + }, + { + "type": "array_value", + "named": true + }, + { + "type": "assignment_expression", + "named": true + }, + { + "type": "binary_expression", + "named": true + }, + { + "type": "for_expression", + "named": true + }, + { + "type": "function_call", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "if_expression", + "named": true + }, + { + "type": "integer_literal", + "named": true + }, + { + "type": "nil_literal", + "named": true + }, + { + "type": "record_expression", + "named": true + }, + { + "type": "record_value", + "named": true + }, + { + "type": "sequence_expression", + "named": true + }, + { + "type": "string_literal", + "named": true + }, + { + "type": "unary_expression", + "named": true + }, + { + "type": "while_expression", + "named": true + } + ] + }, + "end": { + "multiple": false, + "required": true, + "types": [ + { + "type": "array_expression", + "named": true + }, + { + "type": "array_value", + "named": true + }, + { + "type": "assignment_expression", + "named": true + }, + { + "type": "binary_expression", + "named": true + }, + { + "type": "for_expression", + "named": true + }, + { + "type": "function_call", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "if_expression", + "named": true + }, + { + "type": "integer_literal", + "named": true + }, + { + "type": "nil_literal", + "named": true + }, + { + "type": "record_expression", + "named": true + }, + { + "type": "record_value", + "named": true + }, + { + "type": "sequence_expression", + "named": true + }, + { + "type": "string_literal", + "named": true + }, + { + "type": "unary_expression", + "named": true + }, + { + "type": "while_expression", + "named": true + } + ] + }, + "index": { + "multiple": false, + "required": true, + "types": [ + { + "type": "identifier", + "named": true + } + ] + }, + "start": { + "multiple": false, + "required": true, + "types": [ + { + "type": "array_expression", + "named": true + }, + { + "type": "array_value", + "named": true + }, + { + "type": "assignment_expression", + "named": true + }, + { + "type": "binary_expression", + "named": true + }, + { + "type": "for_expression", + "named": true + }, { "type": "function_call", "named": true @@ -503,6 +753,10 @@ "type": "binary_expression", "named": true }, + { + "type": "for_expression", + "named": true + }, { "type": "function_call", "named": true @@ -585,6 +839,10 @@ "type": "binary_expression", "named": true }, + { + "type": "for_expression", + "named": true + }, { "type": "function_call", "named": true @@ -651,6 +909,10 @@ "type": "binary_expression", "named": true }, + { + "type": "for_expression", + "named": true + }, { "type": "function_call", "named": true @@ -717,6 +979,10 @@ "type": "binary_expression", "named": true }, + { + "type": "for_expression", + "named": true + }, { "type": "function_call", "named": true @@ -799,6 +1065,10 @@ "type": "binary_expression", "named": true }, + { + "type": "for_expression", + "named": true + }, { "type": "function_call", "named": true @@ -915,6 +1185,10 @@ "type": "binary_expression", "named": true }, + { + "type": "for_expression", + "named": true + }, { "type": "function_call", "named": true @@ -986,6 +1260,10 @@ "type": "binary_expression", "named": true }, + { + "type": "for_expression", + "named": true + }, { "type": "function_call", "named": true @@ -1072,6 +1350,10 @@ "type": "binary_expression", "named": true }, + { + "type": "for_expression", + "named": true + }, { "type": "function_call", "named": true @@ -1154,6 +1436,10 @@ "type": "binary_expression", "named": true }, + { + "type": "for_expression", + "named": true + }, { "type": "function_call", "named": true @@ -1220,6 +1506,10 @@ "type": "binary_expression", "named": true }, + { + "type": "for_expression", + "named": true + }, { "type": "function_call", "named": true @@ -1320,6 +1610,10 @@ "type": "escape_sequence", "named": true }, + { + "type": "for", + "named": false + }, { "type": "identifier", "named": true @@ -1348,6 +1642,10 @@ "type": "then", "named": false }, + { + "type": "to", + "named": false + }, { "type": "while", "named": false diff --git a/src/parser.c b/src/parser.c index 8682efc..05e89a2 100644 --- a/src/parser.c +++ b/src/parser.c @@ -6,15 +6,15 @@ #endif #define LANGUAGE_VERSION 13 -#define STATE_COUNT 76 +#define STATE_COUNT 84 #define LARGE_STATE_COUNT 2 -#define SYMBOL_COUNT 54 +#define SYMBOL_COUNT 57 #define ALIAS_COUNT 0 -#define TOKEN_COUNT 35 +#define TOKEN_COUNT 37 #define EXTERNAL_TOKEN_COUNT 0 -#define FIELD_COUNT 17 -#define MAX_ALIAS_SEQUENCE_LENGTH 7 -#define PRODUCTION_ID_COUNT 18 +#define FIELD_COUNT 19 +#define MAX_ALIAS_SEQUENCE_LENGTH 8 +#define PRODUCTION_ID_COUNT 19 enum { sym_identifier = 1, @@ -51,25 +51,28 @@ enum { anon_sym_else = 32, anon_sym_while = 33, anon_sym_do = 34, - sym_source_file = 35, - sym__expr = 36, - sym_string_literal = 37, - sym__lvalue = 38, - sym_record_value = 39, - sym_array_value = 40, - sym_function_call = 41, - sym_unary_expression = 42, - sym_binary_expression = 43, - sym_sequence_expression = 44, - sym_array_expression = 45, - sym_record_expression = 46, - sym_assignment_expression = 47, - sym_if_expression = 48, - sym_while_expression = 49, - aux_sym_string_literal_repeat1 = 50, - aux_sym_function_call_repeat1 = 51, - aux_sym_sequence_expression_repeat1 = 52, - aux_sym_record_expression_repeat1 = 53, + anon_sym_for = 35, + anon_sym_to = 36, + sym_source_file = 37, + sym__expr = 38, + sym_string_literal = 39, + sym__lvalue = 40, + sym_record_value = 41, + sym_array_value = 42, + sym_function_call = 43, + sym_unary_expression = 44, + sym_binary_expression = 45, + sym_sequence_expression = 46, + sym_array_expression = 47, + sym_record_expression = 48, + sym_assignment_expression = 49, + sym_if_expression = 50, + sym_while_expression = 51, + sym_for_expression = 52, + aux_sym_string_literal_repeat1 = 53, + aux_sym_function_call_repeat1 = 54, + aux_sym_sequence_expression_repeat1 = 55, + aux_sym_record_expression_repeat1 = 56, }; static const char * const ts_symbol_names[] = { @@ -108,6 +111,8 @@ static const char * const ts_symbol_names[] = { [anon_sym_else] = "else", [anon_sym_while] = "while", [anon_sym_do] = "do", + [anon_sym_for] = "for", + [anon_sym_to] = "to", [sym_source_file] = "source_file", [sym__expr] = "_expr", [sym_string_literal] = "string_literal", @@ -123,6 +128,7 @@ static const char * const ts_symbol_names[] = { [sym_assignment_expression] = "assignment_expression", [sym_if_expression] = "if_expression", [sym_while_expression] = "while_expression", + [sym_for_expression] = "for_expression", [aux_sym_string_literal_repeat1] = "string_literal_repeat1", [aux_sym_function_call_repeat1] = "function_call_repeat1", [aux_sym_sequence_expression_repeat1] = "sequence_expression_repeat1", @@ -165,6 +171,8 @@ static const TSSymbol ts_symbol_map[] = { [anon_sym_else] = anon_sym_else, [anon_sym_while] = anon_sym_while, [anon_sym_do] = anon_sym_do, + [anon_sym_for] = anon_sym_for, + [anon_sym_to] = anon_sym_to, [sym_source_file] = sym_source_file, [sym__expr] = sym__expr, [sym_string_literal] = sym_string_literal, @@ -180,6 +188,7 @@ static const TSSymbol ts_symbol_map[] = { [sym_assignment_expression] = sym_assignment_expression, [sym_if_expression] = sym_if_expression, [sym_while_expression] = sym_while_expression, + [sym_for_expression] = sym_for_expression, [aux_sym_string_literal_repeat1] = aux_sym_string_literal_repeat1, [aux_sym_function_call_repeat1] = aux_sym_function_call_repeat1, [aux_sym_sequence_expression_repeat1] = aux_sym_sequence_expression_repeat1, @@ -327,6 +336,14 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = false, }, + [anon_sym_for] = { + .visible = true, + .named = false, + }, + [anon_sym_to] = { + .visible = true, + .named = false, + }, [sym_source_file] = { .visible = true, .named = true, @@ -387,6 +404,10 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, + [sym_for_expression] = { + .visible = true, + .named = true, + }, [aux_sym_string_literal_repeat1] = { .visible = false, .named = false, @@ -412,17 +433,19 @@ enum { field_body = 4, field_condition = 5, field_consequence = 6, - field_expression = 7, - field_field = 8, - field_function = 9, - field_index = 10, - field_init = 11, - field_left = 12, - field_operator = 13, - field_record = 14, - field_right = 15, - field_size = 16, - field_type = 17, + field_end = 7, + field_expression = 8, + field_field = 9, + field_function = 10, + field_index = 11, + field_init = 12, + field_left = 13, + field_operator = 14, + field_record = 15, + field_right = 16, + field_size = 17, + field_start = 18, + field_type = 19, }; static const char * const ts_field_names[] = { @@ -433,6 +456,7 @@ static const char * const ts_field_names[] = { [field_body] = "body", [field_condition] = "condition", [field_consequence] = "consequence", + [field_end] = "end", [field_expression] = "expression", [field_field] = "field", [field_function] = "function", @@ -443,6 +467,7 @@ static const char * const ts_field_names[] = { [field_record] = "record", [field_right] = "right", [field_size] = "size", + [field_start] = "start", [field_type] = "type", }; @@ -463,7 +488,8 @@ static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = { [14] = {.index = 28, .length = 3}, [15] = {.index = 31, .length = 5}, [16] = {.index = 36, .length = 4}, - [17] = {.index = 40, .length = 2}, + [17] = {.index = 40, .length = 4}, + [18] = {.index = 44, .length = 2}, }; static const TSFieldMapEntry ts_field_map_entries[] = { @@ -524,6 +550,11 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_init, 0, .inherited = true}, {field_init, 1, .inherited = true}, [40] = + {field_body, 7}, + {field_end, 5}, + {field_index, 1}, + {field_start, 3}, + [44] = {field_field, 1}, {field_init, 3}, }; @@ -797,80 +828,94 @@ static bool ts_lex_keywords(TSLexer *lexer, TSStateId state) { case 0: if (lookahead == 'd') ADVANCE(1); if (lookahead == 'e') ADVANCE(2); - if (lookahead == 'i') ADVANCE(3); - if (lookahead == 'n') ADVANCE(4); - if (lookahead == 'o') ADVANCE(5); - if (lookahead == 't') ADVANCE(6); - if (lookahead == 'w') ADVANCE(7); + if (lookahead == 'f') ADVANCE(3); + if (lookahead == 'i') ADVANCE(4); + if (lookahead == 'n') ADVANCE(5); + if (lookahead == 'o') ADVANCE(6); + if (lookahead == 't') ADVANCE(7); + if (lookahead == 'w') ADVANCE(8); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') SKIP(0) END_STATE(); case 1: - if (lookahead == 'o') ADVANCE(8); + if (lookahead == 'o') ADVANCE(9); END_STATE(); case 2: - if (lookahead == 'l') ADVANCE(9); + if (lookahead == 'l') ADVANCE(10); END_STATE(); case 3: - if (lookahead == 'f') ADVANCE(10); + if (lookahead == 'o') ADVANCE(11); END_STATE(); case 4: - if (lookahead == 'i') ADVANCE(11); - END_STATE(); - case 5: if (lookahead == 'f') ADVANCE(12); END_STATE(); + case 5: + if (lookahead == 'i') ADVANCE(13); + END_STATE(); case 6: - if (lookahead == 'h') ADVANCE(13); + if (lookahead == 'f') ADVANCE(14); END_STATE(); case 7: - if (lookahead == 'h') ADVANCE(14); + if (lookahead == 'h') ADVANCE(15); + if (lookahead == 'o') ADVANCE(16); END_STATE(); case 8: - ACCEPT_TOKEN(anon_sym_do); + if (lookahead == 'h') ADVANCE(17); END_STATE(); case 9: - if (lookahead == 's') ADVANCE(15); + ACCEPT_TOKEN(anon_sym_do); END_STATE(); case 10: - ACCEPT_TOKEN(anon_sym_if); + if (lookahead == 's') ADVANCE(18); END_STATE(); case 11: - if (lookahead == 'l') ADVANCE(16); + if (lookahead == 'r') ADVANCE(19); END_STATE(); case 12: - ACCEPT_TOKEN(anon_sym_of); + ACCEPT_TOKEN(anon_sym_if); END_STATE(); case 13: - if (lookahead == 'e') ADVANCE(17); + if (lookahead == 'l') ADVANCE(20); END_STATE(); case 14: - if (lookahead == 'i') ADVANCE(18); + ACCEPT_TOKEN(anon_sym_of); END_STATE(); case 15: - if (lookahead == 'e') ADVANCE(19); + if (lookahead == 'e') ADVANCE(21); END_STATE(); case 16: - ACCEPT_TOKEN(sym_nil_literal); + ACCEPT_TOKEN(anon_sym_to); END_STATE(); case 17: - if (lookahead == 'n') ADVANCE(20); + if (lookahead == 'i') ADVANCE(22); END_STATE(); case 18: - if (lookahead == 'l') ADVANCE(21); + if (lookahead == 'e') ADVANCE(23); END_STATE(); case 19: - ACCEPT_TOKEN(anon_sym_else); + ACCEPT_TOKEN(anon_sym_for); END_STATE(); case 20: - ACCEPT_TOKEN(anon_sym_then); + ACCEPT_TOKEN(sym_nil_literal); END_STATE(); case 21: - if (lookahead == 'e') ADVANCE(22); + if (lookahead == 'n') ADVANCE(24); END_STATE(); case 22: + if (lookahead == 'l') ADVANCE(25); + END_STATE(); + case 23: + ACCEPT_TOKEN(anon_sym_else); + END_STATE(); + case 24: + ACCEPT_TOKEN(anon_sym_then); + END_STATE(); + case 25: + if (lookahead == 'e') ADVANCE(26); + END_STATE(); + case 26: ACCEPT_TOKEN(anon_sym_while); END_STATE(); default: @@ -882,11 +927,11 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [0] = {.lex_state = 0}, [1] = {.lex_state = 0}, [2] = {.lex_state = 9}, - [3] = {.lex_state = 9}, - [4] = {.lex_state = 9}, + [3] = {.lex_state = 0}, + [4] = {.lex_state = 0}, [5] = {.lex_state = 9}, - [6] = {.lex_state = 0}, - [7] = {.lex_state = 0}, + [6] = {.lex_state = 9}, + [7] = {.lex_state = 9}, [8] = {.lex_state = 0}, [9] = {.lex_state = 0}, [10] = {.lex_state = 0}, @@ -906,9 +951,9 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [24] = {.lex_state = 0}, [25] = {.lex_state = 0}, [26] = {.lex_state = 0}, - [27] = {.lex_state = 9}, - [28] = {.lex_state = 9}, - [29] = {.lex_state = 9}, + [27] = {.lex_state = 0}, + [28] = {.lex_state = 0}, + [29] = {.lex_state = 0}, [30] = {.lex_state = 9}, [31] = {.lex_state = 9}, [32] = {.lex_state = 9}, @@ -928,33 +973,41 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [46] = {.lex_state = 9}, [47] = {.lex_state = 9}, [48] = {.lex_state = 9}, - [49] = {.lex_state = 0}, - [50] = {.lex_state = 0}, - [51] = {.lex_state = 0}, - [52] = {.lex_state = 0}, + [49] = {.lex_state = 9}, + [50] = {.lex_state = 9}, + [51] = {.lex_state = 9}, + [52] = {.lex_state = 9}, [53] = {.lex_state = 0}, [54] = {.lex_state = 0}, - [55] = {.lex_state = 9}, + [55] = {.lex_state = 0}, [56] = {.lex_state = 0}, - [57] = {.lex_state = 9}, + [57] = {.lex_state = 0}, [58] = {.lex_state = 0}, [59] = {.lex_state = 0}, - [60] = {.lex_state = 1}, - [61] = {.lex_state = 1}, - [62] = {.lex_state = 1}, + [60] = {.lex_state = 9}, + [61] = {.lex_state = 9}, + [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 = 9}, - [70] = {.lex_state = 9}, - [71] = {.lex_state = 9}, - [72] = {.lex_state = 9}, + [64] = {.lex_state = 9}, + [65] = {.lex_state = 9}, + [66] = {.lex_state = 1}, + [67] = {.lex_state = 1}, + [68] = {.lex_state = 1}, + [69] = {.lex_state = 0}, + [70] = {.lex_state = 0}, + [71] = {.lex_state = 0}, + [72] = {.lex_state = 0}, [73] = {.lex_state = 0}, [74] = {.lex_state = 0}, - [75] = {.lex_state = 0}, + [75] = {.lex_state = 9}, + [76] = {.lex_state = 9}, + [77] = {.lex_state = 0}, + [78] = {.lex_state = 9}, + [79] = {.lex_state = 0}, + [80] = {.lex_state = 0}, + [81] = {.lex_state = 9}, + [82] = {.lex_state = 0}, + [83] = {.lex_state = 9}, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { @@ -993,23 +1046,26 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_else] = ACTIONS(1), [anon_sym_while] = ACTIONS(1), [anon_sym_do] = ACTIONS(1), + [anon_sym_for] = ACTIONS(1), + [anon_sym_to] = ACTIONS(1), }, [1] = { - [sym_source_file] = STATE(75), - [sym__expr] = STATE(58), - [sym_string_literal] = STATE(58), - [sym__lvalue] = STATE(3), - [sym_record_value] = STATE(3), - [sym_array_value] = STATE(3), - [sym_function_call] = STATE(58), - [sym_unary_expression] = STATE(58), - [sym_binary_expression] = STATE(58), - [sym_sequence_expression] = STATE(58), - [sym_array_expression] = STATE(58), - [sym_record_expression] = STATE(58), - [sym_assignment_expression] = STATE(58), - [sym_if_expression] = STATE(58), - [sym_while_expression] = STATE(58), + [sym_source_file] = STATE(79), + [sym__expr] = STATE(59), + [sym_string_literal] = STATE(59), + [sym__lvalue] = STATE(7), + [sym_record_value] = STATE(7), + [sym_array_value] = STATE(7), + [sym_function_call] = STATE(59), + [sym_unary_expression] = STATE(59), + [sym_binary_expression] = STATE(59), + [sym_sequence_expression] = STATE(59), + [sym_array_expression] = STATE(59), + [sym_record_expression] = STATE(59), + [sym_assignment_expression] = STATE(59), + [sym_if_expression] = STATE(59), + [sym_while_expression] = STATE(59), + [sym_for_expression] = STATE(59), [sym_identifier] = ACTIONS(3), [sym_nil_literal] = ACTIONS(5), [sym_integer_literal] = ACTIONS(5), @@ -1018,21 +1074,22 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_DASH] = ACTIONS(11), [anon_sym_if] = ACTIONS(13), [anon_sym_while] = ACTIONS(15), + [anon_sym_for] = ACTIONS(17), }, }; static const uint16_t ts_small_parse_table[] = { [0] = 5, - ACTIONS(19), 1, + ACTIONS(21), 1, anon_sym_LBRACK, - ACTIONS(22), 1, + ACTIONS(24), 1, anon_sym_LPAREN, - ACTIONS(26), 1, + ACTIONS(28), 1, anon_sym_LBRACE, - ACTIONS(24), 2, + ACTIONS(26), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(17), 21, + ACTIONS(19), 22, ts_builtin_sym_end, anon_sym_DOT, anon_sym_RBRACK, @@ -1054,41 +1111,86 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_then, anon_sym_else, anon_sym_do, - [37] = 5, - ACTIONS(30), 1, - anon_sym_DOT, + anon_sym_to, + [38] = 11, + ACTIONS(3), 1, + sym_identifier, + ACTIONS(7), 1, + anon_sym_DQUOTE, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(11), 1, + anon_sym_DASH, + ACTIONS(13), 1, + anon_sym_if, + ACTIONS(15), 1, + anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, ACTIONS(32), 1, - anon_sym_LBRACK, - ACTIONS(36), 1, - anon_sym_COLON_EQ, - ACTIONS(34), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(28), 19, - ts_builtin_sym_end, - anon_sym_RBRACK, - anon_sym_COMMA, anon_sym_RPAREN, + ACTIONS(30), 2, + sym_nil_literal, + sym_integer_literal, + STATE(7), 3, + sym__lvalue, + sym_record_value, + sym_array_value, + STATE(54), 12, + sym__expr, + sym_string_literal, + sym_function_call, + sym_unary_expression, + sym_binary_expression, + sym_sequence_expression, + sym_array_expression, + sym_record_expression, + sym_assignment_expression, + sym_if_expression, + sym_while_expression, + sym_for_expression, + [86] = 11, + ACTIONS(3), 1, + sym_identifier, + ACTIONS(7), 1, + anon_sym_DQUOTE, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(11), 1, anon_sym_DASH, - anon_sym_STAR, - anon_sym_SLASH, - anon_sym_PLUS, - anon_sym_GT_EQ, - anon_sym_LT_EQ, - anon_sym_EQ, - anon_sym_LT_GT, - anon_sym_AMP, - anon_sym_PIPE, - anon_sym_SEMI, - anon_sym_RBRACE, - anon_sym_then, - anon_sym_else, - anon_sym_do, - [72] = 2, + ACTIONS(13), 1, + anon_sym_if, + ACTIONS(15), 1, + anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, + ACTIONS(36), 1, + anon_sym_RPAREN, + ACTIONS(34), 2, + sym_nil_literal, + sym_integer_literal, + STATE(7), 3, + sym__lvalue, + sym_record_value, + sym_array_value, + STATE(55), 12, + sym__expr, + sym_string_literal, + sym_function_call, + sym_unary_expression, + sym_binary_expression, + sym_sequence_expression, + sym_array_expression, + sym_record_expression, + sym_assignment_expression, + sym_if_expression, + sym_while_expression, + sym_for_expression, + [134] = 2, ACTIONS(40), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(38), 22, + ACTIONS(38), 23, ts_builtin_sym_end, anon_sym_DOT, anon_sym_LBRACK, @@ -1111,11 +1213,12 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_then, anon_sym_else, anon_sym_do, - [101] = 2, + anon_sym_to, + [164] = 2, ACTIONS(44), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(42), 22, + ACTIONS(42), 23, ts_builtin_sym_end, anon_sym_DOT, anon_sym_LBRACK, @@ -1138,107 +1241,39 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_then, anon_sym_else, anon_sym_do, - [130] = 10, - ACTIONS(3), 1, - sym_identifier, - ACTIONS(7), 1, - anon_sym_DQUOTE, - ACTIONS(9), 1, - anon_sym_LPAREN, - ACTIONS(11), 1, - anon_sym_DASH, - ACTIONS(13), 1, - anon_sym_if, - ACTIONS(15), 1, - anon_sym_while, + anon_sym_to, + [194] = 5, ACTIONS(48), 1, + anon_sym_DOT, + ACTIONS(50), 1, + anon_sym_LBRACK, + ACTIONS(54), 1, + anon_sym_COLON_EQ, + ACTIONS(52), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(46), 20, + ts_builtin_sym_end, + anon_sym_RBRACK, + anon_sym_COMMA, anon_sym_RPAREN, - ACTIONS(46), 2, - sym_nil_literal, - sym_integer_literal, - STATE(3), 3, - sym__lvalue, - sym_record_value, - sym_array_value, - STATE(49), 11, - sym__expr, - sym_string_literal, - sym_function_call, - sym_unary_expression, - sym_binary_expression, - sym_sequence_expression, - sym_array_expression, - sym_record_expression, - sym_assignment_expression, - sym_if_expression, - sym_while_expression, - [174] = 10, - ACTIONS(3), 1, - sym_identifier, - ACTIONS(7), 1, - anon_sym_DQUOTE, - ACTIONS(9), 1, - anon_sym_LPAREN, - ACTIONS(11), 1, - anon_sym_DASH, - ACTIONS(13), 1, - anon_sym_if, - ACTIONS(15), 1, - anon_sym_while, - ACTIONS(52), 1, - anon_sym_RPAREN, - ACTIONS(50), 2, - sym_nil_literal, - sym_integer_literal, - STATE(3), 3, - sym__lvalue, - sym_record_value, - sym_array_value, - STATE(51), 11, - sym__expr, - sym_string_literal, - sym_function_call, - sym_unary_expression, - sym_binary_expression, - sym_sequence_expression, - sym_array_expression, - sym_record_expression, - sym_assignment_expression, - sym_if_expression, - sym_while_expression, - [218] = 9, - ACTIONS(3), 1, - sym_identifier, - ACTIONS(7), 1, - anon_sym_DQUOTE, - ACTIONS(9), 1, - anon_sym_LPAREN, - ACTIONS(11), 1, - anon_sym_DASH, - ACTIONS(13), 1, - anon_sym_if, - ACTIONS(15), 1, - anon_sym_while, - ACTIONS(54), 2, - sym_nil_literal, - sym_integer_literal, - STATE(3), 3, - sym__lvalue, - sym_record_value, - sym_array_value, - STATE(55), 11, - sym__expr, - sym_string_literal, - sym_function_call, - sym_unary_expression, - sym_binary_expression, - sym_sequence_expression, - sym_array_expression, - sym_record_expression, - sym_assignment_expression, - sym_if_expression, - sym_while_expression, - [259] = 9, + anon_sym_DASH, + anon_sym_STAR, + anon_sym_SLASH, + anon_sym_PLUS, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + anon_sym_AMP, + anon_sym_PIPE, + anon_sym_SEMI, + anon_sym_RBRACE, + anon_sym_then, + anon_sym_else, + anon_sym_do, + anon_sym_to, + [230] = 10, ACTIONS(3), 1, sym_identifier, ACTIONS(7), 1, @@ -1251,14 +1286,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_if, ACTIONS(15), 1, anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, ACTIONS(56), 2, sym_nil_literal, sym_integer_literal, - STATE(3), 3, + STATE(7), 3, sym__lvalue, sym_record_value, sym_array_value, - STATE(38), 11, + STATE(49), 12, sym__expr, sym_string_literal, sym_function_call, @@ -1270,7 +1307,8 @@ static const uint16_t ts_small_parse_table[] = { sym_assignment_expression, sym_if_expression, sym_while_expression, - [300] = 9, + sym_for_expression, + [275] = 10, ACTIONS(3), 1, sym_identifier, ACTIONS(7), 1, @@ -1283,14 +1321,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_if, ACTIONS(15), 1, anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, ACTIONS(58), 2, sym_nil_literal, sym_integer_literal, - STATE(3), 3, + STATE(7), 3, sym__lvalue, sym_record_value, sym_array_value, - STATE(54), 11, + STATE(53), 12, sym__expr, sym_string_literal, sym_function_call, @@ -1302,7 +1342,8 @@ static const uint16_t ts_small_parse_table[] = { sym_assignment_expression, sym_if_expression, sym_while_expression, - [341] = 9, + sym_for_expression, + [320] = 10, ACTIONS(3), 1, sym_identifier, ACTIONS(7), 1, @@ -1315,14 +1356,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_if, ACTIONS(15), 1, anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, ACTIONS(60), 2, sym_nil_literal, sym_integer_literal, - STATE(3), 3, + STATE(7), 3, sym__lvalue, sym_record_value, sym_array_value, - STATE(32), 11, + STATE(58), 12, sym__expr, sym_string_literal, sym_function_call, @@ -1334,7 +1377,8 @@ static const uint16_t ts_small_parse_table[] = { sym_assignment_expression, sym_if_expression, sym_while_expression, - [382] = 9, + sym_for_expression, + [365] = 10, ACTIONS(3), 1, sym_identifier, ACTIONS(7), 1, @@ -1347,14 +1391,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_if, ACTIONS(15), 1, anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, ACTIONS(62), 2, sym_nil_literal, sym_integer_literal, - STATE(3), 3, + STATE(7), 3, sym__lvalue, sym_record_value, sym_array_value, - STATE(57), 11, + STATE(64), 12, sym__expr, sym_string_literal, sym_function_call, @@ -1366,7 +1412,8 @@ static const uint16_t ts_small_parse_table[] = { sym_assignment_expression, sym_if_expression, sym_while_expression, - [423] = 9, + sym_for_expression, + [410] = 10, ACTIONS(3), 1, sym_identifier, ACTIONS(7), 1, @@ -1379,14 +1426,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_if, ACTIONS(15), 1, anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, ACTIONS(64), 2, sym_nil_literal, sym_integer_literal, - STATE(3), 3, + STATE(7), 3, sym__lvalue, sym_record_value, sym_array_value, - STATE(59), 11, + STATE(40), 12, sym__expr, sym_string_literal, sym_function_call, @@ -1398,7 +1447,8 @@ static const uint16_t ts_small_parse_table[] = { sym_assignment_expression, sym_if_expression, sym_while_expression, - [464] = 9, + sym_for_expression, + [455] = 10, ACTIONS(3), 1, sym_identifier, ACTIONS(7), 1, @@ -1411,14 +1461,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_if, ACTIONS(15), 1, anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, ACTIONS(66), 2, sym_nil_literal, sym_integer_literal, - STATE(3), 3, + STATE(7), 3, sym__lvalue, sym_record_value, sym_array_value, - STATE(56), 11, + STATE(31), 12, sym__expr, sym_string_literal, sym_function_call, @@ -1430,7 +1482,8 @@ static const uint16_t ts_small_parse_table[] = { sym_assignment_expression, sym_if_expression, sym_while_expression, - [505] = 9, + sym_for_expression, + [500] = 10, ACTIONS(3), 1, sym_identifier, ACTIONS(7), 1, @@ -1443,14 +1496,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_if, ACTIONS(15), 1, anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, ACTIONS(68), 2, sym_nil_literal, sym_integer_literal, - STATE(3), 3, + STATE(7), 3, sym__lvalue, sym_record_value, sym_array_value, - STATE(50), 11, + STATE(65), 12, sym__expr, sym_string_literal, sym_function_call, @@ -1462,7 +1517,8 @@ static const uint16_t ts_small_parse_table[] = { sym_assignment_expression, sym_if_expression, sym_while_expression, - [546] = 9, + sym_for_expression, + [545] = 10, ACTIONS(3), 1, sym_identifier, ACTIONS(7), 1, @@ -1475,14 +1531,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_if, ACTIONS(15), 1, anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, ACTIONS(70), 2, sym_nil_literal, sym_integer_literal, - STATE(3), 3, + STATE(7), 3, sym__lvalue, sym_record_value, sym_array_value, - STATE(52), 11, + STATE(62), 12, sym__expr, sym_string_literal, sym_function_call, @@ -1494,7 +1552,8 @@ static const uint16_t ts_small_parse_table[] = { sym_assignment_expression, sym_if_expression, sym_while_expression, - [587] = 9, + sym_for_expression, + [590] = 10, ACTIONS(3), 1, sym_identifier, ACTIONS(7), 1, @@ -1507,14 +1566,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_if, ACTIONS(15), 1, anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, ACTIONS(72), 2, sym_nil_literal, sym_integer_literal, - STATE(3), 3, + STATE(7), 3, sym__lvalue, sym_record_value, sym_array_value, - STATE(28), 11, + STATE(56), 12, sym__expr, sym_string_literal, sym_function_call, @@ -1526,7 +1587,8 @@ static const uint16_t ts_small_parse_table[] = { sym_assignment_expression, sym_if_expression, sym_while_expression, - [628] = 9, + sym_for_expression, + [635] = 10, ACTIONS(3), 1, sym_identifier, ACTIONS(7), 1, @@ -1539,14 +1601,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_if, ACTIONS(15), 1, anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, ACTIONS(74), 2, sym_nil_literal, sym_integer_literal, - STATE(3), 3, + STATE(7), 3, sym__lvalue, sym_record_value, sym_array_value, - STATE(27), 11, + STATE(60), 12, sym__expr, sym_string_literal, sym_function_call, @@ -1558,7 +1622,8 @@ static const uint16_t ts_small_parse_table[] = { sym_assignment_expression, sym_if_expression, sym_while_expression, - [669] = 9, + sym_for_expression, + [680] = 10, ACTIONS(3), 1, sym_identifier, ACTIONS(7), 1, @@ -1571,14 +1636,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_if, ACTIONS(15), 1, anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, ACTIONS(76), 2, sym_nil_literal, sym_integer_literal, - STATE(3), 3, + STATE(7), 3, sym__lvalue, sym_record_value, sym_array_value, - STATE(46), 11, + STATE(33), 12, sym__expr, sym_string_literal, sym_function_call, @@ -1590,7 +1657,8 @@ static const uint16_t ts_small_parse_table[] = { sym_assignment_expression, sym_if_expression, sym_while_expression, - [710] = 9, + sym_for_expression, + [725] = 10, ACTIONS(3), 1, sym_identifier, ACTIONS(7), 1, @@ -1603,14 +1671,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_if, ACTIONS(15), 1, anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, ACTIONS(78), 2, sym_nil_literal, sym_integer_literal, - STATE(3), 3, + STATE(7), 3, sym__lvalue, sym_record_value, sym_array_value, - STATE(48), 11, + STATE(61), 12, sym__expr, sym_string_literal, sym_function_call, @@ -1622,7 +1692,8 @@ static const uint16_t ts_small_parse_table[] = { sym_assignment_expression, sym_if_expression, sym_while_expression, - [751] = 9, + sym_for_expression, + [770] = 10, ACTIONS(3), 1, sym_identifier, ACTIONS(7), 1, @@ -1635,14 +1706,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_if, ACTIONS(15), 1, anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, ACTIONS(80), 2, sym_nil_literal, sym_integer_literal, - STATE(3), 3, + STATE(7), 3, sym__lvalue, sym_record_value, sym_array_value, - STATE(41), 11, + STATE(34), 12, sym__expr, sym_string_literal, sym_function_call, @@ -1654,7 +1727,8 @@ static const uint16_t ts_small_parse_table[] = { sym_assignment_expression, sym_if_expression, sym_while_expression, - [792] = 9, + sym_for_expression, + [815] = 10, ACTIONS(3), 1, sym_identifier, ACTIONS(7), 1, @@ -1667,14 +1741,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_if, ACTIONS(15), 1, anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, ACTIONS(82), 2, sym_nil_literal, sym_integer_literal, - STATE(3), 3, + STATE(7), 3, sym__lvalue, sym_record_value, sym_array_value, - STATE(42), 11, + STATE(51), 12, sym__expr, sym_string_literal, sym_function_call, @@ -1686,7 +1762,8 @@ static const uint16_t ts_small_parse_table[] = { sym_assignment_expression, sym_if_expression, sym_while_expression, - [833] = 9, + sym_for_expression, + [860] = 10, ACTIONS(3), 1, sym_identifier, ACTIONS(7), 1, @@ -1699,14 +1776,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_if, ACTIONS(15), 1, anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, ACTIONS(84), 2, sym_nil_literal, sym_integer_literal, - STATE(3), 3, + STATE(7), 3, sym__lvalue, sym_record_value, sym_array_value, - STATE(43), 11, + STATE(57), 12, sym__expr, sym_string_literal, sym_function_call, @@ -1718,7 +1797,8 @@ static const uint16_t ts_small_parse_table[] = { sym_assignment_expression, sym_if_expression, sym_while_expression, - [874] = 9, + sym_for_expression, + [905] = 10, ACTIONS(3), 1, sym_identifier, ACTIONS(7), 1, @@ -1731,14 +1811,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_if, ACTIONS(15), 1, anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, ACTIONS(86), 2, sym_nil_literal, sym_integer_literal, - STATE(3), 3, + STATE(7), 3, sym__lvalue, sym_record_value, sym_array_value, - STATE(44), 11, + STATE(36), 12, sym__expr, sym_string_literal, sym_function_call, @@ -1750,7 +1832,8 @@ static const uint16_t ts_small_parse_table[] = { sym_assignment_expression, sym_if_expression, sym_while_expression, - [915] = 9, + sym_for_expression, + [950] = 10, ACTIONS(3), 1, sym_identifier, ACTIONS(7), 1, @@ -1763,14 +1846,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_if, ACTIONS(15), 1, anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, ACTIONS(88), 2, sym_nil_literal, sym_integer_literal, - STATE(3), 3, + STATE(7), 3, sym__lvalue, sym_record_value, sym_array_value, - STATE(45), 11, + STATE(41), 12, sym__expr, sym_string_literal, sym_function_call, @@ -1782,7 +1867,8 @@ static const uint16_t ts_small_parse_table[] = { sym_assignment_expression, sym_if_expression, sym_while_expression, - [956] = 9, + sym_for_expression, + [995] = 10, ACTIONS(3), 1, sym_identifier, ACTIONS(7), 1, @@ -1795,14 +1881,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_if, ACTIONS(15), 1, anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, ACTIONS(90), 2, sym_nil_literal, sym_integer_literal, - STATE(3), 3, + STATE(7), 3, sym__lvalue, sym_record_value, sym_array_value, - STATE(53), 11, + STATE(50), 12, sym__expr, sym_string_literal, sym_function_call, @@ -1814,69 +1902,152 @@ static const uint16_t ts_small_parse_table[] = { sym_assignment_expression, sym_if_expression, sym_while_expression, - [997] = 7, - ACTIONS(102), 1, - anon_sym_AMP, - ACTIONS(104), 1, - anon_sym_PIPE, + sym_for_expression, + [1040] = 10, + ACTIONS(3), 1, + sym_identifier, + ACTIONS(7), 1, + anon_sym_DQUOTE, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(11), 1, + anon_sym_DASH, + ACTIONS(13), 1, + anon_sym_if, + ACTIONS(15), 1, + anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, + ACTIONS(92), 2, + sym_nil_literal, + sym_integer_literal, + STATE(7), 3, + sym__lvalue, + sym_record_value, + sym_array_value, + STATE(47), 12, + sym__expr, + sym_string_literal, + sym_function_call, + sym_unary_expression, + sym_binary_expression, + sym_sequence_expression, + sym_array_expression, + sym_record_expression, + sym_assignment_expression, + sym_if_expression, + sym_while_expression, + sym_for_expression, + [1085] = 10, + ACTIONS(3), 1, + sym_identifier, + ACTIONS(7), 1, + anon_sym_DQUOTE, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(11), 1, + anon_sym_DASH, + ACTIONS(13), 1, + anon_sym_if, + ACTIONS(15), 1, + anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, ACTIONS(94), 2, + sym_nil_literal, + sym_integer_literal, + STATE(7), 3, + sym__lvalue, + sym_record_value, + sym_array_value, + STATE(48), 12, + sym__expr, + sym_string_literal, + sym_function_call, + sym_unary_expression, + sym_binary_expression, + sym_sequence_expression, + sym_array_expression, + sym_record_expression, + sym_assignment_expression, + sym_if_expression, + sym_while_expression, + sym_for_expression, + [1130] = 10, + ACTIONS(3), 1, + sym_identifier, + ACTIONS(7), 1, + anon_sym_DQUOTE, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(11), 1, anon_sym_DASH, - anon_sym_PLUS, + ACTIONS(13), 1, + anon_sym_if, + ACTIONS(15), 1, + anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, ACTIONS(96), 2, - anon_sym_STAR, - anon_sym_SLASH, - ACTIONS(100), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(98), 4, - anon_sym_GT_EQ, - anon_sym_LT_EQ, - anon_sym_EQ, - anon_sym_LT_GT, - ACTIONS(92), 9, - ts_builtin_sym_end, - anon_sym_RBRACK, - anon_sym_COMMA, - anon_sym_RPAREN, - anon_sym_SEMI, - anon_sym_RBRACE, - anon_sym_then, - anon_sym_else, - anon_sym_do, - [1033] = 7, - ACTIONS(102), 1, - anon_sym_AMP, - ACTIONS(104), 1, - anon_sym_PIPE, - ACTIONS(94), 2, + sym_nil_literal, + sym_integer_literal, + STATE(7), 3, + sym__lvalue, + sym_record_value, + sym_array_value, + STATE(30), 12, + sym__expr, + sym_string_literal, + sym_function_call, + sym_unary_expression, + sym_binary_expression, + sym_sequence_expression, + sym_array_expression, + sym_record_expression, + sym_assignment_expression, + sym_if_expression, + sym_while_expression, + sym_for_expression, + [1175] = 10, + ACTIONS(3), 1, + sym_identifier, + ACTIONS(7), 1, + anon_sym_DQUOTE, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(11), 1, anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(96), 2, - anon_sym_STAR, - anon_sym_SLASH, - ACTIONS(100), 2, + ACTIONS(13), 1, + anon_sym_if, + ACTIONS(15), 1, + anon_sym_while, + ACTIONS(17), 1, + anon_sym_for, + ACTIONS(98), 2, + sym_nil_literal, + sym_integer_literal, + STATE(7), 3, + sym__lvalue, + sym_record_value, + sym_array_value, + STATE(63), 12, + sym__expr, + sym_string_literal, + sym_function_call, + sym_unary_expression, + sym_binary_expression, + sym_sequence_expression, + sym_array_expression, + sym_record_expression, + sym_assignment_expression, + sym_if_expression, + sym_while_expression, + sym_for_expression, + [1220] = 2, + ACTIONS(102), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(98), 4, - anon_sym_GT_EQ, - anon_sym_LT_EQ, - anon_sym_EQ, - anon_sym_LT_GT, - ACTIONS(106), 9, - ts_builtin_sym_end, - anon_sym_RBRACK, - anon_sym_COMMA, - anon_sym_RPAREN, - anon_sym_SEMI, - anon_sym_RBRACE, - anon_sym_then, - anon_sym_else, - anon_sym_do, - [1069] = 2, - ACTIONS(110), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(108), 19, + ACTIONS(100), 20, ts_builtin_sym_end, anon_sym_RBRACK, anon_sym_COMMA, @@ -1896,11 +2067,42 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_then, anon_sym_else, anon_sym_do, - [1095] = 2, - ACTIONS(114), 2, + anon_sym_to, + [1247] = 7, + ACTIONS(114), 1, + anon_sym_AMP, + ACTIONS(116), 1, + anon_sym_PIPE, + ACTIONS(106), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(108), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(112), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(112), 19, + ACTIONS(110), 4, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + ACTIONS(104), 10, + ts_builtin_sym_end, + anon_sym_RBRACK, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_SEMI, + anon_sym_RBRACE, + anon_sym_then, + anon_sym_else, + anon_sym_do, + anon_sym_to, + [1284] = 2, + ACTIONS(120), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(118), 20, ts_builtin_sym_end, anon_sym_RBRACK, anon_sym_COMMA, @@ -1920,50 +2122,27 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_then, anon_sym_else, anon_sym_do, - [1121] = 2, - ACTIONS(118), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(116), 19, - ts_builtin_sym_end, - anon_sym_RBRACK, - anon_sym_COMMA, - anon_sym_RPAREN, + anon_sym_to, + [1311] = 7, + ACTIONS(114), 1, + anon_sym_AMP, + ACTIONS(116), 1, + anon_sym_PIPE, + ACTIONS(106), 2, anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(108), 2, anon_sym_STAR, anon_sym_SLASH, - anon_sym_PLUS, + ACTIONS(112), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(110), 4, anon_sym_GT_EQ, anon_sym_LT_EQ, anon_sym_EQ, anon_sym_LT_GT, - anon_sym_AMP, - anon_sym_PIPE, - anon_sym_SEMI, - anon_sym_RBRACE, - anon_sym_then, - anon_sym_else, - anon_sym_do, - [1147] = 7, - ACTIONS(102), 1, - anon_sym_AMP, - ACTIONS(104), 1, - anon_sym_PIPE, - ACTIONS(94), 2, - anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(96), 2, - anon_sym_STAR, - anon_sym_SLASH, - ACTIONS(100), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(98), 4, - anon_sym_GT_EQ, - anon_sym_LT_EQ, - anon_sym_EQ, - anon_sym_LT_GT, - ACTIONS(120), 9, + ACTIONS(122), 10, ts_builtin_sym_end, anon_sym_RBRACK, anon_sym_COMMA, @@ -1973,35 +2152,42 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_then, anon_sym_else, anon_sym_do, - [1183] = 2, - ACTIONS(124), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(122), 19, - ts_builtin_sym_end, - anon_sym_RBRACK, - anon_sym_COMMA, - anon_sym_RPAREN, + anon_sym_to, + [1348] = 7, + ACTIONS(114), 1, + anon_sym_AMP, + ACTIONS(116), 1, + anon_sym_PIPE, + ACTIONS(106), 2, anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(108), 2, anon_sym_STAR, anon_sym_SLASH, - anon_sym_PLUS, + ACTIONS(112), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(110), 4, anon_sym_GT_EQ, anon_sym_LT_EQ, anon_sym_EQ, anon_sym_LT_GT, - anon_sym_AMP, - anon_sym_PIPE, + ACTIONS(124), 10, + ts_builtin_sym_end, + anon_sym_RBRACK, + anon_sym_COMMA, + anon_sym_RPAREN, anon_sym_SEMI, anon_sym_RBRACE, anon_sym_then, anon_sym_else, anon_sym_do, - [1209] = 2, + anon_sym_to, + [1385] = 2, ACTIONS(128), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(126), 19, + ACTIONS(126), 20, ts_builtin_sym_end, anon_sym_RBRACK, anon_sym_COMMA, @@ -2021,18 +2207,20 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_then, anon_sym_else, anon_sym_do, - [1235] = 2, + anon_sym_to, + [1412] = 3, + ACTIONS(108), 2, + anon_sym_STAR, + anon_sym_SLASH, ACTIONS(132), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(130), 19, + ACTIONS(130), 18, ts_builtin_sym_end, anon_sym_RBRACK, anon_sym_COMMA, anon_sym_RPAREN, anon_sym_DASH, - anon_sym_STAR, - anon_sym_SLASH, anon_sym_PLUS, anon_sym_GT_EQ, anon_sym_LT_EQ, @@ -2045,11 +2233,12 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_then, anon_sym_else, anon_sym_do, - [1261] = 2, + anon_sym_to, + [1441] = 2, ACTIONS(136), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(134), 19, + ACTIONS(134), 20, ts_builtin_sym_end, anon_sym_RBRACK, anon_sym_COMMA, @@ -2069,11 +2258,12 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_then, anon_sym_else, anon_sym_do, - [1287] = 2, + anon_sym_to, + [1468] = 2, ACTIONS(140), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(138), 19, + ACTIONS(138), 20, ts_builtin_sym_end, anon_sym_RBRACK, anon_sym_COMMA, @@ -2093,40 +2283,12 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_then, anon_sym_else, anon_sym_do, - [1313] = 7, - ACTIONS(102), 1, - anon_sym_AMP, - ACTIONS(104), 1, - anon_sym_PIPE, - ACTIONS(94), 2, - anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(96), 2, - anon_sym_STAR, - anon_sym_SLASH, - ACTIONS(100), 2, + anon_sym_to, + [1495] = 2, + ACTIONS(144), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(98), 4, - anon_sym_GT_EQ, - anon_sym_LT_EQ, - anon_sym_EQ, - anon_sym_LT_GT, - ACTIONS(142), 9, - ts_builtin_sym_end, - anon_sym_RBRACK, - anon_sym_COMMA, - anon_sym_RPAREN, - anon_sym_SEMI, - anon_sym_RBRACE, - anon_sym_then, - anon_sym_else, - anon_sym_do, - [1349] = 2, - ACTIONS(146), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(144), 19, + ACTIONS(142), 20, ts_builtin_sym_end, anon_sym_RBRACK, anon_sym_COMMA, @@ -2146,11 +2308,67 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_then, anon_sym_else, anon_sym_do, - [1375] = 2, + anon_sym_to, + [1522] = 7, + ACTIONS(114), 1, + anon_sym_AMP, + ACTIONS(116), 1, + anon_sym_PIPE, + ACTIONS(106), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(108), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(112), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(110), 4, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + ACTIONS(146), 10, + ts_builtin_sym_end, + anon_sym_RBRACK, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_SEMI, + anon_sym_RBRACE, + anon_sym_then, + anon_sym_else, + anon_sym_do, + anon_sym_to, + [1559] = 2, + ACTIONS(132), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(130), 20, + ts_builtin_sym_end, + anon_sym_RBRACK, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_DASH, + anon_sym_STAR, + anon_sym_SLASH, + anon_sym_PLUS, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + anon_sym_AMP, + anon_sym_PIPE, + anon_sym_SEMI, + anon_sym_RBRACE, + anon_sym_then, + anon_sym_else, + anon_sym_do, + anon_sym_to, + [1586] = 2, ACTIONS(150), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(148), 19, + ACTIONS(148), 20, ts_builtin_sym_end, anon_sym_RBRACK, anon_sym_COMMA, @@ -2170,36 +2388,12 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_then, anon_sym_else, anon_sym_do, - [1401] = 3, - ACTIONS(96), 2, - anon_sym_STAR, - anon_sym_SLASH, + anon_sym_to, + [1613] = 2, ACTIONS(154), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(152), 17, - ts_builtin_sym_end, - anon_sym_RBRACK, - anon_sym_COMMA, - anon_sym_RPAREN, - anon_sym_DASH, - anon_sym_PLUS, - anon_sym_GT_EQ, - anon_sym_LT_EQ, - anon_sym_EQ, - anon_sym_LT_GT, - anon_sym_AMP, - anon_sym_PIPE, - anon_sym_SEMI, - anon_sym_RBRACE, - anon_sym_then, - anon_sym_else, - anon_sym_do, - [1429] = 2, - ACTIONS(154), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(152), 19, + ACTIONS(152), 20, ts_builtin_sym_end, anon_sym_RBRACK, anon_sym_COMMA, @@ -2219,21 +2413,20 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_then, anon_sym_else, anon_sym_do, - [1455] = 4, - ACTIONS(94), 2, - anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(96), 2, - anon_sym_STAR, - anon_sym_SLASH, - ACTIONS(154), 2, + anon_sym_to, + [1640] = 2, + ACTIONS(158), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(152), 15, + ACTIONS(156), 20, ts_builtin_sym_end, anon_sym_RBRACK, anon_sym_COMMA, anon_sym_RPAREN, + anon_sym_DASH, + anon_sym_STAR, + anon_sym_SLASH, + anon_sym_PLUS, anon_sym_GT_EQ, anon_sym_LT_EQ, anon_sym_EQ, @@ -2245,96 +2438,12 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_then, anon_sym_else, anon_sym_do, - [1485] = 5, - ACTIONS(94), 2, - anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(96), 2, - anon_sym_STAR, - anon_sym_SLASH, - ACTIONS(100), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(98), 4, - anon_sym_GT_EQ, - anon_sym_LT_EQ, - anon_sym_EQ, - anon_sym_LT_GT, - ACTIONS(152), 11, - ts_builtin_sym_end, - anon_sym_RBRACK, - anon_sym_COMMA, - anon_sym_RPAREN, - anon_sym_AMP, - anon_sym_PIPE, - anon_sym_SEMI, - anon_sym_RBRACE, - anon_sym_then, - anon_sym_else, - anon_sym_do, - [1517] = 6, - ACTIONS(102), 1, - anon_sym_AMP, - ACTIONS(94), 2, - anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(96), 2, - anon_sym_STAR, - anon_sym_SLASH, - ACTIONS(100), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(98), 4, - anon_sym_GT_EQ, - anon_sym_LT_EQ, - anon_sym_EQ, - anon_sym_LT_GT, - ACTIONS(152), 10, - ts_builtin_sym_end, - anon_sym_RBRACK, - anon_sym_COMMA, - anon_sym_RPAREN, - anon_sym_PIPE, - anon_sym_SEMI, - anon_sym_RBRACE, - anon_sym_then, - anon_sym_else, - anon_sym_do, - [1551] = 8, - ACTIONS(102), 1, - anon_sym_AMP, - ACTIONS(104), 1, - anon_sym_PIPE, - ACTIONS(158), 1, - anon_sym_else, - ACTIONS(94), 2, - anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(96), 2, - anon_sym_STAR, - anon_sym_SLASH, - ACTIONS(100), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(98), 4, - anon_sym_GT_EQ, - anon_sym_LT_EQ, - anon_sym_EQ, - anon_sym_LT_GT, - ACTIONS(156), 8, - ts_builtin_sym_end, - anon_sym_RBRACK, - anon_sym_COMMA, - anon_sym_RPAREN, - anon_sym_SEMI, - anon_sym_RBRACE, - anon_sym_then, - anon_sym_do, - [1589] = 2, + anon_sym_to, + [1667] = 2, ACTIONS(162), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(160), 19, + ACTIONS(160), 20, ts_builtin_sym_end, anon_sym_RBRACK, anon_sym_COMMA, @@ -2354,11 +2463,12 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_then, anon_sym_else, anon_sym_do, - [1615] = 2, + anon_sym_to, + [1694] = 2, ACTIONS(166), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(164), 19, + ACTIONS(164), 20, ts_builtin_sym_end, anon_sym_RBRACK, anon_sym_COMMA, @@ -2378,540 +2488,776 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_then, anon_sym_else, anon_sym_do, - [1641] = 9, - ACTIONS(102), 1, - anon_sym_AMP, - ACTIONS(104), 1, - anon_sym_PIPE, - ACTIONS(168), 1, - anon_sym_RPAREN, - ACTIONS(170), 1, - anon_sym_SEMI, - STATE(66), 1, - aux_sym_sequence_expression_repeat1, - ACTIONS(94), 2, + anon_sym_to, + [1721] = 5, + ACTIONS(106), 2, anon_sym_DASH, anon_sym_PLUS, - ACTIONS(96), 2, + ACTIONS(108), 2, anon_sym_STAR, anon_sym_SLASH, - ACTIONS(100), 2, + ACTIONS(112), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(98), 4, + ACTIONS(110), 4, anon_sym_GT_EQ, anon_sym_LT_EQ, anon_sym_EQ, anon_sym_LT_GT, - [1675] = 9, - ACTIONS(102), 1, + ACTIONS(130), 12, + ts_builtin_sym_end, + anon_sym_RBRACK, + anon_sym_COMMA, + anon_sym_RPAREN, anon_sym_AMP, - ACTIONS(104), 1, + anon_sym_PIPE, + anon_sym_SEMI, + anon_sym_RBRACE, + anon_sym_then, + anon_sym_else, + anon_sym_do, + anon_sym_to, + [1754] = 6, + ACTIONS(114), 1, + anon_sym_AMP, + ACTIONS(106), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(108), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(112), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(110), 4, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + ACTIONS(130), 11, + ts_builtin_sym_end, + anon_sym_RBRACK, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_PIPE, + anon_sym_SEMI, + anon_sym_RBRACE, + anon_sym_then, + anon_sym_else, + anon_sym_do, + anon_sym_to, + [1789] = 7, + ACTIONS(114), 1, + anon_sym_AMP, + ACTIONS(116), 1, + anon_sym_PIPE, + ACTIONS(106), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(108), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(112), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(110), 4, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + ACTIONS(168), 10, + ts_builtin_sym_end, + anon_sym_RBRACK, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_SEMI, + anon_sym_RBRACE, + anon_sym_then, + anon_sym_else, + anon_sym_do, + anon_sym_to, + [1826] = 4, + ACTIONS(106), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(108), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(132), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(130), 16, + ts_builtin_sym_end, + anon_sym_RBRACK, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + anon_sym_AMP, + anon_sym_PIPE, + anon_sym_SEMI, + anon_sym_RBRACE, + anon_sym_then, + anon_sym_else, + anon_sym_do, + anon_sym_to, + [1857] = 8, + ACTIONS(114), 1, + anon_sym_AMP, + ACTIONS(116), 1, anon_sym_PIPE, ACTIONS(172), 1, - anon_sym_COMMA, - ACTIONS(174), 1, - anon_sym_RBRACE, - STATE(67), 1, - aux_sym_record_expression_repeat1, - ACTIONS(94), 2, + anon_sym_else, + ACTIONS(106), 2, anon_sym_DASH, anon_sym_PLUS, - ACTIONS(96), 2, + ACTIONS(108), 2, anon_sym_STAR, anon_sym_SLASH, - ACTIONS(100), 2, + ACTIONS(112), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(98), 4, + ACTIONS(110), 4, anon_sym_GT_EQ, anon_sym_LT_EQ, anon_sym_EQ, anon_sym_LT_GT, - [1709] = 9, - ACTIONS(102), 1, - anon_sym_AMP, - ACTIONS(104), 1, - anon_sym_PIPE, - ACTIONS(176), 1, + ACTIONS(170), 9, + ts_builtin_sym_end, + anon_sym_RBRACK, anon_sym_COMMA, - ACTIONS(178), 1, - anon_sym_RPAREN, - STATE(64), 1, - aux_sym_function_call_repeat1, - ACTIONS(94), 2, - anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(96), 2, - anon_sym_STAR, - anon_sym_SLASH, - ACTIONS(100), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(98), 4, - anon_sym_GT_EQ, - anon_sym_LT_EQ, - anon_sym_EQ, - anon_sym_LT_GT, - [1743] = 7, - ACTIONS(102), 1, - anon_sym_AMP, - ACTIONS(104), 1, - anon_sym_PIPE, - ACTIONS(94), 2, - anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(96), 2, - anon_sym_STAR, - anon_sym_SLASH, - ACTIONS(100), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(180), 2, - anon_sym_COMMA, - anon_sym_RPAREN, - ACTIONS(98), 4, - anon_sym_GT_EQ, - anon_sym_LT_EQ, - anon_sym_EQ, - anon_sym_LT_GT, - [1772] = 7, - ACTIONS(102), 1, - anon_sym_AMP, - ACTIONS(104), 1, - anon_sym_PIPE, - ACTIONS(94), 2, - anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(96), 2, - anon_sym_STAR, - anon_sym_SLASH, - ACTIONS(100), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(182), 2, anon_sym_RPAREN, anon_sym_SEMI, - ACTIONS(98), 4, - anon_sym_GT_EQ, - anon_sym_LT_EQ, - anon_sym_EQ, - anon_sym_LT_GT, - [1801] = 7, - ACTIONS(102), 1, - anon_sym_AMP, - ACTIONS(104), 1, - anon_sym_PIPE, - ACTIONS(94), 2, - anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(96), 2, - anon_sym_STAR, - anon_sym_SLASH, - ACTIONS(100), 2, + anon_sym_RBRACE, + anon_sym_then, + anon_sym_do, + anon_sym_to, + [1896] = 2, + ACTIONS(176), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(184), 2, + ACTIONS(174), 20, + ts_builtin_sym_end, + anon_sym_RBRACK, anon_sym_COMMA, - anon_sym_RBRACE, - ACTIONS(98), 4, + anon_sym_RPAREN, + anon_sym_DASH, + anon_sym_STAR, + anon_sym_SLASH, + anon_sym_PLUS, anon_sym_GT_EQ, anon_sym_LT_EQ, anon_sym_EQ, anon_sym_LT_GT, - [1830] = 7, - ACTIONS(102), 1, anon_sym_AMP, - ACTIONS(104), 1, + anon_sym_PIPE, + anon_sym_SEMI, + anon_sym_RBRACE, + anon_sym_then, + anon_sym_else, + anon_sym_do, + anon_sym_to, + [1923] = 9, + ACTIONS(114), 1, + anon_sym_AMP, + ACTIONS(116), 1, + anon_sym_PIPE, + ACTIONS(178), 1, + anon_sym_COMMA, + ACTIONS(180), 1, + anon_sym_RBRACE, + STATE(69), 1, + aux_sym_record_expression_repeat1, + ACTIONS(106), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(108), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(112), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(110), 4, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + [1957] = 9, + ACTIONS(114), 1, + anon_sym_AMP, + ACTIONS(116), 1, + anon_sym_PIPE, + ACTIONS(182), 1, + anon_sym_COMMA, + ACTIONS(184), 1, + anon_sym_RPAREN, + STATE(72), 1, + aux_sym_function_call_repeat1, + ACTIONS(106), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(108), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(112), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(110), 4, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + [1991] = 9, + ACTIONS(114), 1, + anon_sym_AMP, + ACTIONS(116), 1, anon_sym_PIPE, ACTIONS(186), 1, - anon_sym_then, - ACTIONS(94), 2, - anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(96), 2, - anon_sym_STAR, - anon_sym_SLASH, - ACTIONS(100), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(98), 4, - anon_sym_GT_EQ, - anon_sym_LT_EQ, - anon_sym_EQ, - anon_sym_LT_GT, - [1858] = 7, - ACTIONS(102), 1, - anon_sym_AMP, - ACTIONS(104), 1, - anon_sym_PIPE, + anon_sym_RPAREN, ACTIONS(188), 1, - anon_sym_RBRACK, - ACTIONS(94), 2, + anon_sym_SEMI, + STATE(74), 1, + aux_sym_sequence_expression_repeat1, + ACTIONS(106), 2, anon_sym_DASH, anon_sym_PLUS, - ACTIONS(96), 2, + ACTIONS(108), 2, anon_sym_STAR, anon_sym_SLASH, - ACTIONS(100), 2, + ACTIONS(112), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(98), 4, + ACTIONS(110), 4, anon_sym_GT_EQ, anon_sym_LT_EQ, anon_sym_EQ, anon_sym_LT_GT, - [1886] = 7, - ACTIONS(102), 1, + [2025] = 7, + ACTIONS(114), 1, anon_sym_AMP, - ACTIONS(104), 1, + ACTIONS(116), 1, anon_sym_PIPE, - ACTIONS(190), 1, - anon_sym_do, - ACTIONS(94), 2, + ACTIONS(106), 2, anon_sym_DASH, anon_sym_PLUS, - ACTIONS(96), 2, + ACTIONS(108), 2, anon_sym_STAR, anon_sym_SLASH, - ACTIONS(100), 2, + ACTIONS(112), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(98), 4, + ACTIONS(190), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + ACTIONS(110), 4, anon_sym_GT_EQ, anon_sym_LT_EQ, anon_sym_EQ, anon_sym_LT_GT, - [1914] = 7, - ACTIONS(102), 1, + [2054] = 7, + ACTIONS(114), 1, anon_sym_AMP, - ACTIONS(104), 1, + ACTIONS(116), 1, anon_sym_PIPE, - ACTIONS(192), 1, - ts_builtin_sym_end, - ACTIONS(94), 2, + ACTIONS(106), 2, anon_sym_DASH, anon_sym_PLUS, - ACTIONS(96), 2, + ACTIONS(108), 2, anon_sym_STAR, anon_sym_SLASH, - ACTIONS(100), 2, + ACTIONS(112), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(98), 4, + ACTIONS(192), 2, + anon_sym_RPAREN, + anon_sym_SEMI, + ACTIONS(110), 4, anon_sym_GT_EQ, anon_sym_LT_EQ, anon_sym_EQ, anon_sym_LT_GT, - [1942] = 7, - ACTIONS(102), 1, + [2083] = 7, + ACTIONS(114), 1, anon_sym_AMP, - ACTIONS(104), 1, + ACTIONS(116), 1, anon_sym_PIPE, - ACTIONS(194), 1, - anon_sym_RBRACK, - ACTIONS(94), 2, + ACTIONS(106), 2, anon_sym_DASH, anon_sym_PLUS, - ACTIONS(96), 2, + ACTIONS(108), 2, anon_sym_STAR, anon_sym_SLASH, - ACTIONS(100), 2, + ACTIONS(112), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(98), 4, + ACTIONS(194), 2, + anon_sym_COMMA, + anon_sym_RBRACE, + ACTIONS(110), 4, anon_sym_GT_EQ, anon_sym_LT_EQ, anon_sym_EQ, anon_sym_LT_GT, - [1970] = 3, + [2112] = 7, + ACTIONS(114), 1, + anon_sym_AMP, + ACTIONS(116), 1, + anon_sym_PIPE, ACTIONS(196), 1, - anon_sym_DQUOTE, - STATE(62), 1, - aux_sym_string_literal_repeat1, - ACTIONS(198), 2, - aux_sym_string_literal_token1, - sym_escape_sequence, - [1981] = 3, - ACTIONS(200), 1, - anon_sym_DQUOTE, - STATE(60), 1, - aux_sym_string_literal_repeat1, - ACTIONS(202), 2, - aux_sym_string_literal_token1, - sym_escape_sequence, - [1992] = 3, - ACTIONS(204), 1, - anon_sym_DQUOTE, - STATE(62), 1, - aux_sym_string_literal_repeat1, - ACTIONS(206), 2, - aux_sym_string_literal_token1, - sym_escape_sequence, - [2003] = 3, - ACTIONS(182), 1, - anon_sym_RPAREN, - ACTIONS(209), 1, - anon_sym_SEMI, - STATE(63), 1, - aux_sym_sequence_expression_repeat1, - [2013] = 3, - ACTIONS(176), 1, - anon_sym_COMMA, - ACTIONS(212), 1, - anon_sym_RPAREN, - STATE(65), 1, - aux_sym_function_call_repeat1, - [2023] = 3, - ACTIONS(180), 1, - anon_sym_RPAREN, - ACTIONS(214), 1, - anon_sym_COMMA, - STATE(65), 1, - aux_sym_function_call_repeat1, - [2033] = 3, - ACTIONS(170), 1, - anon_sym_SEMI, - ACTIONS(217), 1, - anon_sym_RPAREN, - STATE(63), 1, - aux_sym_sequence_expression_repeat1, - [2043] = 3, - ACTIONS(172), 1, - anon_sym_COMMA, - ACTIONS(219), 1, - anon_sym_RBRACE, - STATE(68), 1, - aux_sym_record_expression_repeat1, - [2053] = 3, - ACTIONS(221), 1, - anon_sym_COMMA, - ACTIONS(224), 1, - anon_sym_RBRACE, - STATE(68), 1, - aux_sym_record_expression_repeat1, - [2063] = 2, - ACTIONS(226), 1, - sym_identifier, - ACTIONS(228), 1, - anon_sym_RBRACE, - [2070] = 1, - ACTIONS(230), 1, - sym_identifier, - [2074] = 1, - ACTIONS(232), 1, - anon_sym_of, - [2078] = 1, - ACTIONS(234), 1, - sym_identifier, - [2082] = 1, - ACTIONS(236), 1, - anon_sym_EQ, - [2086] = 1, - ACTIONS(238), 1, - anon_sym_EQ, - [2090] = 1, - ACTIONS(240), 1, ts_builtin_sym_end, + ACTIONS(106), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(108), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(112), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(110), 4, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + [2140] = 7, + ACTIONS(114), 1, + anon_sym_AMP, + ACTIONS(116), 1, + anon_sym_PIPE, + ACTIONS(198), 1, + anon_sym_do, + ACTIONS(106), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(108), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(112), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(110), 4, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + [2168] = 7, + ACTIONS(114), 1, + anon_sym_AMP, + ACTIONS(116), 1, + anon_sym_PIPE, + ACTIONS(200), 1, + anon_sym_to, + ACTIONS(106), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(108), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(112), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(110), 4, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + [2196] = 7, + ACTIONS(114), 1, + anon_sym_AMP, + ACTIONS(116), 1, + anon_sym_PIPE, + ACTIONS(202), 1, + anon_sym_RBRACK, + ACTIONS(106), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(108), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(112), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(110), 4, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + [2224] = 7, + ACTIONS(114), 1, + anon_sym_AMP, + ACTIONS(116), 1, + anon_sym_PIPE, + ACTIONS(204), 1, + anon_sym_RBRACK, + ACTIONS(106), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(108), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(112), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(110), 4, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + [2252] = 7, + ACTIONS(114), 1, + anon_sym_AMP, + ACTIONS(116), 1, + anon_sym_PIPE, + ACTIONS(206), 1, + anon_sym_do, + ACTIONS(106), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(108), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(112), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(110), 4, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + [2280] = 7, + ACTIONS(114), 1, + anon_sym_AMP, + ACTIONS(116), 1, + anon_sym_PIPE, + ACTIONS(208), 1, + anon_sym_then, + ACTIONS(106), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(108), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(112), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(110), 4, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + [2308] = 3, + ACTIONS(210), 1, + anon_sym_DQUOTE, + STATE(66), 1, + aux_sym_string_literal_repeat1, + ACTIONS(212), 2, + aux_sym_string_literal_token1, + sym_escape_sequence, + [2319] = 3, + ACTIONS(215), 1, + anon_sym_DQUOTE, + STATE(66), 1, + aux_sym_string_literal_repeat1, + ACTIONS(217), 2, + aux_sym_string_literal_token1, + sym_escape_sequence, + [2330] = 3, + ACTIONS(219), 1, + anon_sym_DQUOTE, + STATE(67), 1, + aux_sym_string_literal_repeat1, + ACTIONS(221), 2, + aux_sym_string_literal_token1, + sym_escape_sequence, + [2341] = 3, + ACTIONS(178), 1, + anon_sym_COMMA, + ACTIONS(223), 1, + anon_sym_RBRACE, + STATE(73), 1, + aux_sym_record_expression_repeat1, + [2351] = 3, + ACTIONS(192), 1, + anon_sym_RPAREN, + ACTIONS(225), 1, + anon_sym_SEMI, + STATE(70), 1, + aux_sym_sequence_expression_repeat1, + [2361] = 3, + ACTIONS(190), 1, + anon_sym_RPAREN, + ACTIONS(228), 1, + anon_sym_COMMA, + STATE(71), 1, + aux_sym_function_call_repeat1, + [2371] = 3, + ACTIONS(182), 1, + anon_sym_COMMA, + ACTIONS(231), 1, + anon_sym_RPAREN, + STATE(71), 1, + aux_sym_function_call_repeat1, + [2381] = 3, + ACTIONS(233), 1, + anon_sym_COMMA, + ACTIONS(236), 1, + anon_sym_RBRACE, + STATE(73), 1, + aux_sym_record_expression_repeat1, + [2391] = 3, + ACTIONS(188), 1, + anon_sym_SEMI, + ACTIONS(238), 1, + anon_sym_RPAREN, + STATE(70), 1, + aux_sym_sequence_expression_repeat1, + [2401] = 2, + ACTIONS(240), 1, + sym_identifier, + ACTIONS(242), 1, + anon_sym_RBRACE, + [2408] = 1, + ACTIONS(244), 1, + sym_identifier, + [2412] = 1, + ACTIONS(246), 1, + anon_sym_EQ, + [2416] = 1, + ACTIONS(248), 1, + sym_identifier, + [2420] = 1, + ACTIONS(250), 1, + ts_builtin_sym_end, + [2424] = 1, + ACTIONS(252), 1, + anon_sym_COLON_EQ, + [2428] = 1, + ACTIONS(254), 1, + sym_identifier, + [2432] = 1, + ACTIONS(256), 1, + anon_sym_EQ, + [2436] = 1, + ACTIONS(258), 1, + anon_sym_of, }; static const uint32_t ts_small_parse_table_map[] = { [SMALL_STATE(2)] = 0, - [SMALL_STATE(3)] = 37, - [SMALL_STATE(4)] = 72, - [SMALL_STATE(5)] = 101, - [SMALL_STATE(6)] = 130, - [SMALL_STATE(7)] = 174, - [SMALL_STATE(8)] = 218, - [SMALL_STATE(9)] = 259, - [SMALL_STATE(10)] = 300, - [SMALL_STATE(11)] = 341, - [SMALL_STATE(12)] = 382, - [SMALL_STATE(13)] = 423, - [SMALL_STATE(14)] = 464, - [SMALL_STATE(15)] = 505, - [SMALL_STATE(16)] = 546, - [SMALL_STATE(17)] = 587, - [SMALL_STATE(18)] = 628, - [SMALL_STATE(19)] = 669, - [SMALL_STATE(20)] = 710, - [SMALL_STATE(21)] = 751, - [SMALL_STATE(22)] = 792, - [SMALL_STATE(23)] = 833, - [SMALL_STATE(24)] = 874, - [SMALL_STATE(25)] = 915, - [SMALL_STATE(26)] = 956, - [SMALL_STATE(27)] = 997, - [SMALL_STATE(28)] = 1033, - [SMALL_STATE(29)] = 1069, - [SMALL_STATE(30)] = 1095, - [SMALL_STATE(31)] = 1121, - [SMALL_STATE(32)] = 1147, - [SMALL_STATE(33)] = 1183, - [SMALL_STATE(34)] = 1209, - [SMALL_STATE(35)] = 1235, - [SMALL_STATE(36)] = 1261, - [SMALL_STATE(37)] = 1287, - [SMALL_STATE(38)] = 1313, - [SMALL_STATE(39)] = 1349, - [SMALL_STATE(40)] = 1375, - [SMALL_STATE(41)] = 1401, - [SMALL_STATE(42)] = 1429, - [SMALL_STATE(43)] = 1455, - [SMALL_STATE(44)] = 1485, - [SMALL_STATE(45)] = 1517, - [SMALL_STATE(46)] = 1551, - [SMALL_STATE(47)] = 1589, - [SMALL_STATE(48)] = 1615, - [SMALL_STATE(49)] = 1641, - [SMALL_STATE(50)] = 1675, - [SMALL_STATE(51)] = 1709, - [SMALL_STATE(52)] = 1743, - [SMALL_STATE(53)] = 1772, - [SMALL_STATE(54)] = 1801, - [SMALL_STATE(55)] = 1830, - [SMALL_STATE(56)] = 1858, - [SMALL_STATE(57)] = 1886, - [SMALL_STATE(58)] = 1914, - [SMALL_STATE(59)] = 1942, - [SMALL_STATE(60)] = 1970, - [SMALL_STATE(61)] = 1981, - [SMALL_STATE(62)] = 1992, - [SMALL_STATE(63)] = 2003, - [SMALL_STATE(64)] = 2013, - [SMALL_STATE(65)] = 2023, - [SMALL_STATE(66)] = 2033, - [SMALL_STATE(67)] = 2043, - [SMALL_STATE(68)] = 2053, - [SMALL_STATE(69)] = 2063, - [SMALL_STATE(70)] = 2070, - [SMALL_STATE(71)] = 2074, - [SMALL_STATE(72)] = 2078, - [SMALL_STATE(73)] = 2082, - [SMALL_STATE(74)] = 2086, - [SMALL_STATE(75)] = 2090, + [SMALL_STATE(3)] = 38, + [SMALL_STATE(4)] = 86, + [SMALL_STATE(5)] = 134, + [SMALL_STATE(6)] = 164, + [SMALL_STATE(7)] = 194, + [SMALL_STATE(8)] = 230, + [SMALL_STATE(9)] = 275, + [SMALL_STATE(10)] = 320, + [SMALL_STATE(11)] = 365, + [SMALL_STATE(12)] = 410, + [SMALL_STATE(13)] = 455, + [SMALL_STATE(14)] = 500, + [SMALL_STATE(15)] = 545, + [SMALL_STATE(16)] = 590, + [SMALL_STATE(17)] = 635, + [SMALL_STATE(18)] = 680, + [SMALL_STATE(19)] = 725, + [SMALL_STATE(20)] = 770, + [SMALL_STATE(21)] = 815, + [SMALL_STATE(22)] = 860, + [SMALL_STATE(23)] = 905, + [SMALL_STATE(24)] = 950, + [SMALL_STATE(25)] = 995, + [SMALL_STATE(26)] = 1040, + [SMALL_STATE(27)] = 1085, + [SMALL_STATE(28)] = 1130, + [SMALL_STATE(29)] = 1175, + [SMALL_STATE(30)] = 1220, + [SMALL_STATE(31)] = 1247, + [SMALL_STATE(32)] = 1284, + [SMALL_STATE(33)] = 1311, + [SMALL_STATE(34)] = 1348, + [SMALL_STATE(35)] = 1385, + [SMALL_STATE(36)] = 1412, + [SMALL_STATE(37)] = 1441, + [SMALL_STATE(38)] = 1468, + [SMALL_STATE(39)] = 1495, + [SMALL_STATE(40)] = 1522, + [SMALL_STATE(41)] = 1559, + [SMALL_STATE(42)] = 1586, + [SMALL_STATE(43)] = 1613, + [SMALL_STATE(44)] = 1640, + [SMALL_STATE(45)] = 1667, + [SMALL_STATE(46)] = 1694, + [SMALL_STATE(47)] = 1721, + [SMALL_STATE(48)] = 1754, + [SMALL_STATE(49)] = 1789, + [SMALL_STATE(50)] = 1826, + [SMALL_STATE(51)] = 1857, + [SMALL_STATE(52)] = 1896, + [SMALL_STATE(53)] = 1923, + [SMALL_STATE(54)] = 1957, + [SMALL_STATE(55)] = 1991, + [SMALL_STATE(56)] = 2025, + [SMALL_STATE(57)] = 2054, + [SMALL_STATE(58)] = 2083, + [SMALL_STATE(59)] = 2112, + [SMALL_STATE(60)] = 2140, + [SMALL_STATE(61)] = 2168, + [SMALL_STATE(62)] = 2196, + [SMALL_STATE(63)] = 2224, + [SMALL_STATE(64)] = 2252, + [SMALL_STATE(65)] = 2280, + [SMALL_STATE(66)] = 2308, + [SMALL_STATE(67)] = 2319, + [SMALL_STATE(68)] = 2330, + [SMALL_STATE(69)] = 2341, + [SMALL_STATE(70)] = 2351, + [SMALL_STATE(71)] = 2361, + [SMALL_STATE(72)] = 2371, + [SMALL_STATE(73)] = 2381, + [SMALL_STATE(74)] = 2391, + [SMALL_STATE(75)] = 2401, + [SMALL_STATE(76)] = 2408, + [SMALL_STATE(77)] = 2412, + [SMALL_STATE(78)] = 2416, + [SMALL_STATE(79)] = 2420, + [SMALL_STATE(80)] = 2424, + [SMALL_STATE(81)] = 2428, + [SMALL_STATE(82)] = 2432, + [SMALL_STATE(83)] = 2436, }; static const TSParseActionEntry ts_parse_actions[] = { [0] = {.entry = {.count = 0, .reusable = false}}, [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(), [3] = {.entry = {.count = 1, .reusable = false}}, SHIFT(2), - [5] = {.entry = {.count = 1, .reusable = false}}, SHIFT(58), - [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(61), - [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), - [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), - [13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8), - [15] = {.entry = {.count = 1, .reusable = false}}, SHIFT(12), - [17] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__lvalue, 1), - [19] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym__lvalue, 1), SHIFT(13), - [22] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), - [24] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__lvalue, 1), - [26] = {.entry = {.count = 1, .reusable = true}}, SHIFT(69), - [28] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__expr, 1), - [30] = {.entry = {.count = 1, .reusable = true}}, SHIFT(70), - [32] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), - [34] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__expr, 1), - [36] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), - [38] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_record_value, 3, .production_id = 5), - [40] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_record_value, 3, .production_id = 5), - [42] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_array_value, 4, .production_id = 10), - [44] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_array_value, 4, .production_id = 10), - [46] = {.entry = {.count = 1, .reusable = false}}, SHIFT(49), - [48] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), - [50] = {.entry = {.count = 1, .reusable = false}}, SHIFT(51), - [52] = {.entry = {.count = 1, .reusable = true}}, SHIFT(33), - [54] = {.entry = {.count = 1, .reusable = false}}, SHIFT(55), - [56] = {.entry = {.count = 1, .reusable = false}}, SHIFT(38), - [58] = {.entry = {.count = 1, .reusable = false}}, SHIFT(54), - [60] = {.entry = {.count = 1, .reusable = false}}, SHIFT(32), - [62] = {.entry = {.count = 1, .reusable = false}}, SHIFT(57), - [64] = {.entry = {.count = 1, .reusable = false}}, SHIFT(59), - [66] = {.entry = {.count = 1, .reusable = false}}, SHIFT(56), - [68] = {.entry = {.count = 1, .reusable = false}}, SHIFT(50), - [70] = {.entry = {.count = 1, .reusable = false}}, SHIFT(52), - [72] = {.entry = {.count = 1, .reusable = false}}, SHIFT(28), - [74] = {.entry = {.count = 1, .reusable = false}}, SHIFT(27), - [76] = {.entry = {.count = 1, .reusable = false}}, SHIFT(46), - [78] = {.entry = {.count = 1, .reusable = false}}, SHIFT(48), - [80] = {.entry = {.count = 1, .reusable = false}}, SHIFT(41), - [82] = {.entry = {.count = 1, .reusable = false}}, SHIFT(42), - [84] = {.entry = {.count = 1, .reusable = false}}, SHIFT(43), - [86] = {.entry = {.count = 1, .reusable = false}}, SHIFT(44), - [88] = {.entry = {.count = 1, .reusable = false}}, SHIFT(45), - [90] = {.entry = {.count = 1, .reusable = false}}, SHIFT(53), - [92] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_while_expression, 4, .production_id = 9), - [94] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), - [96] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), - [98] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), - [100] = {.entry = {.count = 1, .reusable = false}}, SHIFT(23), - [102] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24), - [104] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), - [106] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_unary_expression, 2, .production_id = 1), - [108] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sequence_expression, 4), - [110] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sequence_expression, 4), - [112] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_string_literal, 3), - [114] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_string_literal, 3), - [116] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_record_expression, 7, .production_id = 15), - [118] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_record_expression, 7, .production_id = 15), - [120] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_expression, 6, .production_id = 14), - [122] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_call, 3, .production_id = 2), - [124] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_call, 3, .production_id = 2), - [126] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sequence_expression, 2), - [128] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sequence_expression, 2), - [130] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_record_expression, 6, .production_id = 13), - [132] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_record_expression, 6, .production_id = 13), + [5] = {.entry = {.count = 1, .reusable = false}}, SHIFT(59), + [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(68), + [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), + [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), + [13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(14), + [15] = {.entry = {.count = 1, .reusable = false}}, SHIFT(17), + [17] = {.entry = {.count = 1, .reusable = false}}, SHIFT(76), + [19] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__lvalue, 1), + [21] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym__lvalue, 1), SHIFT(15), + [24] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3), + [26] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__lvalue, 1), + [28] = {.entry = {.count = 1, .reusable = true}}, SHIFT(75), + [30] = {.entry = {.count = 1, .reusable = false}}, SHIFT(54), + [32] = {.entry = {.count = 1, .reusable = true}}, SHIFT(44), + [34] = {.entry = {.count = 1, .reusable = false}}, SHIFT(55), + [36] = {.entry = {.count = 1, .reusable = true}}, SHIFT(43), + [38] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_array_value, 4, .production_id = 10), + [40] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_array_value, 4, .production_id = 10), + [42] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_record_value, 3, .production_id = 5), + [44] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_record_value, 3, .production_id = 5), + [46] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__expr, 1), + [48] = {.entry = {.count = 1, .reusable = true}}, SHIFT(81), + [50] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29), + [52] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__expr, 1), + [54] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28), + [56] = {.entry = {.count = 1, .reusable = false}}, SHIFT(49), + [58] = {.entry = {.count = 1, .reusable = false}}, SHIFT(53), + [60] = {.entry = {.count = 1, .reusable = false}}, SHIFT(58), + [62] = {.entry = {.count = 1, .reusable = false}}, SHIFT(64), + [64] = {.entry = {.count = 1, .reusable = false}}, SHIFT(40), + [66] = {.entry = {.count = 1, .reusable = false}}, SHIFT(31), + [68] = {.entry = {.count = 1, .reusable = false}}, SHIFT(65), + [70] = {.entry = {.count = 1, .reusable = false}}, SHIFT(62), + [72] = {.entry = {.count = 1, .reusable = false}}, SHIFT(56), + [74] = {.entry = {.count = 1, .reusable = false}}, SHIFT(60), + [76] = {.entry = {.count = 1, .reusable = false}}, SHIFT(33), + [78] = {.entry = {.count = 1, .reusable = false}}, SHIFT(61), + [80] = {.entry = {.count = 1, .reusable = false}}, SHIFT(34), + [82] = {.entry = {.count = 1, .reusable = false}}, SHIFT(51), + [84] = {.entry = {.count = 1, .reusable = false}}, SHIFT(57), + [86] = {.entry = {.count = 1, .reusable = false}}, SHIFT(36), + [88] = {.entry = {.count = 1, .reusable = false}}, SHIFT(41), + [90] = {.entry = {.count = 1, .reusable = false}}, SHIFT(50), + [92] = {.entry = {.count = 1, .reusable = false}}, SHIFT(47), + [94] = {.entry = {.count = 1, .reusable = false}}, SHIFT(48), + [96] = {.entry = {.count = 1, .reusable = false}}, SHIFT(30), + [98] = {.entry = {.count = 1, .reusable = false}}, SHIFT(63), + [100] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assignment_expression, 3, .production_id = 6), + [102] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_assignment_expression, 3, .production_id = 6), + [104] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_unary_expression, 2, .production_id = 1), + [106] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), + [108] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24), + [110] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), + [112] = {.entry = {.count = 1, .reusable = false}}, SHIFT(25), + [114] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), + [116] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), + [118] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sequence_expression, 4), + [120] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sequence_expression, 4), + [122] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_for_expression, 8, .production_id = 17), + [124] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_while_expression, 4, .production_id = 9), + [126] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_string_literal, 2), + [128] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_string_literal, 2), + [130] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_binary_expression, 3, .production_id = 4), + [132] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_binary_expression, 3, .production_id = 4), [134] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_record_expression, 3, .production_id = 3), [136] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_record_expression, 3, .production_id = 3), [138] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sequence_expression, 3), [140] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sequence_expression, 3), - [142] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_array_expression, 6, .production_id = 12), - [144] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_call, 4, .production_id = 7), - [146] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_call, 4, .production_id = 7), - [148] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_call, 5, .production_id = 11), - [150] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_call, 5, .production_id = 11), - [152] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_binary_expression, 3, .production_id = 4), - [154] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_binary_expression, 3, .production_id = 4), - [156] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_expression, 4, .production_id = 8), - [158] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), - [160] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_string_literal, 2), - [162] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_string_literal, 2), - [164] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assignment_expression, 3, .production_id = 6), - [166] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_assignment_expression, 3, .production_id = 6), - [168] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37), - [170] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), - [172] = {.entry = {.count = 1, .reusable = true}}, SHIFT(72), - [174] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35), - [176] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), - [178] = {.entry = {.count = 1, .reusable = true}}, SHIFT(39), - [180] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_function_call_repeat1, 2), - [182] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_sequence_expression_repeat1, 2), - [184] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_record_expression_repeat1, 4, .production_id = 17), - [186] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), - [188] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), - [190] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), - [192] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1), - [194] = {.entry = {.count = 1, .reusable = true}}, SHIFT(71), - [196] = {.entry = {.count = 1, .reusable = false}}, SHIFT(30), - [198] = {.entry = {.count = 1, .reusable = true}}, SHIFT(62), - [200] = {.entry = {.count = 1, .reusable = false}}, SHIFT(47), - [202] = {.entry = {.count = 1, .reusable = true}}, SHIFT(60), - [204] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_string_literal_repeat1, 2), - [206] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_string_literal_repeat1, 2), SHIFT_REPEAT(62), - [209] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_sequence_expression_repeat1, 2), SHIFT_REPEAT(26), - [212] = {.entry = {.count = 1, .reusable = true}}, SHIFT(40), - [214] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_function_call_repeat1, 2), SHIFT_REPEAT(16), - [217] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29), - [219] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31), - [221] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_record_expression_repeat1, 2, .production_id = 16), SHIFT_REPEAT(72), - [224] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_record_expression_repeat1, 2, .production_id = 16), - [226] = {.entry = {.count = 1, .reusable = true}}, SHIFT(73), - [228] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36), - [230] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), - [232] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), - [234] = {.entry = {.count = 1, .reusable = true}}, SHIFT(74), - [236] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), - [238] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), - [240] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [142] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_record_expression, 7, .production_id = 15), + [144] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_record_expression, 7, .production_id = 15), + [146] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_expression, 6, .production_id = 14), + [148] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_record_expression, 6, .production_id = 13), + [150] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_record_expression, 6, .production_id = 13), + [152] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sequence_expression, 2), + [154] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sequence_expression, 2), + [156] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_call, 3, .production_id = 2), + [158] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_call, 3, .production_id = 2), + [160] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_string_literal, 3), + [162] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_string_literal, 3), + [164] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_call, 4, .production_id = 7), + [166] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_call, 4, .production_id = 7), + [168] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_array_expression, 6, .production_id = 12), + [170] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_expression, 4, .production_id = 8), + [172] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), + [174] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_call, 5, .production_id = 11), + [176] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_call, 5, .production_id = 11), + [178] = {.entry = {.count = 1, .reusable = true}}, SHIFT(78), + [180] = {.entry = {.count = 1, .reusable = true}}, SHIFT(42), + [182] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), + [184] = {.entry = {.count = 1, .reusable = true}}, SHIFT(46), + [186] = {.entry = {.count = 1, .reusable = true}}, SHIFT(38), + [188] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), + [190] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_function_call_repeat1, 2), + [192] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_sequence_expression_repeat1, 2), + [194] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_record_expression_repeat1, 4, .production_id = 18), + [196] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1), + [198] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), + [200] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), + [202] = {.entry = {.count = 1, .reusable = true}}, SHIFT(83), + [204] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), + [206] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), + [208] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), + [210] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_string_literal_repeat1, 2), + [212] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_string_literal_repeat1, 2), SHIFT_REPEAT(66), + [215] = {.entry = {.count = 1, .reusable = false}}, SHIFT(45), + [217] = {.entry = {.count = 1, .reusable = true}}, SHIFT(66), + [219] = {.entry = {.count = 1, .reusable = false}}, SHIFT(35), + [221] = {.entry = {.count = 1, .reusable = true}}, SHIFT(67), + [223] = {.entry = {.count = 1, .reusable = true}}, SHIFT(39), + [225] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_sequence_expression_repeat1, 2), SHIFT_REPEAT(22), + [228] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_function_call_repeat1, 2), SHIFT_REPEAT(16), + [231] = {.entry = {.count = 1, .reusable = true}}, SHIFT(52), + [233] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_record_expression_repeat1, 2, .production_id = 16), SHIFT_REPEAT(78), + [236] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_record_expression_repeat1, 2, .production_id = 16), + [238] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32), + [240] = {.entry = {.count = 1, .reusable = true}}, SHIFT(82), + [242] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37), + [244] = {.entry = {.count = 1, .reusable = true}}, SHIFT(80), + [246] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), + [248] = {.entry = {.count = 1, .reusable = true}}, SHIFT(77), + [250] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [252] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), + [254] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), + [256] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), + [258] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), }; #ifdef __cplusplus diff --git a/test/corpus/control_flow.txt b/test/corpus/control_flow.txt index 57f6a9e..5c5d587 100644 --- a/test/corpus/control_flow.txt +++ b/test/corpus/control_flow.txt @@ -53,3 +53,61 @@ while 12 do 27 (while_expression condition: (integer_literal) body: (integer_literal))) + +================================================================================ +For +================================================================================ + +for i := 12 to nil do "42" + +-------------------------------------------------------------------------------- + +(source_file + (for_expression + index: (identifier) + start: (integer_literal) + end: (nil_literal) + body: (string_literal))) + +================================================================================ +For no index +================================================================================ + +for 12 to nil do "42" + +-------------------------------------------------------------------------------- + +(source_file + (ERROR + (identifier) + (identifier) + (nil_literal)) + (string_literal)) + +================================================================================ +For no end +================================================================================ + +for 12 do "42" + +-------------------------------------------------------------------------------- + +(source_file + (ERROR + (identifier) + (identifier)) + (string_literal)) + +================================================================================ +For no body +================================================================================ + +for 12 to nil + +-------------------------------------------------------------------------------- + +(source_file + (ERROR + (identifier) + (identifier)) + (nil_literal))