From 58d2c9b42330018b2cc4022ba9c825542a694492 Mon Sep 17 00:00:00 2001 From: Hare Date: Tue, 16 Jun 2026 12:01:29 +0900 Subject: [PATCH] Add Tree-sitter grammar for Decodal --- devshell.nix | 2 + doc/manual/souce/development.md | 91 + doc/manual/souce/index.md | 3 +- editors/tree-sitter-decodal/.editorconfig | 39 + editors/tree-sitter-decodal/.gitattributes | 11 + editors/tree-sitter-decodal/.gitignore | 38 + editors/tree-sitter-decodal/Cargo.toml | 23 + editors/tree-sitter-decodal/Makefile | 112 + editors/tree-sitter-decodal/Package.swift | 47 + editors/tree-sitter-decodal/binding.gyp | 30 + .../bindings/c/tree-sitter-decodal.h | 16 + .../bindings/c/tree-sitter-decodal.pc.in | 11 + .../bindings/go/binding.go | 13 + .../bindings/go/binding_test.go | 15 + .../tree-sitter-decodal/bindings/go/go.mod | 5 + .../bindings/node/binding.cc | 20 + .../bindings/node/index.d.ts | 28 + .../bindings/node/index.js | 7 + .../python/tree_sitter_decodal/__init__.py | 5 + .../python/tree_sitter_decodal/__init__.pyi | 1 + .../python/tree_sitter_decodal/binding.c | 27 + .../python/tree_sitter_decodal/py.typed | 0 .../bindings/rust/build.rs | 22 + .../tree-sitter-decodal/bindings/rust/lib.rs | 54 + .../swift/TreeSitterDecodal/decodal.h | 16 + editors/tree-sitter-decodal/corpus/basic.txt | 76 + editors/tree-sitter-decodal/grammar.js | 186 + editors/tree-sitter-decodal/package-lock.json | 27 + editors/tree-sitter-decodal/package.json | 50 + editors/tree-sitter-decodal/pyproject.toml | 29 + .../queries/highlights.scm | 58 + .../tree-sitter-decodal/queries/locals.scm | 3 + editors/tree-sitter-decodal/setup.py | 60 + editors/tree-sitter-decodal/src/grammar.json | 991 ++++ .../tree-sitter-decodal/src/node-types.json | 1529 ++++++ editors/tree-sitter-decodal/src/parser.c | 4200 +++++++++++++++++ .../src/tree_sitter/alloc.h | 54 + .../src/tree_sitter/array.h | 290 ++ .../src/tree_sitter/parser.h | 265 ++ 39 files changed, 8453 insertions(+), 1 deletion(-) create mode 100644 doc/manual/souce/development.md create mode 100644 editors/tree-sitter-decodal/.editorconfig create mode 100644 editors/tree-sitter-decodal/.gitattributes create mode 100644 editors/tree-sitter-decodal/.gitignore create mode 100644 editors/tree-sitter-decodal/Cargo.toml create mode 100644 editors/tree-sitter-decodal/Makefile create mode 100644 editors/tree-sitter-decodal/Package.swift create mode 100644 editors/tree-sitter-decodal/binding.gyp create mode 100644 editors/tree-sitter-decodal/bindings/c/tree-sitter-decodal.h create mode 100644 editors/tree-sitter-decodal/bindings/c/tree-sitter-decodal.pc.in create mode 100644 editors/tree-sitter-decodal/bindings/go/binding.go create mode 100644 editors/tree-sitter-decodal/bindings/go/binding_test.go create mode 100644 editors/tree-sitter-decodal/bindings/go/go.mod create mode 100644 editors/tree-sitter-decodal/bindings/node/binding.cc create mode 100644 editors/tree-sitter-decodal/bindings/node/index.d.ts create mode 100644 editors/tree-sitter-decodal/bindings/node/index.js create mode 100644 editors/tree-sitter-decodal/bindings/python/tree_sitter_decodal/__init__.py create mode 100644 editors/tree-sitter-decodal/bindings/python/tree_sitter_decodal/__init__.pyi create mode 100644 editors/tree-sitter-decodal/bindings/python/tree_sitter_decodal/binding.c create mode 100644 editors/tree-sitter-decodal/bindings/python/tree_sitter_decodal/py.typed create mode 100644 editors/tree-sitter-decodal/bindings/rust/build.rs create mode 100644 editors/tree-sitter-decodal/bindings/rust/lib.rs create mode 100644 editors/tree-sitter-decodal/bindings/swift/TreeSitterDecodal/decodal.h create mode 100644 editors/tree-sitter-decodal/corpus/basic.txt create mode 100644 editors/tree-sitter-decodal/grammar.js create mode 100644 editors/tree-sitter-decodal/package-lock.json create mode 100644 editors/tree-sitter-decodal/package.json create mode 100644 editors/tree-sitter-decodal/pyproject.toml create mode 100644 editors/tree-sitter-decodal/queries/highlights.scm create mode 100644 editors/tree-sitter-decodal/queries/locals.scm create mode 100644 editors/tree-sitter-decodal/setup.py create mode 100644 editors/tree-sitter-decodal/src/grammar.json create mode 100644 editors/tree-sitter-decodal/src/node-types.json create mode 100644 editors/tree-sitter-decodal/src/parser.c create mode 100644 editors/tree-sitter-decodal/src/tree_sitter/alloc.h create mode 100644 editors/tree-sitter-decodal/src/tree_sitter/array.h create mode 100644 editors/tree-sitter-decodal/src/tree_sitter/parser.h diff --git a/devshell.nix b/devshell.nix index f311596..b1e46b2 100644 --- a/devshell.nix +++ b/devshell.nix @@ -4,9 +4,11 @@ pkgs.mkShell { cargo clippy git + nodejs nixfmt rustc rustfmt + tree-sitter ]; shellHook = '' diff --git a/doc/manual/souce/development.md b/doc/manual/souce/development.md new file mode 100644 index 0000000..94f01a5 --- /dev/null +++ b/doc/manual/souce/development.md @@ -0,0 +1,91 @@ +# Development + +This document describes the development workflow for Decodal itself. + +## Rust checks + +Run the normal Rust checks from the repository root. + +```sh +cargo fmt --check +cargo test +cargo check -p decodal-core --no-default-features +nix flake check +``` + +Regex support is optional and should be tested explicitly when touched. + +```sh +cargo test -p decodal-core --features regex +cargo run -q -p decodal --features regex -- examples/regex/main.dcdl +``` + +## Tree-sitter grammar + +The Tree-sitter grammar is kept in: + +```text +editors/tree-sitter-decodal/ +``` + +Important files: + +```text +editors/tree-sitter-decodal/grammar.js +editors/tree-sitter-decodal/queries/highlights.scm +editors/tree-sitter-decodal/queries/locals.scm +editors/tree-sitter-decodal/corpus/basic.txt +``` + +The grammar is intended to be portable across editors such as Zed, Neovim, Helix, and Emacs. +Zed support should consume this grammar rather than relying on a TextMate grammar. + +## Tree-sitter commands + +From the grammar directory: + +```sh +cd editors/tree-sitter-decodal +npm install +npx tree-sitter generate +npx tree-sitter test +``` + +To inspect a parse tree: + +```sh +npx tree-sitter parse ../../examples/advanced/main.dcdl +``` + +The generated parser files under `editors/tree-sitter-decodal/src/` are committed so editor integrations can consume the grammar without regenerating it first. +`node_modules/` is ignored and must not be committed. + +## Updating the grammar + +When the Decodal syntax changes: + +1. Update `grammar.js`. +2. Run `npx tree-sitter generate`. +3. Add or update corpus tests in `corpus/`. +4. Update highlight queries in `queries/highlights.scm` if token names changed. +5. Run `npx tree-sitter test`. +6. Run Rust checks from the repository root if the language parser or examples also changed. + +## Development shell + +The Nix development shell includes Rust tooling, Node.js, and Tree-sitter CLI tooling. + +```sh +nix develop +``` + +The shell provides: + +- `cargo` +- `rustc` +- `rustfmt` +- `clippy` +- `node` +- `npm` +- `tree-sitter` +- `nixfmt` diff --git a/doc/manual/souce/index.md b/doc/manual/souce/index.md index a67d239..51ca162 100644 --- a/doc/manual/souce/index.md +++ b/doc/manual/souce/index.md @@ -43,4 +43,5 @@ Decodal は Deferred Constraint Data Language、略称 DCDL のプロジェク 5. [Diagnostics and Fallback](./design/diagnostics-and-fallback.md) 6. [Embedding API](./design/embedding-api.md) 7. [Features](./design/features.md) -4. [Open Issues](./open-issues.md) +4. [Development](./development.md) +5. [Open Issues](./open-issues.md) diff --git a/editors/tree-sitter-decodal/.editorconfig b/editors/tree-sitter-decodal/.editorconfig new file mode 100644 index 0000000..d3a8b5b --- /dev/null +++ b/editors/tree-sitter-decodal/.editorconfig @@ -0,0 +1,39 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{json,toml,yml,gyp}] +indent_style = space +indent_size = 2 + +[*.js] +indent_style = space +indent_size = 2 + +[*.rs] +indent_style = space +indent_size = 4 + +[*.{c,cc,h}] +indent_style = space +indent_size = 4 + +[*.{py,pyi}] +indent_style = space +indent_size = 4 + +[*.swift] +indent_style = space +indent_size = 4 + +[*.go] +indent_style = tab +indent_size = 8 + +[Makefile] +indent_style = tab +indent_size = 8 diff --git a/editors/tree-sitter-decodal/.gitattributes b/editors/tree-sitter-decodal/.gitattributes new file mode 100644 index 0000000..ffb52ab --- /dev/null +++ b/editors/tree-sitter-decodal/.gitattributes @@ -0,0 +1,11 @@ +* text eol=lf + +src/*.json linguist-generated +src/parser.c linguist-generated +src/tree_sitter/* linguist-generated + +bindings/** linguist-generated +binding.gyp linguist-generated +setup.py linguist-generated +Makefile linguist-generated +Package.swift linguist-generated diff --git a/editors/tree-sitter-decodal/.gitignore b/editors/tree-sitter-decodal/.gitignore new file mode 100644 index 0000000..27fc43f --- /dev/null +++ b/editors/tree-sitter-decodal/.gitignore @@ -0,0 +1,38 @@ +# Rust artifacts +Cargo.lock +target/ + +# Node artifacts +build/ +prebuilds/ +node_modules/ +*.tgz + +# Swift artifacts +.build/ + +# Go artifacts +go.sum +_obj/ + +# Python artifacts +.venv/ +dist/ +*.egg-info +*.whl + +# C artifacts +*.a +*.so +*.so.* +*.dylib +*.dll +*.pc + +# Example dirs +/examples/*/ + +# Grammar volatiles +*.wasm +*.obj +*.o diff --git a/editors/tree-sitter-decodal/Cargo.toml b/editors/tree-sitter-decodal/Cargo.toml new file mode 100644 index 0000000..92ecffc --- /dev/null +++ b/editors/tree-sitter-decodal/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "tree-sitter-decodal" +description = "Decodal grammar for tree-sitter" +version = "0.0.1" +license = "MIT" +readme = "README.md" +keywords = ["incremental", "parsing", "tree-sitter", "decodal"] +categories = ["parsing", "text-editors"] +repository = "https://github.com/tree-sitter/tree-sitter-decodal" +edition = "2021" +autoexamples = false + +build = "bindings/rust/build.rs" +include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*"] + +[lib] +path = "bindings/rust/lib.rs" + +[dependencies] +tree-sitter = ">=0.22.6" + +[build-dependencies] +cc = "1.0.87" diff --git a/editors/tree-sitter-decodal/Makefile b/editors/tree-sitter-decodal/Makefile new file mode 100644 index 0000000..957c132 --- /dev/null +++ b/editors/tree-sitter-decodal/Makefile @@ -0,0 +1,112 @@ +VERSION := 0.0.1 + +LANGUAGE_NAME := tree-sitter-decodal + +# repository +SRC_DIR := src + +PARSER_REPO_URL := $(shell git -C $(SRC_DIR) remote get-url origin 2>/dev/null) + +ifeq ($(PARSER_URL),) + PARSER_URL := $(subst .git,,$(PARSER_REPO_URL)) +ifeq ($(shell echo $(PARSER_URL) | grep '^[a-z][-+.0-9a-z]*://'),) + PARSER_URL := $(subst :,/,$(PARSER_URL)) + PARSER_URL := $(subst git@,https://,$(PARSER_URL)) +endif +endif + +TS ?= tree-sitter + +# ABI versioning +SONAME_MAJOR := $(word 1,$(subst ., ,$(VERSION))) +SONAME_MINOR := $(word 2,$(subst ., ,$(VERSION))) + +# install directory layout +PREFIX ?= /usr/local +INCLUDEDIR ?= $(PREFIX)/include +LIBDIR ?= $(PREFIX)/lib +PCLIBDIR ?= $(LIBDIR)/pkgconfig + +# source/object files +PARSER := $(SRC_DIR)/parser.c +EXTRAS := $(filter-out $(PARSER),$(wildcard $(SRC_DIR)/*.c)) +OBJS := $(patsubst %.c,%.o,$(PARSER) $(EXTRAS)) + +# flags +ARFLAGS ?= rcs +override CFLAGS += -I$(SRC_DIR) -std=c11 -fPIC + +# OS-specific bits +ifeq ($(OS),Windows_NT) + $(error "Windows is not supported") +else ifeq ($(shell uname),Darwin) + SOEXT = dylib + SOEXTVER_MAJOR = $(SONAME_MAJOR).dylib + SOEXTVER = $(SONAME_MAJOR).$(SONAME_MINOR).dylib + LINKSHARED := $(LINKSHARED)-dynamiclib -Wl, + ifneq ($(ADDITIONAL_LIBS),) + LINKSHARED := $(LINKSHARED)$(ADDITIONAL_LIBS), + endif + LINKSHARED := $(LINKSHARED)-install_name,$(LIBDIR)/lib$(LANGUAGE_NAME).$(SONAME_MAJOR).dylib,-rpath,@executable_path/../Frameworks +else + SOEXT = so + SOEXTVER_MAJOR = so.$(SONAME_MAJOR) + SOEXTVER = so.$(SONAME_MAJOR).$(SONAME_MINOR) + LINKSHARED := $(LINKSHARED)-shared -Wl, + ifneq ($(ADDITIONAL_LIBS),) + LINKSHARED := $(LINKSHARED)$(ADDITIONAL_LIBS) + endif + LINKSHARED := $(LINKSHARED)-soname,lib$(LANGUAGE_NAME).so.$(SONAME_MAJOR) +endif +ifneq ($(filter $(shell uname),FreeBSD NetBSD DragonFly),) + PCLIBDIR := $(PREFIX)/libdata/pkgconfig +endif + +all: lib$(LANGUAGE_NAME).a lib$(LANGUAGE_NAME).$(SOEXT) $(LANGUAGE_NAME).pc + +lib$(LANGUAGE_NAME).a: $(OBJS) + $(AR) $(ARFLAGS) $@ $^ + +lib$(LANGUAGE_NAME).$(SOEXT): $(OBJS) + $(CC) $(LDFLAGS) $(LINKSHARED) $^ $(LDLIBS) -o $@ +ifneq ($(STRIP),) + $(STRIP) $@ +endif + +$(LANGUAGE_NAME).pc: bindings/c/$(LANGUAGE_NAME).pc.in + sed -e 's|@URL@|$(PARSER_URL)|' \ + -e 's|@VERSION@|$(VERSION)|' \ + -e 's|@LIBDIR@|$(LIBDIR)|' \ + -e 's|@INCLUDEDIR@|$(INCLUDEDIR)|' \ + -e 's|@REQUIRES@|$(REQUIRES)|' \ + -e 's|@ADDITIONAL_LIBS@|$(ADDITIONAL_LIBS)|' \ + -e 's|=$(PREFIX)|=$${prefix}|' \ + -e 's|@PREFIX@|$(PREFIX)|' $< > $@ + +$(PARSER): $(SRC_DIR)/grammar.json + $(TS) generate --no-bindings $^ + +install: all + install -d '$(DESTDIR)$(INCLUDEDIR)'/tree_sitter '$(DESTDIR)$(PCLIBDIR)' '$(DESTDIR)$(LIBDIR)' + install -m644 bindings/c/$(LANGUAGE_NAME).h '$(DESTDIR)$(INCLUDEDIR)'/tree_sitter/$(LANGUAGE_NAME).h + install -m644 $(LANGUAGE_NAME).pc '$(DESTDIR)$(PCLIBDIR)'/$(LANGUAGE_NAME).pc + install -m644 lib$(LANGUAGE_NAME).a '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).a + install -m755 lib$(LANGUAGE_NAME).$(SOEXT) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER) + ln -sf lib$(LANGUAGE_NAME).$(SOEXTVER) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER_MAJOR) + ln -sf lib$(LANGUAGE_NAME).$(SOEXTVER_MAJOR) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXT) + +uninstall: + $(RM) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).a \ + '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER) \ + '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER_MAJOR) \ + '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXT) \ + '$(DESTDIR)$(INCLUDEDIR)'/tree_sitter/$(LANGUAGE_NAME).h \ + '$(DESTDIR)$(PCLIBDIR)'/$(LANGUAGE_NAME).pc + +clean: + $(RM) $(OBJS) $(LANGUAGE_NAME).pc lib$(LANGUAGE_NAME).a lib$(LANGUAGE_NAME).$(SOEXT) + +test: + $(TS) test + +.PHONY: all install uninstall clean test diff --git a/editors/tree-sitter-decodal/Package.swift b/editors/tree-sitter-decodal/Package.swift new file mode 100644 index 0000000..048f85a --- /dev/null +++ b/editors/tree-sitter-decodal/Package.swift @@ -0,0 +1,47 @@ +// swift-tools-version:5.3 +import PackageDescription + +let package = Package( + name: "TreeSitterDecodal", + products: [ + .library(name: "TreeSitterDecodal", targets: ["TreeSitterDecodal"]), + ], + dependencies: [], + targets: [ + .target(name: "TreeSitterDecodal", + path: ".", + exclude: [ + "Cargo.toml", + "Makefile", + "binding.gyp", + "bindings/c", + "bindings/go", + "bindings/node", + "bindings/python", + "bindings/rust", + "prebuilds", + "grammar.js", + "package.json", + "package-lock.json", + "pyproject.toml", + "setup.py", + "test", + "examples", + ".editorconfig", + ".github", + ".gitignore", + ".gitattributes", + ".gitmodules", + ], + sources: [ + "src/parser.c", + // NOTE: if your language has an external scanner, add it here. + ], + resources: [ + .copy("queries") + ], + publicHeadersPath: "bindings/swift", + cSettings: [.headerSearchPath("src")]) + ], + cLanguageStandard: .c11 +) diff --git a/editors/tree-sitter-decodal/binding.gyp b/editors/tree-sitter-decodal/binding.gyp new file mode 100644 index 0000000..5e22c71 --- /dev/null +++ b/editors/tree-sitter-decodal/binding.gyp @@ -0,0 +1,30 @@ +{ + "targets": [ + { + "target_name": "tree_sitter_decodal_binding", + "dependencies": [ + " + +typedef struct TSLanguage TSLanguage; + +extern "C" TSLanguage *tree_sitter_decodal(); + +// "tree-sitter", "language" hashed with BLAKE2 +const napi_type_tag LANGUAGE_TYPE_TAG = { + 0x8AF2E5212AD58ABF, 0xD5006CAD83ABBA16 +}; + +Napi::Object Init(Napi::Env env, Napi::Object exports) { + exports["name"] = Napi::String::New(env, "decodal"); + auto language = Napi::External::New(env, tree_sitter_decodal()); + language.TypeTag(&LANGUAGE_TYPE_TAG); + exports["language"] = language; + return exports; +} + +NODE_API_MODULE(tree_sitter_decodal_binding, Init) diff --git a/editors/tree-sitter-decodal/bindings/node/index.d.ts b/editors/tree-sitter-decodal/bindings/node/index.d.ts new file mode 100644 index 0000000..efe259e --- /dev/null +++ b/editors/tree-sitter-decodal/bindings/node/index.d.ts @@ -0,0 +1,28 @@ +type BaseNode = { + type: string; + named: boolean; +}; + +type ChildNode = { + multiple: boolean; + required: boolean; + types: BaseNode[]; +}; + +type NodeInfo = + | (BaseNode & { + subtypes: BaseNode[]; + }) + | (BaseNode & { + fields: { [name: string]: ChildNode }; + children: ChildNode[]; + }); + +type Language = { + name: string; + language: unknown; + nodeTypeInfo: NodeInfo[]; +}; + +declare const language: Language; +export = language; diff --git a/editors/tree-sitter-decodal/bindings/node/index.js b/editors/tree-sitter-decodal/bindings/node/index.js new file mode 100644 index 0000000..6657bcf --- /dev/null +++ b/editors/tree-sitter-decodal/bindings/node/index.js @@ -0,0 +1,7 @@ +const root = require("path").join(__dirname, "..", ".."); + +module.exports = require("node-gyp-build")(root); + +try { + module.exports.nodeTypeInfo = require("../../src/node-types.json"); +} catch (_) {} diff --git a/editors/tree-sitter-decodal/bindings/python/tree_sitter_decodal/__init__.py b/editors/tree-sitter-decodal/bindings/python/tree_sitter_decodal/__init__.py new file mode 100644 index 0000000..44d3bc6 --- /dev/null +++ b/editors/tree-sitter-decodal/bindings/python/tree_sitter_decodal/__init__.py @@ -0,0 +1,5 @@ +"Decodal grammar for tree-sitter" + +from ._binding import language + +__all__ = ["language"] diff --git a/editors/tree-sitter-decodal/bindings/python/tree_sitter_decodal/__init__.pyi b/editors/tree-sitter-decodal/bindings/python/tree_sitter_decodal/__init__.pyi new file mode 100644 index 0000000..5416666 --- /dev/null +++ b/editors/tree-sitter-decodal/bindings/python/tree_sitter_decodal/__init__.pyi @@ -0,0 +1 @@ +def language() -> int: ... diff --git a/editors/tree-sitter-decodal/bindings/python/tree_sitter_decodal/binding.c b/editors/tree-sitter-decodal/bindings/python/tree_sitter_decodal/binding.c new file mode 100644 index 0000000..13b8e44 --- /dev/null +++ b/editors/tree-sitter-decodal/bindings/python/tree_sitter_decodal/binding.c @@ -0,0 +1,27 @@ +#include + +typedef struct TSLanguage TSLanguage; + +TSLanguage *tree_sitter_decodal(void); + +static PyObject* _binding_language(PyObject *self, PyObject *args) { + return PyLong_FromVoidPtr(tree_sitter_decodal()); +} + +static PyMethodDef methods[] = { + {"language", _binding_language, METH_NOARGS, + "Get the tree-sitter language for this grammar."}, + {NULL, NULL, 0, NULL} +}; + +static struct PyModuleDef module = { + .m_base = PyModuleDef_HEAD_INIT, + .m_name = "_binding", + .m_doc = NULL, + .m_size = -1, + .m_methods = methods +}; + +PyMODINIT_FUNC PyInit__binding(void) { + return PyModule_Create(&module); +} diff --git a/editors/tree-sitter-decodal/bindings/python/tree_sitter_decodal/py.typed b/editors/tree-sitter-decodal/bindings/python/tree_sitter_decodal/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/editors/tree-sitter-decodal/bindings/rust/build.rs b/editors/tree-sitter-decodal/bindings/rust/build.rs new file mode 100644 index 0000000..f0947e7 --- /dev/null +++ b/editors/tree-sitter-decodal/bindings/rust/build.rs @@ -0,0 +1,22 @@ +fn main() { + let src_dir = std::path::Path::new("src"); + + let mut c_config = cc::Build::new(); + c_config.std("c11").include(src_dir); + + #[cfg(target_env = "msvc")] + c_config.flag("-utf-8"); + + let parser_path = src_dir.join("parser.c"); + c_config.file(&parser_path); + println!("cargo:rerun-if-changed={}", parser_path.to_str().unwrap()); + + // NOTE: if your language uses an external scanner, uncomment this block: + /* + 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("tree-sitter-decodal"); +} diff --git a/editors/tree-sitter-decodal/bindings/rust/lib.rs b/editors/tree-sitter-decodal/bindings/rust/lib.rs new file mode 100644 index 0000000..c07ac7a --- /dev/null +++ b/editors/tree-sitter-decodal/bindings/rust/lib.rs @@ -0,0 +1,54 @@ +//! This crate provides Decodal 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 = r#" +//! "#; +//! let mut parser = tree_sitter::Parser::new(); +//! parser.set_language(&tree_sitter_decodal::language()).expect("Error loading Decodal grammar"); +//! let tree = parser.parse(code, None).unwrap(); +//! assert!(!tree.root_node().has_error()); +//! ``` +//! +//! [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_decodal() -> 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_decodal() } +} + +/// 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: &str = include_str!("../../src/node-types.json"); + +// Uncomment these to include any queries that this grammar contains + +// pub const HIGHLIGHTS_QUERY: &str = include_str!("../../queries/highlights.scm"); +// pub const INJECTIONS_QUERY: &str = include_str!("../../queries/injections.scm"); +// pub const LOCALS_QUERY: &str = include_str!("../../queries/locals.scm"); +// pub const TAGS_QUERY: &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 Decodal grammar"); + } +} diff --git a/editors/tree-sitter-decodal/bindings/swift/TreeSitterDecodal/decodal.h b/editors/tree-sitter-decodal/bindings/swift/TreeSitterDecodal/decodal.h new file mode 100644 index 0000000..34bb5b6 --- /dev/null +++ b/editors/tree-sitter-decodal/bindings/swift/TreeSitterDecodal/decodal.h @@ -0,0 +1,16 @@ +#ifndef TREE_SITTER_DECODAL_H_ +#define TREE_SITTER_DECODAL_H_ + +typedef struct TSLanguage TSLanguage; + +#ifdef __cplusplus +extern "C" { +#endif + +const TSLanguage *tree_sitter_decodal(void); + +#ifdef __cplusplus +} +#endif + +#endif // TREE_SITTER_DECODAL_H_ diff --git a/editors/tree-sitter-decodal/corpus/basic.txt b/editors/tree-sitter-decodal/corpus/basic.txt new file mode 100644 index 0000000..d9922d5 --- /dev/null +++ b/editors/tree-sitter-decodal/corpus/basic.txt @@ -0,0 +1,76 @@ +================== +Top-level fields +================== +host = String; +port = Int & > 443 default 8080; +--- + +(source_file + (field_definition + path: (field_path (identifier)) + value: (identifier)) + (field_definition + path: (field_path (identifier)) + value: (default_expression + base: (binary_expression + left: (identifier) + right: (comparison_constraint + value: (integer))) + fallback: (literal (integer))))) + +================== +Import and function +================== +let + schema = import "./schema.dcdl"; + mk = (cfg: schema.Service) => cfg; +in + mk({ name = "api"; }) +--- + +(source_file + (let_expression + (field_definition + path: (field_path (identifier)) + value: (import_expression + specifier: (string))) + (field_definition + path: (field_path (identifier)) + value: (function_expression + (parameter + name: (identifier) + constraint: (path_expression + object: (identifier) + field: (identifier))) + body: (identifier))) + body: (call_expression + function: (identifier) + (object + (field_definition + path: (field_path (identifier)) + value: (literal (string))))))) + +================== +Match and patch +================== +base // { + summary = match env { + "prod": "production"; + _: "other"; + }; +} +--- + +(source_file + (binary_expression + left: (identifier) + right: (object + (field_definition + path: (field_path (identifier)) + value: (match_expression + scrutinee: (identifier) + (match_arm + pattern: (literal (string)) + body: (literal (string))) + (match_arm + body: (literal (string)))))))) diff --git a/editors/tree-sitter-decodal/grammar.js b/editors/tree-sitter-decodal/grammar.js new file mode 100644 index 0000000..86e5416 --- /dev/null +++ b/editors/tree-sitter-decodal/grammar.js @@ -0,0 +1,186 @@ +const PREC = { + DEFAULT: 1, + PATCH: 2, + AND: 3, + CALL: 7, + PATH: 8, +}; + +function commaSep(rule) { + return optional(seq(rule, repeat(seq(',', rule)), optional(','))); +} + +function semiSep(rule) { + return optional(seq(rule, repeat(seq(';', rule)), optional(';'))); +} + +module.exports = grammar({ + name: 'decodal', + + extras: $ => [ + /[\s\uFEFF\u2060\u200B]/, + $.comment, + ], + + word: $ => $.identifier, + + conflicts: $ => [ + [$._expression, $.parameter], + ], + + rules: { + source_file: $ => repeat($._statement), + + _statement: $ => choice( + seq($.field_definition, optional(';')), + seq($._expression, optional(';')), + ), + + comment: _ => token(seq('#', /.*/)), + + _expression: $ => choice( + $.literal, + $.identifier, + $.regex_literal, + $.comparison_constraint, + $.object, + $.array, + $.let_expression, + $.function_expression, + $.match_expression, + $.import_expression, + $.parenthesized_expression, + $.call_expression, + $.path_expression, + $.binary_expression, + $.default_expression, + ), + + literal: $ => choice( + $.string, + $.integer, + $.float, + $.boolean, + ), + + boolean: _ => choice('true', 'false'), + + string: _ => token(seq( + '"', + repeat(choice(/[^"\\\n]/, /\\./)), + '"', + )), + + integer: _ => token(/[0-9]+/), + float: _ => token(/[0-9]+\.[0-9]+/), + + identifier: _ => /[A-Za-z][A-Za-z0-9_]*/, + + regex_literal: _ => token(seq( + '/', + repeat1(choice(/[^\/\\\n]/, /\\./)), + '/', + )), + + object: $ => seq( + '{', + semiSep($.field_definition), + '}', + ), + + field_definition: $ => seq( + field('path', $.field_path), + '=', + field('value', $._expression), + ), + + field_path: $ => prec(10, seq( + $.identifier, + repeat(seq('.', $.identifier)), + )), + + array: $ => seq( + '[', + commaSep($._expression), + ']', + ), + + let_expression: $ => seq( + 'let', + repeat(seq($.field_definition, ';')), + 'in', + field('body', $._expression), + ), + + function_expression: $ => prec.right(seq( + '(', + commaSep($.parameter), + ')', + '=>', + field('body', $._expression), + )), + + parameter: $ => seq( + field('name', $.identifier), + optional(seq(':', field('constraint', $._expression))), + ), + + match_expression: $ => seq( + 'match', + field('scrutinee', $._expression), + '{', + semiSep($.match_arm), + '}', + ), + + match_arm: $ => seq( + field('pattern', choice('_', $._expression)), + ':', + field('body', $._expression), + ), + + import_expression: $ => seq( + 'import', + field('specifier', $.string), + ), + + parenthesized_expression: $ => seq('(', $._expression, ')'), + + call_expression: $ => prec.left(PREC.CALL, seq( + field('function', $._expression), + '(', + commaSep($._expression), + ')', + )), + + path_expression: $ => prec.left(PREC.PATH, seq( + field('object', $._expression), + '.', + field('field', $.identifier), + )), + + comparison_constraint: $ => prec(6, seq( + field('operator', choice('>', '>=', '<', '<=')), + field('value', choice($.integer, $.float)), + )), + + binary_expression: $ => choice( + prec.left(PREC.AND, seq( + field('left', $._expression), + field('operator', '&'), + field('right', $._expression), + )), + prec.left(PREC.PATCH, seq( + field('left', $._expression), + field('operator', token(prec(2, '//'))), + field('right', $._expression), + )), + ), + + default_expression: $ => prec.right(PREC.DEFAULT, seq( + field('base', $._expression), + 'default', + field('fallback', $._expression), + )), + }, +}); diff --git a/editors/tree-sitter-decodal/package-lock.json b/editors/tree-sitter-decodal/package-lock.json new file mode 100644 index 0000000..cbcb695 --- /dev/null +++ b/editors/tree-sitter-decodal/package-lock.json @@ -0,0 +1,27 @@ +{ + "name": "tree-sitter-decodal", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "tree-sitter-decodal", + "version": "0.1.0", + "license": "MIT", + "devDependencies": { + "tree-sitter-cli": "^0.22.6" + } + }, + "node_modules/tree-sitter-cli": { + "version": "0.22.6", + "resolved": "https://registry.npmjs.org/tree-sitter-cli/-/tree-sitter-cli-0.22.6.tgz", + "integrity": "sha512-s7mYOJXi8sIFkt/nLJSqlYZP96VmKTc3BAwIX0rrrlRxWjWuCwixFqwzxWZBQz4R8Hx01iP7z3cT3ih58BUmZQ==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "tree-sitter": "cli.js" + } + } + } +} diff --git a/editors/tree-sitter-decodal/package.json b/editors/tree-sitter-decodal/package.json new file mode 100644 index 0000000..ce6cd28 --- /dev/null +++ b/editors/tree-sitter-decodal/package.json @@ -0,0 +1,50 @@ +{ + "name": "tree-sitter-decodal", + "version": "0.1.0", + "description": "Tree-sitter grammar for Decodal / DCDL", + "main": "grammar.js", + "types": "bindings/node", + "keywords": [ + "tree-sitter", + "decodal", + "dcdl" + ], + "files": [ + "grammar.js", + "binding.gyp", + "prebuilds/**", + "bindings/node/*", + "queries/*", + "src/**" + ], + "license": "MIT", + "tree-sitter": [ + { + "scope": "source.dcdl", + "file-types": [ + "dcdl" + ] + } + ], + "devDependencies": { + "tree-sitter-cli": "^0.22.6", + "prebuildify": "^6.0.0" + }, + "scripts": { + "generate": "tree-sitter generate", + "test": "tree-sitter test", + "install": "node-gyp-build", + "prebuildify": "prebuildify --napi --strip" + }, + "dependencies": { + "node-gyp-build": "^4.8.0" + }, + "peerDependencies": { + "tree-sitter": "^0.21.0" + }, + "peerDependenciesMeta": { + "tree_sitter": { + "optional": true + } + } +} diff --git a/editors/tree-sitter-decodal/pyproject.toml b/editors/tree-sitter-decodal/pyproject.toml new file mode 100644 index 0000000..bb96739 --- /dev/null +++ b/editors/tree-sitter-decodal/pyproject.toml @@ -0,0 +1,29 @@ +[build-system] +requires = ["setuptools>=42", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "tree-sitter-decodal" +description = "Decodal grammar for tree-sitter" +version = "0.0.1" +keywords = ["incremental", "parsing", "tree-sitter", "decodal"] +classifiers = [ + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Topic :: Software Development :: Compilers", + "Topic :: Text Processing :: Linguistic", + "Typing :: Typed" +] +requires-python = ">=3.8" +license.text = "MIT" +readme = "README.md" + +[project.urls] +Homepage = "https://github.com/tree-sitter/tree-sitter-decodal" + +[project.optional-dependencies] +core = ["tree-sitter~=0.21"] + +[tool.cibuildwheel] +build = "cp38-*" +build-frontend = "build" diff --git a/editors/tree-sitter-decodal/queries/highlights.scm b/editors/tree-sitter-decodal/queries/highlights.scm new file mode 100644 index 0000000..8cb604b --- /dev/null +++ b/editors/tree-sitter-decodal/queries/highlights.scm @@ -0,0 +1,58 @@ +(comment) @comment + +(string) @string +(regex_literal) @string.regexp +(integer) @number +(float) @number +(boolean) @boolean + +[ + "let" + "in" + "match" + "import" + "default" +] @keyword + +[ + "&" + "//" + "=>" + "=" + ">" + ">=" + "<" + "<=" +] @operator + +[ + "{" + "}" + "[" + "]" + "(" + ")" +] @punctuation.bracket + +[ + ";" + "," + "." + ":" +] @punctuation.delimiter + +((identifier) @type.builtin + (#match? @type.builtin "^(String|Int|Float|Bool)$")) + +(field_definition + path: (field_path (identifier) @property)) + +(path_expression + field: (identifier) @property) + +(parameter + name: (identifier) @variable.parameter) + +(function_expression) @function +(call_expression + function: (identifier) @function.call) diff --git a/editors/tree-sitter-decodal/queries/locals.scm b/editors/tree-sitter-decodal/queries/locals.scm new file mode 100644 index 0000000..25a6353 --- /dev/null +++ b/editors/tree-sitter-decodal/queries/locals.scm @@ -0,0 +1,3 @@ +(parameter name: (identifier) @local.definition) +(field_definition path: (field_path (identifier) @local.definition)) +(identifier) @local.reference diff --git a/editors/tree-sitter-decodal/setup.py b/editors/tree-sitter-decodal/setup.py new file mode 100644 index 0000000..83b336c --- /dev/null +++ b/editors/tree-sitter-decodal/setup.py @@ -0,0 +1,60 @@ +from os.path import isdir, join +from platform import system + +from setuptools import Extension, find_packages, setup +from setuptools.command.build import build +from wheel.bdist_wheel import bdist_wheel + + +class Build(build): + def run(self): + if isdir("queries"): + dest = join(self.build_lib, "tree_sitter_decodal", "queries") + self.copy_tree("queries", dest) + super().run() + + +class BdistWheel(bdist_wheel): + def get_tag(self): + python, abi, platform = super().get_tag() + if python.startswith("cp"): + python, abi = "cp38", "abi3" + return python, abi, platform + + +setup( + packages=find_packages("bindings/python"), + package_dir={"": "bindings/python"}, + package_data={ + "tree_sitter_decodal": ["*.pyi", "py.typed"], + "tree_sitter_decodal.queries": ["*.scm"], + }, + ext_package="tree_sitter_decodal", + ext_modules=[ + Extension( + name="_binding", + sources=[ + "bindings/python/tree_sitter_decodal/binding.c", + "src/parser.c", + # NOTE: if your language uses an external scanner, add it here. + ], + extra_compile_args=[ + "-std=c11", + ] if system() != "Windows" else [ + "/std:c11", + "/utf-8", + ], + define_macros=[ + ("Py_LIMITED_API", "0x03080000"), + ("PY_SSIZE_T_CLEAN", None) + ], + include_dirs=["src"], + py_limited_api=True, + ) + ], + cmdclass={ + "build": Build, + "bdist_wheel": BdistWheel + }, + zip_safe=False +) diff --git a/editors/tree-sitter-decodal/src/grammar.json b/editors/tree-sitter-decodal/src/grammar.json new file mode 100644 index 0000000..f2f9e0b --- /dev/null +++ b/editors/tree-sitter-decodal/src/grammar.json @@ -0,0 +1,991 @@ +{ + "name": "decodal", + "word": "identifier", + "rules": { + "source_file": { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_statement" + } + }, + "_statement": { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "field_definition" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": ";" + }, + { + "type": "BLANK" + } + ] + } + ] + }, + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "_expression" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": ";" + }, + { + "type": "BLANK" + } + ] + } + ] + } + ] + }, + "comment": { + "type": "TOKEN", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "#" + }, + { + "type": "PATTERN", + "value": ".*" + } + ] + } + }, + "_expression": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "literal" + }, + { + "type": "SYMBOL", + "name": "identifier" + }, + { + "type": "SYMBOL", + "name": "regex_literal" + }, + { + "type": "SYMBOL", + "name": "comparison_constraint" + }, + { + "type": "SYMBOL", + "name": "object" + }, + { + "type": "SYMBOL", + "name": "array" + }, + { + "type": "SYMBOL", + "name": "let_expression" + }, + { + "type": "SYMBOL", + "name": "function_expression" + }, + { + "type": "SYMBOL", + "name": "match_expression" + }, + { + "type": "SYMBOL", + "name": "import_expression" + }, + { + "type": "SYMBOL", + "name": "parenthesized_expression" + }, + { + "type": "SYMBOL", + "name": "call_expression" + }, + { + "type": "SYMBOL", + "name": "path_expression" + }, + { + "type": "SYMBOL", + "name": "binary_expression" + }, + { + "type": "SYMBOL", + "name": "default_expression" + } + ] + }, + "literal": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "string" + }, + { + "type": "SYMBOL", + "name": "integer" + }, + { + "type": "SYMBOL", + "name": "float" + }, + { + "type": "SYMBOL", + "name": "boolean" + } + ] + }, + "boolean": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "true" + }, + { + "type": "STRING", + "value": "false" + } + ] + }, + "string": { + "type": "TOKEN", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "\"" + }, + { + "type": "REPEAT", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "PATTERN", + "value": "[^\"\\\\\\n]" + }, + { + "type": "PATTERN", + "value": "\\\\." + } + ] + } + }, + { + "type": "STRING", + "value": "\"" + } + ] + } + }, + "integer": { + "type": "TOKEN", + "content": { + "type": "PATTERN", + "value": "[0-9]+" + } + }, + "float": { + "type": "TOKEN", + "content": { + "type": "PATTERN", + "value": "[0-9]+\\.[0-9]+" + } + }, + "identifier": { + "type": "PATTERN", + "value": "[A-Za-z][A-Za-z0-9_]*" + }, + "regex_literal": { + "type": "TOKEN", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "/" + }, + { + "type": "REPEAT1", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "PATTERN", + "value": "[^\\/\\\\\\n]" + }, + { + "type": "PATTERN", + "value": "\\\\." + } + ] + } + }, + { + "type": "STRING", + "value": "/" + } + ] + } + }, + "object": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "{" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "field_definition" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": ";" + }, + { + "type": "SYMBOL", + "name": "field_definition" + } + ] + } + }, + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": ";" + }, + { + "type": "BLANK" + } + ] + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "field_definition": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "path", + "content": { + "type": "SYMBOL", + "name": "field_path" + } + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + } + ] + }, + "field_path": { + "type": "PREC", + "value": 10, + "content": { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "identifier" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "." + }, + { + "type": "SYMBOL", + "name": "identifier" + } + ] + } + } + ] + } + }, + "array": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "[" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "_expression" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "SYMBOL", + "name": "_expression" + } + ] + } + }, + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "BLANK" + } + ] + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": "]" + } + ] + }, + "let_expression": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "let" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "field_definition" + }, + { + "type": "STRING", + "value": ";" + } + ] + } + }, + { + "type": "STRING", + "value": "in" + }, + { + "type": "FIELD", + "name": "body", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + } + ] + }, + "function_expression": { + "type": "PREC_RIGHT", + "value": 0, + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "(" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "parameter" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "SYMBOL", + "name": "parameter" + } + ] + } + }, + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "BLANK" + } + ] + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": ")" + }, + { + "type": "STRING", + "value": "=>" + }, + { + "type": "FIELD", + "name": "body", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + } + ] + } + }, + "parameter": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "identifier" + } + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": ":" + }, + { + "type": "FIELD", + "name": "constraint", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + } + ] + }, + { + "type": "BLANK" + } + ] + } + ] + }, + "match_expression": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "match" + }, + { + "type": "FIELD", + "name": "scrutinee", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + }, + { + "type": "STRING", + "value": "{" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "match_arm" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": ";" + }, + { + "type": "SYMBOL", + "name": "match_arm" + } + ] + } + }, + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": ";" + }, + { + "type": "BLANK" + } + ] + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "match_arm": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "pattern", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "_" + }, + { + "type": "SYMBOL", + "name": "_expression" + } + ] + } + }, + { + "type": "STRING", + "value": ":" + }, + { + "type": "FIELD", + "name": "body", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + } + ] + }, + "import_expression": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "import" + }, + { + "type": "FIELD", + "name": "specifier", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + ] + }, + "parenthesized_expression": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "(" + }, + { + "type": "SYMBOL", + "name": "_expression" + }, + { + "type": "STRING", + "value": ")" + } + ] + }, + "call_expression": { + "type": "PREC_LEFT", + "value": 7, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "function", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + }, + { + "type": "STRING", + "value": "(" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "_expression" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "SYMBOL", + "name": "_expression" + } + ] + } + }, + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "BLANK" + } + ] + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": ")" + } + ] + } + }, + "path_expression": { + "type": "PREC_LEFT", + "value": 8, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "object", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + }, + { + "type": "STRING", + "value": "." + }, + { + "type": "FIELD", + "name": "field", + "content": { + "type": "SYMBOL", + "name": "identifier" + } + } + ] + } + }, + "comparison_constraint": { + "type": "PREC", + "value": 6, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "operator", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": ">" + }, + { + "type": "STRING", + "value": ">=" + }, + { + "type": "STRING", + "value": "<" + }, + { + "type": "STRING", + "value": "<=" + } + ] + } + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "integer" + }, + { + "type": "SYMBOL", + "name": "float" + } + ] + } + } + ] + } + }, + "binary_expression": { + "type": "CHOICE", + "members": [ + { + "type": "PREC_LEFT", + "value": 3, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + }, + { + "type": "FIELD", + "name": "operator", + "content": { + "type": "STRING", + "value": "&" + } + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + } + ] + } + }, + { + "type": "PREC_LEFT", + "value": 2, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + }, + { + "type": "FIELD", + "name": "operator", + "content": { + "type": "TOKEN", + "content": { + "type": "PREC", + "value": 2, + "content": { + "type": "STRING", + "value": "//" + } + } + } + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + } + ] + } + } + ] + }, + "default_expression": { + "type": "PREC_RIGHT", + "value": 1, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "base", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + }, + { + "type": "STRING", + "value": "default" + }, + { + "type": "FIELD", + "name": "fallback", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + } + ] + } + } + }, + "extras": [ + { + "type": "PATTERN", + "value": "[\\s\\uFEFF\\u2060\\u200B]" + }, + { + "type": "SYMBOL", + "name": "comment" + } + ], + "conflicts": [ + [ + "_expression", + "parameter" + ] + ], + "precedences": [], + "externals": [], + "inline": [], + "supertypes": [] +} diff --git a/editors/tree-sitter-decodal/src/node-types.json b/editors/tree-sitter-decodal/src/node-types.json new file mode 100644 index 0000000..58e43bc --- /dev/null +++ b/editors/tree-sitter-decodal/src/node-types.json @@ -0,0 +1,1529 @@ +[ + { + "type": "array", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "array", + "named": true + }, + { + "type": "binary_expression", + "named": true + }, + { + "type": "call_expression", + "named": true + }, + { + "type": "comparison_constraint", + "named": true + }, + { + "type": "default_expression", + "named": true + }, + { + "type": "function_expression", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "import_expression", + "named": true + }, + { + "type": "let_expression", + "named": true + }, + { + "type": "literal", + "named": true + }, + { + "type": "match_expression", + "named": true + }, + { + "type": "object", + "named": true + }, + { + "type": "parenthesized_expression", + "named": true + }, + { + "type": "path_expression", + "named": true + }, + { + "type": "regex_literal", + "named": true + } + ] + } + }, + { + "type": "binary_expression", + "named": true, + "fields": { + "left": { + "multiple": false, + "required": true, + "types": [ + { + "type": "array", + "named": true + }, + { + "type": "binary_expression", + "named": true + }, + { + "type": "call_expression", + "named": true + }, + { + "type": "comparison_constraint", + "named": true + }, + { + "type": "default_expression", + "named": true + }, + { + "type": "function_expression", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "import_expression", + "named": true + }, + { + "type": "let_expression", + "named": true + }, + { + "type": "literal", + "named": true + }, + { + "type": "match_expression", + "named": true + }, + { + "type": "object", + "named": true + }, + { + "type": "parenthesized_expression", + "named": true + }, + { + "type": "path_expression", + "named": true + }, + { + "type": "regex_literal", + "named": true + } + ] + }, + "operator": { + "multiple": false, + "required": true, + "types": [ + { + "type": "&", + "named": false + }, + { + "type": "//", + "named": false + } + ] + }, + "right": { + "multiple": false, + "required": true, + "types": [ + { + "type": "array", + "named": true + }, + { + "type": "binary_expression", + "named": true + }, + { + "type": "call_expression", + "named": true + }, + { + "type": "comparison_constraint", + "named": true + }, + { + "type": "default_expression", + "named": true + }, + { + "type": "function_expression", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "import_expression", + "named": true + }, + { + "type": "let_expression", + "named": true + }, + { + "type": "literal", + "named": true + }, + { + "type": "match_expression", + "named": true + }, + { + "type": "object", + "named": true + }, + { + "type": "parenthesized_expression", + "named": true + }, + { + "type": "path_expression", + "named": true + }, + { + "type": "regex_literal", + "named": true + } + ] + } + } + }, + { + "type": "boolean", + "named": true, + "fields": {} + }, + { + "type": "call_expression", + "named": true, + "fields": { + "function": { + "multiple": false, + "required": true, + "types": [ + { + "type": "array", + "named": true + }, + { + "type": "binary_expression", + "named": true + }, + { + "type": "call_expression", + "named": true + }, + { + "type": "comparison_constraint", + "named": true + }, + { + "type": "default_expression", + "named": true + }, + { + "type": "function_expression", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "import_expression", + "named": true + }, + { + "type": "let_expression", + "named": true + }, + { + "type": "literal", + "named": true + }, + { + "type": "match_expression", + "named": true + }, + { + "type": "object", + "named": true + }, + { + "type": "parenthesized_expression", + "named": true + }, + { + "type": "path_expression", + "named": true + }, + { + "type": "regex_literal", + "named": true + } + ] + } + }, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "array", + "named": true + }, + { + "type": "binary_expression", + "named": true + }, + { + "type": "call_expression", + "named": true + }, + { + "type": "comparison_constraint", + "named": true + }, + { + "type": "default_expression", + "named": true + }, + { + "type": "function_expression", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "import_expression", + "named": true + }, + { + "type": "let_expression", + "named": true + }, + { + "type": "literal", + "named": true + }, + { + "type": "match_expression", + "named": true + }, + { + "type": "object", + "named": true + }, + { + "type": "parenthesized_expression", + "named": true + }, + { + "type": "path_expression", + "named": true + }, + { + "type": "regex_literal", + "named": true + } + ] + } + }, + { + "type": "comparison_constraint", + "named": true, + "fields": { + "operator": { + "multiple": false, + "required": true, + "types": [ + { + "type": "<", + "named": false + }, + { + "type": "<=", + "named": false + }, + { + "type": ">", + "named": false + }, + { + "type": ">=", + "named": false + } + ] + }, + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "float", + "named": true + }, + { + "type": "integer", + "named": true + } + ] + } + } + }, + { + "type": "default_expression", + "named": true, + "fields": { + "base": { + "multiple": false, + "required": true, + "types": [ + { + "type": "array", + "named": true + }, + { + "type": "binary_expression", + "named": true + }, + { + "type": "call_expression", + "named": true + }, + { + "type": "comparison_constraint", + "named": true + }, + { + "type": "default_expression", + "named": true + }, + { + "type": "function_expression", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "import_expression", + "named": true + }, + { + "type": "let_expression", + "named": true + }, + { + "type": "literal", + "named": true + }, + { + "type": "match_expression", + "named": true + }, + { + "type": "object", + "named": true + }, + { + "type": "parenthesized_expression", + "named": true + }, + { + "type": "path_expression", + "named": true + }, + { + "type": "regex_literal", + "named": true + } + ] + }, + "fallback": { + "multiple": false, + "required": true, + "types": [ + { + "type": "array", + "named": true + }, + { + "type": "binary_expression", + "named": true + }, + { + "type": "call_expression", + "named": true + }, + { + "type": "comparison_constraint", + "named": true + }, + { + "type": "default_expression", + "named": true + }, + { + "type": "function_expression", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "import_expression", + "named": true + }, + { + "type": "let_expression", + "named": true + }, + { + "type": "literal", + "named": true + }, + { + "type": "match_expression", + "named": true + }, + { + "type": "object", + "named": true + }, + { + "type": "parenthesized_expression", + "named": true + }, + { + "type": "path_expression", + "named": true + }, + { + "type": "regex_literal", + "named": true + } + ] + } + } + }, + { + "type": "field_definition", + "named": true, + "fields": { + "path": { + "multiple": false, + "required": true, + "types": [ + { + "type": "field_path", + "named": true + } + ] + }, + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "array", + "named": true + }, + { + "type": "binary_expression", + "named": true + }, + { + "type": "call_expression", + "named": true + }, + { + "type": "comparison_constraint", + "named": true + }, + { + "type": "default_expression", + "named": true + }, + { + "type": "function_expression", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "import_expression", + "named": true + }, + { + "type": "let_expression", + "named": true + }, + { + "type": "literal", + "named": true + }, + { + "type": "match_expression", + "named": true + }, + { + "type": "object", + "named": true + }, + { + "type": "parenthesized_expression", + "named": true + }, + { + "type": "path_expression", + "named": true + }, + { + "type": "regex_literal", + "named": true + } + ] + } + } + }, + { + "type": "field_path", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "identifier", + "named": true + } + ] + } + }, + { + "type": "function_expression", + "named": true, + "fields": { + "body": { + "multiple": false, + "required": true, + "types": [ + { + "type": "array", + "named": true + }, + { + "type": "binary_expression", + "named": true + }, + { + "type": "call_expression", + "named": true + }, + { + "type": "comparison_constraint", + "named": true + }, + { + "type": "default_expression", + "named": true + }, + { + "type": "function_expression", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "import_expression", + "named": true + }, + { + "type": "let_expression", + "named": true + }, + { + "type": "literal", + "named": true + }, + { + "type": "match_expression", + "named": true + }, + { + "type": "object", + "named": true + }, + { + "type": "parenthesized_expression", + "named": true + }, + { + "type": "path_expression", + "named": true + }, + { + "type": "regex_literal", + "named": true + } + ] + } + }, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "parameter", + "named": true + } + ] + } + }, + { + "type": "import_expression", + "named": true, + "fields": { + "specifier": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "let_expression", + "named": true, + "fields": { + "body": { + "multiple": false, + "required": true, + "types": [ + { + "type": "array", + "named": true + }, + { + "type": "binary_expression", + "named": true + }, + { + "type": "call_expression", + "named": true + }, + { + "type": "comparison_constraint", + "named": true + }, + { + "type": "default_expression", + "named": true + }, + { + "type": "function_expression", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "import_expression", + "named": true + }, + { + "type": "let_expression", + "named": true + }, + { + "type": "literal", + "named": true + }, + { + "type": "match_expression", + "named": true + }, + { + "type": "object", + "named": true + }, + { + "type": "parenthesized_expression", + "named": true + }, + { + "type": "path_expression", + "named": true + }, + { + "type": "regex_literal", + "named": true + } + ] + } + }, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "field_definition", + "named": true + } + ] + } + }, + { + "type": "literal", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "boolean", + "named": true + }, + { + "type": "float", + "named": true + }, + { + "type": "integer", + "named": true + }, + { + "type": "string", + "named": true + } + ] + } + }, + { + "type": "match_arm", + "named": true, + "fields": { + "body": { + "multiple": false, + "required": true, + "types": [ + { + "type": "array", + "named": true + }, + { + "type": "binary_expression", + "named": true + }, + { + "type": "call_expression", + "named": true + }, + { + "type": "comparison_constraint", + "named": true + }, + { + "type": "default_expression", + "named": true + }, + { + "type": "function_expression", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "import_expression", + "named": true + }, + { + "type": "let_expression", + "named": true + }, + { + "type": "literal", + "named": true + }, + { + "type": "match_expression", + "named": true + }, + { + "type": "object", + "named": true + }, + { + "type": "parenthesized_expression", + "named": true + }, + { + "type": "path_expression", + "named": true + }, + { + "type": "regex_literal", + "named": true + } + ] + }, + "pattern": { + "multiple": false, + "required": true, + "types": [ + { + "type": "_", + "named": false + }, + { + "type": "array", + "named": true + }, + { + "type": "binary_expression", + "named": true + }, + { + "type": "call_expression", + "named": true + }, + { + "type": "comparison_constraint", + "named": true + }, + { + "type": "default_expression", + "named": true + }, + { + "type": "function_expression", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "import_expression", + "named": true + }, + { + "type": "let_expression", + "named": true + }, + { + "type": "literal", + "named": true + }, + { + "type": "match_expression", + "named": true + }, + { + "type": "object", + "named": true + }, + { + "type": "parenthesized_expression", + "named": true + }, + { + "type": "path_expression", + "named": true + }, + { + "type": "regex_literal", + "named": true + } + ] + } + } + }, + { + "type": "match_expression", + "named": true, + "fields": { + "scrutinee": { + "multiple": false, + "required": true, + "types": [ + { + "type": "array", + "named": true + }, + { + "type": "binary_expression", + "named": true + }, + { + "type": "call_expression", + "named": true + }, + { + "type": "comparison_constraint", + "named": true + }, + { + "type": "default_expression", + "named": true + }, + { + "type": "function_expression", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "import_expression", + "named": true + }, + { + "type": "let_expression", + "named": true + }, + { + "type": "literal", + "named": true + }, + { + "type": "match_expression", + "named": true + }, + { + "type": "object", + "named": true + }, + { + "type": "parenthesized_expression", + "named": true + }, + { + "type": "path_expression", + "named": true + }, + { + "type": "regex_literal", + "named": true + } + ] + } + }, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "match_arm", + "named": true + } + ] + } + }, + { + "type": "object", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "field_definition", + "named": true + } + ] + } + }, + { + "type": "parameter", + "named": true, + "fields": { + "constraint": { + "multiple": false, + "required": false, + "types": [ + { + "type": "array", + "named": true + }, + { + "type": "binary_expression", + "named": true + }, + { + "type": "call_expression", + "named": true + }, + { + "type": "comparison_constraint", + "named": true + }, + { + "type": "default_expression", + "named": true + }, + { + "type": "function_expression", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "import_expression", + "named": true + }, + { + "type": "let_expression", + "named": true + }, + { + "type": "literal", + "named": true + }, + { + "type": "match_expression", + "named": true + }, + { + "type": "object", + "named": true + }, + { + "type": "parenthesized_expression", + "named": true + }, + { + "type": "path_expression", + "named": true + }, + { + "type": "regex_literal", + "named": true + } + ] + }, + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "identifier", + "named": true + } + ] + } + } + }, + { + "type": "parenthesized_expression", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "array", + "named": true + }, + { + "type": "binary_expression", + "named": true + }, + { + "type": "call_expression", + "named": true + }, + { + "type": "comparison_constraint", + "named": true + }, + { + "type": "default_expression", + "named": true + }, + { + "type": "function_expression", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "import_expression", + "named": true + }, + { + "type": "let_expression", + "named": true + }, + { + "type": "literal", + "named": true + }, + { + "type": "match_expression", + "named": true + }, + { + "type": "object", + "named": true + }, + { + "type": "parenthesized_expression", + "named": true + }, + { + "type": "path_expression", + "named": true + }, + { + "type": "regex_literal", + "named": true + } + ] + } + }, + { + "type": "path_expression", + "named": true, + "fields": { + "field": { + "multiple": false, + "required": true, + "types": [ + { + "type": "identifier", + "named": true + } + ] + }, + "object": { + "multiple": false, + "required": true, + "types": [ + { + "type": "array", + "named": true + }, + { + "type": "binary_expression", + "named": true + }, + { + "type": "call_expression", + "named": true + }, + { + "type": "comparison_constraint", + "named": true + }, + { + "type": "default_expression", + "named": true + }, + { + "type": "function_expression", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "import_expression", + "named": true + }, + { + "type": "let_expression", + "named": true + }, + { + "type": "literal", + "named": true + }, + { + "type": "match_expression", + "named": true + }, + { + "type": "object", + "named": true + }, + { + "type": "parenthesized_expression", + "named": true + }, + { + "type": "path_expression", + "named": true + }, + { + "type": "regex_literal", + "named": true + } + ] + } + } + }, + { + "type": "source_file", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "array", + "named": true + }, + { + "type": "binary_expression", + "named": true + }, + { + "type": "call_expression", + "named": true + }, + { + "type": "comparison_constraint", + "named": true + }, + { + "type": "default_expression", + "named": true + }, + { + "type": "field_definition", + "named": true + }, + { + "type": "function_expression", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "import_expression", + "named": true + }, + { + "type": "let_expression", + "named": true + }, + { + "type": "literal", + "named": true + }, + { + "type": "match_expression", + "named": true + }, + { + "type": "object", + "named": true + }, + { + "type": "parenthesized_expression", + "named": true + }, + { + "type": "path_expression", + "named": true + }, + { + "type": "regex_literal", + "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": "<=", + "named": false + }, + { + "type": "=", + "named": false + }, + { + "type": "=>", + "named": false + }, + { + "type": ">", + "named": false + }, + { + "type": ">=", + "named": false + }, + { + "type": "[", + "named": false + }, + { + "type": "]", + "named": false + }, + { + "type": "_", + "named": false + }, + { + "type": "comment", + "named": true + }, + { + "type": "default", + "named": false + }, + { + "type": "false", + "named": false + }, + { + "type": "float", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "import", + "named": false + }, + { + "type": "in", + "named": false + }, + { + "type": "integer", + "named": true + }, + { + "type": "let", + "named": false + }, + { + "type": "match", + "named": false + }, + { + "type": "regex_literal", + "named": true + }, + { + "type": "string", + "named": true + }, + { + "type": "true", + "named": false + }, + { + "type": "{", + "named": false + }, + { + "type": "}", + "named": false + } +] \ No newline at end of file diff --git a/editors/tree-sitter-decodal/src/parser.c b/editors/tree-sitter-decodal/src/parser.c new file mode 100644 index 0000000..32813aa --- /dev/null +++ b/editors/tree-sitter-decodal/src/parser.c @@ -0,0 +1,4200 @@ +#include "tree_sitter/parser.h" + +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#endif + +#define LANGUAGE_VERSION 14 +#define STATE_COUNT 117 +#define LARGE_STATE_COUNT 29 +#define SYMBOL_COUNT 61 +#define ALIAS_COUNT 0 +#define TOKEN_COUNT 33 +#define EXTERNAL_TOKEN_COUNT 0 +#define FIELD_COUNT 16 +#define MAX_ALIAS_SEQUENCE_LENGTH 7 +#define PRODUCTION_ID_COUNT 17 + +enum ts_symbol_identifiers { + sym_identifier = 1, + anon_sym_SEMI = 2, + sym_comment = 3, + anon_sym_true = 4, + anon_sym_false = 5, + sym_string = 6, + sym_integer = 7, + sym_float = 8, + sym_regex_literal = 9, + anon_sym_LBRACE = 10, + anon_sym_RBRACE = 11, + anon_sym_EQ = 12, + anon_sym_DOT = 13, + anon_sym_LBRACK = 14, + anon_sym_COMMA = 15, + anon_sym_RBRACK = 16, + anon_sym_let = 17, + anon_sym_in = 18, + anon_sym_LPAREN = 19, + anon_sym_RPAREN = 20, + anon_sym_EQ_GT = 21, + anon_sym_COLON = 22, + anon_sym_match = 23, + anon_sym__ = 24, + anon_sym_import = 25, + anon_sym_GT = 26, + anon_sym_GT_EQ = 27, + anon_sym_LT = 28, + anon_sym_LT_EQ = 29, + anon_sym_AMP = 30, + anon_sym_SLASH_SLASH = 31, + anon_sym_default = 32, + sym_source_file = 33, + sym__statement = 34, + sym__expression = 35, + sym_literal = 36, + sym_boolean = 37, + sym_object = 38, + sym_field_definition = 39, + sym_field_path = 40, + sym_array = 41, + sym_let_expression = 42, + sym_function_expression = 43, + sym_parameter = 44, + sym_match_expression = 45, + sym_match_arm = 46, + sym_import_expression = 47, + sym_parenthesized_expression = 48, + sym_call_expression = 49, + sym_path_expression = 50, + sym_comparison_constraint = 51, + sym_binary_expression = 52, + sym_default_expression = 53, + aux_sym_source_file_repeat1 = 54, + aux_sym_object_repeat1 = 55, + aux_sym_field_path_repeat1 = 56, + aux_sym_array_repeat1 = 57, + aux_sym_let_expression_repeat1 = 58, + aux_sym_function_expression_repeat1 = 59, + aux_sym_match_expression_repeat1 = 60, +}; + +static const char * const ts_symbol_names[] = { + [ts_builtin_sym_end] = "end", + [sym_identifier] = "identifier", + [anon_sym_SEMI] = ";", + [sym_comment] = "comment", + [anon_sym_true] = "true", + [anon_sym_false] = "false", + [sym_string] = "string", + [sym_integer] = "integer", + [sym_float] = "float", + [sym_regex_literal] = "regex_literal", + [anon_sym_LBRACE] = "{", + [anon_sym_RBRACE] = "}", + [anon_sym_EQ] = "=", + [anon_sym_DOT] = ".", + [anon_sym_LBRACK] = "[", + [anon_sym_COMMA] = ",", + [anon_sym_RBRACK] = "]", + [anon_sym_let] = "let", + [anon_sym_in] = "in", + [anon_sym_LPAREN] = "(", + [anon_sym_RPAREN] = ")", + [anon_sym_EQ_GT] = "=>", + [anon_sym_COLON] = ":", + [anon_sym_match] = "match", + [anon_sym__] = "_", + [anon_sym_import] = "import", + [anon_sym_GT] = ">", + [anon_sym_GT_EQ] = ">=", + [anon_sym_LT] = "<", + [anon_sym_LT_EQ] = "<=", + [anon_sym_AMP] = "&", + [anon_sym_SLASH_SLASH] = "//", + [anon_sym_default] = "default", + [sym_source_file] = "source_file", + [sym__statement] = "_statement", + [sym__expression] = "_expression", + [sym_literal] = "literal", + [sym_boolean] = "boolean", + [sym_object] = "object", + [sym_field_definition] = "field_definition", + [sym_field_path] = "field_path", + [sym_array] = "array", + [sym_let_expression] = "let_expression", + [sym_function_expression] = "function_expression", + [sym_parameter] = "parameter", + [sym_match_expression] = "match_expression", + [sym_match_arm] = "match_arm", + [sym_import_expression] = "import_expression", + [sym_parenthesized_expression] = "parenthesized_expression", + [sym_call_expression] = "call_expression", + [sym_path_expression] = "path_expression", + [sym_comparison_constraint] = "comparison_constraint", + [sym_binary_expression] = "binary_expression", + [sym_default_expression] = "default_expression", + [aux_sym_source_file_repeat1] = "source_file_repeat1", + [aux_sym_object_repeat1] = "object_repeat1", + [aux_sym_field_path_repeat1] = "field_path_repeat1", + [aux_sym_array_repeat1] = "array_repeat1", + [aux_sym_let_expression_repeat1] = "let_expression_repeat1", + [aux_sym_function_expression_repeat1] = "function_expression_repeat1", + [aux_sym_match_expression_repeat1] = "match_expression_repeat1", +}; + +static const TSSymbol ts_symbol_map[] = { + [ts_builtin_sym_end] = ts_builtin_sym_end, + [sym_identifier] = sym_identifier, + [anon_sym_SEMI] = anon_sym_SEMI, + [sym_comment] = sym_comment, + [anon_sym_true] = anon_sym_true, + [anon_sym_false] = anon_sym_false, + [sym_string] = sym_string, + [sym_integer] = sym_integer, + [sym_float] = sym_float, + [sym_regex_literal] = sym_regex_literal, + [anon_sym_LBRACE] = anon_sym_LBRACE, + [anon_sym_RBRACE] = anon_sym_RBRACE, + [anon_sym_EQ] = anon_sym_EQ, + [anon_sym_DOT] = anon_sym_DOT, + [anon_sym_LBRACK] = anon_sym_LBRACK, + [anon_sym_COMMA] = anon_sym_COMMA, + [anon_sym_RBRACK] = anon_sym_RBRACK, + [anon_sym_let] = anon_sym_let, + [anon_sym_in] = anon_sym_in, + [anon_sym_LPAREN] = anon_sym_LPAREN, + [anon_sym_RPAREN] = anon_sym_RPAREN, + [anon_sym_EQ_GT] = anon_sym_EQ_GT, + [anon_sym_COLON] = anon_sym_COLON, + [anon_sym_match] = anon_sym_match, + [anon_sym__] = anon_sym__, + [anon_sym_import] = anon_sym_import, + [anon_sym_GT] = anon_sym_GT, + [anon_sym_GT_EQ] = anon_sym_GT_EQ, + [anon_sym_LT] = anon_sym_LT, + [anon_sym_LT_EQ] = anon_sym_LT_EQ, + [anon_sym_AMP] = anon_sym_AMP, + [anon_sym_SLASH_SLASH] = anon_sym_SLASH_SLASH, + [anon_sym_default] = anon_sym_default, + [sym_source_file] = sym_source_file, + [sym__statement] = sym__statement, + [sym__expression] = sym__expression, + [sym_literal] = sym_literal, + [sym_boolean] = sym_boolean, + [sym_object] = sym_object, + [sym_field_definition] = sym_field_definition, + [sym_field_path] = sym_field_path, + [sym_array] = sym_array, + [sym_let_expression] = sym_let_expression, + [sym_function_expression] = sym_function_expression, + [sym_parameter] = sym_parameter, + [sym_match_expression] = sym_match_expression, + [sym_match_arm] = sym_match_arm, + [sym_import_expression] = sym_import_expression, + [sym_parenthesized_expression] = sym_parenthesized_expression, + [sym_call_expression] = sym_call_expression, + [sym_path_expression] = sym_path_expression, + [sym_comparison_constraint] = sym_comparison_constraint, + [sym_binary_expression] = sym_binary_expression, + [sym_default_expression] = sym_default_expression, + [aux_sym_source_file_repeat1] = aux_sym_source_file_repeat1, + [aux_sym_object_repeat1] = aux_sym_object_repeat1, + [aux_sym_field_path_repeat1] = aux_sym_field_path_repeat1, + [aux_sym_array_repeat1] = aux_sym_array_repeat1, + [aux_sym_let_expression_repeat1] = aux_sym_let_expression_repeat1, + [aux_sym_function_expression_repeat1] = aux_sym_function_expression_repeat1, + [aux_sym_match_expression_repeat1] = aux_sym_match_expression_repeat1, +}; + +static const TSSymbolMetadata ts_symbol_metadata[] = { + [ts_builtin_sym_end] = { + .visible = false, + .named = true, + }, + [sym_identifier] = { + .visible = true, + .named = true, + }, + [anon_sym_SEMI] = { + .visible = true, + .named = false, + }, + [sym_comment] = { + .visible = true, + .named = true, + }, + [anon_sym_true] = { + .visible = true, + .named = false, + }, + [anon_sym_false] = { + .visible = true, + .named = false, + }, + [sym_string] = { + .visible = true, + .named = true, + }, + [sym_integer] = { + .visible = true, + .named = true, + }, + [sym_float] = { + .visible = true, + .named = true, + }, + [sym_regex_literal] = { + .visible = true, + .named = true, + }, + [anon_sym_LBRACE] = { + .visible = true, + .named = false, + }, + [anon_sym_RBRACE] = { + .visible = true, + .named = false, + }, + [anon_sym_EQ] = { + .visible = true, + .named = false, + }, + [anon_sym_DOT] = { + .visible = true, + .named = false, + }, + [anon_sym_LBRACK] = { + .visible = true, + .named = false, + }, + [anon_sym_COMMA] = { + .visible = true, + .named = false, + }, + [anon_sym_RBRACK] = { + .visible = true, + .named = false, + }, + [anon_sym_let] = { + .visible = true, + .named = false, + }, + [anon_sym_in] = { + .visible = true, + .named = false, + }, + [anon_sym_LPAREN] = { + .visible = true, + .named = false, + }, + [anon_sym_RPAREN] = { + .visible = true, + .named = false, + }, + [anon_sym_EQ_GT] = { + .visible = true, + .named = false, + }, + [anon_sym_COLON] = { + .visible = true, + .named = false, + }, + [anon_sym_match] = { + .visible = true, + .named = false, + }, + [anon_sym__] = { + .visible = true, + .named = false, + }, + [anon_sym_import] = { + .visible = true, + .named = false, + }, + [anon_sym_GT] = { + .visible = true, + .named = false, + }, + [anon_sym_GT_EQ] = { + .visible = true, + .named = false, + }, + [anon_sym_LT] = { + .visible = true, + .named = false, + }, + [anon_sym_LT_EQ] = { + .visible = true, + .named = false, + }, + [anon_sym_AMP] = { + .visible = true, + .named = false, + }, + [anon_sym_SLASH_SLASH] = { + .visible = true, + .named = false, + }, + [anon_sym_default] = { + .visible = true, + .named = false, + }, + [sym_source_file] = { + .visible = true, + .named = true, + }, + [sym__statement] = { + .visible = false, + .named = true, + }, + [sym__expression] = { + .visible = false, + .named = true, + }, + [sym_literal] = { + .visible = true, + .named = true, + }, + [sym_boolean] = { + .visible = true, + .named = true, + }, + [sym_object] = { + .visible = true, + .named = true, + }, + [sym_field_definition] = { + .visible = true, + .named = true, + }, + [sym_field_path] = { + .visible = true, + .named = true, + }, + [sym_array] = { + .visible = true, + .named = true, + }, + [sym_let_expression] = { + .visible = true, + .named = true, + }, + [sym_function_expression] = { + .visible = true, + .named = true, + }, + [sym_parameter] = { + .visible = true, + .named = true, + }, + [sym_match_expression] = { + .visible = true, + .named = true, + }, + [sym_match_arm] = { + .visible = true, + .named = true, + }, + [sym_import_expression] = { + .visible = true, + .named = true, + }, + [sym_parenthesized_expression] = { + .visible = true, + .named = true, + }, + [sym_call_expression] = { + .visible = true, + .named = true, + }, + [sym_path_expression] = { + .visible = true, + .named = true, + }, + [sym_comparison_constraint] = { + .visible = true, + .named = true, + }, + [sym_binary_expression] = { + .visible = true, + .named = true, + }, + [sym_default_expression] = { + .visible = true, + .named = true, + }, + [aux_sym_source_file_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_object_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_field_path_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_array_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_let_expression_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_function_expression_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_match_expression_repeat1] = { + .visible = false, + .named = false, + }, +}; + +enum ts_field_identifiers { + field_base = 1, + field_body = 2, + field_constraint = 3, + field_fallback = 4, + field_field = 5, + field_function = 6, + field_left = 7, + field_name = 8, + field_object = 9, + field_operator = 10, + field_path = 11, + field_pattern = 12, + field_right = 13, + field_scrutinee = 14, + field_specifier = 15, + field_value = 16, +}; + +static const char * const ts_field_names[] = { + [0] = NULL, + [field_base] = "base", + [field_body] = "body", + [field_constraint] = "constraint", + [field_fallback] = "fallback", + [field_field] = "field", + [field_function] = "function", + [field_left] = "left", + [field_name] = "name", + [field_object] = "object", + [field_operator] = "operator", + [field_path] = "path", + [field_pattern] = "pattern", + [field_right] = "right", + [field_scrutinee] = "scrutinee", + [field_specifier] = "specifier", + [field_value] = "value", +}; + +static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = { + [1] = {.index = 0, .length = 1}, + [2] = {.index = 1, .length = 1}, + [3] = {.index = 2, .length = 2}, + [4] = {.index = 4, .length = 1}, + [5] = {.index = 5, .length = 2}, + [6] = {.index = 7, .length = 1}, + [7] = {.index = 8, .length = 3}, + [8] = {.index = 11, .length = 2}, + [9] = {.index = 13, .length = 2}, + [10] = {.index = 15, .length = 1}, + [11] = {.index = 16, .length = 2}, + [12] = {.index = 18, .length = 1}, + [13] = {.index = 19, .length = 1}, + [14] = {.index = 20, .length = 1}, + [15] = {.index = 21, .length = 2}, + [16] = {.index = 23, .length = 1}, +}; + +static const TSFieldMapEntry ts_field_map_entries[] = { + [0] = + {field_name, 0}, + [1] = + {field_specifier, 1}, + [2] = + {field_operator, 0}, + {field_value, 1}, + [4] = + {field_body, 2}, + [5] = + {field_field, 2}, + {field_object, 0}, + [7] = + {field_function, 0}, + [8] = + {field_left, 0}, + {field_operator, 1}, + {field_right, 2}, + [11] = + {field_base, 0}, + {field_fallback, 2}, + [13] = + {field_path, 0}, + {field_value, 2}, + [15] = + {field_body, 3}, + [16] = + {field_constraint, 2}, + {field_name, 0}, + [18] = + {field_scrutinee, 1}, + [19] = + {field_body, 4}, + [20] = + {field_body, 5}, + [21] = + {field_body, 2}, + {field_pattern, 0}, + [23] = + {field_body, 6}, +}; + +static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = { + [0] = {0}, +}; + +static const uint16_t ts_non_terminal_alias_map[] = { + 0, +}; + +static const TSStateId ts_primary_state_ids[STATE_COUNT] = { + [0] = 0, + [1] = 1, + [2] = 2, + [3] = 3, + [4] = 4, + [5] = 5, + [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] = 20, + [21] = 21, + [22] = 22, + [23] = 23, + [24] = 24, + [25] = 25, + [26] = 26, + [27] = 27, + [28] = 28, + [29] = 29, + [30] = 30, + [31] = 31, + [32] = 32, + [33] = 33, + [34] = 34, + [35] = 35, + [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] = 48, + [49] = 49, + [50] = 50, + [51] = 51, + [52] = 52, + [53] = 53, + [54] = 54, + [55] = 55, + [56] = 56, + [57] = 57, + [58] = 58, + [59] = 59, + [60] = 60, + [61] = 61, + [62] = 62, + [63] = 63, + [64] = 64, + [65] = 65, + [66] = 66, + [67] = 67, + [68] = 68, + [69] = 69, + [70] = 70, + [71] = 71, + [72] = 72, + [73] = 73, + [74] = 74, + [75] = 75, + [76] = 76, + [77] = 77, + [78] = 78, + [79] = 79, + [80] = 80, + [81] = 81, + [82] = 82, + [83] = 83, + [84] = 84, + [85] = 85, + [86] = 86, + [87] = 87, + [88] = 88, + [89] = 89, + [90] = 90, + [91] = 91, + [92] = 92, + [93] = 93, + [94] = 94, + [95] = 95, + [96] = 96, + [97] = 97, + [98] = 98, + [99] = 99, + [100] = 100, + [101] = 101, + [102] = 102, + [103] = 103, + [104] = 104, + [105] = 105, + [106] = 106, + [107] = 107, + [108] = 108, + [109] = 109, + [110] = 110, + [111] = 111, + [112] = 112, + [113] = 113, + [114] = 114, + [115] = 115, + [116] = 116, +}; + +static bool ts_lex(TSLexer *lexer, TSStateId state) { + START_LEXER(); + eof = lexer->eof(lexer); + switch (state) { + case 0: + if (eof) ADVANCE(9); + ADVANCE_MAP( + '"', 1, + '#', 11, + '&', 33, + '(', 24, + ')', 25, + ',', 22, + '.', 20, + '/', 3, + ':', 27, + ';', 10, + '<', 31, + '=', 19, + '>', 29, + '[', 21, + ']', 23, + '_', 28, + '{', 17, + '}', 18, + ); + if (('\t' <= lookahead && lookahead <= '\r') || + lookahead == ' ' || + lookahead == 0x200b || + lookahead == 0x2060 || + lookahead == 0xfeff) SKIP(0); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(13); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(15); + END_STATE(); + case 1: + if (lookahead == '"') ADVANCE(12); + if (lookahead == '\\') ADVANCE(7); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(1); + END_STATE(); + case 2: + if (lookahead == '#') ADVANCE(11); + if (lookahead == '=') ADVANCE(5); + if (('\t' <= lookahead && lookahead <= '\r') || + lookahead == ' ' || + lookahead == 0x200b || + lookahead == 0x2060 || + lookahead == 0xfeff) SKIP(2); + END_STATE(); + case 3: + if (lookahead == '/') ADVANCE(34); + if (lookahead == '\\') ADVANCE(8); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(4); + END_STATE(); + case 4: + if (lookahead == '/') ADVANCE(16); + if (lookahead == '\\') ADVANCE(8); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(4); + END_STATE(); + case 5: + if (lookahead == '>') ADVANCE(26); + END_STATE(); + case 6: + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(14); + END_STATE(); + case 7: + if (lookahead != 0 && + lookahead != '\n') ADVANCE(1); + END_STATE(); + case 8: + if (lookahead != 0 && + lookahead != '\n') ADVANCE(4); + END_STATE(); + case 9: + ACCEPT_TOKEN(ts_builtin_sym_end); + END_STATE(); + case 10: + ACCEPT_TOKEN(anon_sym_SEMI); + END_STATE(); + case 11: + ACCEPT_TOKEN(sym_comment); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(11); + END_STATE(); + case 12: + ACCEPT_TOKEN(sym_string); + END_STATE(); + case 13: + ACCEPT_TOKEN(sym_integer); + if (lookahead == '.') ADVANCE(6); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(13); + END_STATE(); + case 14: + ACCEPT_TOKEN(sym_float); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(14); + END_STATE(); + case 15: + ACCEPT_TOKEN(sym_identifier); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(15); + END_STATE(); + case 16: + ACCEPT_TOKEN(sym_regex_literal); + END_STATE(); + case 17: + ACCEPT_TOKEN(anon_sym_LBRACE); + END_STATE(); + case 18: + ACCEPT_TOKEN(anon_sym_RBRACE); + END_STATE(); + case 19: + ACCEPT_TOKEN(anon_sym_EQ); + END_STATE(); + case 20: + ACCEPT_TOKEN(anon_sym_DOT); + END_STATE(); + case 21: + ACCEPT_TOKEN(anon_sym_LBRACK); + END_STATE(); + case 22: + ACCEPT_TOKEN(anon_sym_COMMA); + END_STATE(); + case 23: + ACCEPT_TOKEN(anon_sym_RBRACK); + END_STATE(); + case 24: + ACCEPT_TOKEN(anon_sym_LPAREN); + END_STATE(); + case 25: + ACCEPT_TOKEN(anon_sym_RPAREN); + END_STATE(); + case 26: + ACCEPT_TOKEN(anon_sym_EQ_GT); + END_STATE(); + case 27: + ACCEPT_TOKEN(anon_sym_COLON); + END_STATE(); + case 28: + ACCEPT_TOKEN(anon_sym__); + END_STATE(); + case 29: + ACCEPT_TOKEN(anon_sym_GT); + if (lookahead == '=') ADVANCE(30); + END_STATE(); + case 30: + ACCEPT_TOKEN(anon_sym_GT_EQ); + END_STATE(); + case 31: + ACCEPT_TOKEN(anon_sym_LT); + if (lookahead == '=') ADVANCE(32); + END_STATE(); + case 32: + ACCEPT_TOKEN(anon_sym_LT_EQ); + END_STATE(); + case 33: + ACCEPT_TOKEN(anon_sym_AMP); + END_STATE(); + case 34: + ACCEPT_TOKEN(anon_sym_SLASH_SLASH); + END_STATE(); + default: + return false; + } +} + +static bool ts_lex_keywords(TSLexer *lexer, TSStateId state) { + START_LEXER(); + eof = lexer->eof(lexer); + switch (state) { + case 0: + if (lookahead == 'd') ADVANCE(1); + if (lookahead == 'f') ADVANCE(2); + if (lookahead == 'i') ADVANCE(3); + if (lookahead == 'l') ADVANCE(4); + if (lookahead == 'm') ADVANCE(5); + if (lookahead == 't') ADVANCE(6); + if (('\t' <= lookahead && lookahead <= '\r') || + lookahead == ' ' || + lookahead == 0x200b || + lookahead == 0x2060 || + lookahead == 0xfeff) SKIP(0); + END_STATE(); + case 1: + if (lookahead == 'e') ADVANCE(7); + END_STATE(); + case 2: + if (lookahead == 'a') ADVANCE(8); + END_STATE(); + case 3: + if (lookahead == 'm') ADVANCE(9); + if (lookahead == 'n') ADVANCE(10); + END_STATE(); + case 4: + if (lookahead == 'e') ADVANCE(11); + END_STATE(); + case 5: + if (lookahead == 'a') ADVANCE(12); + END_STATE(); + case 6: + if (lookahead == 'r') ADVANCE(13); + END_STATE(); + case 7: + if (lookahead == 'f') ADVANCE(14); + END_STATE(); + case 8: + if (lookahead == 'l') ADVANCE(15); + END_STATE(); + case 9: + if (lookahead == 'p') ADVANCE(16); + END_STATE(); + case 10: + ACCEPT_TOKEN(anon_sym_in); + END_STATE(); + case 11: + if (lookahead == 't') ADVANCE(17); + END_STATE(); + case 12: + if (lookahead == 't') ADVANCE(18); + END_STATE(); + case 13: + if (lookahead == 'u') ADVANCE(19); + END_STATE(); + case 14: + if (lookahead == 'a') ADVANCE(20); + END_STATE(); + case 15: + if (lookahead == 's') ADVANCE(21); + END_STATE(); + case 16: + if (lookahead == 'o') ADVANCE(22); + END_STATE(); + case 17: + ACCEPT_TOKEN(anon_sym_let); + END_STATE(); + case 18: + if (lookahead == 'c') ADVANCE(23); + END_STATE(); + case 19: + if (lookahead == 'e') ADVANCE(24); + END_STATE(); + case 20: + if (lookahead == 'u') ADVANCE(25); + END_STATE(); + case 21: + if (lookahead == 'e') ADVANCE(26); + END_STATE(); + case 22: + if (lookahead == 'r') ADVANCE(27); + END_STATE(); + case 23: + if (lookahead == 'h') ADVANCE(28); + END_STATE(); + case 24: + ACCEPT_TOKEN(anon_sym_true); + END_STATE(); + case 25: + if (lookahead == 'l') ADVANCE(29); + END_STATE(); + case 26: + ACCEPT_TOKEN(anon_sym_false); + END_STATE(); + case 27: + if (lookahead == 't') ADVANCE(30); + END_STATE(); + case 28: + ACCEPT_TOKEN(anon_sym_match); + END_STATE(); + case 29: + if (lookahead == 't') ADVANCE(31); + END_STATE(); + case 30: + ACCEPT_TOKEN(anon_sym_import); + END_STATE(); + case 31: + ACCEPT_TOKEN(anon_sym_default); + END_STATE(); + default: + return false; + } +} + +static const TSLexMode ts_lex_modes[STATE_COUNT] = { + [0] = {.lex_state = 0}, + [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}, + [51] = {.lex_state = 0}, + [52] = {.lex_state = 0}, + [53] = {.lex_state = 0}, + [54] = {.lex_state = 0}, + [55] = {.lex_state = 0}, + [56] = {.lex_state = 0}, + [57] = {.lex_state = 0}, + [58] = {.lex_state = 0}, + [59] = {.lex_state = 0}, + [60] = {.lex_state = 0}, + [61] = {.lex_state = 0}, + [62] = {.lex_state = 0}, + [63] = {.lex_state = 0}, + [64] = {.lex_state = 0}, + [65] = {.lex_state = 0}, + [66] = {.lex_state = 0}, + [67] = {.lex_state = 0}, + [68] = {.lex_state = 0}, + [69] = {.lex_state = 0}, + [70] = {.lex_state = 0}, + [71] = {.lex_state = 0}, + [72] = {.lex_state = 0}, + [73] = {.lex_state = 0}, + [74] = {.lex_state = 0}, + [75] = {.lex_state = 0}, + [76] = {.lex_state = 0}, + [77] = {.lex_state = 0}, + [78] = {.lex_state = 0}, + [79] = {.lex_state = 0}, + [80] = {.lex_state = 0}, + [81] = {.lex_state = 0}, + [82] = {.lex_state = 0}, + [83] = {.lex_state = 0}, + [84] = {.lex_state = 0}, + [85] = {.lex_state = 0}, + [86] = {.lex_state = 0}, + [87] = {.lex_state = 0}, + [88] = {.lex_state = 0}, + [89] = {.lex_state = 0}, + [90] = {.lex_state = 0}, + [91] = {.lex_state = 0}, + [92] = {.lex_state = 0}, + [93] = {.lex_state = 0}, + [94] = {.lex_state = 0}, + [95] = {.lex_state = 0}, + [96] = {.lex_state = 0}, + [97] = {.lex_state = 0}, + [98] = {.lex_state = 0}, + [99] = {.lex_state = 0}, + [100] = {.lex_state = 0}, + [101] = {.lex_state = 0}, + [102] = {.lex_state = 0}, + [103] = {.lex_state = 0}, + [104] = {.lex_state = 0}, + [105] = {.lex_state = 0}, + [106] = {.lex_state = 2}, + [107] = {.lex_state = 0}, + [108] = {.lex_state = 0}, + [109] = {.lex_state = 2}, + [110] = {.lex_state = 0}, + [111] = {.lex_state = 2}, + [112] = {.lex_state = 0}, + [113] = {.lex_state = 0}, + [114] = {.lex_state = 0}, + [115] = {.lex_state = 0}, + [116] = {.lex_state = 2}, +}; + +static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { + [0] = { + [ts_builtin_sym_end] = ACTIONS(1), + [sym_identifier] = ACTIONS(1), + [anon_sym_SEMI] = ACTIONS(1), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(1), + [anon_sym_false] = ACTIONS(1), + [sym_string] = ACTIONS(1), + [sym_integer] = ACTIONS(1), + [sym_float] = ACTIONS(1), + [sym_regex_literal] = ACTIONS(1), + [anon_sym_LBRACE] = ACTIONS(1), + [anon_sym_RBRACE] = ACTIONS(1), + [anon_sym_EQ] = ACTIONS(1), + [anon_sym_DOT] = ACTIONS(1), + [anon_sym_LBRACK] = ACTIONS(1), + [anon_sym_COMMA] = ACTIONS(1), + [anon_sym_RBRACK] = ACTIONS(1), + [anon_sym_let] = ACTIONS(1), + [anon_sym_in] = ACTIONS(1), + [anon_sym_LPAREN] = ACTIONS(1), + [anon_sym_RPAREN] = ACTIONS(1), + [anon_sym_COLON] = ACTIONS(1), + [anon_sym_match] = ACTIONS(1), + [anon_sym__] = ACTIONS(1), + [anon_sym_import] = ACTIONS(1), + [anon_sym_GT] = ACTIONS(1), + [anon_sym_GT_EQ] = ACTIONS(1), + [anon_sym_LT] = ACTIONS(1), + [anon_sym_LT_EQ] = ACTIONS(1), + [anon_sym_AMP] = ACTIONS(1), + [anon_sym_SLASH_SLASH] = ACTIONS(1), + [anon_sym_default] = ACTIONS(1), + }, + [1] = { + [sym_source_file] = STATE(115), + [sym__statement] = STATE(3), + [sym__expression] = STATE(62), + [sym_literal] = STATE(62), + [sym_boolean] = STATE(32), + [sym_object] = STATE(62), + [sym_field_definition] = STATE(63), + [sym_field_path] = STATE(114), + [sym_array] = STATE(62), + [sym_let_expression] = STATE(62), + [sym_function_expression] = STATE(62), + [sym_match_expression] = STATE(62), + [sym_import_expression] = STATE(62), + [sym_parenthesized_expression] = STATE(62), + [sym_call_expression] = STATE(62), + [sym_path_expression] = STATE(62), + [sym_comparison_constraint] = STATE(62), + [sym_binary_expression] = STATE(62), + [sym_default_expression] = STATE(62), + [aux_sym_source_file_repeat1] = STATE(3), + [ts_builtin_sym_end] = ACTIONS(5), + [sym_identifier] = ACTIONS(7), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(15), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_match] = ACTIONS(25), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [2] = { + [sym__statement] = STATE(2), + [sym__expression] = STATE(62), + [sym_literal] = STATE(62), + [sym_boolean] = STATE(32), + [sym_object] = STATE(62), + [sym_field_definition] = STATE(63), + [sym_field_path] = STATE(114), + [sym_array] = STATE(62), + [sym_let_expression] = STATE(62), + [sym_function_expression] = STATE(62), + [sym_match_expression] = STATE(62), + [sym_import_expression] = STATE(62), + [sym_parenthesized_expression] = STATE(62), + [sym_call_expression] = STATE(62), + [sym_path_expression] = STATE(62), + [sym_comparison_constraint] = STATE(62), + [sym_binary_expression] = STATE(62), + [sym_default_expression] = STATE(62), + [aux_sym_source_file_repeat1] = STATE(2), + [ts_builtin_sym_end] = ACTIONS(33), + [sym_identifier] = ACTIONS(35), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(38), + [anon_sym_false] = ACTIONS(38), + [sym_string] = ACTIONS(41), + [sym_integer] = ACTIONS(44), + [sym_float] = ACTIONS(41), + [sym_regex_literal] = ACTIONS(47), + [anon_sym_LBRACE] = ACTIONS(50), + [anon_sym_LBRACK] = ACTIONS(53), + [anon_sym_let] = ACTIONS(56), + [anon_sym_LPAREN] = ACTIONS(59), + [anon_sym_match] = ACTIONS(62), + [anon_sym_import] = ACTIONS(65), + [anon_sym_GT] = ACTIONS(68), + [anon_sym_GT_EQ] = ACTIONS(71), + [anon_sym_LT] = ACTIONS(68), + [anon_sym_LT_EQ] = ACTIONS(71), + }, + [3] = { + [sym__statement] = STATE(2), + [sym__expression] = STATE(62), + [sym_literal] = STATE(62), + [sym_boolean] = STATE(32), + [sym_object] = STATE(62), + [sym_field_definition] = STATE(63), + [sym_field_path] = STATE(114), + [sym_array] = STATE(62), + [sym_let_expression] = STATE(62), + [sym_function_expression] = STATE(62), + [sym_match_expression] = STATE(62), + [sym_import_expression] = STATE(62), + [sym_parenthesized_expression] = STATE(62), + [sym_call_expression] = STATE(62), + [sym_path_expression] = STATE(62), + [sym_comparison_constraint] = STATE(62), + [sym_binary_expression] = STATE(62), + [sym_default_expression] = STATE(62), + [aux_sym_source_file_repeat1] = STATE(2), + [ts_builtin_sym_end] = ACTIONS(74), + [sym_identifier] = ACTIONS(7), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(15), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_match] = ACTIONS(25), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [4] = { + [sym__expression] = STATE(73), + [sym_literal] = STATE(73), + [sym_boolean] = STATE(32), + [sym_object] = STATE(73), + [sym_array] = STATE(73), + [sym_let_expression] = STATE(73), + [sym_function_expression] = STATE(73), + [sym_match_expression] = STATE(73), + [sym_match_arm] = STATE(88), + [sym_import_expression] = STATE(73), + [sym_parenthesized_expression] = STATE(73), + [sym_call_expression] = STATE(73), + [sym_path_expression] = STATE(73), + [sym_comparison_constraint] = STATE(73), + [sym_binary_expression] = STATE(73), + [sym_default_expression] = STATE(73), + [sym_identifier] = ACTIONS(76), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(78), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_RBRACE] = ACTIONS(80), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_match] = ACTIONS(25), + [anon_sym__] = ACTIONS(82), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [5] = { + [sym__expression] = STATE(73), + [sym_literal] = STATE(73), + [sym_boolean] = STATE(32), + [sym_object] = STATE(73), + [sym_array] = STATE(73), + [sym_let_expression] = STATE(73), + [sym_function_expression] = STATE(73), + [sym_match_expression] = STATE(73), + [sym_match_arm] = STATE(101), + [sym_import_expression] = STATE(73), + [sym_parenthesized_expression] = STATE(73), + [sym_call_expression] = STATE(73), + [sym_path_expression] = STATE(73), + [sym_comparison_constraint] = STATE(73), + [sym_binary_expression] = STATE(73), + [sym_default_expression] = STATE(73), + [sym_identifier] = ACTIONS(76), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(78), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_RBRACE] = ACTIONS(84), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_match] = ACTIONS(25), + [anon_sym__] = ACTIONS(82), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [6] = { + [sym__expression] = STATE(73), + [sym_literal] = STATE(73), + [sym_boolean] = STATE(32), + [sym_object] = STATE(73), + [sym_array] = STATE(73), + [sym_let_expression] = STATE(73), + [sym_function_expression] = STATE(73), + [sym_match_expression] = STATE(73), + [sym_match_arm] = STATE(101), + [sym_import_expression] = STATE(73), + [sym_parenthesized_expression] = STATE(73), + [sym_call_expression] = STATE(73), + [sym_path_expression] = STATE(73), + [sym_comparison_constraint] = STATE(73), + [sym_binary_expression] = STATE(73), + [sym_default_expression] = STATE(73), + [sym_identifier] = ACTIONS(76), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(78), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_RBRACE] = ACTIONS(86), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_match] = ACTIONS(25), + [anon_sym__] = ACTIONS(82), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [7] = { + [sym__expression] = STATE(72), + [sym_literal] = STATE(72), + [sym_boolean] = STATE(32), + [sym_object] = STATE(72), + [sym_array] = STATE(72), + [sym_let_expression] = STATE(72), + [sym_function_expression] = STATE(72), + [sym_parameter] = STATE(86), + [sym_match_expression] = STATE(72), + [sym_import_expression] = STATE(72), + [sym_parenthesized_expression] = STATE(72), + [sym_call_expression] = STATE(72), + [sym_path_expression] = STATE(72), + [sym_comparison_constraint] = STATE(72), + [sym_binary_expression] = STATE(72), + [sym_default_expression] = STATE(72), + [sym_identifier] = ACTIONS(88), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(90), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_RPAREN] = ACTIONS(92), + [anon_sym_match] = ACTIONS(25), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [8] = { + [sym__expression] = STATE(73), + [sym_literal] = STATE(73), + [sym_boolean] = STATE(32), + [sym_object] = STATE(73), + [sym_array] = STATE(73), + [sym_let_expression] = STATE(73), + [sym_function_expression] = STATE(73), + [sym_match_expression] = STATE(73), + [sym_match_arm] = STATE(101), + [sym_import_expression] = STATE(73), + [sym_parenthesized_expression] = STATE(73), + [sym_call_expression] = STATE(73), + [sym_path_expression] = STATE(73), + [sym_comparison_constraint] = STATE(73), + [sym_binary_expression] = STATE(73), + [sym_default_expression] = STATE(73), + [sym_identifier] = ACTIONS(76), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(78), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_match] = ACTIONS(25), + [anon_sym__] = ACTIONS(82), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [9] = { + [sym__expression] = STATE(67), + [sym_literal] = STATE(67), + [sym_boolean] = STATE(32), + [sym_object] = STATE(67), + [sym_array] = STATE(67), + [sym_let_expression] = STATE(67), + [sym_function_expression] = STATE(67), + [sym_match_expression] = STATE(67), + [sym_import_expression] = STATE(67), + [sym_parenthesized_expression] = STATE(67), + [sym_call_expression] = STATE(67), + [sym_path_expression] = STATE(67), + [sym_comparison_constraint] = STATE(67), + [sym_binary_expression] = STATE(67), + [sym_default_expression] = STATE(67), + [sym_identifier] = ACTIONS(94), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(96), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_RPAREN] = ACTIONS(98), + [anon_sym_match] = ACTIONS(25), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [10] = { + [sym__expression] = STATE(68), + [sym_literal] = STATE(68), + [sym_boolean] = STATE(32), + [sym_object] = STATE(68), + [sym_array] = STATE(68), + [sym_let_expression] = STATE(68), + [sym_function_expression] = STATE(68), + [sym_match_expression] = STATE(68), + [sym_import_expression] = STATE(68), + [sym_parenthesized_expression] = STATE(68), + [sym_call_expression] = STATE(68), + [sym_path_expression] = STATE(68), + [sym_comparison_constraint] = STATE(68), + [sym_binary_expression] = STATE(68), + [sym_default_expression] = STATE(68), + [sym_identifier] = ACTIONS(100), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(102), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_RPAREN] = ACTIONS(104), + [anon_sym_match] = ACTIONS(25), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [11] = { + [sym__expression] = STATE(68), + [sym_literal] = STATE(68), + [sym_boolean] = STATE(32), + [sym_object] = STATE(68), + [sym_array] = STATE(68), + [sym_let_expression] = STATE(68), + [sym_function_expression] = STATE(68), + [sym_match_expression] = STATE(68), + [sym_import_expression] = STATE(68), + [sym_parenthesized_expression] = STATE(68), + [sym_call_expression] = STATE(68), + [sym_path_expression] = STATE(68), + [sym_comparison_constraint] = STATE(68), + [sym_binary_expression] = STATE(68), + [sym_default_expression] = STATE(68), + [sym_identifier] = ACTIONS(100), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(102), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_RBRACK] = ACTIONS(106), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_match] = ACTIONS(25), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [12] = { + [sym__expression] = STATE(66), + [sym_literal] = STATE(66), + [sym_boolean] = STATE(32), + [sym_object] = STATE(66), + [sym_array] = STATE(66), + [sym_let_expression] = STATE(66), + [sym_function_expression] = STATE(66), + [sym_match_expression] = STATE(66), + [sym_import_expression] = STATE(66), + [sym_parenthesized_expression] = STATE(66), + [sym_call_expression] = STATE(66), + [sym_path_expression] = STATE(66), + [sym_comparison_constraint] = STATE(66), + [sym_binary_expression] = STATE(66), + [sym_default_expression] = STATE(66), + [sym_identifier] = ACTIONS(108), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(110), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_RBRACK] = ACTIONS(112), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_match] = ACTIONS(25), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [13] = { + [sym__expression] = STATE(68), + [sym_literal] = STATE(68), + [sym_boolean] = STATE(32), + [sym_object] = STATE(68), + [sym_array] = STATE(68), + [sym_let_expression] = STATE(68), + [sym_function_expression] = STATE(68), + [sym_match_expression] = STATE(68), + [sym_import_expression] = STATE(68), + [sym_parenthesized_expression] = STATE(68), + [sym_call_expression] = STATE(68), + [sym_path_expression] = STATE(68), + [sym_comparison_constraint] = STATE(68), + [sym_binary_expression] = STATE(68), + [sym_default_expression] = STATE(68), + [sym_identifier] = ACTIONS(100), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(102), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_RBRACK] = ACTIONS(114), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_match] = ACTIONS(25), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [14] = { + [sym__expression] = STATE(68), + [sym_literal] = STATE(68), + [sym_boolean] = STATE(32), + [sym_object] = STATE(68), + [sym_array] = STATE(68), + [sym_let_expression] = STATE(68), + [sym_function_expression] = STATE(68), + [sym_match_expression] = STATE(68), + [sym_import_expression] = STATE(68), + [sym_parenthesized_expression] = STATE(68), + [sym_call_expression] = STATE(68), + [sym_path_expression] = STATE(68), + [sym_comparison_constraint] = STATE(68), + [sym_binary_expression] = STATE(68), + [sym_default_expression] = STATE(68), + [sym_identifier] = ACTIONS(100), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(102), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_RPAREN] = ACTIONS(116), + [anon_sym_match] = ACTIONS(25), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [15] = { + [sym__expression] = STATE(47), + [sym_literal] = STATE(47), + [sym_boolean] = STATE(32), + [sym_object] = STATE(47), + [sym_array] = STATE(47), + [sym_let_expression] = STATE(47), + [sym_function_expression] = STATE(47), + [sym_match_expression] = STATE(47), + [sym_import_expression] = STATE(47), + [sym_parenthesized_expression] = STATE(47), + [sym_call_expression] = STATE(47), + [sym_path_expression] = STATE(47), + [sym_comparison_constraint] = STATE(47), + [sym_binary_expression] = STATE(47), + [sym_default_expression] = STATE(47), + [sym_identifier] = ACTIONS(118), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(120), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_match] = ACTIONS(25), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [16] = { + [sym__expression] = STATE(53), + [sym_literal] = STATE(53), + [sym_boolean] = STATE(32), + [sym_object] = STATE(53), + [sym_array] = STATE(53), + [sym_let_expression] = STATE(53), + [sym_function_expression] = STATE(53), + [sym_match_expression] = STATE(53), + [sym_import_expression] = STATE(53), + [sym_parenthesized_expression] = STATE(53), + [sym_call_expression] = STATE(53), + [sym_path_expression] = STATE(53), + [sym_comparison_constraint] = STATE(53), + [sym_binary_expression] = STATE(53), + [sym_default_expression] = STATE(53), + [sym_identifier] = ACTIONS(122), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(124), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_match] = ACTIONS(25), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [17] = { + [sym__expression] = STATE(46), + [sym_literal] = STATE(46), + [sym_boolean] = STATE(32), + [sym_object] = STATE(46), + [sym_array] = STATE(46), + [sym_let_expression] = STATE(46), + [sym_function_expression] = STATE(46), + [sym_match_expression] = STATE(46), + [sym_import_expression] = STATE(46), + [sym_parenthesized_expression] = STATE(46), + [sym_call_expression] = STATE(46), + [sym_path_expression] = STATE(46), + [sym_comparison_constraint] = STATE(46), + [sym_binary_expression] = STATE(46), + [sym_default_expression] = STATE(46), + [sym_identifier] = ACTIONS(126), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(128), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_match] = ACTIONS(25), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [18] = { + [sym__expression] = STATE(34), + [sym_literal] = STATE(34), + [sym_boolean] = STATE(32), + [sym_object] = STATE(34), + [sym_array] = STATE(34), + [sym_let_expression] = STATE(34), + [sym_function_expression] = STATE(34), + [sym_match_expression] = STATE(34), + [sym_import_expression] = STATE(34), + [sym_parenthesized_expression] = STATE(34), + [sym_call_expression] = STATE(34), + [sym_path_expression] = STATE(34), + [sym_comparison_constraint] = STATE(34), + [sym_binary_expression] = STATE(34), + [sym_default_expression] = STATE(34), + [sym_identifier] = ACTIONS(130), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(132), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_match] = ACTIONS(25), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [19] = { + [sym__expression] = STATE(70), + [sym_literal] = STATE(70), + [sym_boolean] = STATE(32), + [sym_object] = STATE(70), + [sym_array] = STATE(70), + [sym_let_expression] = STATE(70), + [sym_function_expression] = STATE(70), + [sym_match_expression] = STATE(70), + [sym_import_expression] = STATE(70), + [sym_parenthesized_expression] = STATE(70), + [sym_call_expression] = STATE(70), + [sym_path_expression] = STATE(70), + [sym_comparison_constraint] = STATE(70), + [sym_binary_expression] = STATE(70), + [sym_default_expression] = STATE(70), + [sym_identifier] = ACTIONS(134), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(136), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_match] = ACTIONS(25), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [20] = { + [sym__expression] = STATE(36), + [sym_literal] = STATE(36), + [sym_boolean] = STATE(32), + [sym_object] = STATE(36), + [sym_array] = STATE(36), + [sym_let_expression] = STATE(36), + [sym_function_expression] = STATE(36), + [sym_match_expression] = STATE(36), + [sym_import_expression] = STATE(36), + [sym_parenthesized_expression] = STATE(36), + [sym_call_expression] = STATE(36), + [sym_path_expression] = STATE(36), + [sym_comparison_constraint] = STATE(36), + [sym_binary_expression] = STATE(36), + [sym_default_expression] = STATE(36), + [sym_identifier] = ACTIONS(138), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(140), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_match] = ACTIONS(25), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [21] = { + [sym__expression] = STATE(68), + [sym_literal] = STATE(68), + [sym_boolean] = STATE(32), + [sym_object] = STATE(68), + [sym_array] = STATE(68), + [sym_let_expression] = STATE(68), + [sym_function_expression] = STATE(68), + [sym_match_expression] = STATE(68), + [sym_import_expression] = STATE(68), + [sym_parenthesized_expression] = STATE(68), + [sym_call_expression] = STATE(68), + [sym_path_expression] = STATE(68), + [sym_comparison_constraint] = STATE(68), + [sym_binary_expression] = STATE(68), + [sym_default_expression] = STATE(68), + [sym_identifier] = ACTIONS(100), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(102), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_match] = ACTIONS(25), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [22] = { + [sym__expression] = STATE(31), + [sym_literal] = STATE(31), + [sym_boolean] = STATE(32), + [sym_object] = STATE(31), + [sym_array] = STATE(31), + [sym_let_expression] = STATE(31), + [sym_function_expression] = STATE(31), + [sym_match_expression] = STATE(31), + [sym_import_expression] = STATE(31), + [sym_parenthesized_expression] = STATE(31), + [sym_call_expression] = STATE(31), + [sym_path_expression] = STATE(31), + [sym_comparison_constraint] = STATE(31), + [sym_binary_expression] = STATE(31), + [sym_default_expression] = STATE(31), + [sym_identifier] = ACTIONS(142), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(144), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_match] = ACTIONS(25), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [23] = { + [sym__expression] = STATE(37), + [sym_literal] = STATE(37), + [sym_boolean] = STATE(32), + [sym_object] = STATE(37), + [sym_array] = STATE(37), + [sym_let_expression] = STATE(37), + [sym_function_expression] = STATE(37), + [sym_match_expression] = STATE(37), + [sym_import_expression] = STATE(37), + [sym_parenthesized_expression] = STATE(37), + [sym_call_expression] = STATE(37), + [sym_path_expression] = STATE(37), + [sym_comparison_constraint] = STATE(37), + [sym_binary_expression] = STATE(37), + [sym_default_expression] = STATE(37), + [sym_identifier] = ACTIONS(146), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(148), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_match] = ACTIONS(25), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [24] = { + [sym__expression] = STATE(71), + [sym_literal] = STATE(71), + [sym_boolean] = STATE(32), + [sym_object] = STATE(71), + [sym_array] = STATE(71), + [sym_let_expression] = STATE(71), + [sym_function_expression] = STATE(71), + [sym_match_expression] = STATE(71), + [sym_import_expression] = STATE(71), + [sym_parenthesized_expression] = STATE(71), + [sym_call_expression] = STATE(71), + [sym_path_expression] = STATE(71), + [sym_comparison_constraint] = STATE(71), + [sym_binary_expression] = STATE(71), + [sym_default_expression] = STATE(71), + [sym_identifier] = ACTIONS(150), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(152), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_match] = ACTIONS(25), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [25] = { + [sym__expression] = STATE(52), + [sym_literal] = STATE(52), + [sym_boolean] = STATE(32), + [sym_object] = STATE(52), + [sym_array] = STATE(52), + [sym_let_expression] = STATE(52), + [sym_function_expression] = STATE(52), + [sym_match_expression] = STATE(52), + [sym_import_expression] = STATE(52), + [sym_parenthesized_expression] = STATE(52), + [sym_call_expression] = STATE(52), + [sym_path_expression] = STATE(52), + [sym_comparison_constraint] = STATE(52), + [sym_binary_expression] = STATE(52), + [sym_default_expression] = STATE(52), + [sym_identifier] = ACTIONS(154), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(156), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_match] = ACTIONS(25), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [26] = { + [sym__expression] = STATE(50), + [sym_literal] = STATE(50), + [sym_boolean] = STATE(32), + [sym_object] = STATE(50), + [sym_array] = STATE(50), + [sym_let_expression] = STATE(50), + [sym_function_expression] = STATE(50), + [sym_match_expression] = STATE(50), + [sym_import_expression] = STATE(50), + [sym_parenthesized_expression] = STATE(50), + [sym_call_expression] = STATE(50), + [sym_path_expression] = STATE(50), + [sym_comparison_constraint] = STATE(50), + [sym_binary_expression] = STATE(50), + [sym_default_expression] = STATE(50), + [sym_identifier] = ACTIONS(158), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(160), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_match] = ACTIONS(25), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [27] = { + [sym__expression] = STATE(69), + [sym_literal] = STATE(69), + [sym_boolean] = STATE(32), + [sym_object] = STATE(69), + [sym_array] = STATE(69), + [sym_let_expression] = STATE(69), + [sym_function_expression] = STATE(69), + [sym_match_expression] = STATE(69), + [sym_import_expression] = STATE(69), + [sym_parenthesized_expression] = STATE(69), + [sym_call_expression] = STATE(69), + [sym_path_expression] = STATE(69), + [sym_comparison_constraint] = STATE(69), + [sym_binary_expression] = STATE(69), + [sym_default_expression] = STATE(69), + [sym_identifier] = ACTIONS(162), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(164), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_match] = ACTIONS(25), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, + [28] = { + [sym__expression] = STATE(61), + [sym_literal] = STATE(61), + [sym_boolean] = STATE(32), + [sym_object] = STATE(61), + [sym_array] = STATE(61), + [sym_let_expression] = STATE(61), + [sym_function_expression] = STATE(61), + [sym_match_expression] = STATE(61), + [sym_import_expression] = STATE(61), + [sym_parenthesized_expression] = STATE(61), + [sym_call_expression] = STATE(61), + [sym_path_expression] = STATE(61), + [sym_comparison_constraint] = STATE(61), + [sym_binary_expression] = STATE(61), + [sym_default_expression] = STATE(61), + [sym_identifier] = ACTIONS(166), + [sym_comment] = ACTIONS(3), + [anon_sym_true] = ACTIONS(9), + [anon_sym_false] = ACTIONS(9), + [sym_string] = ACTIONS(11), + [sym_integer] = ACTIONS(13), + [sym_float] = ACTIONS(11), + [sym_regex_literal] = ACTIONS(168), + [anon_sym_LBRACE] = ACTIONS(17), + [anon_sym_LBRACK] = ACTIONS(19), + [anon_sym_let] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_match] = ACTIONS(25), + [anon_sym_import] = ACTIONS(27), + [anon_sym_GT] = ACTIONS(29), + [anon_sym_GT_EQ] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(29), + [anon_sym_LT_EQ] = ACTIONS(31), + }, +}; + +static const uint16_t ts_small_parse_table[] = { + [0] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(172), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(170), 18, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [36] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(176), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(174), 18, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [72] = 8, + ACTIONS(3), 1, + sym_comment, + ACTIONS(182), 1, + anon_sym_DOT, + ACTIONS(184), 1, + anon_sym_LPAREN, + ACTIONS(186), 1, + anon_sym_AMP, + ACTIONS(188), 1, + anon_sym_SLASH_SLASH, + ACTIONS(190), 1, + anon_sym_default, + ACTIONS(180), 9, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + ACTIONS(178), 14, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + [118] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(194), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(192), 18, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [154] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(198), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(196), 18, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [190] = 8, + ACTIONS(3), 1, + sym_comment, + ACTIONS(182), 1, + anon_sym_DOT, + ACTIONS(184), 1, + anon_sym_LPAREN, + ACTIONS(186), 1, + anon_sym_AMP, + ACTIONS(188), 1, + anon_sym_SLASH_SLASH, + ACTIONS(190), 1, + anon_sym_default, + ACTIONS(202), 9, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + ACTIONS(200), 14, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + [236] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(206), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(204), 18, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [272] = 8, + ACTIONS(3), 1, + sym_comment, + ACTIONS(182), 1, + anon_sym_DOT, + ACTIONS(184), 1, + anon_sym_LPAREN, + ACTIONS(186), 1, + anon_sym_AMP, + ACTIONS(188), 1, + anon_sym_SLASH_SLASH, + ACTIONS(190), 1, + anon_sym_default, + ACTIONS(210), 9, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + ACTIONS(208), 14, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + [318] = 8, + ACTIONS(3), 1, + sym_comment, + ACTIONS(182), 1, + anon_sym_DOT, + ACTIONS(184), 1, + anon_sym_LPAREN, + ACTIONS(186), 1, + anon_sym_AMP, + ACTIONS(188), 1, + anon_sym_SLASH_SLASH, + ACTIONS(190), 1, + anon_sym_default, + ACTIONS(214), 9, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + ACTIONS(212), 14, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + [364] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(218), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(216), 18, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [400] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(222), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(220), 18, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [436] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(226), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(224), 18, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [472] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(230), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(228), 18, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [508] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(234), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(232), 18, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [544] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(238), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(236), 18, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [580] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(242), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(240), 18, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [616] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(246), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(244), 18, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [652] = 8, + ACTIONS(3), 1, + sym_comment, + ACTIONS(182), 1, + anon_sym_DOT, + ACTIONS(184), 1, + anon_sym_LPAREN, + ACTIONS(186), 1, + anon_sym_AMP, + ACTIONS(188), 1, + anon_sym_SLASH_SLASH, + ACTIONS(190), 1, + anon_sym_default, + ACTIONS(250), 9, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + ACTIONS(248), 14, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + [698] = 8, + ACTIONS(3), 1, + sym_comment, + ACTIONS(182), 1, + anon_sym_DOT, + ACTIONS(184), 1, + anon_sym_LPAREN, + ACTIONS(186), 1, + anon_sym_AMP, + ACTIONS(188), 1, + anon_sym_SLASH_SLASH, + ACTIONS(190), 1, + anon_sym_default, + ACTIONS(254), 9, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + ACTIONS(252), 14, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + [744] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(258), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(256), 18, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [780] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(262), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(260), 18, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [816] = 8, + ACTIONS(3), 1, + sym_comment, + ACTIONS(182), 1, + anon_sym_DOT, + ACTIONS(184), 1, + anon_sym_LPAREN, + ACTIONS(186), 1, + anon_sym_AMP, + ACTIONS(188), 1, + anon_sym_SLASH_SLASH, + ACTIONS(190), 1, + anon_sym_default, + ACTIONS(266), 9, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + ACTIONS(264), 14, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + [862] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(270), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(268), 18, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [898] = 6, + ACTIONS(3), 1, + sym_comment, + ACTIONS(182), 1, + anon_sym_DOT, + ACTIONS(184), 1, + anon_sym_LPAREN, + ACTIONS(186), 1, + anon_sym_AMP, + ACTIONS(274), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(272), 15, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_SLASH_SLASH, + [940] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(182), 1, + anon_sym_DOT, + ACTIONS(184), 1, + anon_sym_LPAREN, + ACTIONS(274), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(272), 16, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [980] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(278), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(276), 18, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [1016] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(282), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(280), 18, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [1052] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(286), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(284), 18, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [1088] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(290), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(288), 18, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [1124] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(294), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(292), 18, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [1160] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(298), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(296), 18, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_COLON, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [1196] = 6, + ACTIONS(3), 1, + sym_comment, + ACTIONS(304), 1, + anon_sym_EQ, + ACTIONS(306), 1, + anon_sym_DOT, + STATE(92), 1, + aux_sym_field_path_repeat1, + ACTIONS(302), 10, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + anon_sym_default, + ACTIONS(300), 12, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_LBRACK, + anon_sym_LPAREN, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + [1235] = 8, + ACTIONS(3), 1, + sym_comment, + ACTIONS(182), 1, + anon_sym_DOT, + ACTIONS(184), 1, + anon_sym_LPAREN, + ACTIONS(186), 1, + anon_sym_AMP, + ACTIONS(188), 1, + anon_sym_SLASH_SLASH, + ACTIONS(190), 1, + anon_sym_default, + ACTIONS(310), 9, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + ACTIONS(308), 10, + ts_builtin_sym_end, + anon_sym_SEMI, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_LBRACK, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + [1277] = 9, + ACTIONS(3), 1, + sym_comment, + ACTIONS(182), 1, + anon_sym_DOT, + ACTIONS(184), 1, + anon_sym_LPAREN, + ACTIONS(186), 1, + anon_sym_AMP, + ACTIONS(188), 1, + anon_sym_SLASH_SLASH, + ACTIONS(190), 1, + anon_sym_default, + ACTIONS(316), 1, + anon_sym_SEMI, + ACTIONS(312), 8, + ts_builtin_sym_end, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_LBRACK, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + ACTIONS(314), 9, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + [1320] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(316), 1, + anon_sym_SEMI, + ACTIONS(312), 9, + ts_builtin_sym_end, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_LBRACK, + anon_sym_LPAREN, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + ACTIONS(314), 9, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + [1349] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(318), 9, + ts_builtin_sym_end, + sym_string, + sym_float, + sym_regex_literal, + anon_sym_LBRACE, + anon_sym_LBRACK, + anon_sym_LPAREN, + anon_sym_GT_EQ, + anon_sym_LT_EQ, + ACTIONS(320), 9, + anon_sym_true, + anon_sym_false, + sym_integer, + sym_identifier, + anon_sym_let, + anon_sym_match, + anon_sym_import, + anon_sym_GT, + anon_sym_LT, + [1375] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(322), 1, + anon_sym_COMMA, + ACTIONS(324), 1, + anon_sym_RPAREN, + ACTIONS(327), 1, + anon_sym_COLON, + ACTIONS(300), 5, + anon_sym_DOT, + anon_sym_LPAREN, + anon_sym_AMP, + anon_sym_SLASH_SLASH, + anon_sym_default, + [1395] = 9, + ACTIONS(3), 1, + sym_comment, + ACTIONS(182), 1, + anon_sym_DOT, + ACTIONS(184), 1, + anon_sym_LPAREN, + ACTIONS(186), 1, + anon_sym_AMP, + ACTIONS(188), 1, + anon_sym_SLASH_SLASH, + ACTIONS(329), 1, + anon_sym_COMMA, + ACTIONS(331), 1, + anon_sym_RBRACK, + ACTIONS(333), 1, + anon_sym_default, + STATE(97), 1, + aux_sym_array_repeat1, + [1423] = 9, + ACTIONS(3), 1, + sym_comment, + ACTIONS(182), 1, + anon_sym_DOT, + ACTIONS(184), 1, + anon_sym_LPAREN, + ACTIONS(186), 1, + anon_sym_AMP, + ACTIONS(188), 1, + anon_sym_SLASH_SLASH, + ACTIONS(333), 1, + anon_sym_default, + ACTIONS(335), 1, + anon_sym_COMMA, + ACTIONS(337), 1, + anon_sym_RPAREN, + STATE(91), 1, + aux_sym_array_repeat1, + [1451] = 7, + ACTIONS(3), 1, + sym_comment, + ACTIONS(182), 1, + anon_sym_DOT, + ACTIONS(184), 1, + anon_sym_LPAREN, + ACTIONS(186), 1, + anon_sym_AMP, + ACTIONS(188), 1, + anon_sym_SLASH_SLASH, + ACTIONS(333), 1, + anon_sym_default, + ACTIONS(339), 3, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_RPAREN, + [1475] = 7, + ACTIONS(3), 1, + sym_comment, + ACTIONS(182), 1, + anon_sym_DOT, + ACTIONS(184), 1, + anon_sym_LPAREN, + ACTIONS(186), 1, + anon_sym_AMP, + ACTIONS(188), 1, + anon_sym_SLASH_SLASH, + ACTIONS(333), 1, + anon_sym_default, + ACTIONS(341), 2, + anon_sym_SEMI, + anon_sym_RBRACE, + [1498] = 7, + ACTIONS(3), 1, + sym_comment, + ACTIONS(182), 1, + anon_sym_DOT, + ACTIONS(184), 1, + anon_sym_LPAREN, + ACTIONS(186), 1, + anon_sym_AMP, + ACTIONS(188), 1, + anon_sym_SLASH_SLASH, + ACTIONS(333), 1, + anon_sym_default, + ACTIONS(343), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + [1521] = 7, + ACTIONS(3), 1, + sym_comment, + ACTIONS(182), 1, + anon_sym_DOT, + ACTIONS(184), 1, + anon_sym_LPAREN, + ACTIONS(186), 1, + anon_sym_AMP, + ACTIONS(188), 1, + anon_sym_SLASH_SLASH, + ACTIONS(333), 1, + anon_sym_default, + ACTIONS(345), 1, + anon_sym_LBRACE, + [1543] = 7, + ACTIONS(3), 1, + sym_comment, + ACTIONS(182), 1, + anon_sym_DOT, + ACTIONS(184), 1, + anon_sym_LPAREN, + ACTIONS(186), 1, + anon_sym_AMP, + ACTIONS(188), 1, + anon_sym_SLASH_SLASH, + ACTIONS(333), 1, + anon_sym_default, + ACTIONS(347), 1, + anon_sym_RPAREN, + [1565] = 7, + ACTIONS(3), 1, + sym_comment, + ACTIONS(182), 1, + anon_sym_DOT, + ACTIONS(184), 1, + anon_sym_LPAREN, + ACTIONS(186), 1, + anon_sym_AMP, + ACTIONS(188), 1, + anon_sym_SLASH_SLASH, + ACTIONS(333), 1, + anon_sym_default, + ACTIONS(349), 1, + anon_sym_COLON, + [1587] = 6, + ACTIONS(3), 1, + sym_comment, + ACTIONS(351), 1, + sym_identifier, + ACTIONS(353), 1, + anon_sym_in, + STATE(76), 1, + aux_sym_let_expression_repeat1, + STATE(107), 1, + sym_field_definition, + STATE(114), 1, + sym_field_path, + [1606] = 6, + ACTIONS(3), 1, + sym_comment, + ACTIONS(355), 1, + sym_identifier, + ACTIONS(358), 1, + anon_sym_in, + STATE(75), 1, + aux_sym_let_expression_repeat1, + STATE(107), 1, + sym_field_definition, + STATE(114), 1, + sym_field_path, + [1625] = 6, + ACTIONS(3), 1, + sym_comment, + ACTIONS(351), 1, + sym_identifier, + ACTIONS(360), 1, + anon_sym_in, + STATE(75), 1, + aux_sym_let_expression_repeat1, + STATE(107), 1, + sym_field_definition, + STATE(114), 1, + sym_field_path, + [1644] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(362), 1, + sym_identifier, + ACTIONS(364), 1, + anon_sym_RBRACE, + STATE(105), 1, + sym_field_definition, + STATE(114), 1, + sym_field_path, + [1660] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(362), 1, + sym_identifier, + ACTIONS(366), 1, + anon_sym_RBRACE, + STATE(105), 1, + sym_field_definition, + STATE(114), 1, + sym_field_path, + [1676] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(368), 1, + anon_sym_COMMA, + STATE(79), 1, + aux_sym_array_repeat1, + ACTIONS(339), 2, + anon_sym_RBRACK, + anon_sym_RPAREN, + [1690] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(362), 1, + sym_identifier, + ACTIONS(371), 1, + anon_sym_RBRACE, + STATE(85), 1, + sym_field_definition, + STATE(114), 1, + sym_field_path, + [1706] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(373), 1, + anon_sym_COMMA, + ACTIONS(375), 1, + anon_sym_RPAREN, + STATE(84), 1, + aux_sym_function_expression_repeat1, + [1719] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(366), 1, + anon_sym_RBRACE, + ACTIONS(377), 1, + anon_sym_SEMI, + STATE(98), 1, + aux_sym_object_repeat1, + [1732] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(379), 1, + sym_identifier, + ACTIONS(381), 1, + anon_sym_RPAREN, + STATE(103), 1, + sym_parameter, + [1745] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(383), 1, + anon_sym_COMMA, + ACTIONS(386), 1, + anon_sym_RPAREN, + STATE(84), 1, + aux_sym_function_expression_repeat1, + [1758] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(388), 1, + anon_sym_SEMI, + ACTIONS(390), 1, + anon_sym_RBRACE, + STATE(82), 1, + aux_sym_object_repeat1, + [1771] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(392), 1, + anon_sym_COMMA, + ACTIONS(394), 1, + anon_sym_RPAREN, + STATE(81), 1, + aux_sym_function_expression_repeat1, + [1784] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(327), 1, + anon_sym_COLON, + ACTIONS(322), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + [1795] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(396), 1, + anon_sym_SEMI, + ACTIONS(398), 1, + anon_sym_RBRACE, + STATE(90), 1, + aux_sym_match_expression_repeat1, + [1808] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(400), 1, + anon_sym_SEMI, + ACTIONS(403), 1, + anon_sym_RBRACE, + STATE(89), 1, + aux_sym_match_expression_repeat1, + [1821] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(84), 1, + anon_sym_RBRACE, + ACTIONS(405), 1, + anon_sym_SEMI, + STATE(89), 1, + aux_sym_match_expression_repeat1, + [1834] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(104), 1, + anon_sym_RPAREN, + ACTIONS(407), 1, + anon_sym_COMMA, + STATE(79), 1, + aux_sym_array_repeat1, + [1847] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(306), 1, + anon_sym_DOT, + ACTIONS(409), 1, + anon_sym_EQ, + STATE(94), 1, + aux_sym_field_path_repeat1, + [1860] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(362), 1, + sym_identifier, + STATE(105), 1, + sym_field_definition, + STATE(114), 1, + sym_field_path, + [1873] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(411), 1, + anon_sym_EQ, + ACTIONS(413), 1, + anon_sym_DOT, + STATE(94), 1, + aux_sym_field_path_repeat1, + [1886] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(375), 1, + anon_sym_RPAREN, + ACTIONS(379), 1, + sym_identifier, + STATE(103), 1, + sym_parameter, + [1899] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(304), 1, + anon_sym_EQ, + ACTIONS(306), 1, + anon_sym_DOT, + STATE(92), 1, + aux_sym_field_path_repeat1, + [1912] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(114), 1, + anon_sym_RBRACK, + ACTIONS(416), 1, + anon_sym_COMMA, + STATE(79), 1, + aux_sym_array_repeat1, + [1925] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(418), 1, + anon_sym_SEMI, + ACTIONS(421), 1, + anon_sym_RBRACE, + STATE(98), 1, + aux_sym_object_repeat1, + [1938] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(379), 1, + sym_identifier, + STATE(103), 1, + sym_parameter, + [1948] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(358), 2, + sym_identifier, + anon_sym_in, + [1956] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(403), 2, + anon_sym_SEMI, + anon_sym_RBRACE, + [1964] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(411), 2, + anon_sym_EQ, + anon_sym_DOT, + [1972] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(386), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + [1980] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(423), 1, + sym_integer, + ACTIONS(425), 1, + sym_float, + [1990] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(421), 2, + anon_sym_SEMI, + anon_sym_RBRACE, + [1998] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(427), 1, + anon_sym_EQ_GT, + [2005] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(429), 1, + anon_sym_SEMI, + [2012] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(431), 1, + sym_identifier, + [2019] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(433), 1, + anon_sym_EQ_GT, + [2026] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(349), 1, + anon_sym_COLON, + [2033] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(435), 1, + anon_sym_EQ_GT, + [2040] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(437), 1, + sym_string, + [2047] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(439), 1, + sym_identifier, + [2054] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(441), 1, + anon_sym_EQ, + [2061] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(443), 1, + ts_builtin_sym_end, + [2068] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(445), 1, + anon_sym_EQ_GT, +}; + +static const uint32_t ts_small_parse_table_map[] = { + [SMALL_STATE(29)] = 0, + [SMALL_STATE(30)] = 36, + [SMALL_STATE(31)] = 72, + [SMALL_STATE(32)] = 118, + [SMALL_STATE(33)] = 154, + [SMALL_STATE(34)] = 190, + [SMALL_STATE(35)] = 236, + [SMALL_STATE(36)] = 272, + [SMALL_STATE(37)] = 318, + [SMALL_STATE(38)] = 364, + [SMALL_STATE(39)] = 400, + [SMALL_STATE(40)] = 436, + [SMALL_STATE(41)] = 472, + [SMALL_STATE(42)] = 508, + [SMALL_STATE(43)] = 544, + [SMALL_STATE(44)] = 580, + [SMALL_STATE(45)] = 616, + [SMALL_STATE(46)] = 652, + [SMALL_STATE(47)] = 698, + [SMALL_STATE(48)] = 744, + [SMALL_STATE(49)] = 780, + [SMALL_STATE(50)] = 816, + [SMALL_STATE(51)] = 862, + [SMALL_STATE(52)] = 898, + [SMALL_STATE(53)] = 940, + [SMALL_STATE(54)] = 980, + [SMALL_STATE(55)] = 1016, + [SMALL_STATE(56)] = 1052, + [SMALL_STATE(57)] = 1088, + [SMALL_STATE(58)] = 1124, + [SMALL_STATE(59)] = 1160, + [SMALL_STATE(60)] = 1196, + [SMALL_STATE(61)] = 1235, + [SMALL_STATE(62)] = 1277, + [SMALL_STATE(63)] = 1320, + [SMALL_STATE(64)] = 1349, + [SMALL_STATE(65)] = 1375, + [SMALL_STATE(66)] = 1395, + [SMALL_STATE(67)] = 1423, + [SMALL_STATE(68)] = 1451, + [SMALL_STATE(69)] = 1475, + [SMALL_STATE(70)] = 1498, + [SMALL_STATE(71)] = 1521, + [SMALL_STATE(72)] = 1543, + [SMALL_STATE(73)] = 1565, + [SMALL_STATE(74)] = 1587, + [SMALL_STATE(75)] = 1606, + [SMALL_STATE(76)] = 1625, + [SMALL_STATE(77)] = 1644, + [SMALL_STATE(78)] = 1660, + [SMALL_STATE(79)] = 1676, + [SMALL_STATE(80)] = 1690, + [SMALL_STATE(81)] = 1706, + [SMALL_STATE(82)] = 1719, + [SMALL_STATE(83)] = 1732, + [SMALL_STATE(84)] = 1745, + [SMALL_STATE(85)] = 1758, + [SMALL_STATE(86)] = 1771, + [SMALL_STATE(87)] = 1784, + [SMALL_STATE(88)] = 1795, + [SMALL_STATE(89)] = 1808, + [SMALL_STATE(90)] = 1821, + [SMALL_STATE(91)] = 1834, + [SMALL_STATE(92)] = 1847, + [SMALL_STATE(93)] = 1860, + [SMALL_STATE(94)] = 1873, + [SMALL_STATE(95)] = 1886, + [SMALL_STATE(96)] = 1899, + [SMALL_STATE(97)] = 1912, + [SMALL_STATE(98)] = 1925, + [SMALL_STATE(99)] = 1938, + [SMALL_STATE(100)] = 1948, + [SMALL_STATE(101)] = 1956, + [SMALL_STATE(102)] = 1964, + [SMALL_STATE(103)] = 1972, + [SMALL_STATE(104)] = 1980, + [SMALL_STATE(105)] = 1990, + [SMALL_STATE(106)] = 1998, + [SMALL_STATE(107)] = 2005, + [SMALL_STATE(108)] = 2012, + [SMALL_STATE(109)] = 2019, + [SMALL_STATE(110)] = 2026, + [SMALL_STATE(111)] = 2033, + [SMALL_STATE(112)] = 2040, + [SMALL_STATE(113)] = 2047, + [SMALL_STATE(114)] = 2054, + [SMALL_STATE(115)] = 2061, + [SMALL_STATE(116)] = 2068, +}; + +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_EXTRA(), + [5] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 0, 0, 0), + [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(60), + [9] = {.entry = {.count = 1, .reusable = false}}, SHIFT(42), + [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32), + [13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(32), + [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(62), + [17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(80), + [19] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), + [21] = {.entry = {.count = 1, .reusable = false}}, SHIFT(74), + [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), + [25] = {.entry = {.count = 1, .reusable = false}}, SHIFT(24), + [27] = {.entry = {.count = 1, .reusable = false}}, SHIFT(112), + [29] = {.entry = {.count = 1, .reusable = false}}, SHIFT(104), + [31] = {.entry = {.count = 1, .reusable = true}}, SHIFT(104), + [33] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), + [35] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(60), + [38] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(42), + [41] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(32), + [44] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(32), + [47] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(62), + [50] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(80), + [53] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(12), + [56] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(74), + [59] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(7), + [62] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(24), + [65] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(112), + [68] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(104), + [71] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(104), + [74] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1, 0, 0), + [76] = {.entry = {.count = 1, .reusable = false}}, SHIFT(73), + [78] = {.entry = {.count = 1, .reusable = true}}, SHIFT(73), + [80] = {.entry = {.count = 1, .reusable = true}}, SHIFT(33), + [82] = {.entry = {.count = 1, .reusable = true}}, SHIFT(110), + [84] = {.entry = {.count = 1, .reusable = true}}, SHIFT(54), + [86] = {.entry = {.count = 1, .reusable = true}}, SHIFT(43), + [88] = {.entry = {.count = 1, .reusable = false}}, SHIFT(65), + [90] = {.entry = {.count = 1, .reusable = true}}, SHIFT(72), + [92] = {.entry = {.count = 1, .reusable = true}}, SHIFT(109), + [94] = {.entry = {.count = 1, .reusable = false}}, SHIFT(67), + [96] = {.entry = {.count = 1, .reusable = true}}, SHIFT(67), + [98] = {.entry = {.count = 1, .reusable = true}}, SHIFT(55), + [100] = {.entry = {.count = 1, .reusable = false}}, SHIFT(68), + [102] = {.entry = {.count = 1, .reusable = true}}, SHIFT(68), + [104] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35), + [106] = {.entry = {.count = 1, .reusable = true}}, SHIFT(57), + [108] = {.entry = {.count = 1, .reusable = false}}, SHIFT(66), + [110] = {.entry = {.count = 1, .reusable = true}}, SHIFT(66), + [112] = {.entry = {.count = 1, .reusable = true}}, SHIFT(49), + [114] = {.entry = {.count = 1, .reusable = true}}, SHIFT(39), + [116] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30), + [118] = {.entry = {.count = 1, .reusable = false}}, SHIFT(47), + [120] = {.entry = {.count = 1, .reusable = true}}, SHIFT(47), + [122] = {.entry = {.count = 1, .reusable = false}}, SHIFT(53), + [124] = {.entry = {.count = 1, .reusable = true}}, SHIFT(53), + [126] = {.entry = {.count = 1, .reusable = false}}, SHIFT(46), + [128] = {.entry = {.count = 1, .reusable = true}}, SHIFT(46), + [130] = {.entry = {.count = 1, .reusable = false}}, SHIFT(34), + [132] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), + [134] = {.entry = {.count = 1, .reusable = false}}, SHIFT(70), + [136] = {.entry = {.count = 1, .reusable = true}}, SHIFT(70), + [138] = {.entry = {.count = 1, .reusable = false}}, SHIFT(36), + [140] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36), + [142] = {.entry = {.count = 1, .reusable = false}}, SHIFT(31), + [144] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31), + [146] = {.entry = {.count = 1, .reusable = false}}, SHIFT(37), + [148] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37), + [150] = {.entry = {.count = 1, .reusable = false}}, SHIFT(71), + [152] = {.entry = {.count = 1, .reusable = true}}, SHIFT(71), + [154] = {.entry = {.count = 1, .reusable = false}}, SHIFT(52), + [156] = {.entry = {.count = 1, .reusable = true}}, SHIFT(52), + [158] = {.entry = {.count = 1, .reusable = false}}, SHIFT(50), + [160] = {.entry = {.count = 1, .reusable = true}}, SHIFT(50), + [162] = {.entry = {.count = 1, .reusable = false}}, SHIFT(69), + [164] = {.entry = {.count = 1, .reusable = true}}, SHIFT(69), + [166] = {.entry = {.count = 1, .reusable = false}}, SHIFT(61), + [168] = {.entry = {.count = 1, .reusable = true}}, SHIFT(61), + [170] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_import_expression, 2, 0, 2), + [172] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_import_expression, 2, 0, 2), + [174] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_call_expression, 6, 0, 6), + [176] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_call_expression, 6, 0, 6), + [178] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_expression, 6, 0, 14), + [180] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_expression, 6, 0, 14), + [182] = {.entry = {.count = 1, .reusable = true}}, SHIFT(108), + [184] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), + [186] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), + [188] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), + [190] = {.entry = {.count = 1, .reusable = false}}, SHIFT(15), + [192] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_literal, 1, 0, 0), + [194] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_literal, 1, 0, 0), + [196] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_match_expression, 4, 0, 12), + [198] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_match_expression, 4, 0, 12), + [200] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_expression, 4, 0, 10), + [202] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_expression, 4, 0, 10), + [204] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_call_expression, 5, 0, 6), + [206] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_call_expression, 5, 0, 6), + [208] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_let_expression, 4, 0, 10), + [210] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_let_expression, 4, 0, 10), + [212] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_expression, 7, 0, 16), + [214] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_expression, 7, 0, 16), + [216] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_comparison_constraint, 2, 0, 3), + [218] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_comparison_constraint, 2, 0, 3), + [220] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_array, 4, 0, 0), + [222] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_array, 4, 0, 0), + [224] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_match_expression, 5, 0, 12), + [226] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_match_expression, 5, 0, 12), + [228] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_call_expression, 4, 0, 6), + [230] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_call_expression, 4, 0, 6), + [232] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_boolean, 1, 0, 0), + [234] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_boolean, 1, 0, 0), + [236] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_match_expression, 7, 0, 12), + [238] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_match_expression, 7, 0, 12), + [240] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_object, 4, 0, 0), + [242] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_object, 4, 0, 0), + [244] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_object, 3, 0, 0), + [246] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_object, 3, 0, 0), + [248] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_expression, 5, 0, 13), + [250] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_expression, 5, 0, 13), + [252] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_default_expression, 3, 0, 8), + [254] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_default_expression, 3, 0, 8), + [256] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_array, 3, 0, 0), + [258] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_array, 3, 0, 0), + [260] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_array, 2, 0, 0), + [262] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_array, 2, 0, 0), + [264] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_let_expression, 3, 0, 4), + [266] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_let_expression, 3, 0, 4), + [268] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_object, 2, 0, 0), + [270] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_object, 2, 0, 0), + [272] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_binary_expression, 3, 0, 7), + [274] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_binary_expression, 3, 0, 7), + [276] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_match_expression, 6, 0, 12), + [278] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_match_expression, 6, 0, 12), + [280] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_call_expression, 3, 0, 6), + [282] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_call_expression, 3, 0, 6), + [284] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parenthesized_expression, 3, 0, 0), + [286] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_parenthesized_expression, 3, 0, 0), + [288] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_array, 5, 0, 0), + [290] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_array, 5, 0, 0), + [292] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_object, 5, 0, 0), + [294] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_object, 5, 0, 0), + [296] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_path_expression, 3, 0, 5), + [298] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_path_expression, 3, 0, 5), + [300] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__expression, 1, 0, 0), + [302] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__expression, 1, 0, 0), + [304] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field_path, 1, 0, 0), + [306] = {.entry = {.count = 1, .reusable = true}}, SHIFT(113), + [308] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field_definition, 3, 0, 9), + [310] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_field_definition, 3, 0, 9), + [312] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__statement, 1, 0, 0), + [314] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__statement, 1, 0, 0), + [316] = {.entry = {.count = 1, .reusable = true}}, SHIFT(64), + [318] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__statement, 2, 0, 0), + [320] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__statement, 2, 0, 0), + [322] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parameter, 1, 0, 1), + [324] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym__expression, 1, 0, 0), REDUCE(sym_parameter, 1, 0, 1), + [327] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), + [329] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), + [331] = {.entry = {.count = 1, .reusable = true}}, SHIFT(48), + [333] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), + [335] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), + [337] = {.entry = {.count = 1, .reusable = true}}, SHIFT(41), + [339] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_array_repeat1, 2, 0, 0), + [341] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_match_arm, 3, 0, 15), + [343] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parameter, 3, 0, 11), + [345] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), + [347] = {.entry = {.count = 1, .reusable = true}}, SHIFT(56), + [349] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), + [351] = {.entry = {.count = 1, .reusable = false}}, SHIFT(96), + [353] = {.entry = {.count = 1, .reusable = false}}, SHIFT(26), + [355] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_let_expression_repeat1, 2, 0, 0), SHIFT_REPEAT(96), + [358] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_let_expression_repeat1, 2, 0, 0), + [360] = {.entry = {.count = 1, .reusable = false}}, SHIFT(20), + [362] = {.entry = {.count = 1, .reusable = true}}, SHIFT(96), + [364] = {.entry = {.count = 1, .reusable = true}}, SHIFT(58), + [366] = {.entry = {.count = 1, .reusable = true}}, SHIFT(44), + [368] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_array_repeat1, 2, 0, 0), SHIFT_REPEAT(21), + [371] = {.entry = {.count = 1, .reusable = true}}, SHIFT(51), + [373] = {.entry = {.count = 1, .reusable = true}}, SHIFT(83), + [375] = {.entry = {.count = 1, .reusable = true}}, SHIFT(116), + [377] = {.entry = {.count = 1, .reusable = true}}, SHIFT(77), + [379] = {.entry = {.count = 1, .reusable = true}}, SHIFT(87), + [381] = {.entry = {.count = 1, .reusable = true}}, SHIFT(106), + [383] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_function_expression_repeat1, 2, 0, 0), SHIFT_REPEAT(99), + [386] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_function_expression_repeat1, 2, 0, 0), + [388] = {.entry = {.count = 1, .reusable = true}}, SHIFT(78), + [390] = {.entry = {.count = 1, .reusable = true}}, SHIFT(45), + [392] = {.entry = {.count = 1, .reusable = true}}, SHIFT(95), + [394] = {.entry = {.count = 1, .reusable = true}}, SHIFT(111), + [396] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), + [398] = {.entry = {.count = 1, .reusable = true}}, SHIFT(40), + [400] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_match_expression_repeat1, 2, 0, 0), SHIFT_REPEAT(8), + [403] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_match_expression_repeat1, 2, 0, 0), + [405] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), + [407] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), + [409] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field_path, 2, 0, 0), + [411] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_field_path_repeat1, 2, 0, 0), + [413] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_field_path_repeat1, 2, 0, 0), SHIFT_REPEAT(113), + [416] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), + [418] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_object_repeat1, 2, 0, 0), SHIFT_REPEAT(93), + [421] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_object_repeat1, 2, 0, 0), + [423] = {.entry = {.count = 1, .reusable = false}}, SHIFT(38), + [425] = {.entry = {.count = 1, .reusable = true}}, SHIFT(38), + [427] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), + [429] = {.entry = {.count = 1, .reusable = true}}, SHIFT(100), + [431] = {.entry = {.count = 1, .reusable = true}}, SHIFT(59), + [433] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), + [435] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), + [437] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29), + [439] = {.entry = {.count = 1, .reusable = true}}, SHIFT(102), + [441] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28), + [443] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [445] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), +}; + +#ifdef __cplusplus +extern "C" { +#endif +#ifdef TREE_SITTER_HIDE_SYMBOLS +#define TS_PUBLIC +#elif defined(_WIN32) +#define TS_PUBLIC __declspec(dllexport) +#else +#define TS_PUBLIC __attribute__((visibility("default"))) +#endif + +TS_PUBLIC const TSLanguage *tree_sitter_decodal(void) { + static const TSLanguage language = { + .version = LANGUAGE_VERSION, + .symbol_count = SYMBOL_COUNT, + .alias_count = ALIAS_COUNT, + .token_count = TOKEN_COUNT, + .external_token_count = EXTERNAL_TOKEN_COUNT, + .state_count = STATE_COUNT, + .large_state_count = LARGE_STATE_COUNT, + .production_id_count = PRODUCTION_ID_COUNT, + .field_count = FIELD_COUNT, + .max_alias_sequence_length = MAX_ALIAS_SEQUENCE_LENGTH, + .parse_table = &ts_parse_table[0][0], + .small_parse_table = ts_small_parse_table, + .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, + .alias_sequences = &ts_alias_sequences[0][0], + .lex_modes = ts_lex_modes, + .lex_fn = ts_lex, + .keyword_lex_fn = ts_lex_keywords, + .keyword_capture_token = sym_identifier, + .primary_state_ids = ts_primary_state_ids, + }; + return &language; +} +#ifdef __cplusplus +} +#endif diff --git a/editors/tree-sitter-decodal/src/tree_sitter/alloc.h b/editors/tree-sitter-decodal/src/tree_sitter/alloc.h new file mode 100644 index 0000000..1f4466d --- /dev/null +++ b/editors/tree-sitter-decodal/src/tree_sitter/alloc.h @@ -0,0 +1,54 @@ +#ifndef TREE_SITTER_ALLOC_H_ +#define TREE_SITTER_ALLOC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +// Allow clients to override allocation functions +#ifdef TREE_SITTER_REUSE_ALLOCATOR + +extern void *(*ts_current_malloc)(size_t); +extern void *(*ts_current_calloc)(size_t, size_t); +extern void *(*ts_current_realloc)(void *, size_t); +extern void (*ts_current_free)(void *); + +#ifndef ts_malloc +#define ts_malloc ts_current_malloc +#endif +#ifndef ts_calloc +#define ts_calloc ts_current_calloc +#endif +#ifndef ts_realloc +#define ts_realloc ts_current_realloc +#endif +#ifndef ts_free +#define ts_free ts_current_free +#endif + +#else + +#ifndef ts_malloc +#define ts_malloc malloc +#endif +#ifndef ts_calloc +#define ts_calloc calloc +#endif +#ifndef ts_realloc +#define ts_realloc realloc +#endif +#ifndef ts_free +#define ts_free free +#endif + +#endif + +#ifdef __cplusplus +} +#endif + +#endif // TREE_SITTER_ALLOC_H_ diff --git a/editors/tree-sitter-decodal/src/tree_sitter/array.h b/editors/tree-sitter-decodal/src/tree_sitter/array.h new file mode 100644 index 0000000..15a3b23 --- /dev/null +++ b/editors/tree-sitter-decodal/src/tree_sitter/array.h @@ -0,0 +1,290 @@ +#ifndef TREE_SITTER_ARRAY_H_ +#define TREE_SITTER_ARRAY_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "./alloc.h" + +#include +#include +#include +#include +#include + +#ifdef _MSC_VER +#pragma warning(disable : 4101) +#elif defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#endif + +#define Array(T) \ + struct { \ + T *contents; \ + uint32_t size; \ + uint32_t capacity; \ + } + +/// Initialize an array. +#define array_init(self) \ + ((self)->size = 0, (self)->capacity = 0, (self)->contents = NULL) + +/// Create an empty array. +#define array_new() \ + { NULL, 0, 0 } + +/// Get a pointer to the element at a given `index` in the array. +#define array_get(self, _index) \ + (assert((uint32_t)(_index) < (self)->size), &(self)->contents[_index]) + +/// Get a pointer to the first element in the array. +#define array_front(self) array_get(self, 0) + +/// Get a pointer to the last element in the array. +#define array_back(self) array_get(self, (self)->size - 1) + +/// Clear the array, setting its size to zero. Note that this does not free any +/// memory allocated for the array's contents. +#define array_clear(self) ((self)->size = 0) + +/// Reserve `new_capacity` elements of space in the array. If `new_capacity` is +/// less than the array's current capacity, this function has no effect. +#define array_reserve(self, new_capacity) \ + _array__reserve((Array *)(self), array_elem_size(self), new_capacity) + +/// Free any memory allocated for this array. Note that this does not free any +/// memory allocated for the array's contents. +#define array_delete(self) _array__delete((Array *)(self)) + +/// Push a new `element` onto the end of the array. +#define array_push(self, element) \ + (_array__grow((Array *)(self), 1, array_elem_size(self)), \ + (self)->contents[(self)->size++] = (element)) + +/// Increase the array's size by `count` elements. +/// New elements are zero-initialized. +#define array_grow_by(self, count) \ + do { \ + if ((count) == 0) break; \ + _array__grow((Array *)(self), count, array_elem_size(self)); \ + memset((self)->contents + (self)->size, 0, (count) * array_elem_size(self)); \ + (self)->size += (count); \ + } while (0) + +/// Append all elements from one array to the end of another. +#define array_push_all(self, other) \ + array_extend((self), (other)->size, (other)->contents) + +/// Append `count` elements to the end of the array, reading their values from the +/// `contents` pointer. +#define array_extend(self, count, contents) \ + _array__splice( \ + (Array *)(self), array_elem_size(self), (self)->size, \ + 0, count, contents \ + ) + +/// Remove `old_count` elements from the array starting at the given `index`. At +/// the same index, insert `new_count` new elements, reading their values from the +/// `new_contents` pointer. +#define array_splice(self, _index, old_count, new_count, new_contents) \ + _array__splice( \ + (Array *)(self), array_elem_size(self), _index, \ + old_count, new_count, new_contents \ + ) + +/// Insert one `element` into the array at the given `index`. +#define array_insert(self, _index, element) \ + _array__splice((Array *)(self), array_elem_size(self), _index, 0, 1, &(element)) + +/// Remove one element from the array at the given `index`. +#define array_erase(self, _index) \ + _array__erase((Array *)(self), array_elem_size(self), _index) + +/// Pop the last element off the array, returning the element by value. +#define array_pop(self) ((self)->contents[--(self)->size]) + +/// Assign the contents of one array to another, reallocating if necessary. +#define array_assign(self, other) \ + _array__assign((Array *)(self), (const Array *)(other), array_elem_size(self)) + +/// Swap one array with another +#define array_swap(self, other) \ + _array__swap((Array *)(self), (Array *)(other)) + +/// Get the size of the array contents +#define array_elem_size(self) (sizeof *(self)->contents) + +/// Search a sorted array for a given `needle` value, using the given `compare` +/// callback to determine the order. +/// +/// If an existing element is found to be equal to `needle`, then the `index` +/// out-parameter is set to the existing value's index, and the `exists` +/// out-parameter is set to true. Otherwise, `index` is set to an index where +/// `needle` should be inserted in order to preserve the sorting, and `exists` +/// is set to false. +#define array_search_sorted_with(self, compare, needle, _index, _exists) \ + _array__search_sorted(self, 0, compare, , needle, _index, _exists) + +/// Search a sorted array for a given `needle` value, using integer comparisons +/// of a given struct field (specified with a leading dot) to determine the order. +/// +/// See also `array_search_sorted_with`. +#define array_search_sorted_by(self, field, needle, _index, _exists) \ + _array__search_sorted(self, 0, _compare_int, field, needle, _index, _exists) + +/// Insert a given `value` into a sorted array, using the given `compare` +/// callback to determine the order. +#define array_insert_sorted_with(self, compare, value) \ + do { \ + unsigned _index, _exists; \ + array_search_sorted_with(self, compare, &(value), &_index, &_exists); \ + if (!_exists) array_insert(self, _index, value); \ + } while (0) + +/// Insert a given `value` into a sorted array, using integer comparisons of +/// a given struct field (specified with a leading dot) to determine the order. +/// +/// See also `array_search_sorted_by`. +#define array_insert_sorted_by(self, field, value) \ + do { \ + unsigned _index, _exists; \ + array_search_sorted_by(self, field, (value) field, &_index, &_exists); \ + if (!_exists) array_insert(self, _index, value); \ + } while (0) + +// Private + +typedef Array(void) Array; + +/// This is not what you're looking for, see `array_delete`. +static inline void _array__delete(Array *self) { + if (self->contents) { + ts_free(self->contents); + self->contents = NULL; + self->size = 0; + self->capacity = 0; + } +} + +/// This is not what you're looking for, see `array_erase`. +static inline void _array__erase(Array *self, size_t element_size, + uint32_t index) { + assert(index < self->size); + char *contents = (char *)self->contents; + memmove(contents + index * element_size, contents + (index + 1) * element_size, + (self->size - index - 1) * element_size); + self->size--; +} + +/// This is not what you're looking for, see `array_reserve`. +static inline void _array__reserve(Array *self, size_t element_size, uint32_t new_capacity) { + if (new_capacity > self->capacity) { + if (self->contents) { + self->contents = ts_realloc(self->contents, new_capacity * element_size); + } else { + self->contents = ts_malloc(new_capacity * element_size); + } + self->capacity = new_capacity; + } +} + +/// This is not what you're looking for, see `array_assign`. +static inline void _array__assign(Array *self, const Array *other, size_t element_size) { + _array__reserve(self, element_size, other->size); + self->size = other->size; + memcpy(self->contents, other->contents, self->size * element_size); +} + +/// This is not what you're looking for, see `array_swap`. +static inline void _array__swap(Array *self, Array *other) { + Array swap = *other; + *other = *self; + *self = swap; +} + +/// This is not what you're looking for, see `array_push` or `array_grow_by`. +static inline void _array__grow(Array *self, uint32_t count, size_t element_size) { + uint32_t new_size = self->size + count; + if (new_size > self->capacity) { + uint32_t new_capacity = self->capacity * 2; + if (new_capacity < 8) new_capacity = 8; + if (new_capacity < new_size) new_capacity = new_size; + _array__reserve(self, element_size, new_capacity); + } +} + +/// This is not what you're looking for, see `array_splice`. +static inline void _array__splice(Array *self, size_t element_size, + uint32_t index, uint32_t old_count, + uint32_t new_count, const void *elements) { + uint32_t new_size = self->size + new_count - old_count; + uint32_t old_end = index + old_count; + uint32_t new_end = index + new_count; + assert(old_end <= self->size); + + _array__reserve(self, element_size, new_size); + + char *contents = (char *)self->contents; + if (self->size > old_end) { + memmove( + contents + new_end * element_size, + contents + old_end * element_size, + (self->size - old_end) * element_size + ); + } + if (new_count > 0) { + if (elements) { + memcpy( + (contents + index * element_size), + elements, + new_count * element_size + ); + } else { + memset( + (contents + index * element_size), + 0, + new_count * element_size + ); + } + } + self->size += new_count - old_count; +} + +/// A binary search routine, based on Rust's `std::slice::binary_search_by`. +/// This is not what you're looking for, see `array_search_sorted_with` or `array_search_sorted_by`. +#define _array__search_sorted(self, start, compare, suffix, needle, _index, _exists) \ + do { \ + *(_index) = start; \ + *(_exists) = false; \ + uint32_t size = (self)->size - *(_index); \ + if (size == 0) break; \ + int comparison; \ + while (size > 1) { \ + uint32_t half_size = size / 2; \ + uint32_t mid_index = *(_index) + half_size; \ + comparison = compare(&((self)->contents[mid_index] suffix), (needle)); \ + if (comparison <= 0) *(_index) = mid_index; \ + size -= half_size; \ + } \ + comparison = compare(&((self)->contents[*(_index)] suffix), (needle)); \ + if (comparison == 0) *(_exists) = true; \ + else if (comparison < 0) *(_index) += 1; \ + } while (0) + +/// Helper macro for the `_sorted_by` routines below. This takes the left (existing) +/// parameter by reference in order to work with the generic sorting function above. +#define _compare_int(a, b) ((int)*(a) - (int)(b)) + +#ifdef _MSC_VER +#pragma warning(default : 4101) +#elif defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic pop +#endif + +#ifdef __cplusplus +} +#endif + +#endif // TREE_SITTER_ARRAY_H_ diff --git a/editors/tree-sitter-decodal/src/tree_sitter/parser.h b/editors/tree-sitter-decodal/src/tree_sitter/parser.h new file mode 100644 index 0000000..17f0e94 --- /dev/null +++ b/editors/tree-sitter-decodal/src/tree_sitter/parser.h @@ -0,0 +1,265 @@ +#ifndef TREE_SITTER_PARSER_H_ +#define TREE_SITTER_PARSER_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +#define ts_builtin_sym_error ((TSSymbol)-1) +#define ts_builtin_sym_end 0 +#define TREE_SITTER_SERIALIZATION_BUFFER_SIZE 1024 + +#ifndef TREE_SITTER_API_H_ +typedef uint16_t TSStateId; +typedef uint16_t TSSymbol; +typedef uint16_t TSFieldId; +typedef struct TSLanguage TSLanguage; +#endif + +typedef struct { + TSFieldId field_id; + uint8_t child_index; + bool inherited; +} TSFieldMapEntry; + +typedef struct { + uint16_t index; + uint16_t length; +} TSFieldMapSlice; + +typedef struct { + bool visible; + bool named; + bool supertype; +} TSSymbolMetadata; + +typedef struct TSLexer TSLexer; + +struct TSLexer { + int32_t lookahead; + TSSymbol result_symbol; + void (*advance)(TSLexer *, bool); + void (*mark_end)(TSLexer *); + uint32_t (*get_column)(TSLexer *); + bool (*is_at_included_range_start)(const TSLexer *); + bool (*eof)(const TSLexer *); +}; + +typedef enum { + TSParseActionTypeShift, + TSParseActionTypeReduce, + TSParseActionTypeAccept, + TSParseActionTypeRecover, +} TSParseActionType; + +typedef union { + struct { + uint8_t type; + TSStateId state; + bool extra; + bool repetition; + } shift; + struct { + uint8_t type; + uint8_t child_count; + TSSymbol symbol; + int16_t dynamic_precedence; + uint16_t production_id; + } reduce; + uint8_t type; +} TSParseAction; + +typedef struct { + uint16_t lex_state; + uint16_t external_lex_state; +} TSLexMode; + +typedef union { + TSParseAction action; + struct { + uint8_t count; + bool reusable; + } entry; +} TSParseActionEntry; + +typedef struct { + int32_t start; + int32_t end; +} TSCharacterRange; + +struct TSLanguage { + uint32_t version; + uint32_t symbol_count; + uint32_t alias_count; + uint32_t token_count; + uint32_t external_token_count; + uint32_t state_count; + uint32_t large_state_count; + uint32_t production_id_count; + uint32_t field_count; + uint16_t max_alias_sequence_length; + const uint16_t *parse_table; + const uint16_t *small_parse_table; + const uint32_t *small_parse_table_map; + const TSParseActionEntry *parse_actions; + const char * const *symbol_names; + const char * const *field_names; + const TSFieldMapSlice *field_map_slices; + const TSFieldMapEntry *field_map_entries; + const TSSymbolMetadata *symbol_metadata; + const TSSymbol *public_symbol_map; + const uint16_t *alias_map; + const TSSymbol *alias_sequences; + const TSLexMode *lex_modes; + bool (*lex_fn)(TSLexer *, TSStateId); + bool (*keyword_lex_fn)(TSLexer *, TSStateId); + TSSymbol keyword_capture_token; + struct { + const bool *states; + const TSSymbol *symbol_map; + void *(*create)(void); + void (*destroy)(void *); + bool (*scan)(void *, TSLexer *, const bool *symbol_whitelist); + unsigned (*serialize)(void *, char *); + void (*deserialize)(void *, const char *, unsigned); + } external_scanner; + const TSStateId *primary_state_ids; +}; + +static inline bool set_contains(TSCharacterRange *ranges, uint32_t len, int32_t lookahead) { + uint32_t index = 0; + uint32_t size = len - index; + while (size > 1) { + uint32_t half_size = size / 2; + uint32_t mid_index = index + half_size; + TSCharacterRange *range = &ranges[mid_index]; + if (lookahead >= range->start && lookahead <= range->end) { + return true; + } else if (lookahead > range->end) { + index = mid_index; + } + size -= half_size; + } + TSCharacterRange *range = &ranges[index]; + return (lookahead >= range->start && lookahead <= range->end); +} + +/* + * Lexer Macros + */ + +#ifdef _MSC_VER +#define UNUSED __pragma(warning(suppress : 4101)) +#else +#define UNUSED __attribute__((unused)) +#endif + +#define START_LEXER() \ + bool result = false; \ + bool skip = false; \ + UNUSED \ + bool eof = false; \ + int32_t lookahead; \ + goto start; \ + next_state: \ + lexer->advance(lexer, skip); \ + start: \ + skip = false; \ + lookahead = lexer->lookahead; + +#define ADVANCE(state_value) \ + { \ + state = state_value; \ + goto next_state; \ + } + +#define ADVANCE_MAP(...) \ + { \ + static const uint16_t map[] = { __VA_ARGS__ }; \ + for (uint32_t i = 0; i < sizeof(map) / sizeof(map[0]); i += 2) { \ + if (map[i] == lookahead) { \ + state = map[i + 1]; \ + goto next_state; \ + } \ + } \ + } + +#define SKIP(state_value) \ + { \ + skip = true; \ + state = state_value; \ + goto next_state; \ + } + +#define ACCEPT_TOKEN(symbol_value) \ + result = true; \ + lexer->result_symbol = symbol_value; \ + lexer->mark_end(lexer); + +#define END_STATE() return result; + +/* + * Parse Table Macros + */ + +#define SMALL_STATE(id) ((id) - LARGE_STATE_COUNT) + +#define STATE(id) id + +#define ACTIONS(id) id + +#define SHIFT(state_value) \ + {{ \ + .shift = { \ + .type = TSParseActionTypeShift, \ + .state = (state_value) \ + } \ + }} + +#define SHIFT_REPEAT(state_value) \ + {{ \ + .shift = { \ + .type = TSParseActionTypeShift, \ + .state = (state_value), \ + .repetition = true \ + } \ + }} + +#define SHIFT_EXTRA() \ + {{ \ + .shift = { \ + .type = TSParseActionTypeShift, \ + .extra = true \ + } \ + }} + +#define REDUCE(symbol_name, children, precedence, prod_id) \ + {{ \ + .reduce = { \ + .type = TSParseActionTypeReduce, \ + .symbol = symbol_name, \ + .child_count = children, \ + .dynamic_precedence = precedence, \ + .production_id = prod_id \ + }, \ + }} + +#define RECOVER() \ + {{ \ + .type = TSParseActionTypeRecover \ + }} + +#define ACCEPT_INPUT() \ + {{ \ + .type = TSParseActionTypeAccept \ + }} + +#ifdef __cplusplus +} +#endif + +#endif // TREE_SITTER_PARSER_H_