diff --git a/grammar.js b/grammar.js index 31b5795..709c46d 100644 --- a/grammar.js +++ b/grammar.js @@ -33,6 +33,8 @@ module.exports = grammar({ $.array_expression, $.record_expression, + $.function_call, + $.unary_expression, $.binary_expression, $.sequence_expression, @@ -67,6 +69,13 @@ module.exports = grammar({ ) ), + function_call: ($) => seq( + field("function", $.identifier), + "(", + field("arguments", sepBy(",", $._expr)), + ")", + ), + unary_expression: ($) => seq( field("operator", alias("-", $.operator)), field("expression", $._expr), diff --git a/src/grammar.json b/src/grammar.json index f335a3b..b778624 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -34,6 +34,10 @@ "type": "SYMBOL", "name": "record_expression" }, + { + "type": "SYMBOL", + "name": "function_call" + }, { "type": "SYMBOL", "name": "unary_expression" @@ -169,6 +173,64 @@ ] } }, + "function_call": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "function", + "content": { + "type": "SYMBOL", + "name": "identifier" + } + }, + { + "type": "STRING", + "value": "(" + }, + { + "type": "FIELD", + "name": "arguments", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "_expr" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "SYMBOL", + "name": "_expr" + } + ] + } + } + ] + }, + { + "type": "BLANK" + } + ] + } + }, + { + "type": "STRING", + "value": ")" + } + ] + }, "unary_expression": { "type": "SEQ", "members": [ diff --git a/src/node-types.json b/src/node-types.json index c8cb018..ac8b608 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -15,6 +15,10 @@ "type": "binary_expression", "named": true }, + { + "type": "function_call", + "named": true + }, { "type": "integer_literal", "named": true @@ -53,6 +57,10 @@ "type": "binary_expression", "named": true }, + { + "type": "function_call", + "named": true + }, { "type": "integer_literal", "named": true @@ -107,6 +115,10 @@ "type": "binary_expression", "named": true }, + { + "type": "function_call", + "named": true + }, { "type": "integer_literal", "named": true @@ -155,6 +167,10 @@ "type": "binary_expression", "named": true }, + { + "type": "function_call", + "named": true + }, { "type": "integer_literal", "named": true @@ -183,6 +199,68 @@ } } }, + { + "type": "function_call", + "named": true, + "fields": { + "arguments": { + "multiple": true, + "required": false, + "types": [ + { + "type": ",", + "named": false + }, + { + "type": "array_expression", + "named": true + }, + { + "type": "binary_expression", + "named": true + }, + { + "type": "function_call", + "named": true + }, + { + "type": "integer_literal", + "named": true + }, + { + "type": "nil_literal", + "named": true + }, + { + "type": "record_expression", + "named": true + }, + { + "type": "sequence_expression", + "named": true + }, + { + "type": "string_literal", + "named": true + }, + { + "type": "unary_expression", + "named": true + } + ] + }, + "function": { + "multiple": false, + "required": true, + "types": [ + { + "type": "identifier", + "named": true + } + ] + } + } + }, { "type": "record_expression", "named": true, @@ -209,6 +287,10 @@ "type": "binary_expression", "named": true }, + { + "type": "function_call", + "named": true + }, { "type": "integer_literal", "named": true @@ -263,6 +345,10 @@ "type": "binary_expression", "named": true }, + { + "type": "function_call", + "named": true + }, { "type": "integer_literal", "named": true @@ -306,6 +392,10 @@ "type": "binary_expression", "named": true }, + { + "type": "function_call", + "named": true + }, { "type": "integer_literal", "named": true @@ -364,6 +454,10 @@ "type": "binary_expression", "named": true }, + { + "type": "function_call", + "named": true + }, { "type": "integer_literal", "named": true diff --git a/src/parser.c b/src/parser.c index 56d0ee2..82f6c0d 100644 --- a/src/parser.c +++ b/src/parser.c @@ -6,15 +6,15 @@ #endif #define LANGUAGE_VERSION 13 -#define STATE_COUNT 49 +#define STATE_COUNT 58 #define LARGE_STATE_COUNT 2 -#define SYMBOL_COUNT 39 +#define SYMBOL_COUNT 41 #define ALIAS_COUNT 0 #define TOKEN_COUNT 28 #define EXTERNAL_TOKEN_COUNT 0 -#define FIELD_COUNT 8 +#define FIELD_COUNT 10 #define MAX_ALIAS_SEQUENCE_LENGTH 7 -#define PRODUCTION_ID_COUNT 9 +#define PRODUCTION_ID_COUNT 12 enum { sym_identifier = 1, @@ -23,38 +23,40 @@ enum { anon_sym_DQUOTE = 4, aux_sym_string_literal_token1 = 5, sym_escape_sequence = 6, - anon_sym_DASH = 7, - anon_sym_STAR = 8, - anon_sym_SLASH = 9, - anon_sym_PLUS = 10, - anon_sym_GT_EQ = 11, - anon_sym_LT_EQ = 12, - anon_sym_EQ = 13, - anon_sym_LT_GT = 14, - anon_sym_LT = 15, - anon_sym_GT = 16, - anon_sym_AMP = 17, - anon_sym_PIPE = 18, - anon_sym_LPAREN = 19, - anon_sym_SEMI = 20, - anon_sym_RPAREN = 21, - anon_sym_LBRACK = 22, - anon_sym_RBRACK = 23, - anon_sym_of = 24, - anon_sym_LBRACE = 25, - anon_sym_COMMA = 26, + anon_sym_LPAREN = 7, + anon_sym_COMMA = 8, + anon_sym_RPAREN = 9, + anon_sym_DASH = 10, + anon_sym_STAR = 11, + anon_sym_SLASH = 12, + anon_sym_PLUS = 13, + anon_sym_GT_EQ = 14, + anon_sym_LT_EQ = 15, + anon_sym_EQ = 16, + anon_sym_LT_GT = 17, + anon_sym_LT = 18, + anon_sym_GT = 19, + anon_sym_AMP = 20, + anon_sym_PIPE = 21, + anon_sym_SEMI = 22, + anon_sym_LBRACK = 23, + anon_sym_RBRACK = 24, + anon_sym_of = 25, + anon_sym_LBRACE = 26, anon_sym_RBRACE = 27, sym_source_file = 28, sym__expr = 29, sym_string_literal = 30, - sym_unary_expression = 31, - sym_binary_expression = 32, - sym_sequence_expression = 33, - sym_array_expression = 34, - sym_record_expression = 35, - aux_sym_string_literal_repeat1 = 36, - aux_sym_sequence_expression_repeat1 = 37, - aux_sym_record_expression_repeat1 = 38, + sym_function_call = 31, + sym_unary_expression = 32, + sym_binary_expression = 33, + sym_sequence_expression = 34, + sym_array_expression = 35, + sym_record_expression = 36, + aux_sym_string_literal_repeat1 = 37, + aux_sym_function_call_repeat1 = 38, + aux_sym_sequence_expression_repeat1 = 39, + aux_sym_record_expression_repeat1 = 40, }; static const char * const ts_symbol_names[] = { @@ -65,6 +67,9 @@ static const char * const ts_symbol_names[] = { [anon_sym_DQUOTE] = "\"", [aux_sym_string_literal_token1] = "string_literal_token1", [sym_escape_sequence] = "escape_sequence", + [anon_sym_LPAREN] = "(", + [anon_sym_COMMA] = ",", + [anon_sym_RPAREN] = ")", [anon_sym_DASH] = "operator", [anon_sym_STAR] = "operator", [anon_sym_SLASH] = "operator", @@ -77,24 +82,23 @@ static const char * const ts_symbol_names[] = { [anon_sym_GT] = "operator", [anon_sym_AMP] = "operator", [anon_sym_PIPE] = "operator", - [anon_sym_LPAREN] = "(", [anon_sym_SEMI] = ";", - [anon_sym_RPAREN] = ")", [anon_sym_LBRACK] = "[", [anon_sym_RBRACK] = "]", [anon_sym_of] = "of", [anon_sym_LBRACE] = "{", - [anon_sym_COMMA] = ",", [anon_sym_RBRACE] = "}", [sym_source_file] = "source_file", [sym__expr] = "_expr", [sym_string_literal] = "string_literal", + [sym_function_call] = "function_call", [sym_unary_expression] = "unary_expression", [sym_binary_expression] = "binary_expression", [sym_sequence_expression] = "sequence_expression", [sym_array_expression] = "array_expression", [sym_record_expression] = "record_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", [aux_sym_record_expression_repeat1] = "record_expression_repeat1", }; @@ -107,6 +111,9 @@ static const TSSymbol ts_symbol_map[] = { [anon_sym_DQUOTE] = anon_sym_DQUOTE, [aux_sym_string_literal_token1] = aux_sym_string_literal_token1, [sym_escape_sequence] = sym_escape_sequence, + [anon_sym_LPAREN] = anon_sym_LPAREN, + [anon_sym_COMMA] = anon_sym_COMMA, + [anon_sym_RPAREN] = anon_sym_RPAREN, [anon_sym_DASH] = anon_sym_DASH, [anon_sym_STAR] = anon_sym_DASH, [anon_sym_SLASH] = anon_sym_DASH, @@ -119,24 +126,23 @@ static const TSSymbol ts_symbol_map[] = { [anon_sym_GT] = anon_sym_DASH, [anon_sym_AMP] = anon_sym_DASH, [anon_sym_PIPE] = anon_sym_DASH, - [anon_sym_LPAREN] = anon_sym_LPAREN, [anon_sym_SEMI] = anon_sym_SEMI, - [anon_sym_RPAREN] = anon_sym_RPAREN, [anon_sym_LBRACK] = anon_sym_LBRACK, [anon_sym_RBRACK] = anon_sym_RBRACK, [anon_sym_of] = anon_sym_of, [anon_sym_LBRACE] = anon_sym_LBRACE, - [anon_sym_COMMA] = anon_sym_COMMA, [anon_sym_RBRACE] = anon_sym_RBRACE, [sym_source_file] = sym_source_file, [sym__expr] = sym__expr, [sym_string_literal] = sym_string_literal, + [sym_function_call] = sym_function_call, [sym_unary_expression] = sym_unary_expression, [sym_binary_expression] = sym_binary_expression, [sym_sequence_expression] = sym_sequence_expression, [sym_array_expression] = sym_array_expression, [sym_record_expression] = sym_record_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, [aux_sym_record_expression_repeat1] = aux_sym_record_expression_repeat1, }; @@ -170,6 +176,18 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, + [anon_sym_LPAREN] = { + .visible = true, + .named = false, + }, + [anon_sym_COMMA] = { + .visible = true, + .named = false, + }, + [anon_sym_RPAREN] = { + .visible = true, + .named = false, + }, [anon_sym_DASH] = { .visible = true, .named = true, @@ -218,18 +236,10 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, - [anon_sym_LPAREN] = { - .visible = true, - .named = false, - }, [anon_sym_SEMI] = { .visible = true, .named = false, }, - [anon_sym_RPAREN] = { - .visible = true, - .named = false, - }, [anon_sym_LBRACK] = { .visible = true, .named = false, @@ -246,10 +256,6 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = false, }, - [anon_sym_COMMA] = { - .visible = true, - .named = false, - }, [anon_sym_RBRACE] = { .visible = true, .named = false, @@ -266,6 +272,10 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, + [sym_function_call] = { + .visible = true, + .named = true, + }, [sym_unary_expression] = { .visible = true, .named = true, @@ -290,6 +300,10 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = false, .named = false, }, + [aux_sym_function_call_repeat1] = { + .visible = false, + .named = false, + }, [aux_sym_sequence_expression_repeat1] = { .visible = false, .named = false, @@ -301,20 +315,24 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { }; enum { - field_expression = 1, - field_field = 2, - field_init = 3, - field_left = 4, - field_operator = 5, - field_right = 6, - field_size = 7, - field_type = 8, + field_arguments = 1, + field_expression = 2, + field_field = 3, + field_function = 4, + field_init = 5, + field_left = 6, + field_operator = 7, + field_right = 8, + field_size = 9, + field_type = 10, }; static const char * const ts_field_names[] = { [0] = NULL, + [field_arguments] = "arguments", [field_expression] = "expression", [field_field] = "field", + [field_function] = "function", [field_init] = "init", [field_left] = "left", [field_operator] = "operator", @@ -326,12 +344,15 @@ static const char * const ts_field_names[] = { static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = { [1] = {.index = 0, .length = 2}, [2] = {.index = 2, .length = 1}, - [3] = {.index = 3, .length = 3}, - [4] = {.index = 6, .length = 3}, - [5] = {.index = 9, .length = 3}, - [6] = {.index = 12, .length = 5}, - [7] = {.index = 17, .length = 4}, - [8] = {.index = 21, .length = 2}, + [3] = {.index = 3, .length = 1}, + [4] = {.index = 4, .length = 3}, + [5] = {.index = 7, .length = 2}, + [6] = {.index = 9, .length = 3}, + [7] = {.index = 12, .length = 3}, + [8] = {.index = 15, .length = 3}, + [9] = {.index = 18, .length = 5}, + [10] = {.index = 23, .length = 4}, + [11] = {.index = 27, .length = 2}, }; static const TSFieldMapEntry ts_field_map_entries[] = { @@ -339,38 +360,47 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_expression, 1}, {field_operator, 0}, [2] = - {field_type, 0}, + {field_function, 0}, [3] = + {field_type, 0}, + [4] = {field_left, 0}, {field_operator, 1}, {field_right, 2}, - [6] = + [7] = + {field_arguments, 2}, + {field_function, 0}, + [9] = + {field_arguments, 2}, + {field_arguments, 3}, + {field_function, 0}, + [12] = {field_init, 5}, {field_size, 2}, {field_type, 0}, - [9] = + [15] = {field_field, 2}, {field_init, 4}, {field_type, 0}, - [12] = + [18] = {field_field, 2}, {field_field, 5, .inherited = true}, {field_init, 4}, {field_init, 5, .inherited = true}, {field_type, 0}, - [17] = + [23] = {field_field, 0, .inherited = true}, {field_field, 1, .inherited = true}, {field_init, 0, .inherited = true}, {field_init, 1, .inherited = true}, - [21] = + [27] = {field_field, 1}, {field_init, 3}, }; static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = { [0] = {0}, - [3] = { + [4] = { [1] = anon_sym_DASH, }, }; @@ -386,23 +416,23 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { case 0: if (eof) ADVANCE(9); if (lookahead == '"') ADVANCE(11); - if (lookahead == '&') ADVANCE(26); - if (lookahead == '(') ADVANCE(28); - if (lookahead == ')') ADVANCE(30); - if (lookahead == '*') ADVANCE(17); - if (lookahead == '+') ADVANCE(19); - if (lookahead == ',') ADVANCE(34); - if (lookahead == '-') ADVANCE(16); - if (lookahead == '/') ADVANCE(18); - if (lookahead == ';') ADVANCE(29); - if (lookahead == '<') ADVANCE(24); - if (lookahead == '=') ADVANCE(22); - if (lookahead == '>') ADVANCE(25); - if (lookahead == '[') ADVANCE(31); + if (lookahead == '&') ADVANCE(29); + if (lookahead == '(') ADVANCE(16); + if (lookahead == ')') ADVANCE(18); + if (lookahead == '*') ADVANCE(20); + if (lookahead == '+') ADVANCE(22); + if (lookahead == ',') ADVANCE(17); + if (lookahead == '-') ADVANCE(19); + if (lookahead == '/') ADVANCE(21); + if (lookahead == ';') ADVANCE(31); + if (lookahead == '<') ADVANCE(27); + if (lookahead == '=') ADVANCE(25); + if (lookahead == '>') ADVANCE(28); + if (lookahead == '[') ADVANCE(32); if (lookahead == '\\') ADVANCE(5); - if (lookahead == ']') ADVANCE(32); - if (lookahead == '{') ADVANCE(33); - if (lookahead == '|') ADVANCE(27); + if (lookahead == ']') ADVANCE(33); + if (lookahead == '{') ADVANCE(34); + if (lookahead == '|') ADVANCE(30); if (lookahead == '}') ADVANCE(35); if (lookahead == '\t' || lookahead == '\n' || @@ -465,22 +495,22 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { case 8: if (eof) ADVANCE(9); if (lookahead == '"') ADVANCE(11); - if (lookahead == '&') ADVANCE(26); - if (lookahead == '(') ADVANCE(28); - if (lookahead == ')') ADVANCE(30); - if (lookahead == '*') ADVANCE(17); - if (lookahead == '+') ADVANCE(19); - if (lookahead == ',') ADVANCE(34); - if (lookahead == '-') ADVANCE(16); - if (lookahead == '/') ADVANCE(18); - if (lookahead == ';') ADVANCE(29); - if (lookahead == '<') ADVANCE(24); - if (lookahead == '=') ADVANCE(22); - if (lookahead == '>') ADVANCE(25); - if (lookahead == '[') ADVANCE(31); - if (lookahead == ']') ADVANCE(32); - if (lookahead == '{') ADVANCE(33); - if (lookahead == '|') ADVANCE(27); + if (lookahead == '&') ADVANCE(29); + if (lookahead == '(') ADVANCE(16); + if (lookahead == ')') ADVANCE(18); + if (lookahead == '*') ADVANCE(20); + if (lookahead == '+') ADVANCE(22); + if (lookahead == ',') ADVANCE(17); + if (lookahead == '-') ADVANCE(19); + if (lookahead == '/') ADVANCE(21); + if (lookahead == ';') ADVANCE(31); + if (lookahead == '<') ADVANCE(27); + if (lookahead == '=') ADVANCE(25); + if (lookahead == '>') ADVANCE(28); + if (lookahead == '[') ADVANCE(32); + if (lookahead == ']') ADVANCE(33); + if (lookahead == '{') ADVANCE(34); + if (lookahead == '|') ADVANCE(30); if (lookahead == '}') ADVANCE(35); if (lookahead == '\t' || lookahead == '\n' || @@ -531,64 +561,64 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { ACCEPT_TOKEN(sym_escape_sequence); END_STATE(); case 16: - ACCEPT_TOKEN(anon_sym_DASH); - END_STATE(); - case 17: - ACCEPT_TOKEN(anon_sym_STAR); - END_STATE(); - case 18: - ACCEPT_TOKEN(anon_sym_SLASH); - END_STATE(); - case 19: - ACCEPT_TOKEN(anon_sym_PLUS); - END_STATE(); - case 20: - ACCEPT_TOKEN(anon_sym_GT_EQ); - END_STATE(); - case 21: - ACCEPT_TOKEN(anon_sym_LT_EQ); - END_STATE(); - case 22: - ACCEPT_TOKEN(anon_sym_EQ); - END_STATE(); - case 23: - ACCEPT_TOKEN(anon_sym_LT_GT); - END_STATE(); - case 24: - ACCEPT_TOKEN(anon_sym_LT); - if (lookahead == '=') ADVANCE(21); - if (lookahead == '>') ADVANCE(23); - END_STATE(); - case 25: - ACCEPT_TOKEN(anon_sym_GT); - if (lookahead == '=') ADVANCE(20); - END_STATE(); - case 26: - ACCEPT_TOKEN(anon_sym_AMP); - END_STATE(); - case 27: - ACCEPT_TOKEN(anon_sym_PIPE); - END_STATE(); - case 28: ACCEPT_TOKEN(anon_sym_LPAREN); END_STATE(); - case 29: - ACCEPT_TOKEN(anon_sym_SEMI); + case 17: + ACCEPT_TOKEN(anon_sym_COMMA); END_STATE(); - case 30: + case 18: ACCEPT_TOKEN(anon_sym_RPAREN); END_STATE(); + case 19: + ACCEPT_TOKEN(anon_sym_DASH); + END_STATE(); + case 20: + ACCEPT_TOKEN(anon_sym_STAR); + END_STATE(); + case 21: + ACCEPT_TOKEN(anon_sym_SLASH); + END_STATE(); + case 22: + ACCEPT_TOKEN(anon_sym_PLUS); + END_STATE(); + case 23: + ACCEPT_TOKEN(anon_sym_GT_EQ); + END_STATE(); + case 24: + ACCEPT_TOKEN(anon_sym_LT_EQ); + END_STATE(); + case 25: + ACCEPT_TOKEN(anon_sym_EQ); + END_STATE(); + case 26: + ACCEPT_TOKEN(anon_sym_LT_GT); + END_STATE(); + case 27: + ACCEPT_TOKEN(anon_sym_LT); + if (lookahead == '=') ADVANCE(24); + if (lookahead == '>') ADVANCE(26); + END_STATE(); + case 28: + ACCEPT_TOKEN(anon_sym_GT); + if (lookahead == '=') ADVANCE(23); + END_STATE(); + case 29: + ACCEPT_TOKEN(anon_sym_AMP); + END_STATE(); + case 30: + ACCEPT_TOKEN(anon_sym_PIPE); + END_STATE(); case 31: - ACCEPT_TOKEN(anon_sym_LBRACK); + ACCEPT_TOKEN(anon_sym_SEMI); END_STATE(); case 32: - ACCEPT_TOKEN(anon_sym_RBRACK); + ACCEPT_TOKEN(anon_sym_LBRACK); END_STATE(); case 33: - ACCEPT_TOKEN(anon_sym_LBRACE); + ACCEPT_TOKEN(anon_sym_RBRACK); END_STATE(); case 34: - ACCEPT_TOKEN(anon_sym_COMMA); + ACCEPT_TOKEN(anon_sym_LBRACE); END_STATE(); case 35: ACCEPT_TOKEN(anon_sym_RBRACE); @@ -666,20 +696,29 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [32] = {.lex_state = 0}, [33] = {.lex_state = 0}, [34] = {.lex_state = 0}, - [35] = {.lex_state = 1}, - [36] = {.lex_state = 1}, - [37] = {.lex_state = 1}, + [35] = {.lex_state = 0}, + [36] = {.lex_state = 0}, + [37] = {.lex_state = 0}, [38] = {.lex_state = 0}, [39] = {.lex_state = 0}, [40] = {.lex_state = 0}, [41] = {.lex_state = 0}, - [42] = {.lex_state = 2}, - [43] = {.lex_state = 0}, - [44] = {.lex_state = 0}, - [45] = {.lex_state = 2}, - [46] = {.lex_state = 2}, + [42] = {.lex_state = 1}, + [43] = {.lex_state = 1}, + [44] = {.lex_state = 1}, + [45] = {.lex_state = 0}, + [46] = {.lex_state = 0}, [47] = {.lex_state = 0}, [48] = {.lex_state = 0}, + [49] = {.lex_state = 0}, + [50] = {.lex_state = 0}, + [51] = {.lex_state = 0}, + [52] = {.lex_state = 2}, + [53] = {.lex_state = 2}, + [54] = {.lex_state = 2}, + [55] = {.lex_state = 0}, + [56] = {.lex_state = 0}, + [57] = {.lex_state = 0}, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { @@ -690,6 +729,9 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [sym_integer_literal] = ACTIONS(1), [anon_sym_DQUOTE] = ACTIONS(1), [sym_escape_sequence] = ACTIONS(1), + [anon_sym_LPAREN] = ACTIONS(1), + [anon_sym_COMMA] = ACTIONS(1), + [anon_sym_RPAREN] = ACTIONS(1), [anon_sym_DASH] = ACTIONS(1), [anon_sym_STAR] = ACTIONS(1), [anon_sym_SLASH] = ACTIONS(1), @@ -702,31 +744,29 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_GT] = ACTIONS(1), [anon_sym_AMP] = ACTIONS(1), [anon_sym_PIPE] = ACTIONS(1), - [anon_sym_LPAREN] = ACTIONS(1), [anon_sym_SEMI] = ACTIONS(1), - [anon_sym_RPAREN] = ACTIONS(1), [anon_sym_LBRACK] = ACTIONS(1), [anon_sym_RBRACK] = ACTIONS(1), [anon_sym_of] = ACTIONS(1), [anon_sym_LBRACE] = ACTIONS(1), - [anon_sym_COMMA] = ACTIONS(1), [anon_sym_RBRACE] = ACTIONS(1), }, [1] = { - [sym_source_file] = STATE(47), - [sym__expr] = STATE(30), - [sym_string_literal] = STATE(30), - [sym_unary_expression] = STATE(30), - [sym_binary_expression] = STATE(30), - [sym_sequence_expression] = STATE(30), - [sym_array_expression] = STATE(30), - [sym_record_expression] = STATE(30), + [sym_source_file] = STATE(55), + [sym__expr] = STATE(41), + [sym_string_literal] = STATE(41), + [sym_function_call] = STATE(41), + [sym_unary_expression] = STATE(41), + [sym_binary_expression] = STATE(41), + [sym_sequence_expression] = STATE(41), + [sym_array_expression] = STATE(41), + [sym_record_expression] = STATE(41), [sym_identifier] = ACTIONS(3), [sym_nil_literal] = ACTIONS(5), [sym_integer_literal] = ACTIONS(5), [anon_sym_DQUOTE] = ACTIONS(7), - [anon_sym_DASH] = ACTIONS(9), - [anon_sym_LPAREN] = ACTIONS(11), + [anon_sym_LPAREN] = ACTIONS(9), + [anon_sym_DASH] = ACTIONS(11), }, }; @@ -737,6 +777,8 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_GT, ACTIONS(13), 16, ts_builtin_sym_end, + anon_sym_COMMA, + anon_sym_RPAREN, anon_sym_DASH, anon_sym_STAR, anon_sym_SLASH, @@ -748,9 +790,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_AMP, anon_sym_PIPE, anon_sym_SEMI, - anon_sym_RPAREN, anon_sym_RBRACK, - anon_sym_COMMA, anon_sym_RBRACE, [23] = 2, ACTIONS(19), 2, @@ -758,6 +798,8 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_GT, ACTIONS(17), 16, ts_builtin_sym_end, + anon_sym_COMMA, + anon_sym_RPAREN, anon_sym_DASH, anon_sym_STAR, anon_sym_SLASH, @@ -769,9 +811,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_AMP, anon_sym_PIPE, anon_sym_SEMI, - anon_sym_RPAREN, anon_sym_RBRACK, - anon_sym_COMMA, anon_sym_RBRACE, [46] = 2, ACTIONS(23), 2, @@ -779,6 +819,8 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_GT, ACTIONS(21), 16, ts_builtin_sym_end, + anon_sym_COMMA, + anon_sym_RPAREN, anon_sym_DASH, anon_sym_STAR, anon_sym_SLASH, @@ -790,9 +832,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_AMP, anon_sym_PIPE, anon_sym_SEMI, - anon_sym_RPAREN, anon_sym_RBRACK, - anon_sym_COMMA, anon_sym_RBRACE, [69] = 2, ACTIONS(27), 2, @@ -800,6 +840,8 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_GT, ACTIONS(25), 16, ts_builtin_sym_end, + anon_sym_COMMA, + anon_sym_RPAREN, anon_sym_DASH, anon_sym_STAR, anon_sym_SLASH, @@ -811,42 +853,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_AMP, anon_sym_PIPE, anon_sym_SEMI, - anon_sym_RPAREN, anon_sym_RBRACK, - anon_sym_COMMA, anon_sym_RBRACE, - [92] = 7, - ACTIONS(39), 1, - anon_sym_AMP, - ACTIONS(41), 1, - anon_sym_PIPE, + [92] = 2, ACTIONS(31), 2, - anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(33), 2, - anon_sym_STAR, - anon_sym_SLASH, - ACTIONS(37), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(35), 4, - anon_sym_GT_EQ, - anon_sym_LT_EQ, - anon_sym_EQ, - anon_sym_LT_GT, - ACTIONS(29), 6, + ACTIONS(29), 16, ts_builtin_sym_end, - anon_sym_SEMI, - anon_sym_RPAREN, - anon_sym_RBRACK, anon_sym_COMMA, - anon_sym_RBRACE, - [125] = 2, - ACTIONS(45), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(43), 16, - ts_builtin_sym_end, + anon_sym_RPAREN, anon_sym_DASH, anon_sym_STAR, anon_sym_SLASH, @@ -858,9 +874,33 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_AMP, anon_sym_PIPE, anon_sym_SEMI, - anon_sym_RPAREN, anon_sym_RBRACK, + anon_sym_RBRACE, + [115] = 7, + ACTIONS(43), 1, + anon_sym_AMP, + ACTIONS(45), 1, + anon_sym_PIPE, + ACTIONS(35), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(37), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(41), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(39), 4, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + ACTIONS(33), 6, + ts_builtin_sym_end, anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_SEMI, + anon_sym_RBRACK, anon_sym_RBRACE, [148] = 2, ACTIONS(49), 2, @@ -868,6 +908,8 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_GT, ACTIONS(47), 16, ts_builtin_sym_end, + anon_sym_COMMA, + anon_sym_RPAREN, anon_sym_DASH, anon_sym_STAR, anon_sym_SLASH, @@ -879,152 +921,10 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_AMP, anon_sym_PIPE, anon_sym_SEMI, - anon_sym_RPAREN, anon_sym_RBRACK, - anon_sym_COMMA, anon_sym_RBRACE, - [171] = 6, - ACTIONS(39), 1, - anon_sym_AMP, - ACTIONS(31), 2, - anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(33), 2, - anon_sym_STAR, - anon_sym_SLASH, + [171] = 3, ACTIONS(37), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(35), 4, - anon_sym_GT_EQ, - anon_sym_LT_EQ, - anon_sym_EQ, - anon_sym_LT_GT, - ACTIONS(51), 7, - ts_builtin_sym_end, - anon_sym_PIPE, - anon_sym_SEMI, - anon_sym_RPAREN, - anon_sym_RBRACK, - anon_sym_COMMA, - anon_sym_RBRACE, - [202] = 5, - ACTIONS(31), 2, - anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(33), 2, - anon_sym_STAR, - anon_sym_SLASH, - ACTIONS(37), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(35), 4, - anon_sym_GT_EQ, - anon_sym_LT_EQ, - anon_sym_EQ, - anon_sym_LT_GT, - ACTIONS(51), 8, - ts_builtin_sym_end, - anon_sym_AMP, - anon_sym_PIPE, - anon_sym_SEMI, - anon_sym_RPAREN, - anon_sym_RBRACK, - anon_sym_COMMA, - anon_sym_RBRACE, - [231] = 4, - ACTIONS(31), 2, - anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(33), 2, - anon_sym_STAR, - anon_sym_SLASH, - ACTIONS(53), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(51), 12, - ts_builtin_sym_end, - 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_RPAREN, - anon_sym_RBRACK, - anon_sym_COMMA, - anon_sym_RBRACE, - [258] = 7, - ACTIONS(39), 1, - anon_sym_AMP, - ACTIONS(41), 1, - anon_sym_PIPE, - ACTIONS(31), 2, - anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(33), 2, - anon_sym_STAR, - anon_sym_SLASH, - ACTIONS(37), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(35), 4, - anon_sym_GT_EQ, - anon_sym_LT_EQ, - anon_sym_EQ, - anon_sym_LT_GT, - ACTIONS(55), 6, - ts_builtin_sym_end, - anon_sym_SEMI, - anon_sym_RPAREN, - anon_sym_RBRACK, - anon_sym_COMMA, - anon_sym_RBRACE, - [291] = 2, - ACTIONS(59), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(57), 16, - ts_builtin_sym_end, - 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_RPAREN, - anon_sym_RBRACK, - anon_sym_COMMA, - anon_sym_RBRACE, - [314] = 2, - ACTIONS(53), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(51), 16, - ts_builtin_sym_end, - 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_RPAREN, - anon_sym_RBRACK, - anon_sym_COMMA, - anon_sym_RBRACE, - [337] = 3, - ACTIONS(33), 2, anon_sym_STAR, anon_sym_SLASH, ACTIONS(53), 2, @@ -1032,6 +932,8 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_GT, ACTIONS(51), 14, ts_builtin_sym_end, + anon_sym_COMMA, + anon_sym_RPAREN, anon_sym_DASH, anon_sym_PLUS, anon_sym_GT_EQ, @@ -1041,16 +943,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_AMP, anon_sym_PIPE, anon_sym_SEMI, - anon_sym_RPAREN, anon_sym_RBRACK, - anon_sym_COMMA, anon_sym_RBRACE, - [362] = 2, - ACTIONS(63), 2, + [196] = 2, + ACTIONS(57), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(61), 16, + ACTIONS(55), 16, ts_builtin_sym_end, + anon_sym_COMMA, + anon_sym_RPAREN, anon_sym_DASH, anon_sym_STAR, anon_sym_SLASH, @@ -1062,464 +964,784 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_AMP, anon_sym_PIPE, anon_sym_SEMI, - anon_sym_RPAREN, anon_sym_RBRACK, - anon_sym_COMMA, anon_sym_RBRACE, - [385] = 9, - ACTIONS(39), 1, - anon_sym_AMP, - ACTIONS(41), 1, - anon_sym_PIPE, - ACTIONS(65), 1, - anon_sym_SEMI, - ACTIONS(67), 1, - anon_sym_RPAREN, - STATE(40), 1, - aux_sym_sequence_expression_repeat1, - ACTIONS(31), 2, - anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(33), 2, - anon_sym_STAR, - anon_sym_SLASH, - ACTIONS(37), 2, + [219] = 2, + ACTIONS(61), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(35), 4, - anon_sym_GT_EQ, - anon_sym_LT_EQ, - anon_sym_EQ, - anon_sym_LT_GT, - [419] = 9, - ACTIONS(39), 1, - anon_sym_AMP, - ACTIONS(41), 1, - anon_sym_PIPE, - ACTIONS(69), 1, + ACTIONS(59), 16, + ts_builtin_sym_end, anon_sym_COMMA, - ACTIONS(71), 1, - anon_sym_RBRACE, - STATE(41), 1, - aux_sym_record_expression_repeat1, - ACTIONS(31), 2, - anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(33), 2, - anon_sym_STAR, - anon_sym_SLASH, - ACTIONS(37), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(35), 4, - anon_sym_GT_EQ, - anon_sym_LT_EQ, - anon_sym_EQ, - anon_sym_LT_GT, - [453] = 7, - ACTIONS(39), 1, - anon_sym_AMP, - ACTIONS(41), 1, - anon_sym_PIPE, - ACTIONS(31), 2, - anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(33), 2, - anon_sym_STAR, - anon_sym_SLASH, - ACTIONS(37), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(73), 2, - anon_sym_SEMI, anon_sym_RPAREN, - ACTIONS(35), 4, + 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, - [482] = 7, - ACTIONS(39), 1, anon_sym_AMP, - ACTIONS(41), 1, anon_sym_PIPE, - ACTIONS(31), 2, - anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(33), 2, - anon_sym_STAR, - anon_sym_SLASH, - ACTIONS(37), 2, + anon_sym_SEMI, + anon_sym_RBRACK, + anon_sym_RBRACE, + [242] = 2, + ACTIONS(65), 2, anon_sym_LT, anon_sym_GT, + ACTIONS(63), 16, + ts_builtin_sym_end, + 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_RBRACK, + anon_sym_RBRACE, + [265] = 2, + ACTIONS(69), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(67), 16, + ts_builtin_sym_end, + 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_RBRACK, + anon_sym_RBRACE, + [288] = 2, + ACTIONS(53), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(51), 16, + ts_builtin_sym_end, + 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_RBRACK, + anon_sym_RBRACE, + [311] = 7, + ACTIONS(43), 1, + anon_sym_AMP, + ACTIONS(45), 1, + anon_sym_PIPE, + ACTIONS(35), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(37), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(41), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(39), 4, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + ACTIONS(71), 6, + ts_builtin_sym_end, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_SEMI, + anon_sym_RBRACK, + anon_sym_RBRACE, + [344] = 2, ACTIONS(75), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(73), 16, + ts_builtin_sym_end, anon_sym_COMMA, - anon_sym_RBRACE, - ACTIONS(35), 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, - [511] = 7, - ACTIONS(3), 1, - sym_identifier, - ACTIONS(7), 1, - anon_sym_DQUOTE, - ACTIONS(9), 1, + anon_sym_AMP, + anon_sym_PIPE, + anon_sym_SEMI, + anon_sym_RBRACK, + anon_sym_RBRACE, + [367] = 6, + ACTIONS(43), 1, + anon_sym_AMP, + ACTIONS(35), 2, anon_sym_DASH, - ACTIONS(11), 1, - anon_sym_LPAREN, - ACTIONS(79), 1, + anon_sym_PLUS, + ACTIONS(37), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(41), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(39), 4, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + ACTIONS(51), 7, + ts_builtin_sym_end, + anon_sym_COMMA, anon_sym_RPAREN, - ACTIONS(77), 2, - sym_nil_literal, - sym_integer_literal, - STATE(17), 7, - sym__expr, - sym_string_literal, - sym_unary_expression, - sym_binary_expression, - sym_sequence_expression, - sym_array_expression, - sym_record_expression, - [540] = 6, + anon_sym_PIPE, + anon_sym_SEMI, + anon_sym_RBRACK, + anon_sym_RBRACE, + [398] = 5, + ACTIONS(35), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(37), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(41), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(39), 4, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + ACTIONS(51), 8, + ts_builtin_sym_end, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_AMP, + anon_sym_PIPE, + anon_sym_SEMI, + anon_sym_RBRACK, + anon_sym_RBRACE, + [427] = 4, + ACTIONS(35), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(37), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(53), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(51), 12, + ts_builtin_sym_end, + 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_RBRACK, + anon_sym_RBRACE, + [454] = 9, + ACTIONS(43), 1, + anon_sym_AMP, + ACTIONS(45), 1, + anon_sym_PIPE, + ACTIONS(77), 1, + anon_sym_RPAREN, + ACTIONS(79), 1, + anon_sym_SEMI, + STATE(47), 1, + aux_sym_sequence_expression_repeat1, + ACTIONS(35), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(37), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(41), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(39), 4, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + [488] = 7, ACTIONS(3), 1, sym_identifier, ACTIONS(7), 1, anon_sym_DQUOTE, ACTIONS(9), 1, - anon_sym_DASH, - ACTIONS(11), 1, anon_sym_LPAREN, + ACTIONS(11), 1, + anon_sym_DASH, + ACTIONS(83), 1, + anon_sym_RPAREN, ACTIONS(81), 2, sym_nil_literal, sym_integer_literal, - STATE(15), 7, + STATE(24), 8, sym__expr, sym_string_literal, + sym_function_call, sym_unary_expression, sym_binary_expression, sym_sequence_expression, sym_array_expression, sym_record_expression, - [566] = 6, + [518] = 9, + ACTIONS(43), 1, + anon_sym_AMP, + ACTIONS(45), 1, + anon_sym_PIPE, + ACTIONS(85), 1, + anon_sym_COMMA, + ACTIONS(87), 1, + anon_sym_RBRACE, + STATE(50), 1, + aux_sym_record_expression_repeat1, + ACTIONS(35), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(37), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(41), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(39), 4, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + [552] = 7, ACTIONS(3), 1, sym_identifier, ACTIONS(7), 1, anon_sym_DQUOTE, ACTIONS(9), 1, - anon_sym_DASH, - ACTIONS(11), 1, anon_sym_LPAREN, - ACTIONS(83), 2, - sym_nil_literal, - sym_integer_literal, - STATE(10), 7, - sym__expr, - sym_string_literal, - sym_unary_expression, - sym_binary_expression, - sym_sequence_expression, - sym_array_expression, - sym_record_expression, - [592] = 6, - ACTIONS(3), 1, - sym_identifier, - ACTIONS(7), 1, - anon_sym_DQUOTE, - ACTIONS(9), 1, - anon_sym_DASH, ACTIONS(11), 1, - anon_sym_LPAREN, - ACTIONS(85), 2, - sym_nil_literal, - sym_integer_literal, - STATE(9), 7, - sym__expr, - sym_string_literal, - sym_unary_expression, - sym_binary_expression, - sym_sequence_expression, - sym_array_expression, - sym_record_expression, - [618] = 6, - ACTIONS(3), 1, - sym_identifier, - ACTIONS(7), 1, - anon_sym_DQUOTE, - ACTIONS(9), 1, anon_sym_DASH, - ACTIONS(11), 1, - anon_sym_LPAREN, - ACTIONS(87), 2, - sym_nil_literal, - sym_integer_literal, - STATE(11), 7, - sym__expr, - sym_string_literal, - sym_unary_expression, - sym_binary_expression, - sym_sequence_expression, - sym_array_expression, - sym_record_expression, - [644] = 6, - ACTIONS(3), 1, - sym_identifier, - ACTIONS(7), 1, - anon_sym_DQUOTE, - ACTIONS(9), 1, - anon_sym_DASH, - ACTIONS(11), 1, - anon_sym_LPAREN, + ACTIONS(91), 1, + anon_sym_RPAREN, ACTIONS(89), 2, sym_nil_literal, sym_integer_literal, - STATE(12), 7, + STATE(20), 8, sym__expr, sym_string_literal, + sym_function_call, sym_unary_expression, sym_binary_expression, sym_sequence_expression, sym_array_expression, sym_record_expression, - [670] = 6, - ACTIONS(3), 1, - sym_identifier, - ACTIONS(7), 1, - anon_sym_DQUOTE, - ACTIONS(9), 1, - anon_sym_DASH, - ACTIONS(11), 1, - anon_sym_LPAREN, - ACTIONS(91), 2, - sym_nil_literal, - sym_integer_literal, - STATE(20), 7, - sym__expr, - sym_string_literal, - sym_unary_expression, - sym_binary_expression, - sym_sequence_expression, - sym_array_expression, - sym_record_expression, - [696] = 6, - ACTIONS(3), 1, - sym_identifier, - ACTIONS(7), 1, - anon_sym_DQUOTE, - ACTIONS(9), 1, - anon_sym_DASH, - ACTIONS(11), 1, - anon_sym_LPAREN, - ACTIONS(93), 2, - sym_nil_literal, - sym_integer_literal, - STATE(14), 7, - sym__expr, - sym_string_literal, - sym_unary_expression, - sym_binary_expression, - sym_sequence_expression, - sym_array_expression, - sym_record_expression, - [722] = 6, - ACTIONS(3), 1, - sym_identifier, - ACTIONS(7), 1, - anon_sym_DQUOTE, - ACTIONS(9), 1, - anon_sym_DASH, - ACTIONS(11), 1, - anon_sym_LPAREN, - ACTIONS(95), 2, - sym_nil_literal, - sym_integer_literal, - STATE(19), 7, - sym__expr, - sym_string_literal, - sym_unary_expression, - sym_binary_expression, - sym_sequence_expression, - sym_array_expression, - sym_record_expression, - [748] = 7, - ACTIONS(39), 1, + [582] = 9, + ACTIONS(43), 1, anon_sym_AMP, - ACTIONS(41), 1, + ACTIONS(45), 1, anon_sym_PIPE, - ACTIONS(97), 1, - ts_builtin_sym_end, - ACTIONS(31), 2, + ACTIONS(93), 1, + anon_sym_COMMA, + ACTIONS(95), 1, + anon_sym_RPAREN, + STATE(49), 1, + aux_sym_function_call_repeat1, + ACTIONS(35), 2, anon_sym_DASH, anon_sym_PLUS, - ACTIONS(33), 2, + ACTIONS(37), 2, anon_sym_STAR, anon_sym_SLASH, - ACTIONS(37), 2, + ACTIONS(41), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(35), 4, + ACTIONS(39), 4, anon_sym_GT_EQ, anon_sym_LT_EQ, anon_sym_EQ, anon_sym_LT_GT, - [776] = 7, - ACTIONS(39), 1, + [616] = 7, + ACTIONS(43), 1, anon_sym_AMP, - ACTIONS(41), 1, + ACTIONS(45), 1, anon_sym_PIPE, - ACTIONS(99), 1, - anon_sym_RBRACK, - ACTIONS(31), 2, + ACTIONS(35), 2, anon_sym_DASH, anon_sym_PLUS, - ACTIONS(33), 2, + ACTIONS(37), 2, anon_sym_STAR, anon_sym_SLASH, - ACTIONS(37), 2, + ACTIONS(41), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(35), 4, + ACTIONS(97), 2, + anon_sym_RPAREN, + anon_sym_SEMI, + ACTIONS(39), 4, anon_sym_GT_EQ, anon_sym_LT_EQ, anon_sym_EQ, anon_sym_LT_GT, - [804] = 6, + [645] = 6, ACTIONS(3), 1, sym_identifier, ACTIONS(7), 1, anon_sym_DQUOTE, ACTIONS(9), 1, - anon_sym_DASH, - ACTIONS(11), 1, anon_sym_LPAREN, + ACTIONS(11), 1, + anon_sym_DASH, + ACTIONS(99), 2, + sym_nil_literal, + sym_integer_literal, + STATE(9), 8, + sym__expr, + sym_string_literal, + sym_function_call, + sym_unary_expression, + sym_binary_expression, + sym_sequence_expression, + sym_array_expression, + sym_record_expression, + [672] = 7, + ACTIONS(43), 1, + anon_sym_AMP, + ACTIONS(45), 1, + anon_sym_PIPE, + ACTIONS(35), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(37), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(41), 2, + anon_sym_LT, + anon_sym_GT, ACTIONS(101), 2, - sym_nil_literal, - sym_integer_literal, - STATE(31), 7, - sym__expr, - sym_string_literal, - sym_unary_expression, - sym_binary_expression, - sym_sequence_expression, - sym_array_expression, - sym_record_expression, - [830] = 6, + anon_sym_COMMA, + anon_sym_RBRACE, + ACTIONS(39), 4, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + [701] = 6, ACTIONS(3), 1, sym_identifier, ACTIONS(7), 1, anon_sym_DQUOTE, ACTIONS(9), 1, - anon_sym_DASH, - ACTIONS(11), 1, anon_sym_LPAREN, + ACTIONS(11), 1, + anon_sym_DASH, ACTIONS(103), 2, sym_nil_literal, sym_integer_literal, - STATE(6), 7, + STATE(27), 8, sym__expr, sym_string_literal, + sym_function_call, sym_unary_expression, sym_binary_expression, sym_sequence_expression, sym_array_expression, sym_record_expression, - [856] = 6, + [728] = 6, ACTIONS(3), 1, sym_identifier, ACTIONS(7), 1, anon_sym_DQUOTE, ACTIONS(9), 1, - anon_sym_DASH, - ACTIONS(11), 1, anon_sym_LPAREN, + ACTIONS(11), 1, + anon_sym_DASH, ACTIONS(105), 2, sym_nil_literal, sym_integer_literal, - STATE(18), 7, + STATE(40), 8, sym__expr, sym_string_literal, + sym_function_call, sym_unary_expression, sym_binary_expression, sym_sequence_expression, sym_array_expression, sym_record_expression, - [882] = 3, - ACTIONS(107), 1, + [755] = 6, + ACTIONS(3), 1, + sym_identifier, + ACTIONS(7), 1, anon_sym_DQUOTE, - STATE(37), 1, - aux_sym_string_literal_repeat1, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(11), 1, + anon_sym_DASH, + ACTIONS(107), 2, + sym_nil_literal, + sym_integer_literal, + STATE(7), 8, + sym__expr, + sym_string_literal, + sym_function_call, + sym_unary_expression, + sym_binary_expression, + sym_sequence_expression, + sym_array_expression, + sym_record_expression, + [782] = 6, + ACTIONS(3), 1, + sym_identifier, + ACTIONS(7), 1, + anon_sym_DQUOTE, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(11), 1, + anon_sym_DASH, ACTIONS(109), 2, - aux_sym_string_literal_token1, - sym_escape_sequence, - [893] = 3, - ACTIONS(111), 1, - anon_sym_DQUOTE, - STATE(35), 1, - aux_sym_string_literal_repeat1, - ACTIONS(113), 2, - aux_sym_string_literal_token1, - sym_escape_sequence, - [904] = 3, - ACTIONS(115), 1, - anon_sym_DQUOTE, - STATE(37), 1, - aux_sym_string_literal_repeat1, - ACTIONS(117), 2, - aux_sym_string_literal_token1, - sym_escape_sequence, - [915] = 3, - ACTIONS(73), 1, - anon_sym_RPAREN, - ACTIONS(120), 1, - anon_sym_SEMI, - STATE(38), 1, - aux_sym_sequence_expression_repeat1, - [925] = 3, - ACTIONS(123), 1, + sym_nil_literal, + sym_integer_literal, + STATE(15), 8, + sym__expr, + sym_string_literal, + sym_function_call, + sym_unary_expression, + sym_binary_expression, + sym_sequence_expression, + sym_array_expression, + sym_record_expression, + [809] = 7, + ACTIONS(43), 1, + anon_sym_AMP, + ACTIONS(45), 1, + anon_sym_PIPE, + ACTIONS(35), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(37), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(41), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(111), 2, anon_sym_COMMA, - ACTIONS(126), 1, - anon_sym_RBRACE, - STATE(39), 1, - aux_sym_record_expression_repeat1, - [935] = 3, - ACTIONS(65), 1, - anon_sym_SEMI, - ACTIONS(128), 1, anon_sym_RPAREN, - STATE(38), 1, - aux_sym_sequence_expression_repeat1, - [945] = 3, - ACTIONS(69), 1, - anon_sym_COMMA, - ACTIONS(130), 1, - anon_sym_RBRACE, - STATE(39), 1, - aux_sym_record_expression_repeat1, - [955] = 2, - ACTIONS(132), 1, - sym_identifier, - ACTIONS(134), 1, - anon_sym_RBRACE, - [962] = 2, - ACTIONS(136), 1, - anon_sym_LBRACK, - ACTIONS(138), 1, - anon_sym_LBRACE, - [969] = 1, - ACTIONS(140), 1, + ACTIONS(39), 4, + anon_sym_GT_EQ, + anon_sym_LT_EQ, anon_sym_EQ, - [973] = 1, - ACTIONS(142), 1, - anon_sym_of, - [977] = 1, - ACTIONS(144), 1, + anon_sym_LT_GT, + [838] = 6, + ACTIONS(3), 1, sym_identifier, - [981] = 1, - ACTIONS(146), 1, + ACTIONS(7), 1, + anon_sym_DQUOTE, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(11), 1, + anon_sym_DASH, + ACTIONS(113), 2, + sym_nil_literal, + sym_integer_literal, + STATE(17), 8, + sym__expr, + sym_string_literal, + sym_function_call, + sym_unary_expression, + sym_binary_expression, + sym_sequence_expression, + sym_array_expression, + sym_record_expression, + [865] = 6, + ACTIONS(3), 1, + sym_identifier, + ACTIONS(7), 1, + anon_sym_DQUOTE, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(11), 1, + anon_sym_DASH, + ACTIONS(115), 2, + sym_nil_literal, + sym_integer_literal, + STATE(18), 8, + sym__expr, + sym_string_literal, + sym_function_call, + sym_unary_expression, + sym_binary_expression, + sym_sequence_expression, + sym_array_expression, + sym_record_expression, + [892] = 6, + ACTIONS(3), 1, + sym_identifier, + ACTIONS(7), 1, + anon_sym_DQUOTE, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(11), 1, + anon_sym_DASH, + ACTIONS(117), 2, + sym_nil_literal, + sym_integer_literal, + STATE(19), 8, + sym__expr, + sym_string_literal, + sym_function_call, + sym_unary_expression, + sym_binary_expression, + sym_sequence_expression, + sym_array_expression, + sym_record_expression, + [919] = 6, + ACTIONS(3), 1, + sym_identifier, + ACTIONS(7), 1, + anon_sym_DQUOTE, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(11), 1, + anon_sym_DASH, + ACTIONS(119), 2, + sym_nil_literal, + sym_integer_literal, + STATE(32), 8, + sym__expr, + sym_string_literal, + sym_function_call, + sym_unary_expression, + sym_binary_expression, + sym_sequence_expression, + sym_array_expression, + sym_record_expression, + [946] = 6, + ACTIONS(3), 1, + sym_identifier, + ACTIONS(7), 1, + anon_sym_DQUOTE, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(11), 1, + anon_sym_DASH, + ACTIONS(121), 2, + sym_nil_literal, + sym_integer_literal, + STATE(14), 8, + sym__expr, + sym_string_literal, + sym_function_call, + sym_unary_expression, + sym_binary_expression, + sym_sequence_expression, + sym_array_expression, + sym_record_expression, + [973] = 6, + ACTIONS(3), 1, + sym_identifier, + ACTIONS(7), 1, + anon_sym_DQUOTE, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(11), 1, + anon_sym_DASH, + ACTIONS(123), 2, + sym_nil_literal, + sym_integer_literal, + STATE(25), 8, + sym__expr, + sym_string_literal, + sym_function_call, + sym_unary_expression, + sym_binary_expression, + sym_sequence_expression, + sym_array_expression, + sym_record_expression, + [1000] = 6, + ACTIONS(3), 1, + sym_identifier, + ACTIONS(7), 1, + anon_sym_DQUOTE, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(11), 1, + anon_sym_DASH, + ACTIONS(125), 2, + sym_nil_literal, + sym_integer_literal, + STATE(22), 8, + sym__expr, + sym_string_literal, + sym_function_call, + sym_unary_expression, + sym_binary_expression, + sym_sequence_expression, + sym_array_expression, + sym_record_expression, + [1027] = 7, + ACTIONS(43), 1, + anon_sym_AMP, + ACTIONS(45), 1, + anon_sym_PIPE, + ACTIONS(127), 1, + anon_sym_RBRACK, + ACTIONS(35), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(37), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(41), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(39), 4, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + [1055] = 7, + ACTIONS(43), 1, + anon_sym_AMP, + ACTIONS(45), 1, + anon_sym_PIPE, + ACTIONS(129), 1, ts_builtin_sym_end, - [985] = 1, + ACTIONS(35), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(37), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(41), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(39), 4, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_EQ, + anon_sym_LT_GT, + [1083] = 3, + ACTIONS(131), 1, + anon_sym_DQUOTE, + STATE(42), 1, + aux_sym_string_literal_repeat1, + ACTIONS(133), 2, + aux_sym_string_literal_token1, + sym_escape_sequence, + [1094] = 3, + ACTIONS(136), 1, + anon_sym_DQUOTE, + STATE(42), 1, + aux_sym_string_literal_repeat1, + ACTIONS(138), 2, + aux_sym_string_literal_token1, + sym_escape_sequence, + [1105] = 3, + ACTIONS(140), 1, + anon_sym_DQUOTE, + STATE(43), 1, + aux_sym_string_literal_repeat1, + ACTIONS(142), 2, + aux_sym_string_literal_token1, + sym_escape_sequence, + [1116] = 3, + ACTIONS(144), 1, + anon_sym_LPAREN, + ACTIONS(146), 1, + anon_sym_LBRACK, ACTIONS(148), 1, + anon_sym_LBRACE, + [1126] = 3, + ACTIONS(97), 1, + anon_sym_RPAREN, + ACTIONS(150), 1, + anon_sym_SEMI, + STATE(46), 1, + aux_sym_sequence_expression_repeat1, + [1136] = 3, + ACTIONS(79), 1, + anon_sym_SEMI, + ACTIONS(153), 1, + anon_sym_RPAREN, + STATE(46), 1, + aux_sym_sequence_expression_repeat1, + [1146] = 3, + ACTIONS(111), 1, + anon_sym_RPAREN, + ACTIONS(155), 1, + anon_sym_COMMA, + STATE(48), 1, + aux_sym_function_call_repeat1, + [1156] = 3, + ACTIONS(93), 1, + anon_sym_COMMA, + ACTIONS(158), 1, + anon_sym_RPAREN, + STATE(48), 1, + aux_sym_function_call_repeat1, + [1166] = 3, + ACTIONS(85), 1, + anon_sym_COMMA, + ACTIONS(160), 1, + anon_sym_RBRACE, + STATE(51), 1, + aux_sym_record_expression_repeat1, + [1176] = 3, + ACTIONS(162), 1, + anon_sym_COMMA, + ACTIONS(165), 1, + anon_sym_RBRACE, + STATE(51), 1, + aux_sym_record_expression_repeat1, + [1186] = 2, + ACTIONS(167), 1, + sym_identifier, + ACTIONS(169), 1, + anon_sym_RBRACE, + [1193] = 1, + ACTIONS(171), 1, + anon_sym_of, + [1197] = 1, + ACTIONS(173), 1, + sym_identifier, + [1201] = 1, + ACTIONS(175), 1, + ts_builtin_sym_end, + [1205] = 1, + ACTIONS(177), 1, + anon_sym_EQ, + [1209] = 1, + ACTIONS(179), 1, anon_sym_EQ, }; @@ -1529,125 +1751,149 @@ static const uint32_t ts_small_parse_table_map[] = { [SMALL_STATE(4)] = 46, [SMALL_STATE(5)] = 69, [SMALL_STATE(6)] = 92, - [SMALL_STATE(7)] = 125, + [SMALL_STATE(7)] = 115, [SMALL_STATE(8)] = 148, [SMALL_STATE(9)] = 171, - [SMALL_STATE(10)] = 202, - [SMALL_STATE(11)] = 231, - [SMALL_STATE(12)] = 258, - [SMALL_STATE(13)] = 291, - [SMALL_STATE(14)] = 314, - [SMALL_STATE(15)] = 337, - [SMALL_STATE(16)] = 362, - [SMALL_STATE(17)] = 385, - [SMALL_STATE(18)] = 419, - [SMALL_STATE(19)] = 453, - [SMALL_STATE(20)] = 482, - [SMALL_STATE(21)] = 511, - [SMALL_STATE(22)] = 540, - [SMALL_STATE(23)] = 566, - [SMALL_STATE(24)] = 592, - [SMALL_STATE(25)] = 618, - [SMALL_STATE(26)] = 644, - [SMALL_STATE(27)] = 670, - [SMALL_STATE(28)] = 696, - [SMALL_STATE(29)] = 722, - [SMALL_STATE(30)] = 748, - [SMALL_STATE(31)] = 776, - [SMALL_STATE(32)] = 804, - [SMALL_STATE(33)] = 830, - [SMALL_STATE(34)] = 856, - [SMALL_STATE(35)] = 882, - [SMALL_STATE(36)] = 893, - [SMALL_STATE(37)] = 904, - [SMALL_STATE(38)] = 915, - [SMALL_STATE(39)] = 925, - [SMALL_STATE(40)] = 935, - [SMALL_STATE(41)] = 945, - [SMALL_STATE(42)] = 955, - [SMALL_STATE(43)] = 962, - [SMALL_STATE(44)] = 969, - [SMALL_STATE(45)] = 973, - [SMALL_STATE(46)] = 977, - [SMALL_STATE(47)] = 981, - [SMALL_STATE(48)] = 985, + [SMALL_STATE(10)] = 196, + [SMALL_STATE(11)] = 219, + [SMALL_STATE(12)] = 242, + [SMALL_STATE(13)] = 265, + [SMALL_STATE(14)] = 288, + [SMALL_STATE(15)] = 311, + [SMALL_STATE(16)] = 344, + [SMALL_STATE(17)] = 367, + [SMALL_STATE(18)] = 398, + [SMALL_STATE(19)] = 427, + [SMALL_STATE(20)] = 454, + [SMALL_STATE(21)] = 488, + [SMALL_STATE(22)] = 518, + [SMALL_STATE(23)] = 552, + [SMALL_STATE(24)] = 582, + [SMALL_STATE(25)] = 616, + [SMALL_STATE(26)] = 645, + [SMALL_STATE(27)] = 672, + [SMALL_STATE(28)] = 701, + [SMALL_STATE(29)] = 728, + [SMALL_STATE(30)] = 755, + [SMALL_STATE(31)] = 782, + [SMALL_STATE(32)] = 809, + [SMALL_STATE(33)] = 838, + [SMALL_STATE(34)] = 865, + [SMALL_STATE(35)] = 892, + [SMALL_STATE(36)] = 919, + [SMALL_STATE(37)] = 946, + [SMALL_STATE(38)] = 973, + [SMALL_STATE(39)] = 1000, + [SMALL_STATE(40)] = 1027, + [SMALL_STATE(41)] = 1055, + [SMALL_STATE(42)] = 1083, + [SMALL_STATE(43)] = 1094, + [SMALL_STATE(44)] = 1105, + [SMALL_STATE(45)] = 1116, + [SMALL_STATE(46)] = 1126, + [SMALL_STATE(47)] = 1136, + [SMALL_STATE(48)] = 1146, + [SMALL_STATE(49)] = 1156, + [SMALL_STATE(50)] = 1166, + [SMALL_STATE(51)] = 1176, + [SMALL_STATE(52)] = 1186, + [SMALL_STATE(53)] = 1193, + [SMALL_STATE(54)] = 1197, + [SMALL_STATE(55)] = 1201, + [SMALL_STATE(56)] = 1205, + [SMALL_STATE(57)] = 1209, }; 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(43), - [5] = {.entry = {.count = 1, .reusable = false}}, SHIFT(30), - [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36), - [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), - [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), - [13] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_record_expression, 3, .production_id = 2), - [15] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_record_expression, 3, .production_id = 2), - [17] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sequence_expression, 3), - [19] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sequence_expression, 3), - [21] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_record_expression, 7, .production_id = 6), - [23] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_record_expression, 7, .production_id = 6), - [25] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_record_expression, 6, .production_id = 5), - [27] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_record_expression, 6, .production_id = 5), - [29] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_array_expression, 6, .production_id = 4), - [31] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), - [33] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28), - [35] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), - [37] = {.entry = {.count = 1, .reusable = false}}, SHIFT(25), - [39] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), - [41] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24), - [43] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sequence_expression, 4), - [45] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sequence_expression, 4), + [3] = {.entry = {.count = 1, .reusable = false}}, SHIFT(45), + [5] = {.entry = {.count = 1, .reusable = false}}, SHIFT(41), + [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(44), + [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), + [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31), + [13] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sequence_expression, 3), + [15] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sequence_expression, 3), + [17] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sequence_expression, 2), + [19] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sequence_expression, 2), + [21] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_call, 3, .production_id = 2), + [23] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_call, 3, .production_id = 2), + [25] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_record_expression, 7, .production_id = 9), + [27] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_record_expression, 7, .production_id = 9), + [29] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_record_expression, 6, .production_id = 8), + [31] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_record_expression, 6, .production_id = 8), + [33] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_array_expression, 6, .production_id = 7), + [35] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), + [37] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37), + [39] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35), + [41] = {.entry = {.count = 1, .reusable = false}}, SHIFT(35), + [43] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), + [45] = {.entry = {.count = 1, .reusable = true}}, SHIFT(33), [47] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_string_literal, 2), [49] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_string_literal, 2), - [51] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_binary_expression, 3, .production_id = 3), - [53] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_binary_expression, 3, .production_id = 3), - [55] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_unary_expression, 2, .production_id = 1), - [57] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sequence_expression, 2), - [59] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sequence_expression, 2), - [61] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_string_literal, 3), - [63] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_string_literal, 3), - [65] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29), - [67] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3), - [69] = {.entry = {.count = 1, .reusable = true}}, SHIFT(46), - [71] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), - [73] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_sequence_expression_repeat1, 2), - [75] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_record_expression_repeat1, 4, .production_id = 8), - [77] = {.entry = {.count = 1, .reusable = false}}, SHIFT(17), - [79] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), - [81] = {.entry = {.count = 1, .reusable = false}}, SHIFT(15), - [83] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10), - [85] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9), - [87] = {.entry = {.count = 1, .reusable = false}}, SHIFT(11), - [89] = {.entry = {.count = 1, .reusable = false}}, SHIFT(12), - [91] = {.entry = {.count = 1, .reusable = false}}, SHIFT(20), - [93] = {.entry = {.count = 1, .reusable = false}}, SHIFT(14), - [95] = {.entry = {.count = 1, .reusable = false}}, SHIFT(19), - [97] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1), - [99] = {.entry = {.count = 1, .reusable = true}}, SHIFT(45), - [101] = {.entry = {.count = 1, .reusable = false}}, SHIFT(31), - [103] = {.entry = {.count = 1, .reusable = false}}, SHIFT(6), - [105] = {.entry = {.count = 1, .reusable = false}}, SHIFT(18), - [107] = {.entry = {.count = 1, .reusable = false}}, SHIFT(16), - [109] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37), - [111] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8), - [113] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35), - [115] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_string_literal_repeat1, 2), - [117] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_string_literal_repeat1, 2), SHIFT_REPEAT(37), - [120] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_sequence_expression_repeat1, 2), SHIFT_REPEAT(29), - [123] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_record_expression_repeat1, 2, .production_id = 7), SHIFT_REPEAT(46), - [126] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_record_expression_repeat1, 2, .production_id = 7), - [128] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), - [130] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), - [132] = {.entry = {.count = 1, .reusable = true}}, SHIFT(44), - [134] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2), - [136] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32), + [51] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_binary_expression, 3, .production_id = 4), + [53] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_binary_expression, 3, .production_id = 4), + [55] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_string_literal, 3), + [57] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_string_literal, 3), + [59] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_call, 5, .production_id = 6), + [61] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_call, 5, .production_id = 6), + [63] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sequence_expression, 4), + [65] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sequence_expression, 4), + [67] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_record_expression, 3, .production_id = 3), + [69] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_record_expression, 3, .production_id = 3), + [71] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_unary_expression, 2, .production_id = 1), + [73] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_call, 4, .production_id = 5), + [75] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_call, 4, .production_id = 5), + [77] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2), + [79] = {.entry = {.count = 1, .reusable = true}}, SHIFT(38), + [81] = {.entry = {.count = 1, .reusable = false}}, SHIFT(24), + [83] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), + [85] = {.entry = {.count = 1, .reusable = true}}, SHIFT(54), + [87] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), + [89] = {.entry = {.count = 1, .reusable = false}}, SHIFT(20), + [91] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3), + [93] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36), + [95] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), + [97] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_sequence_expression_repeat1, 2), + [99] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9), + [101] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_record_expression_repeat1, 4, .production_id = 11), + [103] = {.entry = {.count = 1, .reusable = false}}, SHIFT(27), + [105] = {.entry = {.count = 1, .reusable = false}}, SHIFT(40), + [107] = {.entry = {.count = 1, .reusable = false}}, SHIFT(7), + [109] = {.entry = {.count = 1, .reusable = false}}, SHIFT(15), + [111] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_function_call_repeat1, 2), + [113] = {.entry = {.count = 1, .reusable = false}}, SHIFT(17), + [115] = {.entry = {.count = 1, .reusable = false}}, SHIFT(18), + [117] = {.entry = {.count = 1, .reusable = false}}, SHIFT(19), + [119] = {.entry = {.count = 1, .reusable = false}}, SHIFT(32), + [121] = {.entry = {.count = 1, .reusable = false}}, SHIFT(14), + [123] = {.entry = {.count = 1, .reusable = false}}, SHIFT(25), + [125] = {.entry = {.count = 1, .reusable = false}}, SHIFT(22), + [127] = {.entry = {.count = 1, .reusable = true}}, SHIFT(53), + [129] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1), + [131] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_string_literal_repeat1, 2), + [133] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_string_literal_repeat1, 2), SHIFT_REPEAT(42), + [136] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10), [138] = {.entry = {.count = 1, .reusable = true}}, SHIFT(42), - [140] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), - [142] = {.entry = {.count = 1, .reusable = true}}, SHIFT(33), - [144] = {.entry = {.count = 1, .reusable = true}}, SHIFT(48), - [146] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), - [148] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), + [140] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8), + [142] = {.entry = {.count = 1, .reusable = true}}, SHIFT(43), + [144] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), + [146] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29), + [148] = {.entry = {.count = 1, .reusable = true}}, SHIFT(52), + [150] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_sequence_expression_repeat1, 2), SHIFT_REPEAT(38), + [153] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), + [155] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_function_call_repeat1, 2), SHIFT_REPEAT(36), + [158] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), + [160] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), + [162] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_record_expression_repeat1, 2, .production_id = 10), SHIFT_REPEAT(54), + [165] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_record_expression_repeat1, 2, .production_id = 10), + [167] = {.entry = {.count = 1, .reusable = true}}, SHIFT(57), + [169] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), + [171] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30), + [173] = {.entry = {.count = 1, .reusable = true}}, SHIFT(56), + [175] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [177] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28), + [179] = {.entry = {.count = 1, .reusable = true}}, SHIFT(39), }; #ifdef __cplusplus diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt index b9d48ab..5a5ee43 100644 --- a/test/corpus/expressions.txt +++ b/test/corpus/expressions.txt @@ -85,3 +85,56 @@ record_type { a = 12, } field: (identifier) init: (integer_literal) (ERROR))) + +================================================================================ +Function call +================================================================================ + +f(12, "27") + +-------------------------------------------------------------------------------- + +(source_file + (function_call + function: (identifier) + arguments: (integer_literal) + arguments: (string_literal))) + +================================================================================ +Function call single argument +================================================================================ + +f(12) + +-------------------------------------------------------------------------------- + +(source_file + (function_call + function: (identifier) + arguments: (integer_literal))) + +================================================================================ +Function call no arguments +================================================================================ + +f() + +-------------------------------------------------------------------------------- + +(source_file + (function_call + function: (identifier))) + +================================================================================ +Function call trailing comma +================================================================================ + +f(12,) + +-------------------------------------------------------------------------------- + +(source_file + (function_call + function: (identifier) + arguments: (integer_literal) + (ERROR)))