diff --git a/example.scl b/example.scl deleted file mode 100644 index ce01362..0000000 --- a/example.scl +++ /dev/null @@ -1 +0,0 @@ -hello diff --git a/examples/example.scl b/examples/example.scl new file mode 100644 index 0000000..54ed719 --- /dev/null +++ b/examples/example.scl @@ -0,0 +1,2 @@ +1 + 1 +sum(1, 2, 3 + 2) diff --git a/grammar.js b/grammar.js index 936d203..af25567 100644 --- a/grammar.js +++ b/grammar.js @@ -1,5 +1,5 @@ /** - * @file Scl grammar for tree-sitter + * @file SCL grammar for tree-sitter * @author Jacob Signorovitch * @license MIT */ @@ -7,11 +7,108 @@ /// // @ts-check +// grammar.js +const PREC = { + assign: 0, // right-assoc + add: 1, // left-assoc + mul: 2, // left-assoc + call: 3, + funcdef: 4, + lambda: 5, +}; + module.exports = grammar({ name: "scl", + // Whitespace is of no consequence. + extras: ($) => [/\s/], + + conflicts: ($) => [[$.params, $._exp]], + rules: { - // TODO: add the actual grammar rules - source_file: $ => "hello" - } + // A file is zero or more expressions. + source_file: ($) => repeat($._exp), + + // Everything is expressions. Makes this a lot easier. + _exp: ($) => + choice( + $.num, + $.word, + $.binexp, + $.callexp, + $.funcdef, + $.lambda, + $.vardef, + $.parexp, + ), + + // Literals / identifiers. + num: (_) => /\d+/, + word: (_) => /[a-zA-Z_]\w*/, + + // Binary expressions with precedence and left associativity. + binexp: ($) => + choice( + prec.left( + PREC.add, + seq( + field("left", $._exp), + field("op", choice("+", "-")), + field("right", $._exp), + ), + ), + prec.left( + PREC.mul, + seq( + field("left", $._exp), + field("op", choice("*", "/")), + field("right", $._exp), + ), + ), + ), + + // Function call: prefer this over plain `word` via precedence. + callexp: ($) => + prec( + PREC.call, + seq(field("fn", $.word), "(", optional(commaSep($._exp)), ")"), + ), + + // Convenient function definition (sugar): `f(x, y, ...) body`. + // Give it higher precedence than calls to resolve the shared prefix. + funcdef: ($) => + prec( + PREC.funcdef, + seq( + field("name", $.word), + field("params", $.params), + field("body", $._exp), + ), + ), + + // Lambda: `\(x, y, ...) body`. + lambda: ($) => + prec( + PREC.lambda, + seq("\\", field("params", $.params), field("body", $._exp)), + ), + + // Variable definition / assignment: `x = expr`. + // Lowest precedence, right-associative: `a = b = c` → `a = (b = c)`. + vardef: ($) => + prec.right( + PREC.assign, + seq(field("name", $.word), "=", field("value", $._exp)), + ), + + // Parameter list node used by funcdef and lambda. + params: ($) => seq("(", optional(commaSep($.word)), ")"), + + // Parenthesized expression. + parexp: ($) => seq("(", $._exp, ")"), + }, }); + +function commaSep(rule) { + return seq(rule, repeat(seq(",", rule))); +} diff --git a/src/grammar.json b/src/grammar.json index 33b3da2..e9fe276 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -3,8 +3,357 @@ "name": "scl", "rules": { "source_file": { - "type": "STRING", - "value": "hello" + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_exp" + } + }, + "_exp": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "num" + }, + { + "type": "SYMBOL", + "name": "word" + }, + { + "type": "SYMBOL", + "name": "binexp" + }, + { + "type": "SYMBOL", + "name": "callexp" + }, + { + "type": "SYMBOL", + "name": "funcdef" + }, + { + "type": "SYMBOL", + "name": "lambda" + }, + { + "type": "SYMBOL", + "name": "vardef" + }, + { + "type": "SYMBOL", + "name": "parexp" + } + ] + }, + "num": { + "type": "PATTERN", + "value": "\\d+" + }, + "word": { + "type": "PATTERN", + "value": "[a-zA-Z_]\\w*" + }, + "binexp": { + "type": "CHOICE", + "members": [ + { + "type": "PREC_LEFT", + "value": 1, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "_exp" + } + }, + { + "type": "FIELD", + "name": "op", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "+" + }, + { + "type": "STRING", + "value": "-" + } + ] + } + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "_exp" + } + } + ] + } + }, + { + "type": "PREC_LEFT", + "value": 2, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "_exp" + } + }, + { + "type": "FIELD", + "name": "op", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "*" + }, + { + "type": "STRING", + "value": "/" + } + ] + } + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "_exp" + } + } + ] + } + } + ] + }, + "callexp": { + "type": "PREC", + "value": 3, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "fn", + "content": { + "type": "SYMBOL", + "name": "word" + } + }, + { + "type": "STRING", + "value": "(" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "_exp" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "SYMBOL", + "name": "_exp" + } + ] + } + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": ")" + } + ] + } + }, + "funcdef": { + "type": "PREC", + "value": 4, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "word" + } + }, + { + "type": "FIELD", + "name": "params", + "content": { + "type": "SYMBOL", + "name": "params" + } + }, + { + "type": "FIELD", + "name": "body", + "content": { + "type": "SYMBOL", + "name": "_exp" + } + } + ] + } + }, + "lambda": { + "type": "PREC", + "value": 5, + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "\\" + }, + { + "type": "FIELD", + "name": "params", + "content": { + "type": "SYMBOL", + "name": "params" + } + }, + { + "type": "FIELD", + "name": "body", + "content": { + "type": "SYMBOL", + "name": "_exp" + } + } + ] + } + }, + "vardef": { + "type": "PREC_RIGHT", + "value": 0, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "word" + } + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "_exp" + } + } + ] + } + }, + "params": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "(" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "word" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "SYMBOL", + "name": "word" + } + ] + } + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": ")" + } + ] + }, + "parexp": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "(" + }, + { + "type": "SYMBOL", + "name": "_exp" + }, + { + "type": "STRING", + "value": ")" + } + ] } }, "extras": [ @@ -13,7 +362,12 @@ "value": "\\s" } ], - "conflicts": [], + "conflicts": [ + [ + "params", + "_exp" + ] + ], "precedences": [], "externals": [], "inline": [], diff --git a/src/node-types.json b/src/node-types.json index cd69f6e..7ead58e 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -1,12 +1,478 @@ [ + { + "type": "binexp", + "named": true, + "fields": { + "left": { + "multiple": false, + "required": true, + "types": [ + { + "type": "binexp", + "named": true + }, + { + "type": "callexp", + "named": true + }, + { + "type": "funcdef", + "named": true + }, + { + "type": "lambda", + "named": true + }, + { + "type": "num", + "named": true + }, + { + "type": "parexp", + "named": true + }, + { + "type": "vardef", + "named": true + }, + { + "type": "word", + "named": true + } + ] + }, + "op": { + "multiple": false, + "required": true, + "types": [ + { + "type": "*", + "named": false + }, + { + "type": "+", + "named": false + }, + { + "type": "-", + "named": false + }, + { + "type": "/", + "named": false + } + ] + }, + "right": { + "multiple": false, + "required": true, + "types": [ + { + "type": "binexp", + "named": true + }, + { + "type": "callexp", + "named": true + }, + { + "type": "funcdef", + "named": true + }, + { + "type": "lambda", + "named": true + }, + { + "type": "num", + "named": true + }, + { + "type": "parexp", + "named": true + }, + { + "type": "vardef", + "named": true + }, + { + "type": "word", + "named": true + } + ] + } + } + }, + { + "type": "callexp", + "named": true, + "fields": { + "fn": { + "multiple": false, + "required": true, + "types": [ + { + "type": "word", + "named": true + } + ] + } + }, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "binexp", + "named": true + }, + { + "type": "callexp", + "named": true + }, + { + "type": "funcdef", + "named": true + }, + { + "type": "lambda", + "named": true + }, + { + "type": "num", + "named": true + }, + { + "type": "parexp", + "named": true + }, + { + "type": "vardef", + "named": true + }, + { + "type": "word", + "named": true + } + ] + } + }, + { + "type": "funcdef", + "named": true, + "fields": { + "body": { + "multiple": false, + "required": true, + "types": [ + { + "type": "binexp", + "named": true + }, + { + "type": "callexp", + "named": true + }, + { + "type": "funcdef", + "named": true + }, + { + "type": "lambda", + "named": true + }, + { + "type": "num", + "named": true + }, + { + "type": "parexp", + "named": true + }, + { + "type": "vardef", + "named": true + }, + { + "type": "word", + "named": true + } + ] + }, + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "word", + "named": true + } + ] + }, + "params": { + "multiple": false, + "required": true, + "types": [ + { + "type": "params", + "named": true + } + ] + } + } + }, + { + "type": "lambda", + "named": true, + "fields": { + "body": { + "multiple": false, + "required": true, + "types": [ + { + "type": "binexp", + "named": true + }, + { + "type": "callexp", + "named": true + }, + { + "type": "funcdef", + "named": true + }, + { + "type": "lambda", + "named": true + }, + { + "type": "num", + "named": true + }, + { + "type": "parexp", + "named": true + }, + { + "type": "vardef", + "named": true + }, + { + "type": "word", + "named": true + } + ] + }, + "params": { + "multiple": false, + "required": true, + "types": [ + { + "type": "params", + "named": true + } + ] + } + } + }, + { + "type": "params", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "word", + "named": true + } + ] + } + }, + { + "type": "parexp", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "binexp", + "named": true + }, + { + "type": "callexp", + "named": true + }, + { + "type": "funcdef", + "named": true + }, + { + "type": "lambda", + "named": true + }, + { + "type": "num", + "named": true + }, + { + "type": "parexp", + "named": true + }, + { + "type": "vardef", + "named": true + }, + { + "type": "word", + "named": true + } + ] + } + }, { "type": "source_file", "named": true, "root": true, - "fields": {} + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "binexp", + "named": true + }, + { + "type": "callexp", + "named": true + }, + { + "type": "funcdef", + "named": true + }, + { + "type": "lambda", + "named": true + }, + { + "type": "num", + "named": true + }, + { + "type": "parexp", + "named": true + }, + { + "type": "vardef", + "named": true + }, + { + "type": "word", + "named": true + } + ] + } }, { - "type": "hello", + "type": "vardef", + "named": true, + "fields": { + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "word", + "named": true + } + ] + }, + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "binexp", + "named": true + }, + { + "type": "callexp", + "named": true + }, + { + "type": "funcdef", + "named": true + }, + { + "type": "lambda", + "named": true + }, + { + "type": "num", + "named": true + }, + { + "type": "parexp", + "named": true + }, + { + "type": "vardef", + "named": true + }, + { + "type": "word", + "named": true + } + ] + } + } + }, + { + "type": "(", "named": false + }, + { + "type": ")", + "named": false + }, + { + "type": "*", + "named": false + }, + { + "type": "+", + "named": false + }, + { + "type": ",", + "named": false + }, + { + "type": "-", + "named": false + }, + { + "type": "/", + "named": false + }, + { + "type": "=", + "named": false + }, + { + "type": "\\", + "named": false + }, + { + "type": "num", + "named": true + }, + { + "type": "word", + "named": true } ] \ No newline at end of file diff --git a/src/parser.c b/src/parser.c index 3a4ee4d..df64e99 100644 --- a/src/parser.c +++ b/src/parser.c @@ -7,33 +7,96 @@ #endif #define LANGUAGE_VERSION 15 -#define STATE_COUNT 4 -#define LARGE_STATE_COUNT 2 -#define SYMBOL_COUNT 3 +#define STATE_COUNT 51 +#define LARGE_STATE_COUNT 4 +#define SYMBOL_COUNT 24 #define ALIAS_COUNT 0 -#define TOKEN_COUNT 2 +#define TOKEN_COUNT 12 #define EXTERNAL_TOKEN_COUNT 0 -#define FIELD_COUNT 0 -#define MAX_ALIAS_SEQUENCE_LENGTH 1 +#define FIELD_COUNT 8 +#define MAX_ALIAS_SEQUENCE_LENGTH 5 #define MAX_RESERVED_WORD_SET_SIZE 0 -#define PRODUCTION_ID_COUNT 1 +#define PRODUCTION_ID_COUNT 6 #define SUPERTYPE_COUNT 0 enum ts_symbol_identifiers { - anon_sym_hello = 1, - sym_source_file = 2, + sym_num = 1, + sym_word = 2, + anon_sym_PLUS = 3, + anon_sym_DASH = 4, + anon_sym_STAR = 5, + anon_sym_SLASH = 6, + anon_sym_LPAREN = 7, + anon_sym_COMMA = 8, + anon_sym_RPAREN = 9, + anon_sym_BSLASH = 10, + anon_sym_EQ = 11, + sym_source_file = 12, + sym__exp = 13, + sym_binexp = 14, + sym_callexp = 15, + sym_funcdef = 16, + sym_lambda = 17, + sym_vardef = 18, + sym_params = 19, + sym_parexp = 20, + aux_sym_source_file_repeat1 = 21, + aux_sym_callexp_repeat1 = 22, + aux_sym_params_repeat1 = 23, }; static const char * const ts_symbol_names[] = { [ts_builtin_sym_end] = "end", - [anon_sym_hello] = "hello", + [sym_num] = "num", + [sym_word] = "word", + [anon_sym_PLUS] = "+", + [anon_sym_DASH] = "-", + [anon_sym_STAR] = "*", + [anon_sym_SLASH] = "/", + [anon_sym_LPAREN] = "(", + [anon_sym_COMMA] = ",", + [anon_sym_RPAREN] = ")", + [anon_sym_BSLASH] = "\\", + [anon_sym_EQ] = "=", [sym_source_file] = "source_file", + [sym__exp] = "_exp", + [sym_binexp] = "binexp", + [sym_callexp] = "callexp", + [sym_funcdef] = "funcdef", + [sym_lambda] = "lambda", + [sym_vardef] = "vardef", + [sym_params] = "params", + [sym_parexp] = "parexp", + [aux_sym_source_file_repeat1] = "source_file_repeat1", + [aux_sym_callexp_repeat1] = "callexp_repeat1", + [aux_sym_params_repeat1] = "params_repeat1", }; static const TSSymbol ts_symbol_map[] = { [ts_builtin_sym_end] = ts_builtin_sym_end, - [anon_sym_hello] = anon_sym_hello, + [sym_num] = sym_num, + [sym_word] = sym_word, + [anon_sym_PLUS] = anon_sym_PLUS, + [anon_sym_DASH] = anon_sym_DASH, + [anon_sym_STAR] = anon_sym_STAR, + [anon_sym_SLASH] = anon_sym_SLASH, + [anon_sym_LPAREN] = anon_sym_LPAREN, + [anon_sym_COMMA] = anon_sym_COMMA, + [anon_sym_RPAREN] = anon_sym_RPAREN, + [anon_sym_BSLASH] = anon_sym_BSLASH, + [anon_sym_EQ] = anon_sym_EQ, [sym_source_file] = sym_source_file, + [sym__exp] = sym__exp, + [sym_binexp] = sym_binexp, + [sym_callexp] = sym_callexp, + [sym_funcdef] = sym_funcdef, + [sym_lambda] = sym_lambda, + [sym_vardef] = sym_vardef, + [sym_params] = sym_params, + [sym_parexp] = sym_parexp, + [aux_sym_source_file_repeat1] = aux_sym_source_file_repeat1, + [aux_sym_callexp_repeat1] = aux_sym_callexp_repeat1, + [aux_sym_params_repeat1] = aux_sym_params_repeat1, }; static const TSSymbolMetadata ts_symbol_metadata[] = { @@ -41,7 +104,47 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = false, .named = true, }, - [anon_sym_hello] = { + [sym_num] = { + .visible = true, + .named = true, + }, + [sym_word] = { + .visible = true, + .named = true, + }, + [anon_sym_PLUS] = { + .visible = true, + .named = false, + }, + [anon_sym_DASH] = { + .visible = true, + .named = false, + }, + [anon_sym_STAR] = { + .visible = true, + .named = false, + }, + [anon_sym_SLASH] = { + .visible = true, + .named = false, + }, + [anon_sym_LPAREN] = { + .visible = true, + .named = false, + }, + [anon_sym_COMMA] = { + .visible = true, + .named = false, + }, + [anon_sym_RPAREN] = { + .visible = true, + .named = false, + }, + [anon_sym_BSLASH] = { + .visible = true, + .named = false, + }, + [anon_sym_EQ] = { .visible = true, .named = false, }, @@ -49,6 +152,100 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, + [sym__exp] = { + .visible = false, + .named = true, + }, + [sym_binexp] = { + .visible = true, + .named = true, + }, + [sym_callexp] = { + .visible = true, + .named = true, + }, + [sym_funcdef] = { + .visible = true, + .named = true, + }, + [sym_lambda] = { + .visible = true, + .named = true, + }, + [sym_vardef] = { + .visible = true, + .named = true, + }, + [sym_params] = { + .visible = true, + .named = true, + }, + [sym_parexp] = { + .visible = true, + .named = true, + }, + [aux_sym_source_file_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_callexp_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_params_repeat1] = { + .visible = false, + .named = false, + }, +}; + +enum ts_field_identifiers { + field_body = 1, + field_fn = 2, + field_left = 3, + field_name = 4, + field_op = 5, + field_params = 6, + field_right = 7, + field_value = 8, +}; + +static const char * const ts_field_names[] = { + [0] = NULL, + [field_body] = "body", + [field_fn] = "fn", + [field_left] = "left", + [field_name] = "name", + [field_op] = "op", + [field_params] = "params", + [field_right] = "right", + [field_value] = "value", +}; + +static const TSMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = { + [1] = {.index = 0, .length = 1}, + [2] = {.index = 1, .length = 2}, + [3] = {.index = 3, .length = 3}, + [4] = {.index = 6, .length = 2}, + [5] = {.index = 8, .length = 3}, +}; + +static const TSFieldMapEntry ts_field_map_entries[] = { + [0] = + {field_fn, 0}, + [1] = + {field_name, 0}, + {field_value, 2}, + [3] = + {field_body, 2}, + {field_name, 0}, + {field_params, 1}, + [6] = + {field_body, 2}, + {field_params, 1}, + [8] = + {field_left, 0}, + {field_op, 1}, + {field_right, 2}, }; static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = { @@ -64,6 +261,53 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [1] = 1, [2] = 2, [3] = 3, + [4] = 4, + [5] = 4, + [6] = 6, + [7] = 7, + [8] = 8, + [9] = 9, + [10] = 10, + [11] = 11, + [12] = 12, + [13] = 13, + [14] = 14, + [15] = 15, + [16] = 16, + [17] = 17, + [18] = 18, + [19] = 19, + [20] = 8, + [21] = 7, + [22] = 10, + [23] = 9, + [24] = 11, + [25] = 25, + [26] = 26, + [27] = 12, + [28] = 26, + [29] = 29, + [30] = 30, + [31] = 31, + [32] = 32, + [33] = 33, + [34] = 30, + [35] = 31, + [36] = 36, + [37] = 37, + [38] = 38, + [39] = 39, + [40] = 40, + [41] = 41, + [42] = 42, + [43] = 43, + [44] = 44, + [45] = 45, + [46] = 46, + [47] = 47, + [48] = 47, + [49] = 49, + [50] = 50, }; static bool ts_lex(TSLexer *lexer, TSStateId state) { @@ -71,28 +315,65 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { eof = lexer->eof(lexer); switch (state) { case 0: - if (eof) ADVANCE(5); - if (lookahead == 'h') ADVANCE(1); + if (eof) ADVANCE(1); + ADVANCE_MAP( + '(', 8, + ')', 10, + '*', 6, + '+', 4, + ',', 9, + '-', 5, + '/', 7, + '=', 12, + '\\', 11, + ); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') SKIP(0); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(2); + if (('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(3); END_STATE(); case 1: - if (lookahead == 'e') ADVANCE(3); - END_STATE(); - case 2: - if (lookahead == 'l') ADVANCE(4); - END_STATE(); - case 3: - if (lookahead == 'l') ADVANCE(2); - END_STATE(); - case 4: - if (lookahead == 'o') ADVANCE(6); - END_STATE(); - case 5: ACCEPT_TOKEN(ts_builtin_sym_end); END_STATE(); + case 2: + ACCEPT_TOKEN(sym_num); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(2); + END_STATE(); + case 3: + ACCEPT_TOKEN(sym_word); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(3); + END_STATE(); + case 4: + ACCEPT_TOKEN(anon_sym_PLUS); + END_STATE(); + case 5: + ACCEPT_TOKEN(anon_sym_DASH); + END_STATE(); case 6: - ACCEPT_TOKEN(anon_sym_hello); + ACCEPT_TOKEN(anon_sym_STAR); + END_STATE(); + case 7: + ACCEPT_TOKEN(anon_sym_SLASH); + END_STATE(); + case 8: + ACCEPT_TOKEN(anon_sym_LPAREN); + END_STATE(); + case 9: + ACCEPT_TOKEN(anon_sym_COMMA); + END_STATE(); + case 10: + ACCEPT_TOKEN(anon_sym_RPAREN); + END_STATE(); + case 11: + ACCEPT_TOKEN(anon_sym_BSLASH); + END_STATE(); + case 12: + ACCEPT_TOKEN(anon_sym_EQ); END_STATE(); default: return false; @@ -104,39 +385,798 @@ static const TSLexerMode ts_lex_modes[STATE_COUNT] = { [1] = {.lex_state = 0}, [2] = {.lex_state = 0}, [3] = {.lex_state = 0}, + [4] = {.lex_state = 0}, + [5] = {.lex_state = 0}, + [6] = {.lex_state = 0}, + [7] = {.lex_state = 0}, + [8] = {.lex_state = 0}, + [9] = {.lex_state = 0}, + [10] = {.lex_state = 0}, + [11] = {.lex_state = 0}, + [12] = {.lex_state = 0}, + [13] = {.lex_state = 0}, + [14] = {.lex_state = 0}, + [15] = {.lex_state = 0}, + [16] = {.lex_state = 0}, + [17] = {.lex_state = 0}, + [18] = {.lex_state = 0}, + [19] = {.lex_state = 0}, + [20] = {.lex_state = 0}, + [21] = {.lex_state = 0}, + [22] = {.lex_state = 0}, + [23] = {.lex_state = 0}, + [24] = {.lex_state = 0}, + [25] = {.lex_state = 0}, + [26] = {.lex_state = 0}, + [27] = {.lex_state = 0}, + [28] = {.lex_state = 0}, + [29] = {.lex_state = 0}, + [30] = {.lex_state = 0}, + [31] = {.lex_state = 0}, + [32] = {.lex_state = 0}, + [33] = {.lex_state = 0}, + [34] = {.lex_state = 0}, + [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 = 0}, + [43] = {.lex_state = 0}, + [44] = {.lex_state = 0}, + [45] = {.lex_state = 0}, + [46] = {.lex_state = 0}, + [47] = {.lex_state = 0}, + [48] = {.lex_state = 0}, + [49] = {.lex_state = 0}, + [50] = {.lex_state = 0}, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [STATE(0)] = { [ts_builtin_sym_end] = ACTIONS(1), - [anon_sym_hello] = ACTIONS(1), + [sym_num] = ACTIONS(1), + [sym_word] = ACTIONS(1), + [anon_sym_PLUS] = ACTIONS(1), + [anon_sym_DASH] = ACTIONS(1), + [anon_sym_STAR] = ACTIONS(1), + [anon_sym_SLASH] = ACTIONS(1), + [anon_sym_LPAREN] = ACTIONS(1), + [anon_sym_COMMA] = ACTIONS(1), + [anon_sym_RPAREN] = ACTIONS(1), + [anon_sym_BSLASH] = ACTIONS(1), + [anon_sym_EQ] = ACTIONS(1), }, [STATE(1)] = { - [sym_source_file] = STATE(3), - [anon_sym_hello] = ACTIONS(3), + [sym_source_file] = STATE(50), + [sym__exp] = STATE(29), + [sym_binexp] = STATE(29), + [sym_callexp] = STATE(29), + [sym_funcdef] = STATE(29), + [sym_lambda] = STATE(29), + [sym_vardef] = STATE(29), + [sym_parexp] = STATE(29), + [aux_sym_source_file_repeat1] = STATE(3), + [ts_builtin_sym_end] = ACTIONS(3), + [sym_num] = ACTIONS(5), + [sym_word] = ACTIONS(7), + [anon_sym_LPAREN] = ACTIONS(9), + [anon_sym_BSLASH] = ACTIONS(11), + }, + [STATE(2)] = { + [sym__exp] = STATE(29), + [sym_binexp] = STATE(29), + [sym_callexp] = STATE(29), + [sym_funcdef] = STATE(29), + [sym_lambda] = STATE(29), + [sym_vardef] = STATE(29), + [sym_parexp] = STATE(29), + [aux_sym_source_file_repeat1] = STATE(2), + [ts_builtin_sym_end] = ACTIONS(13), + [sym_num] = ACTIONS(15), + [sym_word] = ACTIONS(18), + [anon_sym_LPAREN] = ACTIONS(21), + [anon_sym_BSLASH] = ACTIONS(24), + }, + [STATE(3)] = { + [sym__exp] = STATE(29), + [sym_binexp] = STATE(29), + [sym_callexp] = STATE(29), + [sym_funcdef] = STATE(29), + [sym_lambda] = STATE(29), + [sym_vardef] = STATE(29), + [sym_parexp] = STATE(29), + [aux_sym_source_file_repeat1] = STATE(2), + [ts_builtin_sym_end] = ACTIONS(27), + [sym_num] = ACTIONS(5), + [sym_word] = ACTIONS(7), + [anon_sym_LPAREN] = ACTIONS(9), + [anon_sym_BSLASH] = ACTIONS(11), }, }; static const uint16_t ts_small_parse_table[] = { - [0] = 1, - ACTIONS(5), 1, - ts_builtin_sym_end, - [4] = 1, + [0] = 6, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(29), 1, + sym_num, + ACTIONS(31), 1, + sym_word, + ACTIONS(33), 1, + anon_sym_RPAREN, + ACTIONS(35), 1, + anon_sym_BSLASH, + STATE(32), 7, + sym__exp, + sym_binexp, + sym_callexp, + sym_funcdef, + sym_lambda, + sym_vardef, + sym_parexp, + [25] = 6, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(29), 1, + sym_num, + ACTIONS(31), 1, + sym_word, + ACTIONS(35), 1, + anon_sym_BSLASH, + ACTIONS(37), 1, + anon_sym_RPAREN, + STATE(32), 7, + sym__exp, + sym_binexp, + sym_callexp, + sym_funcdef, + sym_lambda, + sym_vardef, + sym_parexp, + [50] = 5, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(35), 1, + anon_sym_BSLASH, + ACTIONS(39), 1, + sym_num, + ACTIONS(41), 1, + sym_word, + STATE(36), 7, + sym__exp, + sym_binexp, + sym_callexp, + sym_funcdef, + sym_lambda, + sym_vardef, + sym_parexp, + [72] = 5, ACTIONS(7), 1, + sym_word, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(11), 1, + anon_sym_BSLASH, + ACTIONS(43), 1, + sym_num, + STATE(30), 7, + sym__exp, + sym_binexp, + sym_callexp, + sym_funcdef, + sym_lambda, + sym_vardef, + sym_parexp, + [94] = 5, + ACTIONS(7), 1, + sym_word, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(11), 1, + anon_sym_BSLASH, + ACTIONS(45), 1, + sym_num, + STATE(13), 7, + sym__exp, + sym_binexp, + sym_callexp, + sym_funcdef, + sym_lambda, + sym_vardef, + sym_parexp, + [116] = 5, + ACTIONS(7), 1, + sym_word, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(11), 1, + anon_sym_BSLASH, + ACTIONS(47), 1, + sym_num, + STATE(18), 7, + sym__exp, + sym_binexp, + sym_callexp, + sym_funcdef, + sym_lambda, + sym_vardef, + sym_parexp, + [138] = 5, + ACTIONS(7), 1, + sym_word, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(11), 1, + anon_sym_BSLASH, + ACTIONS(49), 1, + sym_num, + STATE(31), 7, + sym__exp, + sym_binexp, + sym_callexp, + sym_funcdef, + sym_lambda, + sym_vardef, + sym_parexp, + [160] = 5, + ACTIONS(7), 1, + sym_word, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(11), 1, + anon_sym_BSLASH, + ACTIONS(51), 1, + sym_num, + STATE(15), 7, + sym__exp, + sym_binexp, + sym_callexp, + sym_funcdef, + sym_lambda, + sym_vardef, + sym_parexp, + [182] = 4, + ACTIONS(55), 1, + anon_sym_LPAREN, + ACTIONS(57), 1, + anon_sym_EQ, + STATE(8), 1, + sym_params, + ACTIONS(53), 8, + ts_builtin_sym_end, + sym_num, + sym_word, + anon_sym_PLUS, + anon_sym_DASH, + anon_sym_STAR, + anon_sym_SLASH, + anon_sym_BSLASH, + [202] = 1, + ACTIONS(59), 11, + ts_builtin_sym_end, + sym_num, + sym_word, + anon_sym_PLUS, + anon_sym_DASH, + anon_sym_STAR, + anon_sym_SLASH, + anon_sym_LPAREN, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_BSLASH, + [216] = 1, + ACTIONS(61), 11, + ts_builtin_sym_end, + sym_num, + sym_word, + anon_sym_PLUS, + anon_sym_DASH, + anon_sym_STAR, + anon_sym_SLASH, + anon_sym_LPAREN, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_BSLASH, + [230] = 1, + ACTIONS(63), 11, + ts_builtin_sym_end, + sym_num, + sym_word, + anon_sym_PLUS, + anon_sym_DASH, + anon_sym_STAR, + anon_sym_SLASH, + anon_sym_LPAREN, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_BSLASH, + [244] = 1, + ACTIONS(65), 11, + ts_builtin_sym_end, + sym_num, + sym_word, + anon_sym_PLUS, + anon_sym_DASH, + anon_sym_STAR, + anon_sym_SLASH, + anon_sym_LPAREN, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_BSLASH, + [258] = 1, + ACTIONS(67), 11, + ts_builtin_sym_end, + sym_num, + sym_word, + anon_sym_PLUS, + anon_sym_DASH, + anon_sym_STAR, + anon_sym_SLASH, + anon_sym_LPAREN, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_BSLASH, + [272] = 1, + ACTIONS(69), 11, + ts_builtin_sym_end, + sym_num, + sym_word, + anon_sym_PLUS, + anon_sym_DASH, + anon_sym_STAR, + anon_sym_SLASH, + anon_sym_LPAREN, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_BSLASH, + [286] = 5, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(35), 1, + anon_sym_BSLASH, + ACTIONS(41), 1, + sym_word, + ACTIONS(71), 1, + sym_num, + STATE(33), 7, + sym__exp, + sym_binexp, + sym_callexp, + sym_funcdef, + sym_lambda, + sym_vardef, + sym_parexp, + [308] = 5, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(35), 1, + anon_sym_BSLASH, + ACTIONS(41), 1, + sym_word, + ACTIONS(45), 1, + sym_num, + STATE(13), 7, + sym__exp, + sym_binexp, + sym_callexp, + sym_funcdef, + sym_lambda, + sym_vardef, + sym_parexp, + [330] = 5, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(35), 1, + anon_sym_BSLASH, + ACTIONS(41), 1, + sym_word, + ACTIONS(73), 1, + sym_num, + STATE(34), 7, + sym__exp, + sym_binexp, + sym_callexp, + sym_funcdef, + sym_lambda, + sym_vardef, + sym_parexp, + [352] = 5, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(35), 1, + anon_sym_BSLASH, + ACTIONS(41), 1, + sym_word, + ACTIONS(75), 1, + sym_num, + STATE(35), 7, + sym__exp, + sym_binexp, + sym_callexp, + sym_funcdef, + sym_lambda, + sym_vardef, + sym_parexp, + [374] = 5, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(35), 1, + anon_sym_BSLASH, + ACTIONS(41), 1, + sym_word, + ACTIONS(47), 1, + sym_num, + STATE(18), 7, + sym__exp, + sym_binexp, + sym_callexp, + sym_funcdef, + sym_lambda, + sym_vardef, + sym_parexp, + [396] = 5, + ACTIONS(9), 1, + anon_sym_LPAREN, + ACTIONS(35), 1, + anon_sym_BSLASH, + ACTIONS(41), 1, + sym_word, + ACTIONS(51), 1, + sym_num, + STATE(15), 7, + sym__exp, + sym_binexp, + sym_callexp, + sym_funcdef, + sym_lambda, + sym_vardef, + sym_parexp, + [418] = 7, + ACTIONS(77), 1, + anon_sym_LPAREN, + ACTIONS(79), 1, + anon_sym_COMMA, + ACTIONS(82), 1, + anon_sym_RPAREN, + ACTIONS(85), 1, + anon_sym_EQ, + STATE(20), 1, + sym_params, + STATE(41), 1, + aux_sym_params_repeat1, + ACTIONS(53), 4, + anon_sym_PLUS, + anon_sym_DASH, + anon_sym_STAR, + anon_sym_SLASH, + [443] = 2, + ACTIONS(87), 4, + sym_num, + sym_word, + anon_sym_LPAREN, + anon_sym_BSLASH, + ACTIONS(89), 6, + anon_sym_PLUS, + anon_sym_DASH, + anon_sym_STAR, + anon_sym_SLASH, + anon_sym_COMMA, + anon_sym_RPAREN, + [458] = 4, + ACTIONS(77), 1, + anon_sym_LPAREN, + ACTIONS(85), 1, + anon_sym_EQ, + STATE(20), 1, + sym_params, + ACTIONS(53), 6, + anon_sym_PLUS, + anon_sym_DASH, + anon_sym_STAR, + anon_sym_SLASH, + anon_sym_COMMA, + anon_sym_RPAREN, + [476] = 1, + ACTIONS(89), 9, + ts_builtin_sym_end, + sym_num, + sym_word, + anon_sym_PLUS, + anon_sym_DASH, + anon_sym_STAR, + anon_sym_SLASH, + anon_sym_LPAREN, + anon_sym_BSLASH, + [488] = 3, + ACTIONS(93), 2, + anon_sym_PLUS, + anon_sym_DASH, + ACTIONS(95), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(91), 5, + ts_builtin_sym_end, + sym_num, + sym_word, + anon_sym_LPAREN, + anon_sym_BSLASH, + [504] = 3, + ACTIONS(93), 2, + anon_sym_PLUS, + anon_sym_DASH, + ACTIONS(95), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(97), 5, + ts_builtin_sym_end, + sym_num, + sym_word, + anon_sym_LPAREN, + anon_sym_BSLASH, + [520] = 2, + ACTIONS(95), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(63), 7, + ts_builtin_sym_end, + sym_num, + sym_word, + anon_sym_PLUS, + anon_sym_DASH, + anon_sym_LPAREN, + anon_sym_BSLASH, + [534] = 5, + ACTIONS(103), 1, + anon_sym_COMMA, + ACTIONS(105), 1, + anon_sym_RPAREN, + STATE(42), 1, + aux_sym_callexp_repeat1, + ACTIONS(99), 2, + anon_sym_PLUS, + anon_sym_DASH, + ACTIONS(101), 2, + anon_sym_STAR, + anon_sym_SLASH, + [552] = 3, + ACTIONS(99), 2, + anon_sym_PLUS, + anon_sym_DASH, + ACTIONS(101), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(107), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + [565] = 3, + ACTIONS(97), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + ACTIONS(99), 2, + anon_sym_PLUS, + anon_sym_DASH, + ACTIONS(101), 2, + anon_sym_STAR, + anon_sym_SLASH, + [578] = 2, + ACTIONS(101), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(63), 4, + anon_sym_PLUS, + anon_sym_DASH, + anon_sym_COMMA, + anon_sym_RPAREN, + [589] = 3, + ACTIONS(109), 1, + anon_sym_RPAREN, + ACTIONS(99), 2, + anon_sym_PLUS, + anon_sym_DASH, + ACTIONS(101), 2, + anon_sym_STAR, + anon_sym_SLASH, + [601] = 1, + ACTIONS(111), 4, + sym_num, + sym_word, + anon_sym_LPAREN, + anon_sym_BSLASH, + [608] = 1, + ACTIONS(113), 4, + sym_num, + sym_word, + anon_sym_LPAREN, + anon_sym_BSLASH, + [615] = 1, + ACTIONS(87), 4, + sym_num, + sym_word, + anon_sym_LPAREN, + anon_sym_BSLASH, + [622] = 3, + ACTIONS(115), 1, + anon_sym_COMMA, + ACTIONS(118), 1, + anon_sym_RPAREN, + STATE(40), 1, + aux_sym_params_repeat1, + [632] = 3, + ACTIONS(120), 1, + anon_sym_COMMA, + ACTIONS(122), 1, + anon_sym_RPAREN, + STATE(40), 1, + aux_sym_params_repeat1, + [642] = 3, + ACTIONS(103), 1, + anon_sym_COMMA, + ACTIONS(124), 1, + anon_sym_RPAREN, + STATE(43), 1, + aux_sym_callexp_repeat1, + [652] = 3, + ACTIONS(107), 1, + anon_sym_RPAREN, + ACTIONS(126), 1, + anon_sym_COMMA, + STATE(43), 1, + aux_sym_callexp_repeat1, + [662] = 3, + ACTIONS(120), 1, + anon_sym_COMMA, + ACTIONS(129), 1, + anon_sym_RPAREN, + STATE(41), 1, + aux_sym_params_repeat1, + [672] = 1, + ACTIONS(118), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + [677] = 2, + ACTIONS(131), 1, + sym_word, + ACTIONS(133), 1, + anon_sym_RPAREN, + [684] = 2, + ACTIONS(135), 1, + anon_sym_LPAREN, + STATE(9), 1, + sym_params, + [691] = 2, + ACTIONS(135), 1, + anon_sym_LPAREN, + STATE(23), 1, + sym_params, + [698] = 1, + ACTIONS(137), 1, + sym_word, + [702] = 1, + ACTIONS(139), 1, ts_builtin_sym_end, }; static const uint32_t ts_small_parse_table_map[] = { - [SMALL_STATE(2)] = 0, - [SMALL_STATE(3)] = 4, + [SMALL_STATE(4)] = 0, + [SMALL_STATE(5)] = 25, + [SMALL_STATE(6)] = 50, + [SMALL_STATE(7)] = 72, + [SMALL_STATE(8)] = 94, + [SMALL_STATE(9)] = 116, + [SMALL_STATE(10)] = 138, + [SMALL_STATE(11)] = 160, + [SMALL_STATE(12)] = 182, + [SMALL_STATE(13)] = 202, + [SMALL_STATE(14)] = 216, + [SMALL_STATE(15)] = 230, + [SMALL_STATE(16)] = 244, + [SMALL_STATE(17)] = 258, + [SMALL_STATE(18)] = 272, + [SMALL_STATE(19)] = 286, + [SMALL_STATE(20)] = 308, + [SMALL_STATE(21)] = 330, + [SMALL_STATE(22)] = 352, + [SMALL_STATE(23)] = 374, + [SMALL_STATE(24)] = 396, + [SMALL_STATE(25)] = 418, + [SMALL_STATE(26)] = 443, + [SMALL_STATE(27)] = 458, + [SMALL_STATE(28)] = 476, + [SMALL_STATE(29)] = 488, + [SMALL_STATE(30)] = 504, + [SMALL_STATE(31)] = 520, + [SMALL_STATE(32)] = 534, + [SMALL_STATE(33)] = 552, + [SMALL_STATE(34)] = 565, + [SMALL_STATE(35)] = 578, + [SMALL_STATE(36)] = 589, + [SMALL_STATE(37)] = 601, + [SMALL_STATE(38)] = 608, + [SMALL_STATE(39)] = 615, + [SMALL_STATE(40)] = 622, + [SMALL_STATE(41)] = 632, + [SMALL_STATE(42)] = 642, + [SMALL_STATE(43)] = 652, + [SMALL_STATE(44)] = 662, + [SMALL_STATE(45)] = 672, + [SMALL_STATE(46)] = 677, + [SMALL_STATE(47)] = 684, + [SMALL_STATE(48)] = 691, + [SMALL_STATE(49)] = 698, + [SMALL_STATE(50)] = 702, }; static const TSParseActionEntry ts_parse_actions[] = { [0] = {.entry = {.count = 0, .reusable = false}}, [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(), - [3] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2), - [5] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1, 0, 0), - [7] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [3] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 0, 0, 0), + [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29), + [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), + [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), + [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(47), + [13] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), + [15] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(29), + [18] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(12), + [21] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(6), + [24] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(47), + [27] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1, 0, 0), + [29] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32), + [31] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), + [33] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28), + [35] = {.entry = {.count = 1, .reusable = true}}, SHIFT(48), + [37] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), + [39] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36), + [41] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), + [43] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30), + [45] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), + [47] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), + [49] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31), + [51] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), + [53] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__exp, 1, 0, 0), + [55] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), + [57] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), + [59] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_funcdef, 3, 0, 3), + [61] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parexp, 3, 0, 0), + [63] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_binexp, 3, 0, 5), + [65] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_callexp, 4, 0, 1), + [67] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_callexp, 5, 0, 1), + [69] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_lambda, 3, 0, 4), + [71] = {.entry = {.count = 1, .reusable = true}}, SHIFT(33), + [73] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), + [75] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35), + [77] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), + [79] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym__exp, 1, 0, 0), SHIFT(49), + [82] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym__exp, 1, 0, 0), SHIFT(37), + [85] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), + [87] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_params, 2, 0, 0), + [89] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_callexp, 3, 0, 1), + [91] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 1, 0, 0), + [93] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), + [95] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), + [97] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_vardef, 3, 0, 2), + [99] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), + [101] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24), + [103] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), + [105] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), + [107] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_callexp_repeat1, 2, 0, 0), + [109] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), + [111] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_params, 3, 0, 0), + [113] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_params, 4, 0, 0), + [115] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_params_repeat1, 2, 0, 0), SHIFT_REPEAT(49), + [118] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_params_repeat1, 2, 0, 0), + [120] = {.entry = {.count = 1, .reusable = true}}, SHIFT(49), + [122] = {.entry = {.count = 1, .reusable = true}}, SHIFT(38), + [124] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), + [126] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_callexp_repeat1, 2, 0, 0), SHIFT_REPEAT(19), + [129] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37), + [131] = {.entry = {.count = 1, .reusable = true}}, SHIFT(44), + [133] = {.entry = {.count = 1, .reusable = true}}, SHIFT(39), + [135] = {.entry = {.count = 1, .reusable = true}}, SHIFT(46), + [137] = {.entry = {.count = 1, .reusable = true}}, SHIFT(45), + [139] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), }; #ifdef __cplusplus @@ -168,6 +1208,9 @@ TS_PUBLIC const TSLanguage *tree_sitter_scl(void) { .small_parse_table_map = ts_small_parse_table_map, .parse_actions = ts_parse_actions, .symbol_names = ts_symbol_names, + .field_names = ts_field_names, + .field_map_slices = ts_field_map_slices, + .field_map_entries = ts_field_map_entries, .symbol_metadata = ts_symbol_metadata, .public_symbol_map = ts_symbol_map, .alias_map = ts_non_terminal_alias_map,