diff --git a/bindings/node/binding.cc b/bindings/node/binding.cc new file mode 100644 index 0000000..a0fb097 --- /dev/null +++ b/bindings/node/binding.cc @@ -0,0 +1,28 @@ +#include "tree_sitter/parser.h" +#include +#include "nan.h" + +using namespace v8; + +extern "C" TSLanguage * tree_sitter_dust(); + +namespace { + +NAN_METHOD(New) {} + +void Init(Local exports, Local module) { + Local tpl = Nan::New(New); + tpl->SetClassName(Nan::New("Language").ToLocalChecked()); + tpl->InstanceTemplate()->SetInternalFieldCount(1); + + Local constructor = Nan::GetFunction(tpl).ToLocalChecked(); + Local instance = constructor->NewInstance(Nan::GetCurrentContext()).ToLocalChecked(); + Nan::SetInternalFieldPointer(instance, 0, tree_sitter_dust()); + + Nan::Set(instance, Nan::New("name").ToLocalChecked(), Nan::New("dust").ToLocalChecked()); + Nan::Set(module, Nan::New("exports").ToLocalChecked(), instance); +} + +NODE_MODULE(tree_sitter_dust_binding, Init) + +} // namespace diff --git a/bindings/node/index.js b/bindings/node/index.js new file mode 100644 index 0000000..30f7e35 --- /dev/null +++ b/bindings/node/index.js @@ -0,0 +1,19 @@ +try { + module.exports = require("../../build/Release/tree_sitter_dust_binding"); +} catch (error1) { + if (error1.code !== 'MODULE_NOT_FOUND') { + throw error1; + } + try { + module.exports = require("../../build/Debug/tree_sitter_dust_binding"); + } catch (error2) { + if (error2.code !== 'MODULE_NOT_FOUND') { + throw error2; + } + throw error1 + } +} + +try { + module.exports.nodeTypeInfo = require("../../src/node-types.json"); +} catch (_) {} diff --git a/bindings/rust/build.rs b/bindings/rust/build.rs new file mode 100644 index 0000000..c6061f0 --- /dev/null +++ b/bindings/rust/build.rs @@ -0,0 +1,40 @@ +fn main() { + let src_dir = std::path::Path::new("src"); + + let mut c_config = cc::Build::new(); + c_config.include(&src_dir); + c_config + .flag_if_supported("-Wno-unused-parameter") + .flag_if_supported("-Wno-unused-but-set-variable") + .flag_if_supported("-Wno-trigraphs"); + let parser_path = src_dir.join("parser.c"); + c_config.file(&parser_path); + + // If your language uses an external scanner written in C, + // then include this block of code: + + /* + let scanner_path = src_dir.join("scanner.c"); + c_config.file(&scanner_path); + println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap()); + */ + + c_config.compile("parser"); + println!("cargo:rerun-if-changed={}", parser_path.to_str().unwrap()); + + // If your language uses an external scanner written in C++, + // then include this block of code: + + /* + let mut cpp_config = cc::Build::new(); + cpp_config.cpp(true); + cpp_config.include(&src_dir); + cpp_config + .flag_if_supported("-Wno-unused-parameter") + .flag_if_supported("-Wno-unused-but-set-variable"); + let scanner_path = src_dir.join("scanner.cc"); + cpp_config.file(&scanner_path); + cpp_config.compile("scanner"); + println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap()); + */ +} diff --git a/bindings/rust/lib.rs b/bindings/rust/lib.rs new file mode 100644 index 0000000..befe286 --- /dev/null +++ b/bindings/rust/lib.rs @@ -0,0 +1,52 @@ +//! This crate provides dust language support for the [tree-sitter][] parsing library. +//! +//! Typically, you will use the [language][language func] function to add this language to a +//! tree-sitter [Parser][], and then use the parser to parse some code: +//! +//! ``` +//! let code = ""; +//! let mut parser = tree_sitter::Parser::new(); +//! parser.set_language(tree_sitter_dust::language()).expect("Error loading dust grammar"); +//! let tree = parser.parse(code, None).unwrap(); +//! ``` +//! +//! [Language]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Language.html +//! [language func]: fn.language.html +//! [Parser]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Parser.html +//! [tree-sitter]: https://tree-sitter.github.io/ + +use tree_sitter::Language; + +extern "C" { + fn tree_sitter_dust() -> Language; +} + +/// Get the tree-sitter [Language][] for this grammar. +/// +/// [Language]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Language.html +pub fn language() -> Language { + unsafe { tree_sitter_dust() } +} + +/// The content of the [`node-types.json`][] file for this grammar. +/// +/// [`node-types.json`]: https://tree-sitter.github.io/tree-sitter/using-parsers#static-node-types +pub const NODE_TYPES: &'static str = include_str!("../../src/node-types.json"); + +// Uncomment these to include any queries that this grammar contains + +// pub const HIGHLIGHTS_QUERY: &'static str = include_str!("../../queries/highlights.scm"); +// pub const INJECTIONS_QUERY: &'static str = include_str!("../../queries/injections.scm"); +// pub const LOCALS_QUERY: &'static str = include_str!("../../queries/locals.scm"); +// pub const TAGS_QUERY: &'static str = include_str!("../../queries/tags.scm"); + +#[cfg(test)] +mod tests { + #[test] + fn test_can_load_grammar() { + let mut parser = tree_sitter::Parser::new(); + parser + .set_language(super::language()) + .expect("Error loading dust language"); + } +} diff --git a/corpus/statements.txt b/corpus/statements.txt new file mode 100644 index 0000000..f2bc937 --- /dev/null +++ b/corpus/statements.txt @@ -0,0 +1,50 @@ +================== +Simple Statements +================== + +1; +"one"; +x; + +--- + +(source + (statement + (value + (integer)) + (close)) + (statement + (value + (string)) + (close)) + (statement + (identifier) + (close))) + +================== +Simple Assignment +================== + +x = 1; +y = "one"; + +--- + +(source + (statement + (identifier) + (operator + (assignment)) + (statement + (value + (integer)) + (close))) + (statement + (identifier) + (operator + (assignment)) + (statement + (value + (string)) + (close)))) + diff --git a/corpus/tests.txt b/corpus/tests.txt deleted file mode 100644 index c66bcc8..0000000 --- a/corpus/tests.txt +++ /dev/null @@ -1,152 +0,0 @@ -================== -Comments -================== - -# x = 1; -# unassigned_variable -#xyz - ---- - -(source - (comment) - (comment) - (comment)) - -================== -Identifiers -================== - -variable_name -_unused_variable -__strange_format__ -a -blahblah -x.x - ---- - -(source - (identifier) - (identifier) - (identifier) - (identifier) - (identifier) - (identifier)) - -================== -Operators -================== - -x = y + y; - ---- - -(source - (identifier) - (operator) - (identifier) - (operator) - (identifier) - (operator)) - -================== -String -================== - -"string" -'string' - ---- - -(source - (value - (string)) - (value - (string))) - -================== -Integer -================== - -1 -123 - ---- - -(source - (value - (integer)) - (value - (integer))) - -================== -Float -================== - -1.0 -123.123 - ---- - -(source - (value - (float)) - (value - (float))) - -================== -List -================== - -(1, 2) - ---- - -(source - (value - (list - (value - (integer)) - (value - (integer))))) - -================== -Empty -================== - -() - ---- - -(source - (value - (empty))) - -================== -Tool -================== - -random_boolean(); - ---- - -(source - (tool) - (value - (empty)) - (operator)) - -================== -Boolean -================== - -true false - ---- - -(source - (value - (boolean)) - (value - (boolean))) diff --git a/grammar.js b/grammar.js index b640a28..c01c972 100644 --- a/grammar.js +++ b/grammar.js @@ -3,14 +3,16 @@ module.exports = grammar({ rules: { source: $ => repeat(choice( - $.comment, - $.identifier, - $.value, - $.tool, - $.operator, + $.statement, )), - comment: $ => seq('#', /.*/), + statement: $ => choice( + seq($.value, $.close), + seq($.identifier, $.close), + seq($.identifier, $.operator, $.statement), + ), + + close: $ => ";", identifier: $ => /[a-zA-Z|_|.]+(_[a-zA-Z]+)*/, @@ -24,38 +26,19 @@ module.exports = grammar({ $.function, ), - tool: $ => choice( - "random", - "random_boolean", - "random_integer", - "random_string", - "random_float", - ), - - operator: $ => choice( - '=', - '-', - '+', - '/', - '|', - '&', - ';', - "->", - ), - float: $ => /\d+\.\d*/, integer: $ => /\d+/, - string: $ => /("|')(.*?)("|')/, + string: $ => /("|'|`)(.*?)("|'|`)/, function: $ => /{(.*?)}/, - empty: $ => "()", + empty: $ => '()', boolean: $ => choice( - "true", - "false" + 'true', + 'false', ), list: $ => seq( @@ -63,5 +46,17 @@ module.exports = grammar({ repeat1(seq($.value, optional(','))), ')' ), + + operator: $ => choice( + '+', + '-', + $.assignment, + ), + + assignment: $ => choice( + '=', + '+=', + '-=', + ), } }); diff --git a/src/grammar.json b/src/grammar.json index e962a31..9e9f705 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -8,40 +8,63 @@ "members": [ { "type": "SYMBOL", - "name": "comment" - }, - { - "type": "SYMBOL", - "name": "identifier" - }, - { - "type": "SYMBOL", - "name": "value" - }, - { - "type": "SYMBOL", - "name": "tool" - }, - { - "type": "SYMBOL", - "name": "operator" + "name": "statement" } ] } }, - "comment": { - "type": "SEQ", + "statement": { + "type": "CHOICE", "members": [ { - "type": "STRING", - "value": "#" + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "value" + }, + { + "type": "SYMBOL", + "name": "close" + } + ] }, { - "type": "PATTERN", - "value": ".*" + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "identifier" + }, + { + "type": "SYMBOL", + "name": "close" + } + ] + }, + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "identifier" + }, + { + "type": "SYMBOL", + "name": "operator" + }, + { + "type": "SYMBOL", + "name": "statement" + } + ] } ] }, + "close": { + "type": "STRING", + "value": ";" + }, "identifier": { "type": "PATTERN", "value": "[a-zA-Z|_|.]+(_[a-zA-Z]+)*" @@ -79,68 +102,6 @@ } ] }, - "tool": { - "type": "CHOICE", - "members": [ - { - "type": "STRING", - "value": "random" - }, - { - "type": "STRING", - "value": "random_boolean" - }, - { - "type": "STRING", - "value": "random_integer" - }, - { - "type": "STRING", - "value": "random_string" - }, - { - "type": "STRING", - "value": "random_float" - } - ] - }, - "operator": { - "type": "CHOICE", - "members": [ - { - "type": "STRING", - "value": "=" - }, - { - "type": "STRING", - "value": "-" - }, - { - "type": "STRING", - "value": "+" - }, - { - "type": "STRING", - "value": "/" - }, - { - "type": "STRING", - "value": "|" - }, - { - "type": "STRING", - "value": "&" - }, - { - "type": "STRING", - "value": ";" - }, - { - "type": "STRING", - "value": "->" - } - ] - }, "float": { "type": "PATTERN", "value": "\\d+\\.\\d*" @@ -151,7 +112,7 @@ }, "string": { "type": "PATTERN", - "value": "(\"|')(.*?)(\"|')" + "value": "(\"|'|`)(.*?)(\"|'|`)" }, "function": { "type": "PATTERN", @@ -210,6 +171,40 @@ "value": ")" } ] + }, + "operator": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "+" + }, + { + "type": "STRING", + "value": "-" + }, + { + "type": "SYMBOL", + "name": "assignment" + } + ] + }, + "assignment": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "=" + }, + { + "type": "STRING", + "value": "+=" + }, + { + "type": "STRING", + "value": "-=" + } + ] } }, "extras": [ diff --git a/src/node-types.json b/src/node-types.json index 571f1ef..bee1273 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -1,11 +1,11 @@ [ { - "type": "boolean", + "type": "assignment", "named": true, "fields": {} }, { - "type": "comment", + "type": "boolean", "named": true, "fields": {} }, @@ -27,7 +27,17 @@ { "type": "operator", "named": true, - "fields": {} + "fields": {}, + "children": { + "multiple": false, + "required": false, + "types": [ + { + "type": "assignment", + "named": true + } + ] + } }, { "type": "source", @@ -38,7 +48,22 @@ "required": false, "types": [ { - "type": "comment", + "type": "statement", + "named": true + } + ] + } + }, + { + "type": "statement", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "close", "named": true }, { @@ -50,7 +75,7 @@ "named": true }, { - "type": "tool", + "type": "statement", "named": true }, { @@ -60,11 +85,6 @@ ] } }, - { - "type": "tool", - "named": true, - "fields": {} - }, { "type": "value", "named": true, @@ -104,14 +124,6 @@ ] } }, - { - "type": "#", - "named": false - }, - { - "type": "&", - "named": false - }, { "type": "(", "named": false @@ -124,6 +136,10 @@ "type": "+", "named": false }, + { + "type": "+=", + "named": false + }, { "type": ",", "named": false @@ -133,21 +149,17 @@ "named": false }, { - "type": "->", - "named": false - }, - { - "type": "/", - "named": false - }, - { - "type": ";", + "type": "-=", "named": false }, { "type": "=", "named": false }, + { + "type": "close", + "named": true + }, { "type": "empty", "named": true @@ -172,26 +184,6 @@ "type": "integer", "named": true }, - { - "type": "random", - "named": false - }, - { - "type": "random_boolean", - "named": false - }, - { - "type": "random_float", - "named": false - }, - { - "type": "random_integer", - "named": false - }, - { - "type": "random_string", - "named": false - }, { "type": "string", "named": true @@ -199,9 +191,5 @@ { "type": "true", "named": false - }, - { - "type": "|", - "named": false } ] \ No newline at end of file diff --git a/src/parser.c b/src/parser.c index 8c45941..93ab51b 100644 --- a/src/parser.c +++ b/src/parser.c @@ -6,72 +6,49 @@ #endif #define LANGUAGE_VERSION 14 -#define STATE_COUNT 22 -#define LARGE_STATE_COUNT 10 -#define SYMBOL_COUNT 36 +#define STATE_COUNT 20 +#define LARGE_STATE_COUNT 4 +#define SYMBOL_COUNT 27 #define ALIAS_COUNT 0 -#define TOKEN_COUNT 27 +#define TOKEN_COUNT 18 #define EXTERNAL_TOKEN_COUNT 0 #define FIELD_COUNT 0 #define MAX_ALIAS_SEQUENCE_LENGTH 3 #define PRODUCTION_ID_COUNT 1 enum { - anon_sym_POUND = 1, - aux_sym_comment_token1 = 2, - sym_identifier = 3, - anon_sym_random = 4, - anon_sym_random_boolean = 5, - anon_sym_random_integer = 6, - anon_sym_random_string = 7, - anon_sym_random_float = 8, - anon_sym_EQ = 9, - anon_sym_DASH = 10, - anon_sym_PLUS = 11, - anon_sym_SLASH = 12, - anon_sym_PIPE = 13, - anon_sym_AMP = 14, - anon_sym_SEMI = 15, - anon_sym_DASH_GT = 16, - sym_float = 17, - sym_integer = 18, - sym_string = 19, - sym_function = 20, - sym_empty = 21, - anon_sym_true = 22, - anon_sym_false = 23, - anon_sym_LPAREN = 24, - anon_sym_COMMA = 25, - anon_sym_RPAREN = 26, - sym_source = 27, - sym_comment = 28, - sym_value = 29, - sym_tool = 30, - sym_operator = 31, - sym_boolean = 32, - sym_list = 33, - aux_sym_source_repeat1 = 34, - aux_sym_list_repeat1 = 35, + sym_close = 1, + sym_identifier = 2, + sym_float = 3, + sym_integer = 4, + sym_string = 5, + sym_function = 6, + sym_empty = 7, + anon_sym_true = 8, + anon_sym_false = 9, + anon_sym_LPAREN = 10, + anon_sym_COMMA = 11, + anon_sym_RPAREN = 12, + anon_sym_PLUS = 13, + anon_sym_DASH = 14, + anon_sym_EQ = 15, + anon_sym_PLUS_EQ = 16, + anon_sym_DASH_EQ = 17, + sym_source = 18, + sym_statement = 19, + sym_value = 20, + sym_boolean = 21, + sym_list = 22, + sym_operator = 23, + sym_assignment = 24, + aux_sym_source_repeat1 = 25, + aux_sym_list_repeat1 = 26, }; static const char * const ts_symbol_names[] = { [ts_builtin_sym_end] = "end", - [anon_sym_POUND] = "#", - [aux_sym_comment_token1] = "comment_token1", + [sym_close] = "close", [sym_identifier] = "identifier", - [anon_sym_random] = "random", - [anon_sym_random_boolean] = "random_boolean", - [anon_sym_random_integer] = "random_integer", - [anon_sym_random_string] = "random_string", - [anon_sym_random_float] = "random_float", - [anon_sym_EQ] = "=", - [anon_sym_DASH] = "-", - [anon_sym_PLUS] = "+", - [anon_sym_SLASH] = "/", - [anon_sym_PIPE] = "|", - [anon_sym_AMP] = "&", - [anon_sym_SEMI] = ";", - [anon_sym_DASH_GT] = "->", [sym_float] = "float", [sym_integer] = "integer", [sym_string] = "string", @@ -82,35 +59,26 @@ static const char * const ts_symbol_names[] = { [anon_sym_LPAREN] = "(", [anon_sym_COMMA] = ",", [anon_sym_RPAREN] = ")", + [anon_sym_PLUS] = "+", + [anon_sym_DASH] = "-", + [anon_sym_EQ] = "=", + [anon_sym_PLUS_EQ] = "+=", + [anon_sym_DASH_EQ] = "-=", [sym_source] = "source", - [sym_comment] = "comment", + [sym_statement] = "statement", [sym_value] = "value", - [sym_tool] = "tool", - [sym_operator] = "operator", [sym_boolean] = "boolean", [sym_list] = "list", + [sym_operator] = "operator", + [sym_assignment] = "assignment", [aux_sym_source_repeat1] = "source_repeat1", [aux_sym_list_repeat1] = "list_repeat1", }; static const TSSymbol ts_symbol_map[] = { [ts_builtin_sym_end] = ts_builtin_sym_end, - [anon_sym_POUND] = anon_sym_POUND, - [aux_sym_comment_token1] = aux_sym_comment_token1, + [sym_close] = sym_close, [sym_identifier] = sym_identifier, - [anon_sym_random] = anon_sym_random, - [anon_sym_random_boolean] = anon_sym_random_boolean, - [anon_sym_random_integer] = anon_sym_random_integer, - [anon_sym_random_string] = anon_sym_random_string, - [anon_sym_random_float] = anon_sym_random_float, - [anon_sym_EQ] = anon_sym_EQ, - [anon_sym_DASH] = anon_sym_DASH, - [anon_sym_PLUS] = anon_sym_PLUS, - [anon_sym_SLASH] = anon_sym_SLASH, - [anon_sym_PIPE] = anon_sym_PIPE, - [anon_sym_AMP] = anon_sym_AMP, - [anon_sym_SEMI] = anon_sym_SEMI, - [anon_sym_DASH_GT] = anon_sym_DASH_GT, [sym_float] = sym_float, [sym_integer] = sym_integer, [sym_string] = sym_string, @@ -121,13 +89,18 @@ static const TSSymbol ts_symbol_map[] = { [anon_sym_LPAREN] = anon_sym_LPAREN, [anon_sym_COMMA] = anon_sym_COMMA, [anon_sym_RPAREN] = anon_sym_RPAREN, + [anon_sym_PLUS] = anon_sym_PLUS, + [anon_sym_DASH] = anon_sym_DASH, + [anon_sym_EQ] = anon_sym_EQ, + [anon_sym_PLUS_EQ] = anon_sym_PLUS_EQ, + [anon_sym_DASH_EQ] = anon_sym_DASH_EQ, [sym_source] = sym_source, - [sym_comment] = sym_comment, + [sym_statement] = sym_statement, [sym_value] = sym_value, - [sym_tool] = sym_tool, - [sym_operator] = sym_operator, [sym_boolean] = sym_boolean, [sym_list] = sym_list, + [sym_operator] = sym_operator, + [sym_assignment] = sym_assignment, [aux_sym_source_repeat1] = aux_sym_source_repeat1, [aux_sym_list_repeat1] = aux_sym_list_repeat1, }; @@ -137,70 +110,14 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = false, .named = true, }, - [anon_sym_POUND] = { + [sym_close] = { .visible = true, - .named = false, - }, - [aux_sym_comment_token1] = { - .visible = false, - .named = false, + .named = true, }, [sym_identifier] = { .visible = true, .named = true, }, - [anon_sym_random] = { - .visible = true, - .named = false, - }, - [anon_sym_random_boolean] = { - .visible = true, - .named = false, - }, - [anon_sym_random_integer] = { - .visible = true, - .named = false, - }, - [anon_sym_random_string] = { - .visible = true, - .named = false, - }, - [anon_sym_random_float] = { - .visible = true, - .named = false, - }, - [anon_sym_EQ] = { - .visible = true, - .named = false, - }, - [anon_sym_DASH] = { - .visible = true, - .named = false, - }, - [anon_sym_PLUS] = { - .visible = true, - .named = false, - }, - [anon_sym_SLASH] = { - .visible = true, - .named = false, - }, - [anon_sym_PIPE] = { - .visible = true, - .named = false, - }, - [anon_sym_AMP] = { - .visible = true, - .named = false, - }, - [anon_sym_SEMI] = { - .visible = true, - .named = false, - }, - [anon_sym_DASH_GT] = { - .visible = true, - .named = false, - }, [sym_float] = { .visible = true, .named = true, @@ -241,11 +158,31 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = false, }, + [anon_sym_PLUS] = { + .visible = true, + .named = false, + }, + [anon_sym_DASH] = { + .visible = true, + .named = false, + }, + [anon_sym_EQ] = { + .visible = true, + .named = false, + }, + [anon_sym_PLUS_EQ] = { + .visible = true, + .named = false, + }, + [anon_sym_DASH_EQ] = { + .visible = true, + .named = false, + }, [sym_source] = { .visible = true, .named = true, }, - [sym_comment] = { + [sym_statement] = { .visible = true, .named = true, }, @@ -253,14 +190,6 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, - [sym_tool] = { - .visible = true, - .named = true, - }, - [sym_operator] = { - .visible = true, - .named = true, - }, [sym_boolean] = { .visible = true, .named = true, @@ -269,6 +198,14 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, + [sym_operator] = { + .visible = true, + .named = true, + }, + [sym_assignment] = { + .visible = true, + .named = true, + }, [aux_sym_source_repeat1] = { .visible = false, .named = false, @@ -300,16 +237,14 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [9] = 9, [10] = 10, [11] = 11, - [12] = 10, + [12] = 12, [13] = 13, - [14] = 13, + [14] = 14, [15] = 15, - [16] = 5, - [17] = 6, - [18] = 9, + [16] = 16, + [17] = 17, + [18] = 18, [19] = 19, - [20] = 20, - [21] = 21, }; static bool ts_lex(TSLexer *lexer, TSStateId state) { @@ -319,40 +254,35 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { case 0: if (eof) ADVANCE(11); if (lookahead == '"' || - lookahead == '\'') ADVANCE(10); - if (lookahead == '#') ADVANCE(12); - if (lookahead == '&') ADVANCE(61); - if (lookahead == '(') ADVANCE(73); - if (lookahead == ')') ADVANCE(75); - if (lookahead == '+') ADVANCE(58); - if (lookahead == ',') ADVANCE(74); - if (lookahead == '-') ADVANCE(57); - if (lookahead == '/') ADVANCE(59); - if (lookahead == ';') ADVANCE(62); - if (lookahead == '=') ADVANCE(56); - if (lookahead == 'f') ADVANCE(15); - if (lookahead == 'r') ADVANCE(16); - if (lookahead == 't') ADVANCE(41); + lookahead == '\'' || + lookahead == '`') ADVANCE(10); + if (lookahead == '(') ADVANCE(31); + if (lookahead == ')') ADVANCE(33); + if (lookahead == '+') ADVANCE(34); + if (lookahead == ',') ADVANCE(32); + if (lookahead == '-') ADVANCE(35); + if (lookahead == ';') ADVANCE(12); + if (lookahead == '=') ADVANCE(36); + if (lookahead == 'f') ADVANCE(13); + if (lookahead == 't') ADVANCE(17); if (lookahead == '{') ADVANCE(8); - if (lookahead == '|') ADVANCE(60); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') SKIP(0) - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(65); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(23); if (lookahead == '.' || ('A' <= lookahead && lookahead <= 'Z') || - lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(50); + ('_' <= lookahead && lookahead <= '|')) ADVANCE(21); END_STATE(); case 1: if (lookahead == 'a') ADVANCE(4); END_STATE(); case 2: - if (lookahead == 'e') ADVANCE(69); + if (lookahead == 'e') ADVANCE(27); END_STATE(); case 3: - if (lookahead == 'e') ADVANCE(71); + if (lookahead == 'e') ADVANCE(29); END_STATE(); case 4: if (lookahead == 'l') ADVANCE(6); @@ -367,16 +297,18 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (lookahead == 'u') ADVANCE(2); END_STATE(); case 8: - if (lookahead == '}') ADVANCE(67); + if (lookahead == '}') ADVANCE(25); if (lookahead != 0 && lookahead != '\n') ADVANCE(8); END_STATE(); case 9: if (lookahead == '"' || - lookahead == '\'') ADVANCE(10); - if (lookahead == '(') ADVANCE(73); - if (lookahead == ')') ADVANCE(75); - if (lookahead == ',') ADVANCE(74); + lookahead == '\'' || + lookahead == '`') ADVANCE(10); + if (lookahead == '(') ADVANCE(31); + if (lookahead == ')') ADVANCE(33); + if (lookahead == ',') ADVANCE(32); + if (lookahead == ';') ADVANCE(12); if (lookahead == 'f') ADVANCE(1); if (lookahead == 't') ADVANCE(5); if (lookahead == '{') ADVANCE(8); @@ -384,11 +316,12 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead == '\n' || lookahead == '\r' || lookahead == ' ') SKIP(9) - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(65); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(23); END_STATE(); case 10: if (lookahead == '"' || - lookahead == '\'') ADVANCE(66); + lookahead == '\'' || + lookahead == '`') ADVANCE(24); if (lookahead != 0 && lookahead != '\n') ADVANCE(10); END_STATE(); @@ -396,473 +329,162 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { ACCEPT_TOKEN(ts_builtin_sym_end); END_STATE(); case 12: - ACCEPT_TOKEN(anon_sym_POUND); + ACCEPT_TOKEN(sym_close); END_STATE(); case 13: - ACCEPT_TOKEN(aux_sym_comment_token1); - if (lookahead == '\t' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(13); - if (lookahead != 0 && - lookahead != '\n') ADVANCE(14); + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(20); + if (lookahead == 'a') ADVANCE(16); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('b' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(21); END_STATE(); case 14: - ACCEPT_TOKEN(aux_sym_comment_token1); - if (lookahead != 0 && - lookahead != '\n') ADVANCE(14); + ACCEPT_TOKEN(sym_identifier); + if (lookahead == '_') ADVANCE(20); + if (lookahead == 'e') ADVANCE(28); + if (lookahead == '.' || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(21); END_STATE(); case 15: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'a') ADVANCE(29); + if (lookahead == '_') ADVANCE(20); + if (lookahead == 'e') ADVANCE(30); if (lookahead == '.' || ('A' <= lookahead && lookahead <= 'Z') || - ('b' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(50); + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(21); END_STATE(); case 16: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'a') ADVANCE(33); + if (lookahead == '_') ADVANCE(20); + if (lookahead == 'l') ADVANCE(18); if (lookahead == '.' || ('A' <= lookahead && lookahead <= 'Z') || - ('b' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(50); + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(21); END_STATE(); case 17: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'a') ADVANCE(34); + if (lookahead == '_') ADVANCE(20); + if (lookahead == 'r') ADVANCE(19); if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('b' <= lookahead && lookahead <= 'z')) ADVANCE(49); + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(21); END_STATE(); case 18: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'a') ADVANCE(47); + if (lookahead == '_') ADVANCE(20); + if (lookahead == 's') ADVANCE(15); if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('b' <= lookahead && lookahead <= 'z')) ADVANCE(49); + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(21); END_STATE(); case 19: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'b') ADVANCE(39); - if (lookahead == 'f') ADVANCE(31); - if (lookahead == 'i') ADVANCE(35); - if (lookahead == 's') ADVANCE(45); + if (lookahead == '_') ADVANCE(20); + if (lookahead == 'u') ADVANCE(14); if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z') || + lookahead == '|') ADVANCE(21); END_STATE(); case 20: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'd') ADVANCE(37); + if (lookahead == '_') ADVANCE(20); if (lookahead == '.' || - ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(50); + lookahead == '|') ADVANCE(21); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(20); END_STATE(); case 21: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'e') ADVANCE(70); + if (lookahead == '_') ADVANCE(20); if (lookahead == '.' || ('A' <= lookahead && lookahead <= 'Z') || ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(50); + lookahead == '|') ADVANCE(21); END_STATE(); case 22: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'e') ADVANCE(72); - if (lookahead == '.' || - ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(50); + ACCEPT_TOKEN(sym_float); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(22); END_STATE(); case 23: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'e') ADVANCE(27); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); + ACCEPT_TOKEN(sym_integer); + if (lookahead == '.') ADVANCE(22); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(23); END_STATE(); case 24: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'e') ADVANCE(43); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); - END_STATE(); - case 25: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'e') ADVANCE(17); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); - END_STATE(); - case 26: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'g') ADVANCE(54); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); - END_STATE(); - case 27: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'g') ADVANCE(24); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); - END_STATE(); - case 28: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'i') ADVANCE(36); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); - END_STATE(); - case 29: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'l') ADVANCE(44); - if (lookahead == '.' || - ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(50); - END_STATE(); - case 30: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'l') ADVANCE(25); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); - END_STATE(); - case 31: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'l') ADVANCE(38); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); - END_STATE(); - case 32: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'm') ADVANCE(51); - if (lookahead == '.' || - ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(50); - END_STATE(); - case 33: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'n') ADVANCE(20); - if (lookahead == '.' || - ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(50); - END_STATE(); - case 34: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'n') ADVANCE(52); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); - END_STATE(); - case 35: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'n') ADVANCE(46); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); - END_STATE(); - case 36: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'n') ADVANCE(26); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); - END_STATE(); - case 37: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'o') ADVANCE(32); - if (lookahead == '.' || - ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(50); - END_STATE(); - case 38: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'o') ADVANCE(18); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); - END_STATE(); - case 39: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'o') ADVANCE(40); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); - END_STATE(); - case 40: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'o') ADVANCE(30); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); - END_STATE(); - case 41: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'r') ADVANCE(48); - if (lookahead == '.' || - ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(50); - END_STATE(); - case 42: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'r') ADVANCE(28); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); - END_STATE(); - case 43: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'r') ADVANCE(53); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); - END_STATE(); - case 44: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 's') ADVANCE(22); - if (lookahead == '.' || - ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(50); - END_STATE(); - case 45: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 't') ADVANCE(42); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); - END_STATE(); - case 46: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 't') ADVANCE(23); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); - END_STATE(); - case 47: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 't') ADVANCE(55); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); - END_STATE(); - case 48: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == 'u') ADVANCE(21); - if (lookahead == '.' || - ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(50); - END_STATE(); - case 49: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); - END_STATE(); - case 50: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '_') ADVANCE(49); - if (lookahead == '.' || - ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(50); - END_STATE(); - case 51: - ACCEPT_TOKEN(anon_sym_random); - if (lookahead == '_') ADVANCE(19); - if (lookahead == '.' || - ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(50); - END_STATE(); - case 52: - ACCEPT_TOKEN(anon_sym_random_boolean); - if (lookahead == '_') ADVANCE(49); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); - END_STATE(); - case 53: - ACCEPT_TOKEN(anon_sym_random_integer); - if (lookahead == '_') ADVANCE(49); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); - END_STATE(); - case 54: - ACCEPT_TOKEN(anon_sym_random_string); - if (lookahead == '_') ADVANCE(49); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); - END_STATE(); - case 55: - ACCEPT_TOKEN(anon_sym_random_float); - if (lookahead == '_') ADVANCE(49); - if (lookahead == '.' || - lookahead == '|') ADVANCE(50); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(49); - END_STATE(); - case 56: - ACCEPT_TOKEN(anon_sym_EQ); - END_STATE(); - case 57: - ACCEPT_TOKEN(anon_sym_DASH); - if (lookahead == '>') ADVANCE(63); - END_STATE(); - case 58: - ACCEPT_TOKEN(anon_sym_PLUS); - END_STATE(); - case 59: - ACCEPT_TOKEN(anon_sym_SLASH); - END_STATE(); - case 60: - ACCEPT_TOKEN(anon_sym_PIPE); - if (lookahead == '_') ADVANCE(49); - if (lookahead == '.' || - ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(50); - END_STATE(); - case 61: - ACCEPT_TOKEN(anon_sym_AMP); - END_STATE(); - case 62: - ACCEPT_TOKEN(anon_sym_SEMI); - END_STATE(); - case 63: - ACCEPT_TOKEN(anon_sym_DASH_GT); - END_STATE(); - case 64: - ACCEPT_TOKEN(sym_float); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(64); - END_STATE(); - case 65: - ACCEPT_TOKEN(sym_integer); - if (lookahead == '.') ADVANCE(64); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(65); - END_STATE(); - case 66: ACCEPT_TOKEN(sym_string); if (lookahead == '"' || - lookahead == '\'') ADVANCE(66); + lookahead == '\'' || + lookahead == '`') ADVANCE(24); if (lookahead != 0 && lookahead != '\n') ADVANCE(10); END_STATE(); - case 67: + case 25: ACCEPT_TOKEN(sym_function); - if (lookahead == '}') ADVANCE(67); + if (lookahead == '}') ADVANCE(25); if (lookahead != 0 && lookahead != '\n') ADVANCE(8); END_STATE(); - case 68: + case 26: ACCEPT_TOKEN(sym_empty); END_STATE(); - case 69: + case 27: ACCEPT_TOKEN(anon_sym_true); END_STATE(); - case 70: + case 28: ACCEPT_TOKEN(anon_sym_true); - if (lookahead == '_') ADVANCE(49); + if (lookahead == '_') ADVANCE(20); if (lookahead == '.' || ('A' <= lookahead && lookahead <= 'Z') || ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(50); + lookahead == '|') ADVANCE(21); END_STATE(); - case 71: + case 29: ACCEPT_TOKEN(anon_sym_false); END_STATE(); - case 72: + case 30: ACCEPT_TOKEN(anon_sym_false); - if (lookahead == '_') ADVANCE(49); + if (lookahead == '_') ADVANCE(20); if (lookahead == '.' || ('A' <= lookahead && lookahead <= 'Z') || ('a' <= lookahead && lookahead <= 'z') || - lookahead == '|') ADVANCE(50); + lookahead == '|') ADVANCE(21); END_STATE(); - case 73: + case 31: ACCEPT_TOKEN(anon_sym_LPAREN); - if (lookahead == ')') ADVANCE(68); + if (lookahead == ')') ADVANCE(26); END_STATE(); - case 74: + case 32: ACCEPT_TOKEN(anon_sym_COMMA); END_STATE(); - case 75: + case 33: ACCEPT_TOKEN(anon_sym_RPAREN); END_STATE(); + case 34: + ACCEPT_TOKEN(anon_sym_PLUS); + if (lookahead == '=') ADVANCE(37); + END_STATE(); + case 35: + ACCEPT_TOKEN(anon_sym_DASH); + if (lookahead == '=') ADVANCE(38); + END_STATE(); + case 36: + ACCEPT_TOKEN(anon_sym_EQ); + END_STATE(); + case 37: + ACCEPT_TOKEN(anon_sym_PLUS_EQ); + END_STATE(); + case 38: + ACCEPT_TOKEN(anon_sym_DASH_EQ); + END_STATE(); default: return false; } @@ -874,43 +496,28 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [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}, + [5] = {.lex_state = 9}, + [6] = {.lex_state = 9}, + [7] = {.lex_state = 9}, + [8] = {.lex_state = 9}, + [9] = {.lex_state = 9}, [10] = {.lex_state = 9}, - [11] = {.lex_state = 9}, + [11] = {.lex_state = 0}, [12] = {.lex_state = 9}, - [13] = {.lex_state = 9}, - [14] = {.lex_state = 9}, - [15] = {.lex_state = 9}, + [13] = {.lex_state = 0}, + [14] = {.lex_state = 0}, + [15] = {.lex_state = 0}, [16] = {.lex_state = 9}, - [17] = {.lex_state = 9}, - [18] = {.lex_state = 9}, - [19] = {.lex_state = 9}, - [20] = {.lex_state = 0}, - [21] = {.lex_state = 13}, + [17] = {.lex_state = 0}, + [18] = {.lex_state = 0}, + [19] = {.lex_state = 0}, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [0] = { [ts_builtin_sym_end] = ACTIONS(1), - [anon_sym_POUND] = ACTIONS(1), + [sym_close] = ACTIONS(1), [sym_identifier] = ACTIONS(1), - [anon_sym_random] = ACTIONS(1), - [anon_sym_random_boolean] = ACTIONS(1), - [anon_sym_random_integer] = ACTIONS(1), - [anon_sym_random_string] = ACTIONS(1), - [anon_sym_random_float] = ACTIONS(1), - [anon_sym_EQ] = ACTIONS(1), - [anon_sym_DASH] = ACTIONS(1), - [anon_sym_PLUS] = ACTIONS(1), - [anon_sym_SLASH] = ACTIONS(1), - [anon_sym_PIPE] = ACTIONS(1), - [anon_sym_AMP] = ACTIONS(1), - [anon_sym_SEMI] = ACTIONS(1), - [anon_sym_DASH_GT] = ACTIONS(1), [sym_float] = ACTIONS(1), [sym_integer] = ACTIONS(1), [sym_string] = ACTIONS(1), @@ -921,391 +528,187 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_LPAREN] = ACTIONS(1), [anon_sym_COMMA] = ACTIONS(1), [anon_sym_RPAREN] = ACTIONS(1), + [anon_sym_PLUS] = ACTIONS(1), + [anon_sym_DASH] = ACTIONS(1), + [anon_sym_EQ] = ACTIONS(1), + [anon_sym_PLUS_EQ] = ACTIONS(1), + [anon_sym_DASH_EQ] = ACTIONS(1), }, [1] = { - [sym_source] = STATE(20), - [sym_comment] = STATE(2), - [sym_value] = STATE(2), - [sym_tool] = STATE(2), - [sym_operator] = STATE(2), - [sym_boolean] = STATE(5), - [sym_list] = STATE(5), + [sym_source] = STATE(18), + [sym_statement] = STATE(2), + [sym_value] = STATE(19), + [sym_boolean] = STATE(8), + [sym_list] = STATE(8), [aux_sym_source_repeat1] = STATE(2), [ts_builtin_sym_end] = ACTIONS(3), - [anon_sym_POUND] = ACTIONS(5), - [sym_identifier] = ACTIONS(7), - [anon_sym_random] = ACTIONS(9), - [anon_sym_random_boolean] = ACTIONS(9), - [anon_sym_random_integer] = ACTIONS(9), - [anon_sym_random_string] = ACTIONS(9), - [anon_sym_random_float] = ACTIONS(9), - [anon_sym_EQ] = ACTIONS(11), - [anon_sym_DASH] = ACTIONS(13), - [anon_sym_PLUS] = ACTIONS(11), - [anon_sym_SLASH] = ACTIONS(11), - [anon_sym_PIPE] = ACTIONS(13), - [anon_sym_AMP] = ACTIONS(11), - [anon_sym_SEMI] = ACTIONS(11), - [anon_sym_DASH_GT] = ACTIONS(11), - [sym_float] = ACTIONS(15), - [sym_integer] = ACTIONS(17), - [sym_string] = ACTIONS(15), - [sym_function] = ACTIONS(15), - [sym_empty] = ACTIONS(15), - [anon_sym_true] = ACTIONS(19), - [anon_sym_false] = ACTIONS(19), - [anon_sym_LPAREN] = ACTIONS(21), + [sym_identifier] = ACTIONS(5), + [sym_float] = ACTIONS(7), + [sym_integer] = ACTIONS(9), + [sym_string] = ACTIONS(7), + [sym_function] = ACTIONS(7), + [sym_empty] = ACTIONS(7), + [anon_sym_true] = ACTIONS(11), + [anon_sym_false] = ACTIONS(11), + [anon_sym_LPAREN] = ACTIONS(13), }, [2] = { - [sym_comment] = STATE(3), - [sym_value] = STATE(3), - [sym_tool] = STATE(3), - [sym_operator] = STATE(3), - [sym_boolean] = STATE(5), - [sym_list] = STATE(5), + [sym_statement] = STATE(3), + [sym_value] = STATE(19), + [sym_boolean] = STATE(8), + [sym_list] = STATE(8), [aux_sym_source_repeat1] = STATE(3), - [ts_builtin_sym_end] = ACTIONS(23), - [anon_sym_POUND] = ACTIONS(5), - [sym_identifier] = ACTIONS(25), - [anon_sym_random] = ACTIONS(9), - [anon_sym_random_boolean] = ACTIONS(9), - [anon_sym_random_integer] = ACTIONS(9), - [anon_sym_random_string] = ACTIONS(9), - [anon_sym_random_float] = ACTIONS(9), - [anon_sym_EQ] = ACTIONS(11), - [anon_sym_DASH] = ACTIONS(13), - [anon_sym_PLUS] = ACTIONS(11), - [anon_sym_SLASH] = ACTIONS(11), - [anon_sym_PIPE] = ACTIONS(13), - [anon_sym_AMP] = ACTIONS(11), - [anon_sym_SEMI] = ACTIONS(11), - [anon_sym_DASH_GT] = ACTIONS(11), - [sym_float] = ACTIONS(15), - [sym_integer] = ACTIONS(17), - [sym_string] = ACTIONS(15), - [sym_function] = ACTIONS(15), - [sym_empty] = ACTIONS(15), - [anon_sym_true] = ACTIONS(19), - [anon_sym_false] = ACTIONS(19), - [anon_sym_LPAREN] = ACTIONS(21), + [ts_builtin_sym_end] = ACTIONS(15), + [sym_identifier] = ACTIONS(5), + [sym_float] = ACTIONS(7), + [sym_integer] = ACTIONS(9), + [sym_string] = ACTIONS(7), + [sym_function] = ACTIONS(7), + [sym_empty] = ACTIONS(7), + [anon_sym_true] = ACTIONS(11), + [anon_sym_false] = ACTIONS(11), + [anon_sym_LPAREN] = ACTIONS(13), }, [3] = { - [sym_comment] = STATE(3), - [sym_value] = STATE(3), - [sym_tool] = STATE(3), - [sym_operator] = STATE(3), - [sym_boolean] = STATE(5), - [sym_list] = STATE(5), + [sym_statement] = STATE(3), + [sym_value] = STATE(19), + [sym_boolean] = STATE(8), + [sym_list] = STATE(8), [aux_sym_source_repeat1] = STATE(3), - [ts_builtin_sym_end] = ACTIONS(27), - [anon_sym_POUND] = ACTIONS(29), - [sym_identifier] = ACTIONS(32), - [anon_sym_random] = ACTIONS(35), - [anon_sym_random_boolean] = ACTIONS(35), - [anon_sym_random_integer] = ACTIONS(35), - [anon_sym_random_string] = ACTIONS(35), - [anon_sym_random_float] = ACTIONS(35), - [anon_sym_EQ] = ACTIONS(38), - [anon_sym_DASH] = ACTIONS(41), - [anon_sym_PLUS] = ACTIONS(38), - [anon_sym_SLASH] = ACTIONS(38), - [anon_sym_PIPE] = ACTIONS(41), - [anon_sym_AMP] = ACTIONS(38), - [anon_sym_SEMI] = ACTIONS(38), - [anon_sym_DASH_GT] = ACTIONS(38), - [sym_float] = ACTIONS(44), - [sym_integer] = ACTIONS(47), - [sym_string] = ACTIONS(44), - [sym_function] = ACTIONS(44), - [sym_empty] = ACTIONS(44), - [anon_sym_true] = ACTIONS(50), - [anon_sym_false] = ACTIONS(50), - [anon_sym_LPAREN] = ACTIONS(53), - }, - [4] = { - [ts_builtin_sym_end] = ACTIONS(56), - [anon_sym_POUND] = ACTIONS(56), - [sym_identifier] = ACTIONS(58), - [anon_sym_random] = ACTIONS(58), - [anon_sym_random_boolean] = ACTIONS(58), - [anon_sym_random_integer] = ACTIONS(58), - [anon_sym_random_string] = ACTIONS(58), - [anon_sym_random_float] = ACTIONS(58), - [anon_sym_EQ] = ACTIONS(56), - [anon_sym_DASH] = ACTIONS(58), - [anon_sym_PLUS] = ACTIONS(56), - [anon_sym_SLASH] = ACTIONS(56), - [anon_sym_PIPE] = ACTIONS(58), - [anon_sym_AMP] = ACTIONS(56), - [anon_sym_SEMI] = ACTIONS(56), - [anon_sym_DASH_GT] = ACTIONS(56), - [sym_float] = ACTIONS(56), - [sym_integer] = ACTIONS(58), - [sym_string] = ACTIONS(56), - [sym_function] = ACTIONS(56), - [sym_empty] = ACTIONS(56), - [anon_sym_true] = ACTIONS(58), - [anon_sym_false] = ACTIONS(58), - [anon_sym_LPAREN] = ACTIONS(58), - }, - [5] = { - [ts_builtin_sym_end] = ACTIONS(60), - [anon_sym_POUND] = ACTIONS(60), - [sym_identifier] = ACTIONS(62), - [anon_sym_random] = ACTIONS(62), - [anon_sym_random_boolean] = ACTIONS(62), - [anon_sym_random_integer] = ACTIONS(62), - [anon_sym_random_string] = ACTIONS(62), - [anon_sym_random_float] = ACTIONS(62), - [anon_sym_EQ] = ACTIONS(60), - [anon_sym_DASH] = ACTIONS(62), - [anon_sym_PLUS] = ACTIONS(60), - [anon_sym_SLASH] = ACTIONS(60), - [anon_sym_PIPE] = ACTIONS(62), - [anon_sym_AMP] = ACTIONS(60), - [anon_sym_SEMI] = ACTIONS(60), - [anon_sym_DASH_GT] = ACTIONS(60), - [sym_float] = ACTIONS(60), - [sym_integer] = ACTIONS(62), - [sym_string] = ACTIONS(60), - [sym_function] = ACTIONS(60), - [sym_empty] = ACTIONS(60), - [anon_sym_true] = ACTIONS(62), - [anon_sym_false] = ACTIONS(62), - [anon_sym_LPAREN] = ACTIONS(62), - }, - [6] = { - [ts_builtin_sym_end] = ACTIONS(64), - [anon_sym_POUND] = ACTIONS(64), - [sym_identifier] = ACTIONS(66), - [anon_sym_random] = ACTIONS(66), - [anon_sym_random_boolean] = ACTIONS(66), - [anon_sym_random_integer] = ACTIONS(66), - [anon_sym_random_string] = ACTIONS(66), - [anon_sym_random_float] = ACTIONS(66), - [anon_sym_EQ] = ACTIONS(64), - [anon_sym_DASH] = ACTIONS(66), - [anon_sym_PLUS] = ACTIONS(64), - [anon_sym_SLASH] = ACTIONS(64), - [anon_sym_PIPE] = ACTIONS(66), - [anon_sym_AMP] = ACTIONS(64), - [anon_sym_SEMI] = ACTIONS(64), - [anon_sym_DASH_GT] = ACTIONS(64), - [sym_float] = ACTIONS(64), - [sym_integer] = ACTIONS(66), - [sym_string] = ACTIONS(64), - [sym_function] = ACTIONS(64), - [sym_empty] = ACTIONS(64), - [anon_sym_true] = ACTIONS(66), - [anon_sym_false] = ACTIONS(66), - [anon_sym_LPAREN] = ACTIONS(66), - }, - [7] = { - [ts_builtin_sym_end] = ACTIONS(68), - [anon_sym_POUND] = ACTIONS(68), - [sym_identifier] = ACTIONS(70), - [anon_sym_random] = ACTIONS(70), - [anon_sym_random_boolean] = ACTIONS(70), - [anon_sym_random_integer] = ACTIONS(70), - [anon_sym_random_string] = ACTIONS(70), - [anon_sym_random_float] = ACTIONS(70), - [anon_sym_EQ] = ACTIONS(68), - [anon_sym_DASH] = ACTIONS(70), - [anon_sym_PLUS] = ACTIONS(68), - [anon_sym_SLASH] = ACTIONS(68), - [anon_sym_PIPE] = ACTIONS(70), - [anon_sym_AMP] = ACTIONS(68), - [anon_sym_SEMI] = ACTIONS(68), - [anon_sym_DASH_GT] = ACTIONS(68), - [sym_float] = ACTIONS(68), - [sym_integer] = ACTIONS(70), - [sym_string] = ACTIONS(68), - [sym_function] = ACTIONS(68), - [sym_empty] = ACTIONS(68), - [anon_sym_true] = ACTIONS(70), - [anon_sym_false] = ACTIONS(70), - [anon_sym_LPAREN] = ACTIONS(70), - }, - [8] = { - [ts_builtin_sym_end] = ACTIONS(72), - [anon_sym_POUND] = ACTIONS(72), - [sym_identifier] = ACTIONS(74), - [anon_sym_random] = ACTIONS(74), - [anon_sym_random_boolean] = ACTIONS(74), - [anon_sym_random_integer] = ACTIONS(74), - [anon_sym_random_string] = ACTIONS(74), - [anon_sym_random_float] = ACTIONS(74), - [anon_sym_EQ] = ACTIONS(72), - [anon_sym_DASH] = ACTIONS(74), - [anon_sym_PLUS] = ACTIONS(72), - [anon_sym_SLASH] = ACTIONS(72), - [anon_sym_PIPE] = ACTIONS(74), - [anon_sym_AMP] = ACTIONS(72), - [anon_sym_SEMI] = ACTIONS(72), - [anon_sym_DASH_GT] = ACTIONS(72), - [sym_float] = ACTIONS(72), - [sym_integer] = ACTIONS(74), - [sym_string] = ACTIONS(72), - [sym_function] = ACTIONS(72), - [sym_empty] = ACTIONS(72), - [anon_sym_true] = ACTIONS(74), - [anon_sym_false] = ACTIONS(74), - [anon_sym_LPAREN] = ACTIONS(74), - }, - [9] = { - [ts_builtin_sym_end] = ACTIONS(76), - [anon_sym_POUND] = ACTIONS(76), - [sym_identifier] = ACTIONS(78), - [anon_sym_random] = ACTIONS(78), - [anon_sym_random_boolean] = ACTIONS(78), - [anon_sym_random_integer] = ACTIONS(78), - [anon_sym_random_string] = ACTIONS(78), - [anon_sym_random_float] = ACTIONS(78), - [anon_sym_EQ] = ACTIONS(76), - [anon_sym_DASH] = ACTIONS(78), - [anon_sym_PLUS] = ACTIONS(76), - [anon_sym_SLASH] = ACTIONS(76), - [anon_sym_PIPE] = ACTIONS(78), - [anon_sym_AMP] = ACTIONS(76), - [anon_sym_SEMI] = ACTIONS(76), - [anon_sym_DASH_GT] = ACTIONS(76), - [sym_float] = ACTIONS(76), - [sym_integer] = ACTIONS(78), - [sym_string] = ACTIONS(76), - [sym_function] = ACTIONS(76), - [sym_empty] = ACTIONS(76), - [anon_sym_true] = ACTIONS(78), - [anon_sym_false] = ACTIONS(78), - [anon_sym_LPAREN] = ACTIONS(78), + [ts_builtin_sym_end] = ACTIONS(17), + [sym_identifier] = ACTIONS(19), + [sym_float] = ACTIONS(22), + [sym_integer] = ACTIONS(25), + [sym_string] = ACTIONS(22), + [sym_function] = ACTIONS(22), + [sym_empty] = ACTIONS(22), + [anon_sym_true] = ACTIONS(28), + [anon_sym_false] = ACTIONS(28), + [anon_sym_LPAREN] = ACTIONS(31), }, }; static const uint16_t ts_small_parse_table[] = { [0] = 8, - ACTIONS(82), 1, + ACTIONS(5), 1, + sym_identifier, + ACTIONS(9), 1, sym_integer, - ACTIONS(86), 1, + ACTIONS(13), 1, anon_sym_LPAREN, - ACTIONS(88), 1, - anon_sym_RPAREN, - STATE(11), 1, - aux_sym_list_repeat1, - STATE(15), 1, + STATE(13), 1, + sym_statement, + STATE(19), 1, sym_value, - ACTIONS(84), 2, + ACTIONS(11), 2, anon_sym_true, anon_sym_false, - STATE(16), 2, + STATE(8), 2, sym_boolean, sym_list, - ACTIONS(80), 4, + ACTIONS(7), 4, sym_float, sym_string, sym_function, sym_empty, [30] = 8, - ACTIONS(93), 1, + ACTIONS(9), 1, sym_integer, - ACTIONS(99), 1, + ACTIONS(13), 1, anon_sym_LPAREN, - ACTIONS(102), 1, + ACTIONS(36), 1, anon_sym_RPAREN, - STATE(11), 1, + STATE(6), 1, aux_sym_list_repeat1, - STATE(15), 1, + STATE(12), 1, sym_value, - ACTIONS(96), 2, + ACTIONS(34), 2, anon_sym_true, anon_sym_false, - STATE(16), 2, + STATE(8), 2, sym_boolean, sym_list, - ACTIONS(90), 4, + ACTIONS(7), 4, sym_float, sym_string, sym_function, sym_empty, [60] = 8, - ACTIONS(82), 1, + ACTIONS(41), 1, sym_integer, - ACTIONS(86), 1, + ACTIONS(47), 1, anon_sym_LPAREN, - ACTIONS(104), 1, + ACTIONS(50), 1, anon_sym_RPAREN, - STATE(11), 1, + STATE(6), 1, aux_sym_list_repeat1, - STATE(15), 1, + STATE(12), 1, sym_value, - ACTIONS(84), 2, + ACTIONS(44), 2, anon_sym_true, anon_sym_false, - STATE(16), 2, + STATE(8), 2, sym_boolean, sym_list, - ACTIONS(80), 4, + ACTIONS(38), 4, sym_float, sym_string, sym_function, sym_empty, [90] = 7, - ACTIONS(82), 1, + ACTIONS(9), 1, sym_integer, - ACTIONS(86), 1, + ACTIONS(13), 1, anon_sym_LPAREN, - STATE(10), 1, + STATE(5), 1, aux_sym_list_repeat1, - STATE(15), 1, - sym_value, - ACTIONS(84), 2, - anon_sym_true, - anon_sym_false, - STATE(16), 2, - sym_boolean, - sym_list, - ACTIONS(80), 4, - sym_float, - sym_string, - sym_function, - sym_empty, - [117] = 7, - ACTIONS(82), 1, - sym_integer, - ACTIONS(86), 1, - anon_sym_LPAREN, STATE(12), 1, - aux_sym_list_repeat1, - STATE(15), 1, sym_value, - ACTIONS(84), 2, + ACTIONS(34), 2, anon_sym_true, anon_sym_false, - STATE(16), 2, + STATE(8), 2, sym_boolean, sym_list, - ACTIONS(80), 4, + ACTIONS(7), 4, sym_float, sym_string, sym_function, sym_empty, - [144] = 3, - ACTIONS(110), 1, - anon_sym_COMMA, - ACTIONS(108), 2, + [117] = 2, + ACTIONS(54), 2, sym_integer, anon_sym_LPAREN, - ACTIONS(106), 7, + ACTIONS(52), 9, + sym_close, sym_float, sym_string, sym_function, sym_empty, anon_sym_true, anon_sym_false, + anon_sym_COMMA, anon_sym_RPAREN, - [161] = 2, + [133] = 2, + ACTIONS(58), 2, + sym_integer, + anon_sym_LPAREN, + ACTIONS(56), 9, + sym_close, + sym_float, + sym_string, + sym_function, + sym_empty, + anon_sym_true, + anon_sym_false, + anon_sym_COMMA, + anon_sym_RPAREN, + [149] = 2, ACTIONS(62), 2, sym_integer, anon_sym_LPAREN, - ACTIONS(60), 8, + ACTIONS(60), 9, + sym_close, sym_float, sym_string, sym_function, @@ -1314,121 +717,168 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_false, anon_sym_COMMA, anon_sym_RPAREN, - [176] = 2, - ACTIONS(66), 2, - sym_integer, - anon_sym_LPAREN, - ACTIONS(64), 8, - sym_float, - sym_string, - sym_function, - sym_empty, - anon_sym_true, - anon_sym_false, - anon_sym_COMMA, - anon_sym_RPAREN, - [191] = 2, - ACTIONS(78), 2, - sym_integer, - anon_sym_LPAREN, - ACTIONS(76), 8, - sym_float, - sym_string, - sym_function, - sym_empty, - anon_sym_true, - anon_sym_false, - anon_sym_COMMA, - anon_sym_RPAREN, - [206] = 2, - ACTIONS(112), 2, - sym_integer, - anon_sym_LPAREN, - ACTIONS(102), 7, - sym_float, - sym_string, - sym_function, - sym_empty, - anon_sym_true, - anon_sym_false, - anon_sym_RPAREN, - [220] = 1, - ACTIONS(114), 1, + [165] = 2, + ACTIONS(64), 5, ts_builtin_sym_end, - [224] = 1, - ACTIONS(116), 1, - aux_sym_comment_token1, + sym_float, + sym_string, + sym_function, + sym_empty, + ACTIONS(66), 5, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + [180] = 3, + ACTIONS(72), 1, + anon_sym_COMMA, + ACTIONS(70), 2, + sym_integer, + anon_sym_LPAREN, + ACTIONS(68), 7, + sym_float, + sym_string, + sym_function, + sym_empty, + anon_sym_true, + anon_sym_false, + anon_sym_RPAREN, + [197] = 2, + ACTIONS(74), 5, + ts_builtin_sym_end, + sym_float, + sym_string, + sym_function, + sym_empty, + ACTIONS(76), 5, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + [212] = 2, + ACTIONS(80), 4, + sym_float, + sym_string, + sym_function, + sym_empty, + ACTIONS(78), 5, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + [226] = 2, + ACTIONS(84), 4, + sym_float, + sym_string, + sym_function, + sym_empty, + ACTIONS(82), 5, + sym_identifier, + sym_integer, + anon_sym_true, + anon_sym_false, + anon_sym_LPAREN, + [240] = 2, + ACTIONS(86), 2, + sym_integer, + anon_sym_LPAREN, + ACTIONS(50), 7, + sym_float, + sym_string, + sym_function, + sym_empty, + anon_sym_true, + anon_sym_false, + anon_sym_RPAREN, + [254] = 5, + ACTIONS(88), 1, + sym_close, + STATE(4), 1, + sym_operator, + STATE(14), 1, + sym_assignment, + ACTIONS(90), 2, + anon_sym_PLUS, + anon_sym_DASH, + ACTIONS(92), 3, + anon_sym_EQ, + anon_sym_PLUS_EQ, + anon_sym_DASH_EQ, + [273] = 1, + ACTIONS(94), 1, + ts_builtin_sym_end, + [277] = 1, + ACTIONS(88), 1, + sym_close, }; static const uint32_t ts_small_parse_table_map[] = { - [SMALL_STATE(10)] = 0, - [SMALL_STATE(11)] = 30, - [SMALL_STATE(12)] = 60, - [SMALL_STATE(13)] = 90, - [SMALL_STATE(14)] = 117, - [SMALL_STATE(15)] = 144, - [SMALL_STATE(16)] = 161, - [SMALL_STATE(17)] = 176, - [SMALL_STATE(18)] = 191, - [SMALL_STATE(19)] = 206, - [SMALL_STATE(20)] = 220, - [SMALL_STATE(21)] = 224, + [SMALL_STATE(4)] = 0, + [SMALL_STATE(5)] = 30, + [SMALL_STATE(6)] = 60, + [SMALL_STATE(7)] = 90, + [SMALL_STATE(8)] = 117, + [SMALL_STATE(9)] = 133, + [SMALL_STATE(10)] = 149, + [SMALL_STATE(11)] = 165, + [SMALL_STATE(12)] = 180, + [SMALL_STATE(13)] = 197, + [SMALL_STATE(14)] = 212, + [SMALL_STATE(15)] = 226, + [SMALL_STATE(16)] = 240, + [SMALL_STATE(17)] = 254, + [SMALL_STATE(18)] = 273, + [SMALL_STATE(19)] = 277, }; static const TSParseActionEntry ts_parse_actions[] = { [0] = {.entry = {.count = 0, .reusable = false}}, [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(), [3] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source, 0), - [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), - [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(2), + [5] = {.entry = {.count = 1, .reusable = false}}, SHIFT(17), + [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), [9] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8), - [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), + [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9), [13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(7), - [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), - [17] = {.entry = {.count = 1, .reusable = false}}, SHIFT(5), - [19] = {.entry = {.count = 1, .reusable = false}}, SHIFT(6), - [21] = {.entry = {.count = 1, .reusable = false}}, SHIFT(13), - [23] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source, 1), - [25] = {.entry = {.count = 1, .reusable = false}}, SHIFT(3), - [27] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), - [29] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(21), - [32] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(3), - [35] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(8), - [38] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(7), - [41] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(7), - [44] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(5), - [47] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(5), - [50] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(6), - [53] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(13), - [56] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_comment, 2), - [58] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_comment, 2), - [60] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_value, 1), - [62] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_value, 1), - [64] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_boolean, 1), - [66] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_boolean, 1), - [68] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_operator, 1), - [70] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_operator, 1), - [72] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tool, 1), - [74] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tool, 1), - [76] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_list, 3), - [78] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_list, 3), - [80] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), - [82] = {.entry = {.count = 1, .reusable = false}}, SHIFT(16), - [84] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), - [86] = {.entry = {.count = 1, .reusable = false}}, SHIFT(14), - [88] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), - [90] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(16), - [93] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(16), - [96] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(17), - [99] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(14), - [102] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), - [104] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), - [106] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 1), - [108] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 1), - [110] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), - [112] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), - [114] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), - [116] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), + [15] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source, 1), + [17] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), + [19] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(17), + [22] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(8), + [25] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(8), + [28] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(9), + [31] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(7), + [34] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), + [36] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), + [38] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(8), + [41] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(8), + [44] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(9), + [47] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), SHIFT_REPEAT(7), + [50] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 2), + [52] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_value, 1), + [54] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_value, 1), + [56] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_boolean, 1), + [58] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_boolean, 1), + [60] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_list, 3), + [62] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_list, 3), + [64] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_statement, 2), + [66] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_statement, 2), + [68] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_list_repeat1, 1), + [70] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 1), + [72] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), + [74] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_statement, 3), + [76] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_statement, 3), + [78] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_operator, 1), + [80] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_operator, 1), + [82] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_assignment, 1), + [84] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assignment, 1), + [86] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_list_repeat1, 2), + [88] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), + [90] = {.entry = {.count = 1, .reusable = false}}, SHIFT(14), + [92] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), + [94] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), }; #ifdef __cplusplus