diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..d3a8b5b --- /dev/null +++ b/.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/.gitattributes b/.gitattributes new file mode 100644 index 0000000..ffb52ab --- /dev/null +++ b/.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/.gitignore b/.gitignore new file mode 100644 index 0000000..27fc43f --- /dev/null +++ b/.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/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..8396f71 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "tree-sitter-exograph" +description = "Exograph grammar for tree-sitter" +version = "0.0.1" +license = "Apache-2.0" +readme = "README.md" +keywords = ["incremental", "parsing", "tree-sitter", "exograph"] +categories = ["parsing", "text-editors"] +repository = "https://github.com/exograph/tree-sitter-grammar" +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/Makefile b/Makefile new file mode 100644 index 0000000..4df5d26 --- /dev/null +++ b/Makefile @@ -0,0 +1,112 @@ +VERSION := 0.0.1 + +LANGUAGE_NAME := tree-sitter-exograph + +# 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/Package.swift b/Package.swift new file mode 100644 index 0000000..d4c14d8 --- /dev/null +++ b/Package.swift @@ -0,0 +1,47 @@ +// swift-tools-version:5.3 +import PackageDescription + +let package = Package( + name: "TreeSitterExograph", + products: [ + .library(name: "TreeSitterExograph", targets: ["TreeSitterExograph"]), + ], + dependencies: [], + targets: [ + .target(name: "TreeSitterExograph", + 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/README.md b/README.md new file mode 100644 index 0000000..1a41d10 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Tree Sitter Exograph + +Exograph grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter). diff --git a/binding.gyp b/binding.gyp new file mode 100644 index 0000000..0b700a5 --- /dev/null +++ b/binding.gyp @@ -0,0 +1,30 @@ +{ + "targets": [ + { + "target_name": "tree_sitter_exograph_binding", + "dependencies": [ + " + +typedef struct TSLanguage TSLanguage; + +extern "C" TSLanguage *tree_sitter_exograph(); + +// "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, "exograph"); + auto language = Napi::External::New(env, tree_sitter_exograph()); + language.TypeTag(&LANGUAGE_TYPE_TAG); + exports["language"] = language; + return exports; +} + +NODE_API_MODULE(tree_sitter_exograph_binding, Init) diff --git a/bindings/node/index.d.ts b/bindings/node/index.d.ts new file mode 100644 index 0000000..efe259e --- /dev/null +++ b/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/bindings/node/index.js b/bindings/node/index.js new file mode 100644 index 0000000..6657bcf --- /dev/null +++ b/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/bindings/python/tree_sitter_exograph/__init__.py b/bindings/python/tree_sitter_exograph/__init__.py new file mode 100644 index 0000000..2725d74 --- /dev/null +++ b/bindings/python/tree_sitter_exograph/__init__.py @@ -0,0 +1,5 @@ +"Exograph grammar for tree-sitter" + +from ._binding import language + +__all__ = ["language"] diff --git a/bindings/python/tree_sitter_exograph/__init__.pyi b/bindings/python/tree_sitter_exograph/__init__.pyi new file mode 100644 index 0000000..5416666 --- /dev/null +++ b/bindings/python/tree_sitter_exograph/__init__.pyi @@ -0,0 +1 @@ +def language() -> int: ... diff --git a/bindings/python/tree_sitter_exograph/binding.c b/bindings/python/tree_sitter_exograph/binding.c new file mode 100644 index 0000000..5f28260 --- /dev/null +++ b/bindings/python/tree_sitter_exograph/binding.c @@ -0,0 +1,27 @@ +#include + +typedef struct TSLanguage TSLanguage; + +TSLanguage *tree_sitter_exograph(void); + +static PyObject* _binding_language(PyObject *self, PyObject *args) { + return PyLong_FromVoidPtr(tree_sitter_exograph()); +} + +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/bindings/python/tree_sitter_exograph/py.typed b/bindings/python/tree_sitter_exograph/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/bindings/rust/build.rs b/bindings/rust/build.rs new file mode 100644 index 0000000..0e18a26 --- /dev/null +++ b/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-exograph"); +} diff --git a/bindings/rust/lib.rs b/bindings/rust/lib.rs new file mode 100644 index 0000000..3a02f4c --- /dev/null +++ b/bindings/rust/lib.rs @@ -0,0 +1,54 @@ +//! This crate provides Exograph 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_exograph::language()).expect("Error loading Exograph 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_exograph() -> 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_exograph() } +} + +/// 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 Exograph grammar"); + } +} diff --git a/bindings/swift/TreeSitterExograph/exograph.h b/bindings/swift/TreeSitterExograph/exograph.h new file mode 100644 index 0000000..beb39ca --- /dev/null +++ b/bindings/swift/TreeSitterExograph/exograph.h @@ -0,0 +1,16 @@ +#ifndef TREE_SITTER_EXOGRAPH_H_ +#define TREE_SITTER_EXOGRAPH_H_ + +typedef struct TSLanguage TSLanguage; + +#ifdef __cplusplus +extern "C" { +#endif + +const TSLanguage *tree_sitter_exograph(void); + +#ifdef __cplusplus +} +#endif + +#endif // TREE_SITTER_EXOGRAPH_H_ diff --git a/grammar.js b/grammar.js new file mode 100644 index 0000000..f73aba0 --- /dev/null +++ b/grammar.js @@ -0,0 +1,221 @@ +// Copyright Exograph, Inc. All rights reserved. + +const logical_level = 1; +const relational_level = logical_level + 1; +const not_level = relational_level + 1; + +module.exports = grammar({ + name: 'exograph', + + extras: $ => [ + /\s/, + $.comment + ], + + rules: { + source_file: $ => repeat($.declaration), + declaration: $ => choice( + $.context, + $.module, + $.import + ), + import: $ => seq( + "import", + field("path", $.literal_str) + ), + module: $ => seq( + repeat(field("annotation", $.annotation)), + "module", + field("name", $.term), + field("body", $.module_body) + ), + module_body: $ => seq( + "{", + repeat(field("field", $.module_field)), + "}" + ), + module_field: $ => choice( + $.type, + $.module_method, + $.interceptor + ), + module_method: $ => seq( + repeat(field("annotation", $.annotation)), + optional(field("is_exported", "export")), + field("method_type", choice("query", "mutation")), + field("name", $.term), + "(", + optional(commaSep(field("args", $.argument))), + "):", + field("return_type", $.field_type) + ), + interceptor: $ => seq( + repeat(field("annotation", $.annotation)), + "interceptor", + field("name", $.term), + "(", + optional(commaSep(field("args", $.argument))), + ")", + ), + context: $ => seq( + repeat(field("annotation", $.annotation)), + "context", + field("name", $.term), + field("body", $.type_body) + ), + type: $ => seq( + repeat(field("annotation", $.annotation)), + "type", + field("name", $.term), + field("body", $.type_body) + ), + type_body: $ => seq("{", repeat(field("field", $.field)), "}"), + annotation: $ => seq( + "@", + field("name", $.term), + optional(seq( + "(", + field("params", $.annotation_params), + ")" + )) + ), + annotation_params: $ => choice( + $.annotation_multiple_params, + $.annotation_map_params + ), + annotation_multiple_params: $ => commaSep(field("exprs", $.expression)), + annotation_map_params: $ => commaSep(field("param", $.annotation_map_param)), + annotation_map_param: $ => seq(field("name", $.term), "=", field("expr", $.expression)), + argument: $ => seq( + repeat(field("annotation", $.annotation)), + field("name", $.term), + ":", + field("argument_type", $.field_type), + ), + field: $ => seq( + repeat(field("annotation", $.annotation)), + field("name", $.term), + ":", + field("field_type", $.field_type), + optional(seq( + "=", + field("default_value", $.field_default_value) + )), + optional(";") + ), + field_default_value: $ => choice( + field("default_value_concrete", $.expression), + seq( + field("default_value_fn", $.term), + "(", + optional(commaSep(field("default_value_fn_args", $.expression))), + ")" + ) + ), + field_type: $ => choice( + $.optional_field_type, + seq($.term, optional(seq("<", commaSep(field("type_param", $.field_type)), ">"))) + ), + optional_field_type: $ => seq(field("inner", $.field_type), "?"), + expression: $ => choice( + $.parenthetical, + prec(1, $.logical_op), + prec(3, $.relational_op), + $.selection, + $.literal_number, + $.literal_str, + $.literal_boolean + ), + parenthetical: $ => seq("(", field("expression", $.expression), ")"), + selection: $ => choice( + $.selection_select, + $.term + ), + selection_select: $ => seq( + field("prefix", $.selection), + ".", + field("selection_element", $.selection_element) + ), + selection_element: $ => choice( + $.term, + $.hof_call, + ), + // High-order function call of the `name(param_name, expr)` such as: + // - `some((du) => du.userId == AuthContext.id && du.read)` + // - `some(du => du.userId == AuthContext.id && du.read)` + // (note `du` vs `(du)`) + hof_call: $ => seq( + field("name", $.term), // "some" + "(", + choice( + field("param_name", $.term), // "du" + seq("(", field("param_name", $.term), ")") // "(du)" + ), + "=>", + field("expr", $.expression), // "du.userId == AuthContext.id && du.read" + ")" + ), + logical_op: $ => choice( + $.logical_or, + $.logical_and, + $.logical_not + ), + logical_or: $ => prec.left(logical_level, seq( + field("left", $.expression), "||", field("right", $.expression) + )), + logical_and: $ => prec.left(logical_level, seq( + field("left", $.expression), "&&", field("right", $.expression) + )), + logical_not: $ => prec(not_level, seq( + "!", field("value", $.expression) + )), + relational_op: $ => choice( + $.relational_eq, + $.relational_neq, + $.relational_lt, + $.relational_lte, + $.relational_gt, + $.relational_gte, + $.relational_in, + ), + relational_eq: $ => prec.left(relational_level, seq( + field("left", $.expression), "==", field("right", $.expression) + )), + relational_neq: $ => prec.left(relational_level, seq( + field("left", $.expression), "!=", field("right", $.expression) + )), + relational_lt: $ => prec.left(relational_level, seq( + field("left", $.expression), "<", field("right", $.expression) + )), + relational_lte: $ => prec.left(relational_level, seq( + field("left", $.expression), "<=", field("right", $.expression) + )), + relational_gt: $ => prec.left(relational_level, seq( + field("left", $.expression), ">", field("right", $.expression) + )), + relational_gte: $ => prec.left(relational_level, seq( + field("left", $.expression), ">=", field("right", $.expression) + )), + relational_in: $ => prec.left(relational_level, seq( + field("left", $.expression), "in", field("right", $.expression) + )), + term: $ => /[a-zA-Z_][a-zA-Z0-9_]*/, + str: $ => /(?:[^"\\]|\\.)*/, // string with escaped quotes + number: $ => /\d+/, + literal_str: $ => seq("\"", field("value", $.str), "\""), + literal_boolean: $ => choice("true", "false"), + literal_number: $ => field("value", $.number), + comment: $ => token(choice( + seq('//', /.*/), + seq( + '/*', + /[^*]*\*+([^/*][^*]*\*+)*/, + '/' + ) + )) + } +}); + +function commaSep(rule) { + return seq(rule, repeat(seq(",", rule))) +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..e0c7d9a --- /dev/null +++ b/package-lock.json @@ -0,0 +1,34 @@ +{ + "name": "tree-sitter-grammar", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "tree-sitter-grammar", + "version": "1.0.0", + "license": "Apache-2.0", + "dependencies": { + "nan": "^2.19.0" + }, + "devDependencies": { + "tree-sitter-cli": "^0.22.6" + } + }, + "node_modules/nan": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.19.0.tgz", + "integrity": "sha512-nO1xXxfh/RWNxfd/XPfbIfFk5vgLsAxUR9y5O0cHMJu/AW9U95JLXqthYHjEp+8gQ5p96K9jUp8nbVOxCdRbtw==" + }, + "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, + "bin": { + "tree-sitter": "cli.js" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..bbd6ddd --- /dev/null +++ b/package.json @@ -0,0 +1,48 @@ +{ + "name": "tree-sitter-grammar", + "version": "0.0.1", + "description": "Exograph grammar for tree-sitter", + "repository": "github:exograph/tree-sitter-grammar", + "main": "bindings/node", + "types": "bindings/node", + "scripts": { + "install": "node-gyp-build", + "prebuildify": "prebuildify --napi --strip" + }, + "keywords": [ + "tree-sitter", + "exograph", + "grammar" + ], + "files": [ + "grammar.js", + "binding.gyp", + "prebuilds/**", + "bindings/node/*", + "queries/*", + "src/**" + ], + "license": "Apache-2.0", + "dependencies": { + "node-addon-api": "^7.1.0", + "node-gyp-build": "^4.8.0" + }, + "peerDependencies": { + "tree-sitter": "^0.21.0" + }, + "peerDependenciesMeta": { + "tree_sitter": { + "optional": true + } + }, + "devDependencies": { + "tree-sitter-cli": "^0.22.6", + "prebuildify": "^6.0.0" + }, + "tree-sitter": [ + { + "scope": "source.exograph", + "injection-regex": "^exograph$" + } + ] +} diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..5922821 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,29 @@ +[build-system] +requires = ["setuptools>=42", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "tree-sitter-exograph" +description = "Exograph grammar for tree-sitter" +version = "0.0.1" +keywords = ["incremental", "parsing", "tree-sitter", "exograph"] +classifiers = [ + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Topic :: Software Development :: Compilers", + "Topic :: Text Processing :: Linguistic", + "Typing :: Typed" +] +requires-python = ">=3.8" +license.text = "Apache-2.0" +readme = "README.md" + +[project.urls] +Homepage = "https://github.com/exograph/tree-sitter-grammar" + +[project.optional-dependencies] +core = ["tree-sitter~=0.21"] + +[tool.cibuildwheel] +build = "cp38-*" +build-frontend = "build" diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..65ad78b --- /dev/null +++ b/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_exograph", "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_exograph": ["*.pyi", "py.typed"], + "tree_sitter_exograph.queries": ["*.scm"], + }, + ext_package="tree_sitter_exograph", + ext_modules=[ + Extension( + name="_binding", + sources=[ + "bindings/python/tree_sitter_exograph/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/src/grammar.json b/src/grammar.json new file mode 100644 index 0000000..7b74ade --- /dev/null +++ b/src/grammar.json @@ -0,0 +1,1452 @@ +{ + "name": "exograph", + "rules": { + "source_file": { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "declaration" + } + }, + "declaration": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "context" + }, + { + "type": "SYMBOL", + "name": "module" + }, + { + "type": "SYMBOL", + "name": "import" + } + ] + }, + "import": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "import" + }, + { + "type": "FIELD", + "name": "path", + "content": { + "type": "SYMBOL", + "name": "literal_str" + } + } + ] + }, + "module": { + "type": "SEQ", + "members": [ + { + "type": "REPEAT", + "content": { + "type": "FIELD", + "name": "annotation", + "content": { + "type": "SYMBOL", + "name": "annotation" + } + } + }, + { + "type": "STRING", + "value": "module" + }, + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "term" + } + }, + { + "type": "FIELD", + "name": "body", + "content": { + "type": "SYMBOL", + "name": "module_body" + } + } + ] + }, + "module_body": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "{" + }, + { + "type": "REPEAT", + "content": { + "type": "FIELD", + "name": "field", + "content": { + "type": "SYMBOL", + "name": "module_field" + } + } + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "module_field": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "type" + }, + { + "type": "SYMBOL", + "name": "module_method" + }, + { + "type": "SYMBOL", + "name": "interceptor" + } + ] + }, + "module_method": { + "type": "SEQ", + "members": [ + { + "type": "REPEAT", + "content": { + "type": "FIELD", + "name": "annotation", + "content": { + "type": "SYMBOL", + "name": "annotation" + } + } + }, + { + "type": "CHOICE", + "members": [ + { + "type": "FIELD", + "name": "is_exported", + "content": { + "type": "STRING", + "value": "export" + } + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "FIELD", + "name": "method_type", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "query" + }, + { + "type": "STRING", + "value": "mutation" + } + ] + } + }, + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "term" + } + }, + { + "type": "STRING", + "value": "(" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "args", + "content": { + "type": "SYMBOL", + "name": "argument" + } + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "FIELD", + "name": "args", + "content": { + "type": "SYMBOL", + "name": "argument" + } + } + ] + } + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": "):" + }, + { + "type": "FIELD", + "name": "return_type", + "content": { + "type": "SYMBOL", + "name": "field_type" + } + } + ] + }, + "interceptor": { + "type": "SEQ", + "members": [ + { + "type": "REPEAT", + "content": { + "type": "FIELD", + "name": "annotation", + "content": { + "type": "SYMBOL", + "name": "annotation" + } + } + }, + { + "type": "STRING", + "value": "interceptor" + }, + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "term" + } + }, + { + "type": "STRING", + "value": "(" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "args", + "content": { + "type": "SYMBOL", + "name": "argument" + } + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "FIELD", + "name": "args", + "content": { + "type": "SYMBOL", + "name": "argument" + } + } + ] + } + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": ")" + } + ] + }, + "context": { + "type": "SEQ", + "members": [ + { + "type": "REPEAT", + "content": { + "type": "FIELD", + "name": "annotation", + "content": { + "type": "SYMBOL", + "name": "annotation" + } + } + }, + { + "type": "STRING", + "value": "context" + }, + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "term" + } + }, + { + "type": "FIELD", + "name": "body", + "content": { + "type": "SYMBOL", + "name": "type_body" + } + } + ] + }, + "type": { + "type": "SEQ", + "members": [ + { + "type": "REPEAT", + "content": { + "type": "FIELD", + "name": "annotation", + "content": { + "type": "SYMBOL", + "name": "annotation" + } + } + }, + { + "type": "STRING", + "value": "type" + }, + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "term" + } + }, + { + "type": "FIELD", + "name": "body", + "content": { + "type": "SYMBOL", + "name": "type_body" + } + } + ] + }, + "type_body": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "{" + }, + { + "type": "REPEAT", + "content": { + "type": "FIELD", + "name": "field", + "content": { + "type": "SYMBOL", + "name": "field" + } + } + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "annotation": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "@" + }, + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "term" + } + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "(" + }, + { + "type": "FIELD", + "name": "params", + "content": { + "type": "SYMBOL", + "name": "annotation_params" + } + }, + { + "type": "STRING", + "value": ")" + } + ] + }, + { + "type": "BLANK" + } + ] + } + ] + }, + "annotation_params": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "annotation_multiple_params" + }, + { + "type": "SYMBOL", + "name": "annotation_map_params" + } + ] + }, + "annotation_multiple_params": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "exprs", + "content": { + "type": "SYMBOL", + "name": "expression" + } + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "FIELD", + "name": "exprs", + "content": { + "type": "SYMBOL", + "name": "expression" + } + } + ] + } + } + ] + }, + "annotation_map_params": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "param", + "content": { + "type": "SYMBOL", + "name": "annotation_map_param" + } + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "FIELD", + "name": "param", + "content": { + "type": "SYMBOL", + "name": "annotation_map_param" + } + } + ] + } + } + ] + }, + "annotation_map_param": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "term" + } + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "expr", + "content": { + "type": "SYMBOL", + "name": "expression" + } + } + ] + }, + "argument": { + "type": "SEQ", + "members": [ + { + "type": "REPEAT", + "content": { + "type": "FIELD", + "name": "annotation", + "content": { + "type": "SYMBOL", + "name": "annotation" + } + } + }, + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "term" + } + }, + { + "type": "STRING", + "value": ":" + }, + { + "type": "FIELD", + "name": "argument_type", + "content": { + "type": "SYMBOL", + "name": "field_type" + } + } + ] + }, + "field": { + "type": "SEQ", + "members": [ + { + "type": "REPEAT", + "content": { + "type": "FIELD", + "name": "annotation", + "content": { + "type": "SYMBOL", + "name": "annotation" + } + } + }, + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "term" + } + }, + { + "type": "STRING", + "value": ":" + }, + { + "type": "FIELD", + "name": "field_type", + "content": { + "type": "SYMBOL", + "name": "field_type" + } + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "default_value", + "content": { + "type": "SYMBOL", + "name": "field_default_value" + } + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": ";" + }, + { + "type": "BLANK" + } + ] + } + ] + }, + "field_default_value": { + "type": "CHOICE", + "members": [ + { + "type": "FIELD", + "name": "default_value_concrete", + "content": { + "type": "SYMBOL", + "name": "expression" + } + }, + { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "default_value_fn", + "content": { + "type": "SYMBOL", + "name": "term" + } + }, + { + "type": "STRING", + "value": "(" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "default_value_fn_args", + "content": { + "type": "SYMBOL", + "name": "expression" + } + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "FIELD", + "name": "default_value_fn_args", + "content": { + "type": "SYMBOL", + "name": "expression" + } + } + ] + } + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": ")" + } + ] + } + ] + }, + "field_type": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "optional_field_type" + }, + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "term" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "<" + }, + { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "type_param", + "content": { + "type": "SYMBOL", + "name": "field_type" + } + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "FIELD", + "name": "type_param", + "content": { + "type": "SYMBOL", + "name": "field_type" + } + } + ] + } + } + ] + }, + { + "type": "STRING", + "value": ">" + } + ] + }, + { + "type": "BLANK" + } + ] + } + ] + } + ] + }, + "optional_field_type": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "inner", + "content": { + "type": "SYMBOL", + "name": "field_type" + } + }, + { + "type": "STRING", + "value": "?" + } + ] + }, + "expression": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "parenthetical" + }, + { + "type": "PREC", + "value": 1, + "content": { + "type": "SYMBOL", + "name": "logical_op" + } + }, + { + "type": "PREC", + "value": 3, + "content": { + "type": "SYMBOL", + "name": "relational_op" + } + }, + { + "type": "SYMBOL", + "name": "selection" + }, + { + "type": "SYMBOL", + "name": "literal_number" + }, + { + "type": "SYMBOL", + "name": "literal_str" + }, + { + "type": "SYMBOL", + "name": "literal_boolean" + } + ] + }, + "parenthetical": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "(" + }, + { + "type": "FIELD", + "name": "expression", + "content": { + "type": "SYMBOL", + "name": "expression" + } + }, + { + "type": "STRING", + "value": ")" + } + ] + }, + "selection": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "selection_select" + }, + { + "type": "SYMBOL", + "name": "term" + } + ] + }, + "selection_select": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "prefix", + "content": { + "type": "SYMBOL", + "name": "selection" + } + }, + { + "type": "STRING", + "value": "." + }, + { + "type": "FIELD", + "name": "selection_element", + "content": { + "type": "SYMBOL", + "name": "selection_element" + } + } + ] + }, + "selection_element": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "term" + }, + { + "type": "SYMBOL", + "name": "hof_call" + } + ] + }, + "hof_call": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "term" + } + }, + { + "type": "STRING", + "value": "(" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "FIELD", + "name": "param_name", + "content": { + "type": "SYMBOL", + "name": "term" + } + }, + { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "(" + }, + { + "type": "FIELD", + "name": "param_name", + "content": { + "type": "SYMBOL", + "name": "term" + } + }, + { + "type": "STRING", + "value": ")" + } + ] + } + ] + }, + { + "type": "STRING", + "value": "=>" + }, + { + "type": "FIELD", + "name": "expr", + "content": { + "type": "SYMBOL", + "name": "expression" + } + }, + { + "type": "STRING", + "value": ")" + } + ] + }, + "logical_op": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "logical_or" + }, + { + "type": "SYMBOL", + "name": "logical_and" + }, + { + "type": "SYMBOL", + "name": "logical_not" + } + ] + }, + "logical_or": { + "type": "PREC_LEFT", + "value": 1, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "expression" + } + }, + { + "type": "STRING", + "value": "||" + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "expression" + } + } + ] + } + }, + "logical_and": { + "type": "PREC_LEFT", + "value": 1, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "expression" + } + }, + { + "type": "STRING", + "value": "&&" + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "expression" + } + } + ] + } + }, + "logical_not": { + "type": "PREC", + "value": 3, + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "!" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "expression" + } + } + ] + } + }, + "relational_op": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "relational_eq" + }, + { + "type": "SYMBOL", + "name": "relational_neq" + }, + { + "type": "SYMBOL", + "name": "relational_lt" + }, + { + "type": "SYMBOL", + "name": "relational_lte" + }, + { + "type": "SYMBOL", + "name": "relational_gt" + }, + { + "type": "SYMBOL", + "name": "relational_gte" + }, + { + "type": "SYMBOL", + "name": "relational_in" + } + ] + }, + "relational_eq": { + "type": "PREC_LEFT", + "value": 2, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "expression" + } + }, + { + "type": "STRING", + "value": "==" + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "expression" + } + } + ] + } + }, + "relational_neq": { + "type": "PREC_LEFT", + "value": 2, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "expression" + } + }, + { + "type": "STRING", + "value": "!=" + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "expression" + } + } + ] + } + }, + "relational_lt": { + "type": "PREC_LEFT", + "value": 2, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "expression" + } + }, + { + "type": "STRING", + "value": "<" + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "expression" + } + } + ] + } + }, + "relational_lte": { + "type": "PREC_LEFT", + "value": 2, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "expression" + } + }, + { + "type": "STRING", + "value": "<=" + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "expression" + } + } + ] + } + }, + "relational_gt": { + "type": "PREC_LEFT", + "value": 2, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "expression" + } + }, + { + "type": "STRING", + "value": ">" + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "expression" + } + } + ] + } + }, + "relational_gte": { + "type": "PREC_LEFT", + "value": 2, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "expression" + } + }, + { + "type": "STRING", + "value": ">=" + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "expression" + } + } + ] + } + }, + "relational_in": { + "type": "PREC_LEFT", + "value": 2, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "expression" + } + }, + { + "type": "STRING", + "value": "in" + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "expression" + } + } + ] + } + }, + "term": { + "type": "PATTERN", + "value": "[a-zA-Z_][a-zA-Z0-9_]*" + }, + "str": { + "type": "PATTERN", + "value": "(?:[^\"\\\\]|\\\\.)*" + }, + "number": { + "type": "PATTERN", + "value": "\\d+" + }, + "literal_str": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "\"" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "str" + } + }, + { + "type": "STRING", + "value": "\"" + } + ] + }, + "literal_boolean": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "true" + }, + { + "type": "STRING", + "value": "false" + } + ] + }, + "literal_number": { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "number" + } + }, + "comment": { + "type": "TOKEN", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "//" + }, + { + "type": "PATTERN", + "value": ".*" + } + ] + }, + { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "/*" + }, + { + "type": "PATTERN", + "value": "[^*]*\\*+([^/*][^*]*\\*+)*" + }, + { + "type": "STRING", + "value": "/" + } + ] + } + ] + } + } + }, + "extras": [ + { + "type": "PATTERN", + "value": "\\s" + }, + { + "type": "SYMBOL", + "name": "comment" + } + ], + "conflicts": [], + "precedences": [], + "externals": [], + "inline": [], + "supertypes": [] +} diff --git a/src/node-types.json b/src/node-types.json new file mode 100644 index 0000000..e46eb4a --- /dev/null +++ b/src/node-types.json @@ -0,0 +1,1248 @@ +[ + { + "type": "annotation", + "named": true, + "fields": { + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "term", + "named": true + } + ] + }, + "params": { + "multiple": false, + "required": false, + "types": [ + { + "type": "annotation_params", + "named": true + } + ] + } + } + }, + { + "type": "annotation_map_param", + "named": true, + "fields": { + "expr": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + }, + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "term", + "named": true + } + ] + } + } + }, + { + "type": "annotation_map_params", + "named": true, + "fields": { + "param": { + "multiple": true, + "required": true, + "types": [ + { + "type": "annotation_map_param", + "named": true + } + ] + } + } + }, + { + "type": "annotation_multiple_params", + "named": true, + "fields": { + "exprs": { + "multiple": true, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + } + } + }, + { + "type": "annotation_params", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "annotation_map_params", + "named": true + }, + { + "type": "annotation_multiple_params", + "named": true + } + ] + } + }, + { + "type": "argument", + "named": true, + "fields": { + "annotation": { + "multiple": true, + "required": false, + "types": [ + { + "type": "annotation", + "named": true + } + ] + }, + "argument_type": { + "multiple": false, + "required": true, + "types": [ + { + "type": "field_type", + "named": true + } + ] + }, + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "term", + "named": true + } + ] + } + } + }, + { + "type": "context", + "named": true, + "fields": { + "annotation": { + "multiple": true, + "required": false, + "types": [ + { + "type": "annotation", + "named": true + } + ] + }, + "body": { + "multiple": false, + "required": true, + "types": [ + { + "type": "type_body", + "named": true + } + ] + }, + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "term", + "named": true + } + ] + } + } + }, + { + "type": "declaration", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "context", + "named": true + }, + { + "type": "import", + "named": true + }, + { + "type": "module", + "named": true + } + ] + } + }, + { + "type": "expression", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "literal_boolean", + "named": true + }, + { + "type": "literal_number", + "named": true + }, + { + "type": "literal_str", + "named": true + }, + { + "type": "logical_op", + "named": true + }, + { + "type": "parenthetical", + "named": true + }, + { + "type": "relational_op", + "named": true + }, + { + "type": "selection", + "named": true + } + ] + } + }, + { + "type": "field", + "named": true, + "fields": { + "annotation": { + "multiple": true, + "required": false, + "types": [ + { + "type": "annotation", + "named": true + } + ] + }, + "default_value": { + "multiple": false, + "required": false, + "types": [ + { + "type": "field_default_value", + "named": true + } + ] + }, + "field_type": { + "multiple": false, + "required": true, + "types": [ + { + "type": "field_type", + "named": true + } + ] + }, + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "term", + "named": true + } + ] + } + } + }, + { + "type": "field_default_value", + "named": true, + "fields": { + "default_value_concrete": { + "multiple": false, + "required": false, + "types": [ + { + "type": "expression", + "named": true + } + ] + }, + "default_value_fn": { + "multiple": false, + "required": false, + "types": [ + { + "type": "term", + "named": true + } + ] + }, + "default_value_fn_args": { + "multiple": true, + "required": false, + "types": [ + { + "type": "expression", + "named": true + } + ] + } + } + }, + { + "type": "field_type", + "named": true, + "fields": { + "type_param": { + "multiple": true, + "required": false, + "types": [ + { + "type": "field_type", + "named": true + } + ] + } + }, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "optional_field_type", + "named": true + }, + { + "type": "term", + "named": true + } + ] + } + }, + { + "type": "hof_call", + "named": true, + "fields": { + "expr": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + }, + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "term", + "named": true + } + ] + }, + "param_name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "term", + "named": true + } + ] + } + } + }, + { + "type": "import", + "named": true, + "fields": { + "path": { + "multiple": false, + "required": true, + "types": [ + { + "type": "literal_str", + "named": true + } + ] + } + } + }, + { + "type": "interceptor", + "named": true, + "fields": { + "annotation": { + "multiple": true, + "required": false, + "types": [ + { + "type": "annotation", + "named": true + } + ] + }, + "args": { + "multiple": true, + "required": false, + "types": [ + { + "type": "argument", + "named": true + } + ] + }, + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "term", + "named": true + } + ] + } + } + }, + { + "type": "literal_boolean", + "named": true, + "fields": {} + }, + { + "type": "literal_number", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "number", + "named": true + } + ] + } + } + }, + { + "type": "literal_str", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "str", + "named": true + } + ] + } + } + }, + { + "type": "logical_and", + "named": true, + "fields": { + "left": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + }, + "right": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + } + } + }, + { + "type": "logical_not", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + } + } + }, + { + "type": "logical_op", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "logical_and", + "named": true + }, + { + "type": "logical_not", + "named": true + }, + { + "type": "logical_or", + "named": true + } + ] + } + }, + { + "type": "logical_or", + "named": true, + "fields": { + "left": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + }, + "right": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + } + } + }, + { + "type": "module", + "named": true, + "fields": { + "annotation": { + "multiple": true, + "required": false, + "types": [ + { + "type": "annotation", + "named": true + } + ] + }, + "body": { + "multiple": false, + "required": true, + "types": [ + { + "type": "module_body", + "named": true + } + ] + }, + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "term", + "named": true + } + ] + } + } + }, + { + "type": "module_body", + "named": true, + "fields": { + "field": { + "multiple": true, + "required": false, + "types": [ + { + "type": "module_field", + "named": true + } + ] + } + } + }, + { + "type": "module_field", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "interceptor", + "named": true + }, + { + "type": "module_method", + "named": true + }, + { + "type": "type", + "named": true + } + ] + } + }, + { + "type": "module_method", + "named": true, + "fields": { + "annotation": { + "multiple": true, + "required": false, + "types": [ + { + "type": "annotation", + "named": true + } + ] + }, + "args": { + "multiple": true, + "required": false, + "types": [ + { + "type": "argument", + "named": true + } + ] + }, + "is_exported": { + "multiple": false, + "required": false, + "types": [ + { + "type": "export", + "named": false + } + ] + }, + "method_type": { + "multiple": false, + "required": true, + "types": [ + { + "type": "mutation", + "named": false + }, + { + "type": "query", + "named": false + } + ] + }, + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "term", + "named": true + } + ] + }, + "return_type": { + "multiple": false, + "required": true, + "types": [ + { + "type": "field_type", + "named": true + } + ] + } + } + }, + { + "type": "optional_field_type", + "named": true, + "fields": { + "inner": { + "multiple": false, + "required": true, + "types": [ + { + "type": "field_type", + "named": true + } + ] + } + } + }, + { + "type": "parenthetical", + "named": true, + "fields": { + "expression": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + } + } + }, + { + "type": "relational_eq", + "named": true, + "fields": { + "left": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + }, + "right": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + } + } + }, + { + "type": "relational_gt", + "named": true, + "fields": { + "left": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + }, + "right": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + } + } + }, + { + "type": "relational_gte", + "named": true, + "fields": { + "left": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + }, + "right": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + } + } + }, + { + "type": "relational_in", + "named": true, + "fields": { + "left": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + }, + "right": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + } + } + }, + { + "type": "relational_lt", + "named": true, + "fields": { + "left": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + }, + "right": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + } + } + }, + { + "type": "relational_lte", + "named": true, + "fields": { + "left": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + }, + "right": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + } + } + }, + { + "type": "relational_neq", + "named": true, + "fields": { + "left": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + }, + "right": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + } + } + }, + { + "type": "relational_op", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "relational_eq", + "named": true + }, + { + "type": "relational_gt", + "named": true + }, + { + "type": "relational_gte", + "named": true + }, + { + "type": "relational_in", + "named": true + }, + { + "type": "relational_lt", + "named": true + }, + { + "type": "relational_lte", + "named": true + }, + { + "type": "relational_neq", + "named": true + } + ] + } + }, + { + "type": "selection", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "selection_select", + "named": true + }, + { + "type": "term", + "named": true + } + ] + } + }, + { + "type": "selection_element", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "hof_call", + "named": true + }, + { + "type": "term", + "named": true + } + ] + } + }, + { + "type": "selection_select", + "named": true, + "fields": { + "prefix": { + "multiple": false, + "required": true, + "types": [ + { + "type": "selection", + "named": true + } + ] + }, + "selection_element": { + "multiple": false, + "required": true, + "types": [ + { + "type": "selection_element", + "named": true + } + ] + } + } + }, + { + "type": "source_file", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "declaration", + "named": true + } + ] + } + }, + { + "type": "type", + "named": true, + "fields": { + "annotation": { + "multiple": true, + "required": false, + "types": [ + { + "type": "annotation", + "named": true + } + ] + }, + "body": { + "multiple": false, + "required": true, + "types": [ + { + "type": "type_body", + "named": true + } + ] + }, + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "term", + "named": true + } + ] + } + } + }, + { + "type": "type_body", + "named": true, + "fields": { + "field": { + "multiple": true, + "required": false, + "types": [ + { + "type": "field", + "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": ">=", + "named": false + }, + { + "type": "?", + "named": false + }, + { + "type": "@", + "named": false + }, + { + "type": "comment", + "named": true + }, + { + "type": "context", + "named": false + }, + { + "type": "export", + "named": false + }, + { + "type": "false", + "named": false + }, + { + "type": "import", + "named": false + }, + { + "type": "in", + "named": false + }, + { + "type": "interceptor", + "named": false + }, + { + "type": "module", + "named": false + }, + { + "type": "mutation", + "named": false + }, + { + "type": "number", + "named": true + }, + { + "type": "query", + "named": false + }, + { + "type": "str", + "named": true + }, + { + "type": "term", + "named": true + }, + { + "type": "true", + "named": false + }, + { + "type": "type", + "named": false + }, + { + "type": "{", + "named": false + }, + { + "type": "||", + "named": false + }, + { + "type": "}", + "named": false + } +] \ No newline at end of file diff --git a/src/parser.c b/src/parser.c new file mode 100644 index 0000000..5efd832 --- /dev/null +++ b/src/parser.c @@ -0,0 +1,7781 @@ +#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 309 +#define LARGE_STATE_COUNT 2 +#define SYMBOL_COUNT 90 +#define ALIAS_COUNT 0 +#define TOKEN_COUNT 39 +#define EXTERNAL_TOKEN_COUNT 0 +#define FIELD_COUNT 28 +#define MAX_ALIAS_SEQUENCE_LENGTH 9 +#define PRODUCTION_ID_COUNT 63 + +enum ts_symbol_identifiers { + anon_sym_import = 1, + anon_sym_module = 2, + anon_sym_LBRACE = 3, + anon_sym_RBRACE = 4, + anon_sym_export = 5, + anon_sym_query = 6, + anon_sym_mutation = 7, + anon_sym_LPAREN = 8, + anon_sym_COMMA = 9, + anon_sym_RPAREN_COLON = 10, + anon_sym_interceptor = 11, + anon_sym_RPAREN = 12, + anon_sym_context = 13, + anon_sym_type = 14, + anon_sym_AT = 15, + anon_sym_EQ = 16, + anon_sym_COLON = 17, + anon_sym_SEMI = 18, + anon_sym_LT = 19, + anon_sym_GT = 20, + anon_sym_QMARK = 21, + anon_sym_DOT = 22, + anon_sym_EQ_GT = 23, + anon_sym_PIPE_PIPE = 24, + anon_sym_AMP_AMP = 25, + anon_sym_BANG = 26, + anon_sym_EQ_EQ = 27, + anon_sym_BANG_EQ = 28, + anon_sym_LT_EQ = 29, + anon_sym_GT_EQ = 30, + anon_sym_in = 31, + sym_term = 32, + sym_str = 33, + sym_number = 34, + anon_sym_DQUOTE = 35, + anon_sym_true = 36, + anon_sym_false = 37, + sym_comment = 38, + sym_source_file = 39, + sym_declaration = 40, + sym_import = 41, + sym_module = 42, + sym_module_body = 43, + sym_module_field = 44, + sym_module_method = 45, + sym_interceptor = 46, + sym_context = 47, + sym_type = 48, + sym_type_body = 49, + sym_annotation = 50, + sym_annotation_params = 51, + sym_annotation_multiple_params = 52, + sym_annotation_map_params = 53, + sym_annotation_map_param = 54, + sym_argument = 55, + sym_field = 56, + sym_field_default_value = 57, + sym_field_type = 58, + sym_optional_field_type = 59, + sym_expression = 60, + sym_parenthetical = 61, + sym_selection = 62, + sym_selection_select = 63, + sym_selection_element = 64, + sym_hof_call = 65, + sym_logical_op = 66, + sym_logical_or = 67, + sym_logical_and = 68, + sym_logical_not = 69, + sym_relational_op = 70, + sym_relational_eq = 71, + sym_relational_neq = 72, + sym_relational_lt = 73, + sym_relational_lte = 74, + sym_relational_gt = 75, + sym_relational_gte = 76, + sym_relational_in = 77, + sym_literal_str = 78, + sym_literal_boolean = 79, + sym_literal_number = 80, + aux_sym_source_file_repeat1 = 81, + aux_sym_module_repeat1 = 82, + aux_sym_module_body_repeat1 = 83, + aux_sym_module_method_repeat1 = 84, + aux_sym_type_body_repeat1 = 85, + aux_sym_annotation_multiple_params_repeat1 = 86, + aux_sym_annotation_map_params_repeat1 = 87, + aux_sym_field_default_value_repeat1 = 88, + aux_sym_field_type_repeat1 = 89, +}; + +static const char * const ts_symbol_names[] = { + [ts_builtin_sym_end] = "end", + [anon_sym_import] = "import", + [anon_sym_module] = "module", + [anon_sym_LBRACE] = "{", + [anon_sym_RBRACE] = "}", + [anon_sym_export] = "export", + [anon_sym_query] = "query", + [anon_sym_mutation] = "mutation", + [anon_sym_LPAREN] = "(", + [anon_sym_COMMA] = ",", + [anon_sym_RPAREN_COLON] = "):", + [anon_sym_interceptor] = "interceptor", + [anon_sym_RPAREN] = ")", + [anon_sym_context] = "context", + [anon_sym_type] = "type", + [anon_sym_AT] = "@", + [anon_sym_EQ] = "=", + [anon_sym_COLON] = ":", + [anon_sym_SEMI] = ";", + [anon_sym_LT] = "<", + [anon_sym_GT] = ">", + [anon_sym_QMARK] = "\?", + [anon_sym_DOT] = ".", + [anon_sym_EQ_GT] = "=>", + [anon_sym_PIPE_PIPE] = "||", + [anon_sym_AMP_AMP] = "&&", + [anon_sym_BANG] = "!", + [anon_sym_EQ_EQ] = "==", + [anon_sym_BANG_EQ] = "!=", + [anon_sym_LT_EQ] = "<=", + [anon_sym_GT_EQ] = ">=", + [anon_sym_in] = "in", + [sym_term] = "term", + [sym_str] = "str", + [sym_number] = "number", + [anon_sym_DQUOTE] = "\"", + [anon_sym_true] = "true", + [anon_sym_false] = "false", + [sym_comment] = "comment", + [sym_source_file] = "source_file", + [sym_declaration] = "declaration", + [sym_import] = "import", + [sym_module] = "module", + [sym_module_body] = "module_body", + [sym_module_field] = "module_field", + [sym_module_method] = "module_method", + [sym_interceptor] = "interceptor", + [sym_context] = "context", + [sym_type] = "type", + [sym_type_body] = "type_body", + [sym_annotation] = "annotation", + [sym_annotation_params] = "annotation_params", + [sym_annotation_multiple_params] = "annotation_multiple_params", + [sym_annotation_map_params] = "annotation_map_params", + [sym_annotation_map_param] = "annotation_map_param", + [sym_argument] = "argument", + [sym_field] = "field", + [sym_field_default_value] = "field_default_value", + [sym_field_type] = "field_type", + [sym_optional_field_type] = "optional_field_type", + [sym_expression] = "expression", + [sym_parenthetical] = "parenthetical", + [sym_selection] = "selection", + [sym_selection_select] = "selection_select", + [sym_selection_element] = "selection_element", + [sym_hof_call] = "hof_call", + [sym_logical_op] = "logical_op", + [sym_logical_or] = "logical_or", + [sym_logical_and] = "logical_and", + [sym_logical_not] = "logical_not", + [sym_relational_op] = "relational_op", + [sym_relational_eq] = "relational_eq", + [sym_relational_neq] = "relational_neq", + [sym_relational_lt] = "relational_lt", + [sym_relational_lte] = "relational_lte", + [sym_relational_gt] = "relational_gt", + [sym_relational_gte] = "relational_gte", + [sym_relational_in] = "relational_in", + [sym_literal_str] = "literal_str", + [sym_literal_boolean] = "literal_boolean", + [sym_literal_number] = "literal_number", + [aux_sym_source_file_repeat1] = "source_file_repeat1", + [aux_sym_module_repeat1] = "module_repeat1", + [aux_sym_module_body_repeat1] = "module_body_repeat1", + [aux_sym_module_method_repeat1] = "module_method_repeat1", + [aux_sym_type_body_repeat1] = "type_body_repeat1", + [aux_sym_annotation_multiple_params_repeat1] = "annotation_multiple_params_repeat1", + [aux_sym_annotation_map_params_repeat1] = "annotation_map_params_repeat1", + [aux_sym_field_default_value_repeat1] = "field_default_value_repeat1", + [aux_sym_field_type_repeat1] = "field_type_repeat1", +}; + +static const TSSymbol ts_symbol_map[] = { + [ts_builtin_sym_end] = ts_builtin_sym_end, + [anon_sym_import] = anon_sym_import, + [anon_sym_module] = anon_sym_module, + [anon_sym_LBRACE] = anon_sym_LBRACE, + [anon_sym_RBRACE] = anon_sym_RBRACE, + [anon_sym_export] = anon_sym_export, + [anon_sym_query] = anon_sym_query, + [anon_sym_mutation] = anon_sym_mutation, + [anon_sym_LPAREN] = anon_sym_LPAREN, + [anon_sym_COMMA] = anon_sym_COMMA, + [anon_sym_RPAREN_COLON] = anon_sym_RPAREN_COLON, + [anon_sym_interceptor] = anon_sym_interceptor, + [anon_sym_RPAREN] = anon_sym_RPAREN, + [anon_sym_context] = anon_sym_context, + [anon_sym_type] = anon_sym_type, + [anon_sym_AT] = anon_sym_AT, + [anon_sym_EQ] = anon_sym_EQ, + [anon_sym_COLON] = anon_sym_COLON, + [anon_sym_SEMI] = anon_sym_SEMI, + [anon_sym_LT] = anon_sym_LT, + [anon_sym_GT] = anon_sym_GT, + [anon_sym_QMARK] = anon_sym_QMARK, + [anon_sym_DOT] = anon_sym_DOT, + [anon_sym_EQ_GT] = anon_sym_EQ_GT, + [anon_sym_PIPE_PIPE] = anon_sym_PIPE_PIPE, + [anon_sym_AMP_AMP] = anon_sym_AMP_AMP, + [anon_sym_BANG] = anon_sym_BANG, + [anon_sym_EQ_EQ] = anon_sym_EQ_EQ, + [anon_sym_BANG_EQ] = anon_sym_BANG_EQ, + [anon_sym_LT_EQ] = anon_sym_LT_EQ, + [anon_sym_GT_EQ] = anon_sym_GT_EQ, + [anon_sym_in] = anon_sym_in, + [sym_term] = sym_term, + [sym_str] = sym_str, + [sym_number] = sym_number, + [anon_sym_DQUOTE] = anon_sym_DQUOTE, + [anon_sym_true] = anon_sym_true, + [anon_sym_false] = anon_sym_false, + [sym_comment] = sym_comment, + [sym_source_file] = sym_source_file, + [sym_declaration] = sym_declaration, + [sym_import] = sym_import, + [sym_module] = sym_module, + [sym_module_body] = sym_module_body, + [sym_module_field] = sym_module_field, + [sym_module_method] = sym_module_method, + [sym_interceptor] = sym_interceptor, + [sym_context] = sym_context, + [sym_type] = sym_type, + [sym_type_body] = sym_type_body, + [sym_annotation] = sym_annotation, + [sym_annotation_params] = sym_annotation_params, + [sym_annotation_multiple_params] = sym_annotation_multiple_params, + [sym_annotation_map_params] = sym_annotation_map_params, + [sym_annotation_map_param] = sym_annotation_map_param, + [sym_argument] = sym_argument, + [sym_field] = sym_field, + [sym_field_default_value] = sym_field_default_value, + [sym_field_type] = sym_field_type, + [sym_optional_field_type] = sym_optional_field_type, + [sym_expression] = sym_expression, + [sym_parenthetical] = sym_parenthetical, + [sym_selection] = sym_selection, + [sym_selection_select] = sym_selection_select, + [sym_selection_element] = sym_selection_element, + [sym_hof_call] = sym_hof_call, + [sym_logical_op] = sym_logical_op, + [sym_logical_or] = sym_logical_or, + [sym_logical_and] = sym_logical_and, + [sym_logical_not] = sym_logical_not, + [sym_relational_op] = sym_relational_op, + [sym_relational_eq] = sym_relational_eq, + [sym_relational_neq] = sym_relational_neq, + [sym_relational_lt] = sym_relational_lt, + [sym_relational_lte] = sym_relational_lte, + [sym_relational_gt] = sym_relational_gt, + [sym_relational_gte] = sym_relational_gte, + [sym_relational_in] = sym_relational_in, + [sym_literal_str] = sym_literal_str, + [sym_literal_boolean] = sym_literal_boolean, + [sym_literal_number] = sym_literal_number, + [aux_sym_source_file_repeat1] = aux_sym_source_file_repeat1, + [aux_sym_module_repeat1] = aux_sym_module_repeat1, + [aux_sym_module_body_repeat1] = aux_sym_module_body_repeat1, + [aux_sym_module_method_repeat1] = aux_sym_module_method_repeat1, + [aux_sym_type_body_repeat1] = aux_sym_type_body_repeat1, + [aux_sym_annotation_multiple_params_repeat1] = aux_sym_annotation_multiple_params_repeat1, + [aux_sym_annotation_map_params_repeat1] = aux_sym_annotation_map_params_repeat1, + [aux_sym_field_default_value_repeat1] = aux_sym_field_default_value_repeat1, + [aux_sym_field_type_repeat1] = aux_sym_field_type_repeat1, +}; + +static const TSSymbolMetadata ts_symbol_metadata[] = { + [ts_builtin_sym_end] = { + .visible = false, + .named = true, + }, + [anon_sym_import] = { + .visible = true, + .named = false, + }, + [anon_sym_module] = { + .visible = true, + .named = false, + }, + [anon_sym_LBRACE] = { + .visible = true, + .named = false, + }, + [anon_sym_RBRACE] = { + .visible = true, + .named = false, + }, + [anon_sym_export] = { + .visible = true, + .named = false, + }, + [anon_sym_query] = { + .visible = true, + .named = false, + }, + [anon_sym_mutation] = { + .visible = true, + .named = false, + }, + [anon_sym_LPAREN] = { + .visible = true, + .named = false, + }, + [anon_sym_COMMA] = { + .visible = true, + .named = false, + }, + [anon_sym_RPAREN_COLON] = { + .visible = true, + .named = false, + }, + [anon_sym_interceptor] = { + .visible = true, + .named = false, + }, + [anon_sym_RPAREN] = { + .visible = true, + .named = false, + }, + [anon_sym_context] = { + .visible = true, + .named = false, + }, + [anon_sym_type] = { + .visible = true, + .named = false, + }, + [anon_sym_AT] = { + .visible = true, + .named = false, + }, + [anon_sym_EQ] = { + .visible = true, + .named = false, + }, + [anon_sym_COLON] = { + .visible = true, + .named = false, + }, + [anon_sym_SEMI] = { + .visible = true, + .named = false, + }, + [anon_sym_LT] = { + .visible = true, + .named = false, + }, + [anon_sym_GT] = { + .visible = true, + .named = false, + }, + [anon_sym_QMARK] = { + .visible = true, + .named = false, + }, + [anon_sym_DOT] = { + .visible = true, + .named = false, + }, + [anon_sym_EQ_GT] = { + .visible = true, + .named = false, + }, + [anon_sym_PIPE_PIPE] = { + .visible = true, + .named = false, + }, + [anon_sym_AMP_AMP] = { + .visible = true, + .named = false, + }, + [anon_sym_BANG] = { + .visible = true, + .named = false, + }, + [anon_sym_EQ_EQ] = { + .visible = true, + .named = false, + }, + [anon_sym_BANG_EQ] = { + .visible = true, + .named = false, + }, + [anon_sym_LT_EQ] = { + .visible = true, + .named = false, + }, + [anon_sym_GT_EQ] = { + .visible = true, + .named = false, + }, + [anon_sym_in] = { + .visible = true, + .named = false, + }, + [sym_term] = { + .visible = true, + .named = true, + }, + [sym_str] = { + .visible = true, + .named = true, + }, + [sym_number] = { + .visible = true, + .named = true, + }, + [anon_sym_DQUOTE] = { + .visible = true, + .named = false, + }, + [anon_sym_true] = { + .visible = true, + .named = false, + }, + [anon_sym_false] = { + .visible = true, + .named = false, + }, + [sym_comment] = { + .visible = true, + .named = true, + }, + [sym_source_file] = { + .visible = true, + .named = true, + }, + [sym_declaration] = { + .visible = true, + .named = true, + }, + [sym_import] = { + .visible = true, + .named = true, + }, + [sym_module] = { + .visible = true, + .named = true, + }, + [sym_module_body] = { + .visible = true, + .named = true, + }, + [sym_module_field] = { + .visible = true, + .named = true, + }, + [sym_module_method] = { + .visible = true, + .named = true, + }, + [sym_interceptor] = { + .visible = true, + .named = true, + }, + [sym_context] = { + .visible = true, + .named = true, + }, + [sym_type] = { + .visible = true, + .named = true, + }, + [sym_type_body] = { + .visible = true, + .named = true, + }, + [sym_annotation] = { + .visible = true, + .named = true, + }, + [sym_annotation_params] = { + .visible = true, + .named = true, + }, + [sym_annotation_multiple_params] = { + .visible = true, + .named = true, + }, + [sym_annotation_map_params] = { + .visible = true, + .named = true, + }, + [sym_annotation_map_param] = { + .visible = true, + .named = true, + }, + [sym_argument] = { + .visible = true, + .named = true, + }, + [sym_field] = { + .visible = true, + .named = true, + }, + [sym_field_default_value] = { + .visible = true, + .named = true, + }, + [sym_field_type] = { + .visible = true, + .named = true, + }, + [sym_optional_field_type] = { + .visible = true, + .named = true, + }, + [sym_expression] = { + .visible = true, + .named = true, + }, + [sym_parenthetical] = { + .visible = true, + .named = true, + }, + [sym_selection] = { + .visible = true, + .named = true, + }, + [sym_selection_select] = { + .visible = true, + .named = true, + }, + [sym_selection_element] = { + .visible = true, + .named = true, + }, + [sym_hof_call] = { + .visible = true, + .named = true, + }, + [sym_logical_op] = { + .visible = true, + .named = true, + }, + [sym_logical_or] = { + .visible = true, + .named = true, + }, + [sym_logical_and] = { + .visible = true, + .named = true, + }, + [sym_logical_not] = { + .visible = true, + .named = true, + }, + [sym_relational_op] = { + .visible = true, + .named = true, + }, + [sym_relational_eq] = { + .visible = true, + .named = true, + }, + [sym_relational_neq] = { + .visible = true, + .named = true, + }, + [sym_relational_lt] = { + .visible = true, + .named = true, + }, + [sym_relational_lte] = { + .visible = true, + .named = true, + }, + [sym_relational_gt] = { + .visible = true, + .named = true, + }, + [sym_relational_gte] = { + .visible = true, + .named = true, + }, + [sym_relational_in] = { + .visible = true, + .named = true, + }, + [sym_literal_str] = { + .visible = true, + .named = true, + }, + [sym_literal_boolean] = { + .visible = true, + .named = true, + }, + [sym_literal_number] = { + .visible = true, + .named = true, + }, + [aux_sym_source_file_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_module_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_module_body_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_module_method_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_type_body_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_annotation_multiple_params_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_annotation_map_params_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_field_default_value_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_field_type_repeat1] = { + .visible = false, + .named = false, + }, +}; + +enum ts_field_identifiers { + field_annotation = 1, + field_args = 2, + field_argument_type = 3, + field_body = 4, + field_default_value = 5, + field_default_value_concrete = 6, + field_default_value_fn = 7, + field_default_value_fn_args = 8, + field_expr = 9, + field_expression = 10, + field_exprs = 11, + field_field = 12, + field_field_type = 13, + field_inner = 14, + field_is_exported = 15, + field_left = 16, + field_method_type = 17, + field_name = 18, + field_param = 19, + field_param_name = 20, + field_params = 21, + field_path = 22, + field_prefix = 23, + field_return_type = 24, + field_right = 25, + field_selection_element = 26, + field_type_param = 27, + field_value = 28, +}; + +static const char * const ts_field_names[] = { + [0] = NULL, + [field_annotation] = "annotation", + [field_args] = "args", + [field_argument_type] = "argument_type", + [field_body] = "body", + [field_default_value] = "default_value", + [field_default_value_concrete] = "default_value_concrete", + [field_default_value_fn] = "default_value_fn", + [field_default_value_fn_args] = "default_value_fn_args", + [field_expr] = "expr", + [field_expression] = "expression", + [field_exprs] = "exprs", + [field_field] = "field", + [field_field_type] = "field_type", + [field_inner] = "inner", + [field_is_exported] = "is_exported", + [field_left] = "left", + [field_method_type] = "method_type", + [field_name] = "name", + [field_param] = "param", + [field_param_name] = "param_name", + [field_params] = "params", + [field_path] = "path", + [field_prefix] = "prefix", + [field_return_type] = "return_type", + [field_right] = "right", + [field_selection_element] = "selection_element", + [field_type_param] = "type_param", + [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 = 1}, + [4] = {.index = 3, .length = 2}, + [5] = {.index = 5, .length = 2}, + [6] = {.index = 7, .length = 1}, + [7] = {.index = 8, .length = 1}, + [8] = {.index = 9, .length = 1}, + [9] = {.index = 10, .length = 1}, + [10] = {.index = 11, .length = 1}, + [11] = {.index = 12, .length = 3}, + [12] = {.index = 15, .length = 1}, + [13] = {.index = 16, .length = 2}, + [14] = {.index = 18, .length = 2}, + [15] = {.index = 20, .length = 2}, + [16] = {.index = 22, .length = 2}, + [17] = {.index = 24, .length = 2}, + [18] = {.index = 26, .length = 1}, + [19] = {.index = 27, .length = 2}, + [20] = {.index = 29, .length = 1}, + [21] = {.index = 30, .length = 2}, + [22] = {.index = 32, .length = 1}, + [23] = {.index = 33, .length = 2}, + [24] = {.index = 35, .length = 2}, + [25] = {.index = 37, .length = 2}, + [26] = {.index = 39, .length = 1}, + [27] = {.index = 40, .length = 3}, + [28] = {.index = 43, .length = 3}, + [29] = {.index = 46, .length = 2}, + [30] = {.index = 48, .length = 2}, + [31] = {.index = 50, .length = 3}, + [32] = {.index = 53, .length = 1}, + [33] = {.index = 54, .length = 4}, + [34] = {.index = 58, .length = 2}, + [35] = {.index = 60, .length = 1}, + [36] = {.index = 61, .length = 4}, + [37] = {.index = 65, .length = 2}, + [38] = {.index = 67, .length = 3}, + [39] = {.index = 70, .length = 4}, + [40] = {.index = 74, .length = 3}, + [41] = {.index = 77, .length = 1}, + [42] = {.index = 78, .length = 4}, + [43] = {.index = 82, .length = 5}, + [44] = {.index = 87, .length = 5}, + [45] = {.index = 92, .length = 3}, + [46] = {.index = 95, .length = 5}, + [47] = {.index = 100, .length = 5}, + [48] = {.index = 105, .length = 4}, + [49] = {.index = 109, .length = 1}, + [50] = {.index = 110, .length = 2}, + [51] = {.index = 112, .length = 2}, + [52] = {.index = 114, .length = 1}, + [53] = {.index = 115, .length = 6}, + [54] = {.index = 121, .length = 6}, + [55] = {.index = 127, .length = 6}, + [56] = {.index = 133, .length = 2}, + [57] = {.index = 135, .length = 3}, + [58] = {.index = 138, .length = 7}, + [59] = {.index = 145, .length = 1}, + [60] = {.index = 146, .length = 3}, + [61] = {.index = 149, .length = 2}, + [62] = {.index = 151, .length = 3}, +}; + +static const TSFieldMapEntry ts_field_map_entries[] = { + [0] = + {field_annotation, 0}, + [1] = + {field_path, 1}, + [2] = + {field_name, 1}, + [3] = + {field_annotation, 0, .inherited = true}, + {field_annotation, 1, .inherited = true}, + [5] = + {field_body, 2}, + {field_name, 1}, + [7] = + {field_value, 1}, + [8] = + {field_field, 0}, + [9] = + {field_value, 0}, + [10] = + {field_param, 0}, + [11] = + {field_exprs, 0}, + [12] = + {field_annotation, 0, .inherited = true}, + {field_body, 3}, + {field_name, 2}, + [15] = + {field_field, 1, .inherited = true}, + [16] = + {field_field, 0, .inherited = true}, + {field_field, 1, .inherited = true}, + [18] = + {field_name, 1}, + {field_params, 3}, + [20] = + {field_param, 0}, + {field_param, 1, .inherited = true}, + [22] = + {field_exprs, 0}, + {field_exprs, 1, .inherited = true}, + [24] = + {field_field_type, 2}, + {field_name, 0}, + [26] = + {field_expression, 1}, + [27] = + {field_expr, 2}, + {field_name, 0}, + [29] = + {field_param, 1}, + [30] = + {field_param, 0, .inherited = true}, + {field_param, 1, .inherited = true}, + [32] = + {field_exprs, 1}, + [33] = + {field_left, 0}, + {field_right, 2}, + [35] = + {field_exprs, 0, .inherited = true}, + {field_exprs, 1, .inherited = true}, + [37] = + {field_prefix, 0}, + {field_selection_element, 2}, + [39] = + {field_inner, 0}, + [40] = + {field_annotation, 0, .inherited = true}, + {field_field_type, 3}, + {field_name, 1}, + [43] = + {field_method_type, 0}, + {field_name, 1}, + {field_return_type, 4}, + [46] = + {field_args, 3}, + {field_name, 1}, + [48] = + {field_annotation, 0, .inherited = true}, + {field_name, 2}, + [50] = + {field_default_value, 4}, + {field_field_type, 2}, + {field_name, 0}, + [53] = + {field_default_value_concrete, 0}, + [54] = + {field_is_exported, 0}, + {field_method_type, 1}, + {field_name, 2}, + {field_return_type, 5}, + [58] = + {field_argument_type, 2}, + {field_name, 0}, + [60] = + {field_args, 1}, + [61] = + {field_args, 3}, + {field_method_type, 0}, + {field_name, 1}, + {field_return_type, 5}, + [65] = + {field_args, 0, .inherited = true}, + {field_args, 1, .inherited = true}, + [67] = + {field_args, 3}, + {field_args, 4, .inherited = true}, + {field_name, 1}, + [70] = + {field_annotation, 0, .inherited = true}, + {field_method_type, 1}, + {field_name, 2}, + {field_return_type, 5}, + [74] = + {field_annotation, 0, .inherited = true}, + {field_args, 4}, + {field_name, 2}, + [77] = + {field_type_param, 2}, + [78] = + {field_annotation, 0, .inherited = true}, + {field_default_value, 5}, + {field_field_type, 3}, + {field_name, 1}, + [82] = + {field_args, 4}, + {field_is_exported, 0}, + {field_method_type, 1}, + {field_name, 2}, + {field_return_type, 6}, + [87] = + {field_args, 3}, + {field_args, 4, .inherited = true}, + {field_method_type, 0}, + {field_name, 1}, + {field_return_type, 6}, + [92] = + {field_annotation, 0, .inherited = true}, + {field_argument_type, 3}, + {field_name, 1}, + [95] = + {field_annotation, 0, .inherited = true}, + {field_is_exported, 1}, + {field_method_type, 2}, + {field_name, 3}, + {field_return_type, 6}, + [100] = + {field_annotation, 0, .inherited = true}, + {field_args, 4}, + {field_method_type, 1}, + {field_name, 2}, + {field_return_type, 6}, + [105] = + {field_annotation, 0, .inherited = true}, + {field_args, 4}, + {field_args, 5, .inherited = true}, + {field_name, 2}, + [109] = + {field_type_param, 1}, + [110] = + {field_type_param, 2}, + {field_type_param, 3, .inherited = true}, + [112] = + {field_type_param, 0, .inherited = true}, + {field_type_param, 1, .inherited = true}, + [114] = + {field_default_value_fn, 0}, + [115] = + {field_args, 4}, + {field_args, 5, .inherited = true}, + {field_is_exported, 0}, + {field_method_type, 1}, + {field_name, 2}, + {field_return_type, 7}, + [121] = + {field_annotation, 0, .inherited = true}, + {field_args, 5}, + {field_is_exported, 1}, + {field_method_type, 2}, + {field_name, 3}, + {field_return_type, 7}, + [127] = + {field_annotation, 0, .inherited = true}, + {field_args, 4}, + {field_args, 5, .inherited = true}, + {field_method_type, 1}, + {field_name, 2}, + {field_return_type, 7}, + [133] = + {field_default_value_fn, 0}, + {field_default_value_fn_args, 2}, + [135] = + {field_expr, 4}, + {field_name, 0}, + {field_param_name, 2}, + [138] = + {field_annotation, 0, .inherited = true}, + {field_args, 5}, + {field_args, 6, .inherited = true}, + {field_is_exported, 1}, + {field_method_type, 2}, + {field_name, 3}, + {field_return_type, 8}, + [145] = + {field_default_value_fn_args, 1}, + [146] = + {field_default_value_fn, 0}, + {field_default_value_fn_args, 2}, + {field_default_value_fn_args, 3, .inherited = true}, + [149] = + {field_default_value_fn_args, 0, .inherited = true}, + {field_default_value_fn_args, 1, .inherited = true}, + [151] = + {field_expr, 6}, + {field_name, 0}, + {field_param_name, 3}, +}; + +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] = 2, + [4] = 4, + [5] = 5, + [6] = 6, + [7] = 7, + [8] = 8, + [9] = 9, + [10] = 9, + [11] = 11, + [12] = 12, + [13] = 13, + [14] = 14, + [15] = 15, + [16] = 16, + [17] = 17, + [18] = 18, + [19] = 19, + [20] = 7, + [21] = 11, + [22] = 17, + [23] = 14, + [24] = 13, + [25] = 8, + [26] = 12, + [27] = 27, + [28] = 27, + [29] = 29, + [30] = 15, + [31] = 31, + [32] = 32, + [33] = 16, + [34] = 18, + [35] = 19, + [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] = 37, + [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] = 36, + [68] = 68, + [69] = 69, + [70] = 47, + [71] = 41, + [72] = 43, + [73] = 73, + [74] = 42, + [75] = 75, + [76] = 76, + [77] = 77, + [78] = 46, + [79] = 44, + [80] = 55, + [81] = 68, + [82] = 49, + [83] = 48, + [84] = 65, + [85] = 58, + [86] = 63, + [87] = 50, + [88] = 59, + [89] = 60, + [90] = 61, + [91] = 91, + [92] = 92, + [93] = 66, + [94] = 94, + [95] = 95, + [96] = 62, + [97] = 64, + [98] = 53, + [99] = 54, + [100] = 100, + [101] = 57, + [102] = 56, + [103] = 103, + [104] = 104, + [105] = 105, + [106] = 106, + [107] = 107, + [108] = 107, + [109] = 109, + [110] = 110, + [111] = 111, + [112] = 112, + [113] = 111, + [114] = 104, + [115] = 115, + [116] = 100, + [117] = 117, + [118] = 118, + [119] = 119, + [120] = 120, + [121] = 121, + [122] = 122, + [123] = 123, + [124] = 124, + [125] = 110, + [126] = 109, + [127] = 127, + [128] = 105, + [129] = 129, + [130] = 130, + [131] = 131, + [132] = 132, + [133] = 133, + [134] = 134, + [135] = 106, + [136] = 136, + [137] = 137, + [138] = 138, + [139] = 139, + [140] = 140, + [141] = 141, + [142] = 142, + [143] = 143, + [144] = 144, + [145] = 145, + [146] = 146, + [147] = 147, + [148] = 148, + [149] = 149, + [150] = 150, + [151] = 151, + [152] = 152, + [153] = 153, + [154] = 154, + [155] = 155, + [156] = 156, + [157] = 157, + [158] = 158, + [159] = 159, + [160] = 160, + [161] = 161, + [162] = 162, + [163] = 163, + [164] = 164, + [165] = 165, + [166] = 166, + [167] = 167, + [168] = 168, + [169] = 169, + [170] = 170, + [171] = 171, + [172] = 172, + [173] = 173, + [174] = 174, + [175] = 175, + [176] = 176, + [177] = 177, + [178] = 112, + [179] = 179, + [180] = 180, + [181] = 181, + [182] = 182, + [183] = 183, + [184] = 184, + [185] = 182, + [186] = 186, + [187] = 187, + [188] = 188, + [189] = 189, + [190] = 190, + [191] = 191, + [192] = 192, + [193] = 193, + [194] = 194, + [195] = 195, + [196] = 196, + [197] = 197, + [198] = 198, + [199] = 199, + [200] = 200, + [201] = 201, + [202] = 202, + [203] = 203, + [204] = 204, + [205] = 205, + [206] = 206, + [207] = 207, + [208] = 208, + [209] = 209, + [210] = 210, + [211] = 211, + [212] = 212, + [213] = 213, + [214] = 214, + [215] = 215, + [216] = 216, + [217] = 217, + [218] = 218, + [219] = 219, + [220] = 202, + [221] = 221, + [222] = 222, + [223] = 218, + [224] = 224, + [225] = 225, + [226] = 205, + [227] = 227, + [228] = 228, + [229] = 229, + [230] = 230, + [231] = 231, + [232] = 232, + [233] = 233, + [234] = 234, + [235] = 235, + [236] = 236, + [237] = 237, + [238] = 238, + [239] = 239, + [240] = 240, + [241] = 241, + [242] = 242, + [243] = 243, + [244] = 244, + [245] = 115, + [246] = 246, + [247] = 247, + [248] = 248, + [249] = 120, + [250] = 250, + [251] = 251, + [252] = 252, + [253] = 253, + [254] = 254, + [255] = 255, + [256] = 256, + [257] = 257, + [258] = 124, + [259] = 259, + [260] = 260, + [261] = 261, + [262] = 261, + [263] = 263, + [264] = 264, + [265] = 265, + [266] = 266, + [267] = 267, + [268] = 268, + [269] = 269, + [270] = 270, + [271] = 271, + [272] = 272, + [273] = 273, + [274] = 274, + [275] = 275, + [276] = 276, + [277] = 277, + [278] = 278, + [279] = 279, + [280] = 280, + [281] = 281, + [282] = 282, + [283] = 283, + [284] = 284, + [285] = 285, + [286] = 286, + [287] = 287, + [288] = 288, + [289] = 279, + [290] = 290, + [291] = 265, + [292] = 292, + [293] = 293, + [294] = 294, + [295] = 295, + [296] = 296, + [297] = 297, + [298] = 290, + [299] = 299, + [300] = 288, + [301] = 301, + [302] = 302, + [303] = 303, + [304] = 296, + [305] = 295, + [306] = 306, + [307] = 272, + [308] = 293, +}; + +static bool ts_lex(TSLexer *lexer, TSStateId state) { + START_LEXER(); + eof = lexer->eof(lexer); + switch (state) { + case 0: + if (eof) ADVANCE(70); + ADVANCE_MAP( + '!', 102, + '"', 125, + '&', 4, + '(', 78, + ')', 83, + ',', 79, + '.', 97, + '/', 8, + ':', 90, + ';', 91, + '<', 93, + '=', 89, + '>', 95, + '?', 96, + '@', 86, + 'c', 33, + 'e', 62, + 'f', 14, + 'i', 29, + 'm', 35, + 'q', 59, + 't', 49, + '{', 73, + '|', 66, + '}', 74, + ); + if (('\t' <= lookahead && lookahead <= '\r') || + lookahead == ' ') SKIP(0); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(124); + END_STATE(); + case 1: + if (lookahead == '\n') ADVANCE(10); + if (lookahead == '*') ADVANCE(119); + if (lookahead != 0) ADVANCE(120); + END_STATE(); + case 2: + ADVANCE_MAP( + '!', 101, + '"', 125, + '(', 78, + ')', 82, + ',', 79, + '/', 8, + '=', 87, + '>', 94, + '?', 96, + 'f', 109, + 't', 114, + ); + if (('\t' <= lookahead && lookahead <= '\r') || + lookahead == ' ') SKIP(2); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(124); + if (('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(117); + END_STATE(); + case 3: + ADVANCE_MAP( + '!', 12, + '&', 4, + '(', 78, + ')', 11, + ',', 79, + '.', 97, + '/', 8, + ';', 91, + '<', 93, + '=', 13, + '>', 95, + '@', 86, + 'i', 113, + '|', 66, + '}', 74, + ); + if (('\t' <= lookahead && lookahead <= '\r') || + lookahead == ' ') SKIP(3); + if (('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(117); + END_STATE(); + case 4: + if (lookahead == '&') ADVANCE(100); + END_STATE(); + case 5: + ADVANCE_MAP( + '(', 78, + ')', 83, + ',', 79, + '/', 8, + ';', 91, + '<', 92, + '=', 87, + '>', 94, + '?', 96, + '@', 86, + '}', 74, + ); + if (('\t' <= lookahead && lookahead <= '\r') || + lookahead == ' ') SKIP(5); + if (('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(117); + END_STATE(); + case 6: + if (lookahead == ')') ADVANCE(82); + if (lookahead == '/') ADVANCE(8); + if (lookahead == '@') ADVANCE(86); + if (('\t' <= lookahead && lookahead <= '\r') || + lookahead == ' ') SKIP(6); + if (('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(117); + END_STATE(); + case 7: + if (lookahead == ')') ADVANCE(11); + if (lookahead == '/') ADVANCE(8); + if (lookahead == '@') ADVANCE(86); + if (('\t' <= lookahead && lookahead <= '\r') || + lookahead == ' ') SKIP(7); + if (('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(117); + END_STATE(); + case 8: + if (lookahead == '*') ADVANCE(10); + if (lookahead == '/') ADVANCE(131); + END_STATE(); + case 9: + if (lookahead == '*') ADVANCE(9); + if (lookahead == '/') ADVANCE(130); + if (lookahead != 0) ADVANCE(10); + END_STATE(); + case 10: + if (lookahead == '*') ADVANCE(9); + if (lookahead != 0) ADVANCE(10); + END_STATE(); + case 11: + if (lookahead == ':') ADVANCE(80); + END_STATE(); + case 12: + if (lookahead == '=') ADVANCE(104); + END_STATE(); + case 13: + if (lookahead == '=') ADVANCE(103); + if (lookahead == '>') ADVANCE(98); + END_STATE(); + case 14: + if (lookahead == 'a') ADVANCE(27); + END_STATE(); + case 15: + if (lookahead == 'a') ADVANCE(51); + END_STATE(); + case 16: + if (lookahead == 'c') ADVANCE(24); + END_STATE(); + case 17: + if (lookahead == 'd') ADVANCE(60); + END_STATE(); + case 18: + if (lookahead == 'e') ADVANCE(44); + END_STATE(); + case 19: + if (lookahead == 'e') ADVANCE(126); + END_STATE(); + case 20: + if (lookahead == 'e') ADVANCE(85); + END_STATE(); + case 21: + if (lookahead == 'e') ADVANCE(128); + END_STATE(); + case 22: + if (lookahead == 'e') ADVANCE(72); + END_STATE(); + case 23: + if (lookahead == 'e') ADVANCE(63); + END_STATE(); + case 24: + if (lookahead == 'e') ADVANCE(42); + END_STATE(); + case 25: + if (lookahead == 'e') ADVANCE(45); + END_STATE(); + case 26: + if (lookahead == 'i') ADVANCE(36); + END_STATE(); + case 27: + if (lookahead == 'l') ADVANCE(50); + END_STATE(); + case 28: + if (lookahead == 'l') ADVANCE(22); + END_STATE(); + case 29: + if (lookahead == 'm') ADVANCE(43); + if (lookahead == 'n') ADVANCE(107); + END_STATE(); + case 30: + if (lookahead == 'm') ADVANCE(43); + if (lookahead == 'n') ADVANCE(57); + END_STATE(); + case 31: + if (lookahead == 'n') ADVANCE(77); + END_STATE(); + case 32: + if (lookahead == 'n') ADVANCE(56); + END_STATE(); + case 33: + if (lookahead == 'o') ADVANCE(32); + END_STATE(); + case 34: + if (lookahead == 'o') ADVANCE(17); + END_STATE(); + case 35: + if (lookahead == 'o') ADVANCE(17); + if (lookahead == 'u') ADVANCE(55); + END_STATE(); + case 36: + if (lookahead == 'o') ADVANCE(31); + END_STATE(); + case 37: + if (lookahead == 'o') ADVANCE(47); + END_STATE(); + case 38: + if (lookahead == 'o') ADVANCE(46); + END_STATE(); + case 39: + if (lookahead == 'o') ADVANCE(48); + END_STATE(); + case 40: + if (lookahead == 'p') ADVANCE(37); + END_STATE(); + case 41: + if (lookahead == 'p') ADVANCE(20); + END_STATE(); + case 42: + if (lookahead == 'p') ADVANCE(58); + END_STATE(); + case 43: + if (lookahead == 'p') ADVANCE(39); + END_STATE(); + case 44: + if (lookahead == 'r') ADVANCE(64); + END_STATE(); + case 45: + if (lookahead == 'r') ADVANCE(16); + END_STATE(); + case 46: + if (lookahead == 'r') ADVANCE(81); + END_STATE(); + case 47: + if (lookahead == 'r') ADVANCE(52); + END_STATE(); + case 48: + if (lookahead == 'r') ADVANCE(53); + END_STATE(); + case 49: + if (lookahead == 'r') ADVANCE(61); + if (lookahead == 'y') ADVANCE(41); + END_STATE(); + case 50: + if (lookahead == 's') ADVANCE(21); + END_STATE(); + case 51: + if (lookahead == 't') ADVANCE(26); + END_STATE(); + case 52: + if (lookahead == 't') ADVANCE(75); + END_STATE(); + case 53: + if (lookahead == 't') ADVANCE(71); + END_STATE(); + case 54: + if (lookahead == 't') ADVANCE(84); + END_STATE(); + case 55: + if (lookahead == 't') ADVANCE(15); + END_STATE(); + case 56: + if (lookahead == 't') ADVANCE(23); + END_STATE(); + case 57: + if (lookahead == 't') ADVANCE(25); + END_STATE(); + case 58: + if (lookahead == 't') ADVANCE(38); + END_STATE(); + case 59: + if (lookahead == 'u') ADVANCE(18); + END_STATE(); + case 60: + if (lookahead == 'u') ADVANCE(28); + END_STATE(); + case 61: + if (lookahead == 'u') ADVANCE(19); + END_STATE(); + case 62: + if (lookahead == 'x') ADVANCE(40); + END_STATE(); + case 63: + if (lookahead == 'x') ADVANCE(54); + END_STATE(); + case 64: + if (lookahead == 'y') ADVANCE(76); + END_STATE(); + case 65: + if (lookahead == 'y') ADVANCE(41); + END_STATE(); + case 66: + if (lookahead == '|') ADVANCE(99); + END_STATE(); + case 67: + if (lookahead != 0 && + lookahead != '\n') ADVANCE(123); + END_STATE(); + case 68: + if (eof) ADVANCE(70); + ADVANCE_MAP( + '!', 12, + '&', 4, + '(', 78, + ')', 82, + ',', 79, + '.', 97, + '/', 8, + '<', 93, + '=', 88, + '>', 95, + '@', 86, + 'c', 33, + 'i', 29, + 'm', 34, + '|', 66, + ); + if (('\t' <= lookahead && lookahead <= '\r') || + lookahead == ' ') SKIP(68); + END_STATE(); + case 69: + if (eof) ADVANCE(70); + ADVANCE_MAP( + '(', 78, + '/', 8, + '<', 92, + '?', 96, + '@', 86, + 'c', 33, + 'e', 62, + 'i', 30, + 'm', 35, + 'q', 59, + 't', 65, + '}', 74, + ); + if (('\t' <= lookahead && lookahead <= '\r') || + lookahead == ' ') SKIP(69); + END_STATE(); + case 70: + ACCEPT_TOKEN(ts_builtin_sym_end); + END_STATE(); + case 71: + ACCEPT_TOKEN(anon_sym_import); + END_STATE(); + case 72: + ACCEPT_TOKEN(anon_sym_module); + END_STATE(); + case 73: + ACCEPT_TOKEN(anon_sym_LBRACE); + END_STATE(); + case 74: + ACCEPT_TOKEN(anon_sym_RBRACE); + END_STATE(); + case 75: + ACCEPT_TOKEN(anon_sym_export); + END_STATE(); + case 76: + ACCEPT_TOKEN(anon_sym_query); + END_STATE(); + case 77: + ACCEPT_TOKEN(anon_sym_mutation); + END_STATE(); + case 78: + ACCEPT_TOKEN(anon_sym_LPAREN); + END_STATE(); + case 79: + ACCEPT_TOKEN(anon_sym_COMMA); + END_STATE(); + case 80: + ACCEPT_TOKEN(anon_sym_RPAREN_COLON); + END_STATE(); + case 81: + ACCEPT_TOKEN(anon_sym_interceptor); + END_STATE(); + case 82: + ACCEPT_TOKEN(anon_sym_RPAREN); + END_STATE(); + case 83: + ACCEPT_TOKEN(anon_sym_RPAREN); + if (lookahead == ':') ADVANCE(80); + END_STATE(); + case 84: + ACCEPT_TOKEN(anon_sym_context); + END_STATE(); + case 85: + ACCEPT_TOKEN(anon_sym_type); + END_STATE(); + case 86: + ACCEPT_TOKEN(anon_sym_AT); + END_STATE(); + case 87: + ACCEPT_TOKEN(anon_sym_EQ); + END_STATE(); + case 88: + ACCEPT_TOKEN(anon_sym_EQ); + if (lookahead == '=') ADVANCE(103); + END_STATE(); + case 89: + ACCEPT_TOKEN(anon_sym_EQ); + if (lookahead == '=') ADVANCE(103); + if (lookahead == '>') ADVANCE(98); + END_STATE(); + case 90: + ACCEPT_TOKEN(anon_sym_COLON); + END_STATE(); + case 91: + ACCEPT_TOKEN(anon_sym_SEMI); + END_STATE(); + case 92: + ACCEPT_TOKEN(anon_sym_LT); + END_STATE(); + case 93: + ACCEPT_TOKEN(anon_sym_LT); + if (lookahead == '=') ADVANCE(105); + END_STATE(); + case 94: + ACCEPT_TOKEN(anon_sym_GT); + END_STATE(); + case 95: + ACCEPT_TOKEN(anon_sym_GT); + if (lookahead == '=') ADVANCE(106); + END_STATE(); + case 96: + ACCEPT_TOKEN(anon_sym_QMARK); + END_STATE(); + case 97: + ACCEPT_TOKEN(anon_sym_DOT); + END_STATE(); + case 98: + ACCEPT_TOKEN(anon_sym_EQ_GT); + END_STATE(); + case 99: + ACCEPT_TOKEN(anon_sym_PIPE_PIPE); + END_STATE(); + case 100: + ACCEPT_TOKEN(anon_sym_AMP_AMP); + END_STATE(); + case 101: + ACCEPT_TOKEN(anon_sym_BANG); + END_STATE(); + case 102: + ACCEPT_TOKEN(anon_sym_BANG); + if (lookahead == '=') ADVANCE(104); + END_STATE(); + case 103: + ACCEPT_TOKEN(anon_sym_EQ_EQ); + END_STATE(); + case 104: + ACCEPT_TOKEN(anon_sym_BANG_EQ); + END_STATE(); + case 105: + ACCEPT_TOKEN(anon_sym_LT_EQ); + END_STATE(); + case 106: + ACCEPT_TOKEN(anon_sym_GT_EQ); + END_STATE(); + case 107: + ACCEPT_TOKEN(anon_sym_in); + END_STATE(); + case 108: + ACCEPT_TOKEN(anon_sym_in); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(117); + END_STATE(); + case 109: + ACCEPT_TOKEN(sym_term); + if (lookahead == 'a') ADVANCE(112); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('b' <= lookahead && lookahead <= 'z')) ADVANCE(117); + END_STATE(); + case 110: + ACCEPT_TOKEN(sym_term); + if (lookahead == 'e') ADVANCE(127); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(117); + END_STATE(); + case 111: + ACCEPT_TOKEN(sym_term); + if (lookahead == 'e') ADVANCE(129); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(117); + END_STATE(); + case 112: + ACCEPT_TOKEN(sym_term); + if (lookahead == 'l') ADVANCE(115); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(117); + END_STATE(); + case 113: + ACCEPT_TOKEN(sym_term); + if (lookahead == 'n') ADVANCE(108); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(117); + END_STATE(); + case 114: + ACCEPT_TOKEN(sym_term); + if (lookahead == 'r') ADVANCE(116); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(117); + END_STATE(); + case 115: + ACCEPT_TOKEN(sym_term); + if (lookahead == 's') ADVANCE(111); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(117); + END_STATE(); + case 116: + ACCEPT_TOKEN(sym_term); + if (lookahead == 'u') ADVANCE(110); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(117); + END_STATE(); + case 117: + ACCEPT_TOKEN(sym_term); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(117); + END_STATE(); + case 118: + ACCEPT_TOKEN(sym_str); + if (lookahead == '\n') ADVANCE(123); + if (lookahead == '"') ADVANCE(131); + if (lookahead == '\\') ADVANCE(132); + if (lookahead != 0) ADVANCE(118); + END_STATE(); + case 119: + ACCEPT_TOKEN(sym_str); + if (lookahead == '"') ADVANCE(10); + if (lookahead == '*') ADVANCE(119); + if (lookahead == '/') ADVANCE(123); + if (lookahead == '\\') ADVANCE(1); + if (lookahead != 0) ADVANCE(120); + END_STATE(); + case 120: + ACCEPT_TOKEN(sym_str); + if (lookahead == '"') ADVANCE(10); + if (lookahead == '*') ADVANCE(119); + if (lookahead == '\\') ADVANCE(1); + if (lookahead != 0) ADVANCE(120); + END_STATE(); + case 121: + ACCEPT_TOKEN(sym_str); + if (lookahead == '*') ADVANCE(120); + if (lookahead == '/') ADVANCE(118); + if (lookahead == '\\') ADVANCE(67); + if (lookahead != 0 && + lookahead != '"') ADVANCE(123); + END_STATE(); + case 122: + ACCEPT_TOKEN(sym_str); + if (lookahead == '/') ADVANCE(121); + if (lookahead == '\\') ADVANCE(67); + if (('\t' <= lookahead && lookahead <= '\r') || + lookahead == ' ') ADVANCE(122); + if (lookahead != 0 && + lookahead != '"') ADVANCE(123); + END_STATE(); + case 123: + ACCEPT_TOKEN(sym_str); + if (lookahead == '\\') ADVANCE(67); + if (lookahead != 0 && + lookahead != '"') ADVANCE(123); + END_STATE(); + case 124: + ACCEPT_TOKEN(sym_number); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(124); + END_STATE(); + case 125: + ACCEPT_TOKEN(anon_sym_DQUOTE); + END_STATE(); + case 126: + ACCEPT_TOKEN(anon_sym_true); + END_STATE(); + case 127: + ACCEPT_TOKEN(anon_sym_true); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(117); + END_STATE(); + case 128: + ACCEPT_TOKEN(anon_sym_false); + END_STATE(); + case 129: + ACCEPT_TOKEN(anon_sym_false); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(117); + END_STATE(); + case 130: + ACCEPT_TOKEN(sym_comment); + END_STATE(); + case 131: + ACCEPT_TOKEN(sym_comment); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(131); + END_STATE(); + case 132: + ACCEPT_TOKEN(sym_comment); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(118); + END_STATE(); + default: + return false; + } +} + +static const TSLexMode ts_lex_modes[STATE_COUNT] = { + [0] = {.lex_state = 0}, + [1] = {.lex_state = 0}, + [2] = {.lex_state = 2}, + [3] = {.lex_state = 2}, + [4] = {.lex_state = 2}, + [5] = {.lex_state = 2}, + [6] = {.lex_state = 2}, + [7] = {.lex_state = 2}, + [8] = {.lex_state = 2}, + [9] = {.lex_state = 2}, + [10] = {.lex_state = 2}, + [11] = {.lex_state = 2}, + [12] = {.lex_state = 2}, + [13] = {.lex_state = 2}, + [14] = {.lex_state = 2}, + [15] = {.lex_state = 2}, + [16] = {.lex_state = 2}, + [17] = {.lex_state = 2}, + [18] = {.lex_state = 2}, + [19] = {.lex_state = 2}, + [20] = {.lex_state = 2}, + [21] = {.lex_state = 2}, + [22] = {.lex_state = 2}, + [23] = {.lex_state = 2}, + [24] = {.lex_state = 2}, + [25] = {.lex_state = 2}, + [26] = {.lex_state = 2}, + [27] = {.lex_state = 2}, + [28] = {.lex_state = 2}, + [29] = {.lex_state = 2}, + [30] = {.lex_state = 2}, + [31] = {.lex_state = 2}, + [32] = {.lex_state = 2}, + [33] = {.lex_state = 2}, + [34] = {.lex_state = 2}, + [35] = {.lex_state = 2}, + [36] = {.lex_state = 68}, + [37] = {.lex_state = 3}, + [38] = {.lex_state = 3}, + [39] = {.lex_state = 69}, + [40] = {.lex_state = 69}, + [41] = {.lex_state = 3}, + [42] = {.lex_state = 3}, + [43] = {.lex_state = 3}, + [44] = {.lex_state = 3}, + [45] = {.lex_state = 69}, + [46] = {.lex_state = 3}, + [47] = {.lex_state = 3}, + [48] = {.lex_state = 3}, + [49] = {.lex_state = 3}, + [50] = {.lex_state = 3}, + [51] = {.lex_state = 68}, + [52] = {.lex_state = 3}, + [53] = {.lex_state = 3}, + [54] = {.lex_state = 3}, + [55] = {.lex_state = 3}, + [56] = {.lex_state = 3}, + [57] = {.lex_state = 3}, + [58] = {.lex_state = 3}, + [59] = {.lex_state = 3}, + [60] = {.lex_state = 3}, + [61] = {.lex_state = 3}, + [62] = {.lex_state = 3}, + [63] = {.lex_state = 3}, + [64] = {.lex_state = 3}, + [65] = {.lex_state = 3}, + [66] = {.lex_state = 3}, + [67] = {.lex_state = 3}, + [68] = {.lex_state = 3}, + [69] = {.lex_state = 68}, + [70] = {.lex_state = 68}, + [71] = {.lex_state = 68}, + [72] = {.lex_state = 68}, + [73] = {.lex_state = 68}, + [74] = {.lex_state = 68}, + [75] = {.lex_state = 0}, + [76] = {.lex_state = 0}, + [77] = {.lex_state = 68}, + [78] = {.lex_state = 68}, + [79] = {.lex_state = 68}, + [80] = {.lex_state = 68}, + [81] = {.lex_state = 68}, + [82] = {.lex_state = 68}, + [83] = {.lex_state = 68}, + [84] = {.lex_state = 68}, + [85] = {.lex_state = 68}, + [86] = {.lex_state = 68}, + [87] = {.lex_state = 68}, + [88] = {.lex_state = 68}, + [89] = {.lex_state = 68}, + [90] = {.lex_state = 68}, + [91] = {.lex_state = 68}, + [92] = {.lex_state = 69}, + [93] = {.lex_state = 68}, + [94] = {.lex_state = 69}, + [95] = {.lex_state = 68}, + [96] = {.lex_state = 68}, + [97] = {.lex_state = 68}, + [98] = {.lex_state = 68}, + [99] = {.lex_state = 68}, + [100] = {.lex_state = 5}, + [101] = {.lex_state = 68}, + [102] = {.lex_state = 68}, + [103] = {.lex_state = 68}, + [104] = {.lex_state = 68}, + [105] = {.lex_state = 5}, + [106] = {.lex_state = 5}, + [107] = {.lex_state = 68}, + [108] = {.lex_state = 68}, + [109] = {.lex_state = 5}, + [110] = {.lex_state = 5}, + [111] = {.lex_state = 68}, + [112] = {.lex_state = 69}, + [113] = {.lex_state = 68}, + [114] = {.lex_state = 68}, + [115] = {.lex_state = 69}, + [116] = {.lex_state = 69}, + [117] = {.lex_state = 69}, + [118] = {.lex_state = 69}, + [119] = {.lex_state = 69}, + [120] = {.lex_state = 69}, + [121] = {.lex_state = 69}, + [122] = {.lex_state = 69}, + [123] = {.lex_state = 69}, + [124] = {.lex_state = 69}, + [125] = {.lex_state = 69}, + [126] = {.lex_state = 69}, + [127] = {.lex_state = 69}, + [128] = {.lex_state = 69}, + [129] = {.lex_state = 69}, + [130] = {.lex_state = 69}, + [131] = {.lex_state = 69}, + [132] = {.lex_state = 69}, + [133] = {.lex_state = 69}, + [134] = {.lex_state = 69}, + [135] = {.lex_state = 69}, + [136] = {.lex_state = 69}, + [137] = {.lex_state = 69}, + [138] = {.lex_state = 69}, + [139] = {.lex_state = 69}, + [140] = {.lex_state = 69}, + [141] = {.lex_state = 69}, + [142] = {.lex_state = 69}, + [143] = {.lex_state = 69}, + [144] = {.lex_state = 69}, + [145] = {.lex_state = 69}, + [146] = {.lex_state = 5}, + [147] = {.lex_state = 69}, + [148] = {.lex_state = 69}, + [149] = {.lex_state = 5}, + [150] = {.lex_state = 69}, + [151] = {.lex_state = 69}, + [152] = {.lex_state = 5}, + [153] = {.lex_state = 69}, + [154] = {.lex_state = 69}, + [155] = {.lex_state = 7}, + [156] = {.lex_state = 7}, + [157] = {.lex_state = 7}, + [158] = {.lex_state = 5}, + [159] = {.lex_state = 7}, + [160] = {.lex_state = 7}, + [161] = {.lex_state = 7}, + [162] = {.lex_state = 6}, + [163] = {.lex_state = 6}, + [164] = {.lex_state = 5}, + [165] = {.lex_state = 0}, + [166] = {.lex_state = 0}, + [167] = {.lex_state = 0}, + [168] = {.lex_state = 0}, + [169] = {.lex_state = 0}, + [170] = {.lex_state = 0}, + [171] = {.lex_state = 5}, + [172] = {.lex_state = 0}, + [173] = {.lex_state = 0}, + [174] = {.lex_state = 0}, + [175] = {.lex_state = 0}, + [176] = {.lex_state = 5}, + [177] = {.lex_state = 5}, + [178] = {.lex_state = 5}, + [179] = {.lex_state = 0}, + [180] = {.lex_state = 5}, + [181] = {.lex_state = 5}, + [182] = {.lex_state = 2}, + [183] = {.lex_state = 5}, + [184] = {.lex_state = 5}, + [185] = {.lex_state = 2}, + [186] = {.lex_state = 5}, + [187] = {.lex_state = 0}, + [188] = {.lex_state = 3}, + [189] = {.lex_state = 5}, + [190] = {.lex_state = 5}, + [191] = {.lex_state = 5}, + [192] = {.lex_state = 3}, + [193] = {.lex_state = 5}, + [194] = {.lex_state = 3}, + [195] = {.lex_state = 5}, + [196] = {.lex_state = 3}, + [197] = {.lex_state = 5}, + [198] = {.lex_state = 3}, + [199] = {.lex_state = 2}, + [200] = {.lex_state = 5}, + [201] = {.lex_state = 5}, + [202] = {.lex_state = 2}, + [203] = {.lex_state = 5}, + [204] = {.lex_state = 5}, + [205] = {.lex_state = 5}, + [206] = {.lex_state = 5}, + [207] = {.lex_state = 5}, + [208] = {.lex_state = 3}, + [209] = {.lex_state = 5}, + [210] = {.lex_state = 5}, + [211] = {.lex_state = 5}, + [212] = {.lex_state = 0}, + [213] = {.lex_state = 5}, + [214] = {.lex_state = 3}, + [215] = {.lex_state = 5}, + [216] = {.lex_state = 5}, + [217] = {.lex_state = 2}, + [218] = {.lex_state = 5}, + [219] = {.lex_state = 2}, + [220] = {.lex_state = 2}, + [221] = {.lex_state = 2}, + [222] = {.lex_state = 5}, + [223] = {.lex_state = 5}, + [224] = {.lex_state = 2}, + [225] = {.lex_state = 3}, + [226] = {.lex_state = 5}, + [227] = {.lex_state = 5}, + [228] = {.lex_state = 2}, + [229] = {.lex_state = 5}, + [230] = {.lex_state = 2}, + [231] = {.lex_state = 5}, + [232] = {.lex_state = 2}, + [233] = {.lex_state = 3}, + [234] = {.lex_state = 2}, + [235] = {.lex_state = 5}, + [236] = {.lex_state = 2}, + [237] = {.lex_state = 3}, + [238] = {.lex_state = 5}, + [239] = {.lex_state = 5}, + [240] = {.lex_state = 2}, + [241] = {.lex_state = 2}, + [242] = {.lex_state = 5}, + [243] = {.lex_state = 5}, + [244] = {.lex_state = 2}, + [245] = {.lex_state = 5}, + [246] = {.lex_state = 3}, + [247] = {.lex_state = 3}, + [248] = {.lex_state = 5}, + [249] = {.lex_state = 5}, + [250] = {.lex_state = 0}, + [251] = {.lex_state = 0}, + [252] = {.lex_state = 0}, + [253] = {.lex_state = 0}, + [254] = {.lex_state = 0}, + [255] = {.lex_state = 0}, + [256] = {.lex_state = 0}, + [257] = {.lex_state = 5}, + [258] = {.lex_state = 5}, + [259] = {.lex_state = 2}, + [260] = {.lex_state = 0}, + [261] = {.lex_state = 5}, + [262] = {.lex_state = 5}, + [263] = {.lex_state = 0}, + [264] = {.lex_state = 5}, + [265] = {.lex_state = 2}, + [266] = {.lex_state = 0}, + [267] = {.lex_state = 2}, + [268] = {.lex_state = 5}, + [269] = {.lex_state = 0}, + [270] = {.lex_state = 5}, + [271] = {.lex_state = 5}, + [272] = {.lex_state = 2}, + [273] = {.lex_state = 0}, + [274] = {.lex_state = 5}, + [275] = {.lex_state = 0}, + [276] = {.lex_state = 0}, + [277] = {.lex_state = 0}, + [278] = {.lex_state = 5}, + [279] = {.lex_state = 0}, + [280] = {.lex_state = 5}, + [281] = {.lex_state = 5}, + [282] = {.lex_state = 5}, + [283] = {.lex_state = 0}, + [284] = {.lex_state = 5}, + [285] = {.lex_state = 0}, + [286] = {.lex_state = 0}, + [287] = {.lex_state = 5}, + [288] = {.lex_state = 5}, + [289] = {.lex_state = 0}, + [290] = {.lex_state = 122}, + [291] = {.lex_state = 2}, + [292] = {.lex_state = 5}, + [293] = {.lex_state = 5}, + [294] = {.lex_state = 2}, + [295] = {.lex_state = 3}, + [296] = {.lex_state = 3}, + [297] = {.lex_state = 0}, + [298] = {.lex_state = 122}, + [299] = {.lex_state = 0}, + [300] = {.lex_state = 5}, + [301] = {.lex_state = 0}, + [302] = {.lex_state = 5}, + [303] = {.lex_state = 5}, + [304] = {.lex_state = 3}, + [305] = {.lex_state = 3}, + [306] = {.lex_state = 0}, + [307] = {.lex_state = 2}, + [308] = {.lex_state = 5}, +}; + +static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { + [0] = { + [ts_builtin_sym_end] = ACTIONS(1), + [anon_sym_import] = ACTIONS(1), + [anon_sym_module] = ACTIONS(1), + [anon_sym_LBRACE] = ACTIONS(1), + [anon_sym_RBRACE] = ACTIONS(1), + [anon_sym_export] = ACTIONS(1), + [anon_sym_query] = ACTIONS(1), + [anon_sym_mutation] = ACTIONS(1), + [anon_sym_LPAREN] = ACTIONS(1), + [anon_sym_COMMA] = ACTIONS(1), + [anon_sym_RPAREN_COLON] = ACTIONS(1), + [anon_sym_RPAREN] = ACTIONS(1), + [anon_sym_context] = ACTIONS(1), + [anon_sym_type] = ACTIONS(1), + [anon_sym_AT] = ACTIONS(1), + [anon_sym_EQ] = ACTIONS(1), + [anon_sym_COLON] = ACTIONS(1), + [anon_sym_SEMI] = ACTIONS(1), + [anon_sym_LT] = ACTIONS(1), + [anon_sym_GT] = ACTIONS(1), + [anon_sym_QMARK] = ACTIONS(1), + [anon_sym_DOT] = ACTIONS(1), + [anon_sym_EQ_GT] = ACTIONS(1), + [anon_sym_PIPE_PIPE] = ACTIONS(1), + [anon_sym_AMP_AMP] = ACTIONS(1), + [anon_sym_BANG] = ACTIONS(1), + [anon_sym_EQ_EQ] = ACTIONS(1), + [anon_sym_BANG_EQ] = ACTIONS(1), + [anon_sym_LT_EQ] = ACTIONS(1), + [anon_sym_GT_EQ] = ACTIONS(1), + [anon_sym_in] = ACTIONS(1), + [sym_number] = ACTIONS(1), + [anon_sym_DQUOTE] = ACTIONS(1), + [anon_sym_true] = ACTIONS(1), + [anon_sym_false] = ACTIONS(1), + [sym_comment] = ACTIONS(3), + }, + [1] = { + [sym_source_file] = STATE(299), + [sym_declaration] = STATE(75), + [sym_import] = STATE(169), + [sym_module] = STATE(169), + [sym_context] = STATE(169), + [sym_annotation] = STATE(120), + [aux_sym_source_file_repeat1] = STATE(75), + [aux_sym_module_repeat1] = STATE(166), + [ts_builtin_sym_end] = ACTIONS(5), + [anon_sym_import] = ACTIONS(7), + [anon_sym_module] = ACTIONS(9), + [anon_sym_context] = ACTIONS(11), + [anon_sym_AT] = ACTIONS(13), + [sym_comment] = ACTIONS(3), + }, +}; + +static const uint16_t ts_small_parse_table[] = { + [0] = 18, + ACTIONS(3), 1, + sym_comment, + ACTIONS(15), 1, + anon_sym_LPAREN, + ACTIONS(17), 1, + anon_sym_BANG, + ACTIONS(19), 1, + sym_term, + ACTIONS(21), 1, + sym_number, + ACTIONS(23), 1, + anon_sym_DQUOTE, + STATE(70), 1, + sym_selection_select, + STATE(73), 1, + sym_expression, + STATE(78), 1, + sym_selection, + STATE(88), 1, + sym_relational_op, + STATE(90), 1, + sym_logical_op, + STATE(230), 1, + sym_annotation_map_param, + STATE(265), 1, + sym_annotation_params, + ACTIONS(25), 2, + anon_sym_true, + anon_sym_false, + STATE(267), 2, + sym_annotation_multiple_params, + sym_annotation_map_params, + STATE(89), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(97), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(87), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [68] = 18, + ACTIONS(3), 1, + sym_comment, + ACTIONS(15), 1, + anon_sym_LPAREN, + ACTIONS(17), 1, + anon_sym_BANG, + ACTIONS(19), 1, + sym_term, + ACTIONS(21), 1, + sym_number, + ACTIONS(23), 1, + anon_sym_DQUOTE, + STATE(70), 1, + sym_selection_select, + STATE(73), 1, + sym_expression, + STATE(78), 1, + sym_selection, + STATE(88), 1, + sym_relational_op, + STATE(90), 1, + sym_logical_op, + STATE(230), 1, + sym_annotation_map_param, + STATE(291), 1, + sym_annotation_params, + ACTIONS(25), 2, + anon_sym_true, + anon_sym_false, + STATE(267), 2, + sym_annotation_multiple_params, + sym_annotation_map_params, + STATE(89), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(97), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(87), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [136] = 16, + ACTIONS(3), 1, + sym_comment, + ACTIONS(15), 1, + anon_sym_LPAREN, + ACTIONS(17), 1, + anon_sym_BANG, + ACTIONS(21), 1, + sym_number, + ACTIONS(23), 1, + anon_sym_DQUOTE, + ACTIONS(27), 1, + anon_sym_RPAREN, + ACTIONS(29), 1, + sym_term, + STATE(70), 1, + sym_selection_select, + STATE(77), 1, + sym_expression, + STATE(78), 1, + sym_selection, + STATE(88), 1, + sym_relational_op, + STATE(90), 1, + sym_logical_op, + ACTIONS(25), 2, + anon_sym_true, + anon_sym_false, + STATE(89), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(97), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(87), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [197] = 16, + ACTIONS(3), 1, + sym_comment, + ACTIONS(31), 1, + anon_sym_LPAREN, + ACTIONS(33), 1, + anon_sym_BANG, + ACTIONS(35), 1, + sym_term, + ACTIONS(37), 1, + sym_number, + ACTIONS(39), 1, + anon_sym_DQUOTE, + STATE(46), 1, + sym_selection, + STATE(47), 1, + sym_selection_select, + STATE(52), 1, + sym_expression, + STATE(59), 1, + sym_relational_op, + STATE(61), 1, + sym_logical_op, + STATE(184), 1, + sym_field_default_value, + ACTIONS(41), 2, + anon_sym_true, + anon_sym_false, + STATE(60), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(64), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(50), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [258] = 16, + ACTIONS(3), 1, + sym_comment, + ACTIONS(31), 1, + anon_sym_LPAREN, + ACTIONS(33), 1, + anon_sym_BANG, + ACTIONS(35), 1, + sym_term, + ACTIONS(37), 1, + sym_number, + ACTIONS(39), 1, + anon_sym_DQUOTE, + STATE(46), 1, + sym_selection, + STATE(47), 1, + sym_selection_select, + STATE(52), 1, + sym_expression, + STATE(59), 1, + sym_relational_op, + STATE(61), 1, + sym_logical_op, + STATE(176), 1, + sym_field_default_value, + ACTIONS(41), 2, + anon_sym_true, + anon_sym_false, + STATE(60), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(64), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(50), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [319] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(31), 1, + anon_sym_LPAREN, + ACTIONS(33), 1, + anon_sym_BANG, + ACTIONS(37), 1, + sym_number, + ACTIONS(39), 1, + anon_sym_DQUOTE, + ACTIONS(43), 1, + sym_term, + STATE(46), 1, + sym_selection, + STATE(47), 1, + sym_selection_select, + STATE(56), 1, + sym_expression, + STATE(59), 1, + sym_relational_op, + STATE(61), 1, + sym_logical_op, + ACTIONS(41), 2, + anon_sym_true, + anon_sym_false, + STATE(60), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(64), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(50), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [377] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(15), 1, + anon_sym_LPAREN, + ACTIONS(17), 1, + anon_sym_BANG, + ACTIONS(21), 1, + sym_number, + ACTIONS(23), 1, + anon_sym_DQUOTE, + ACTIONS(29), 1, + sym_term, + STATE(70), 1, + sym_selection_select, + STATE(78), 1, + sym_selection, + STATE(88), 1, + sym_relational_op, + STATE(90), 1, + sym_logical_op, + STATE(111), 1, + sym_expression, + ACTIONS(25), 2, + anon_sym_true, + anon_sym_false, + STATE(89), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(97), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(87), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [435] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(15), 1, + anon_sym_LPAREN, + ACTIONS(17), 1, + anon_sym_BANG, + ACTIONS(21), 1, + sym_number, + ACTIONS(23), 1, + anon_sym_DQUOTE, + ACTIONS(29), 1, + sym_term, + STATE(70), 1, + sym_selection_select, + STATE(78), 1, + sym_selection, + STATE(88), 1, + sym_relational_op, + STATE(90), 1, + sym_logical_op, + STATE(96), 1, + sym_expression, + ACTIONS(25), 2, + anon_sym_true, + anon_sym_false, + STATE(89), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(97), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(87), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [493] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(31), 1, + anon_sym_LPAREN, + ACTIONS(33), 1, + anon_sym_BANG, + ACTIONS(37), 1, + sym_number, + ACTIONS(39), 1, + anon_sym_DQUOTE, + ACTIONS(43), 1, + sym_term, + STATE(46), 1, + sym_selection, + STATE(47), 1, + sym_selection_select, + STATE(59), 1, + sym_relational_op, + STATE(61), 1, + sym_logical_op, + STATE(62), 1, + sym_expression, + ACTIONS(41), 2, + anon_sym_true, + anon_sym_false, + STATE(60), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(64), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(50), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [551] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(15), 1, + anon_sym_LPAREN, + ACTIONS(17), 1, + anon_sym_BANG, + ACTIONS(21), 1, + sym_number, + ACTIONS(23), 1, + anon_sym_DQUOTE, + ACTIONS(29), 1, + sym_term, + STATE(70), 1, + sym_selection_select, + STATE(78), 1, + sym_selection, + STATE(88), 1, + sym_relational_op, + STATE(90), 1, + sym_logical_op, + STATE(108), 1, + sym_expression, + ACTIONS(25), 2, + anon_sym_true, + anon_sym_false, + STATE(89), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(97), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(87), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [609] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(31), 1, + anon_sym_LPAREN, + ACTIONS(33), 1, + anon_sym_BANG, + ACTIONS(37), 1, + sym_number, + ACTIONS(39), 1, + anon_sym_DQUOTE, + ACTIONS(43), 1, + sym_term, + STATE(46), 1, + sym_selection, + STATE(47), 1, + sym_selection_select, + STATE(48), 1, + sym_expression, + STATE(59), 1, + sym_relational_op, + STATE(61), 1, + sym_logical_op, + ACTIONS(41), 2, + anon_sym_true, + anon_sym_false, + STATE(60), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(64), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(50), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [667] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(31), 1, + anon_sym_LPAREN, + ACTIONS(33), 1, + anon_sym_BANG, + ACTIONS(37), 1, + sym_number, + ACTIONS(39), 1, + anon_sym_DQUOTE, + ACTIONS(43), 1, + sym_term, + STATE(46), 1, + sym_selection, + STATE(47), 1, + sym_selection_select, + STATE(49), 1, + sym_expression, + STATE(59), 1, + sym_relational_op, + STATE(61), 1, + sym_logical_op, + ACTIONS(41), 2, + anon_sym_true, + anon_sym_false, + STATE(60), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(64), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(50), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [725] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(31), 1, + anon_sym_LPAREN, + ACTIONS(33), 1, + anon_sym_BANG, + ACTIONS(37), 1, + sym_number, + ACTIONS(39), 1, + anon_sym_DQUOTE, + ACTIONS(43), 1, + sym_term, + STATE(46), 1, + sym_selection, + STATE(47), 1, + sym_selection_select, + STATE(58), 1, + sym_expression, + STATE(59), 1, + sym_relational_op, + STATE(61), 1, + sym_logical_op, + ACTIONS(41), 2, + anon_sym_true, + anon_sym_false, + STATE(60), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(64), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(50), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [783] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(15), 1, + anon_sym_LPAREN, + ACTIONS(17), 1, + anon_sym_BANG, + ACTIONS(21), 1, + sym_number, + ACTIONS(23), 1, + anon_sym_DQUOTE, + ACTIONS(29), 1, + sym_term, + STATE(70), 1, + sym_selection_select, + STATE(78), 1, + sym_selection, + STATE(88), 1, + sym_relational_op, + STATE(90), 1, + sym_logical_op, + STATE(114), 1, + sym_expression, + ACTIONS(25), 2, + anon_sym_true, + anon_sym_false, + STATE(89), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(97), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(87), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [841] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(15), 1, + anon_sym_LPAREN, + ACTIONS(17), 1, + anon_sym_BANG, + ACTIONS(21), 1, + sym_number, + ACTIONS(23), 1, + anon_sym_DQUOTE, + ACTIONS(29), 1, + sym_term, + STATE(70), 1, + sym_selection_select, + STATE(78), 1, + sym_selection, + STATE(88), 1, + sym_relational_op, + STATE(90), 1, + sym_logical_op, + STATE(98), 1, + sym_expression, + ACTIONS(25), 2, + anon_sym_true, + anon_sym_false, + STATE(89), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(97), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(87), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [899] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(31), 1, + anon_sym_LPAREN, + ACTIONS(33), 1, + anon_sym_BANG, + ACTIONS(37), 1, + sym_number, + ACTIONS(39), 1, + anon_sym_DQUOTE, + ACTIONS(43), 1, + sym_term, + STATE(46), 1, + sym_selection, + STATE(47), 1, + sym_selection_select, + STATE(57), 1, + sym_expression, + STATE(59), 1, + sym_relational_op, + STATE(61), 1, + sym_logical_op, + ACTIONS(41), 2, + anon_sym_true, + anon_sym_false, + STATE(60), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(64), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(50), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [957] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(15), 1, + anon_sym_LPAREN, + ACTIONS(17), 1, + anon_sym_BANG, + ACTIONS(21), 1, + sym_number, + ACTIONS(23), 1, + anon_sym_DQUOTE, + ACTIONS(29), 1, + sym_term, + STATE(70), 1, + sym_selection_select, + STATE(78), 1, + sym_selection, + STATE(88), 1, + sym_relational_op, + STATE(90), 1, + sym_logical_op, + STATE(99), 1, + sym_expression, + ACTIONS(25), 2, + anon_sym_true, + anon_sym_false, + STATE(89), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(97), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(87), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [1015] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(15), 1, + anon_sym_LPAREN, + ACTIONS(17), 1, + anon_sym_BANG, + ACTIONS(21), 1, + sym_number, + ACTIONS(23), 1, + anon_sym_DQUOTE, + ACTIONS(29), 1, + sym_term, + STATE(70), 1, + sym_selection_select, + STATE(78), 1, + sym_selection, + STATE(80), 1, + sym_expression, + STATE(88), 1, + sym_relational_op, + STATE(90), 1, + sym_logical_op, + ACTIONS(25), 2, + anon_sym_true, + anon_sym_false, + STATE(89), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(97), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(87), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [1073] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(15), 1, + anon_sym_LPAREN, + ACTIONS(17), 1, + anon_sym_BANG, + ACTIONS(21), 1, + sym_number, + ACTIONS(23), 1, + anon_sym_DQUOTE, + ACTIONS(29), 1, + sym_term, + STATE(70), 1, + sym_selection_select, + STATE(78), 1, + sym_selection, + STATE(88), 1, + sym_relational_op, + STATE(90), 1, + sym_logical_op, + STATE(102), 1, + sym_expression, + ACTIONS(25), 2, + anon_sym_true, + anon_sym_false, + STATE(89), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(97), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(87), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [1131] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(15), 1, + anon_sym_LPAREN, + ACTIONS(17), 1, + anon_sym_BANG, + ACTIONS(21), 1, + sym_number, + ACTIONS(23), 1, + anon_sym_DQUOTE, + ACTIONS(29), 1, + sym_term, + STATE(70), 1, + sym_selection_select, + STATE(78), 1, + sym_selection, + STATE(88), 1, + sym_relational_op, + STATE(90), 1, + sym_logical_op, + STATE(107), 1, + sym_expression, + ACTIONS(25), 2, + anon_sym_true, + anon_sym_false, + STATE(89), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(97), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(87), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [1189] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(15), 1, + anon_sym_LPAREN, + ACTIONS(17), 1, + anon_sym_BANG, + ACTIONS(21), 1, + sym_number, + ACTIONS(23), 1, + anon_sym_DQUOTE, + ACTIONS(29), 1, + sym_term, + STATE(70), 1, + sym_selection_select, + STATE(78), 1, + sym_selection, + STATE(88), 1, + sym_relational_op, + STATE(90), 1, + sym_logical_op, + STATE(101), 1, + sym_expression, + ACTIONS(25), 2, + anon_sym_true, + anon_sym_false, + STATE(89), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(97), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(87), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [1247] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(15), 1, + anon_sym_LPAREN, + ACTIONS(17), 1, + anon_sym_BANG, + ACTIONS(21), 1, + sym_number, + ACTIONS(23), 1, + anon_sym_DQUOTE, + ACTIONS(29), 1, + sym_term, + STATE(70), 1, + sym_selection_select, + STATE(78), 1, + sym_selection, + STATE(85), 1, + sym_expression, + STATE(88), 1, + sym_relational_op, + STATE(90), 1, + sym_logical_op, + ACTIONS(25), 2, + anon_sym_true, + anon_sym_false, + STATE(89), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(97), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(87), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [1305] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(15), 1, + anon_sym_LPAREN, + ACTIONS(17), 1, + anon_sym_BANG, + ACTIONS(21), 1, + sym_number, + ACTIONS(23), 1, + anon_sym_DQUOTE, + ACTIONS(29), 1, + sym_term, + STATE(70), 1, + sym_selection_select, + STATE(78), 1, + sym_selection, + STATE(82), 1, + sym_expression, + STATE(88), 1, + sym_relational_op, + STATE(90), 1, + sym_logical_op, + ACTIONS(25), 2, + anon_sym_true, + anon_sym_false, + STATE(89), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(97), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(87), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [1363] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(15), 1, + anon_sym_LPAREN, + ACTIONS(17), 1, + anon_sym_BANG, + ACTIONS(21), 1, + sym_number, + ACTIONS(23), 1, + anon_sym_DQUOTE, + ACTIONS(29), 1, + sym_term, + STATE(70), 1, + sym_selection_select, + STATE(78), 1, + sym_selection, + STATE(88), 1, + sym_relational_op, + STATE(90), 1, + sym_logical_op, + STATE(113), 1, + sym_expression, + ACTIONS(25), 2, + anon_sym_true, + anon_sym_false, + STATE(89), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(97), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(87), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [1421] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(15), 1, + anon_sym_LPAREN, + ACTIONS(17), 1, + anon_sym_BANG, + ACTIONS(21), 1, + sym_number, + ACTIONS(23), 1, + anon_sym_DQUOTE, + ACTIONS(29), 1, + sym_term, + STATE(70), 1, + sym_selection_select, + STATE(78), 1, + sym_selection, + STATE(83), 1, + sym_expression, + STATE(88), 1, + sym_relational_op, + STATE(90), 1, + sym_logical_op, + ACTIONS(25), 2, + anon_sym_true, + anon_sym_false, + STATE(89), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(97), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(87), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [1479] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(15), 1, + anon_sym_LPAREN, + ACTIONS(17), 1, + anon_sym_BANG, + ACTIONS(21), 1, + sym_number, + ACTIONS(23), 1, + anon_sym_DQUOTE, + ACTIONS(29), 1, + sym_term, + STATE(70), 1, + sym_selection_select, + STATE(78), 1, + sym_selection, + STATE(86), 1, + sym_expression, + STATE(88), 1, + sym_relational_op, + STATE(90), 1, + sym_logical_op, + ACTIONS(25), 2, + anon_sym_true, + anon_sym_false, + STATE(89), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(97), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(87), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [1537] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(31), 1, + anon_sym_LPAREN, + ACTIONS(33), 1, + anon_sym_BANG, + ACTIONS(37), 1, + sym_number, + ACTIONS(39), 1, + anon_sym_DQUOTE, + ACTIONS(43), 1, + sym_term, + STATE(46), 1, + sym_selection, + STATE(47), 1, + sym_selection_select, + STATE(59), 1, + sym_relational_op, + STATE(61), 1, + sym_logical_op, + STATE(63), 1, + sym_expression, + ACTIONS(41), 2, + anon_sym_true, + anon_sym_false, + STATE(60), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(64), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(50), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [1595] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(15), 1, + anon_sym_LPAREN, + ACTIONS(17), 1, + anon_sym_BANG, + ACTIONS(21), 1, + sym_number, + ACTIONS(23), 1, + anon_sym_DQUOTE, + ACTIONS(29), 1, + sym_term, + STATE(70), 1, + sym_selection_select, + STATE(78), 1, + sym_selection, + STATE(88), 1, + sym_relational_op, + STATE(90), 1, + sym_logical_op, + STATE(91), 1, + sym_expression, + ACTIONS(25), 2, + anon_sym_true, + anon_sym_false, + STATE(89), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(97), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(87), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [1653] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(15), 1, + anon_sym_LPAREN, + ACTIONS(17), 1, + anon_sym_BANG, + ACTIONS(21), 1, + sym_number, + ACTIONS(23), 1, + anon_sym_DQUOTE, + ACTIONS(29), 1, + sym_term, + STATE(70), 1, + sym_selection_select, + STATE(78), 1, + sym_selection, + STATE(88), 1, + sym_relational_op, + STATE(90), 1, + sym_logical_op, + STATE(104), 1, + sym_expression, + ACTIONS(25), 2, + anon_sym_true, + anon_sym_false, + STATE(89), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(97), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(87), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [1711] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(15), 1, + anon_sym_LPAREN, + ACTIONS(17), 1, + anon_sym_BANG, + ACTIONS(21), 1, + sym_number, + ACTIONS(23), 1, + anon_sym_DQUOTE, + ACTIONS(29), 1, + sym_term, + STATE(70), 1, + sym_selection_select, + STATE(78), 1, + sym_selection, + STATE(88), 1, + sym_relational_op, + STATE(90), 1, + sym_logical_op, + STATE(95), 1, + sym_expression, + ACTIONS(25), 2, + anon_sym_true, + anon_sym_false, + STATE(89), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(97), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(87), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [1769] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(15), 1, + anon_sym_LPAREN, + ACTIONS(17), 1, + anon_sym_BANG, + ACTIONS(21), 1, + sym_number, + ACTIONS(23), 1, + anon_sym_DQUOTE, + ACTIONS(29), 1, + sym_term, + STATE(70), 1, + sym_selection_select, + STATE(78), 1, + sym_selection, + STATE(88), 1, + sym_relational_op, + STATE(90), 1, + sym_logical_op, + STATE(103), 1, + sym_expression, + ACTIONS(25), 2, + anon_sym_true, + anon_sym_false, + STATE(89), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(97), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(87), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [1827] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(31), 1, + anon_sym_LPAREN, + ACTIONS(33), 1, + anon_sym_BANG, + ACTIONS(37), 1, + sym_number, + ACTIONS(39), 1, + anon_sym_DQUOTE, + ACTIONS(43), 1, + sym_term, + STATE(46), 1, + sym_selection, + STATE(47), 1, + sym_selection_select, + STATE(53), 1, + sym_expression, + STATE(59), 1, + sym_relational_op, + STATE(61), 1, + sym_logical_op, + ACTIONS(41), 2, + anon_sym_true, + anon_sym_false, + STATE(60), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(64), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(50), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [1885] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(31), 1, + anon_sym_LPAREN, + ACTIONS(33), 1, + anon_sym_BANG, + ACTIONS(37), 1, + sym_number, + ACTIONS(39), 1, + anon_sym_DQUOTE, + ACTIONS(43), 1, + sym_term, + STATE(46), 1, + sym_selection, + STATE(47), 1, + sym_selection_select, + STATE(54), 1, + sym_expression, + STATE(59), 1, + sym_relational_op, + STATE(61), 1, + sym_logical_op, + ACTIONS(41), 2, + anon_sym_true, + anon_sym_false, + STATE(60), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(64), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(50), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [1943] = 15, + ACTIONS(3), 1, + sym_comment, + ACTIONS(31), 1, + anon_sym_LPAREN, + ACTIONS(33), 1, + anon_sym_BANG, + ACTIONS(37), 1, + sym_number, + ACTIONS(39), 1, + anon_sym_DQUOTE, + ACTIONS(43), 1, + sym_term, + STATE(46), 1, + sym_selection, + STATE(47), 1, + sym_selection_select, + STATE(55), 1, + sym_expression, + STATE(59), 1, + sym_relational_op, + STATE(61), 1, + sym_logical_op, + ACTIONS(41), 2, + anon_sym_true, + anon_sym_false, + STATE(60), 3, + sym_logical_or, + sym_logical_and, + sym_logical_not, + STATE(64), 4, + sym_parenthetical, + sym_literal_str, + sym_literal_boolean, + sym_literal_number, + STATE(50), 7, + sym_relational_eq, + sym_relational_neq, + sym_relational_lt, + sym_relational_lte, + sym_relational_gt, + sym_relational_gte, + sym_relational_in, + [2001] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(47), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(45), 14, + ts_builtin_sym_end, + anon_sym_import, + anon_sym_module, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_context, + anon_sym_AT, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [2025] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(51), 1, + anon_sym_LPAREN, + ACTIONS(53), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(49), 10, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_DOT, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2050] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(57), 1, + anon_sym_LPAREN, + ACTIONS(59), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(55), 10, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_DOT, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2075] = 12, + ACTIONS(3), 1, + sym_comment, + ACTIONS(13), 1, + anon_sym_AT, + ACTIONS(61), 1, + anon_sym_RBRACE, + ACTIONS(63), 1, + anon_sym_export, + ACTIONS(67), 1, + anon_sym_interceptor, + ACTIONS(69), 1, + anon_sym_type, + STATE(45), 1, + aux_sym_module_body_repeat1, + STATE(120), 1, + sym_annotation, + STATE(140), 1, + aux_sym_module_repeat1, + STATE(143), 1, + sym_module_field, + ACTIONS(65), 2, + anon_sym_query, + anon_sym_mutation, + STATE(142), 3, + sym_module_method, + sym_interceptor, + sym_type, + [2115] = 12, + ACTIONS(3), 1, + sym_comment, + ACTIONS(13), 1, + anon_sym_AT, + ACTIONS(63), 1, + anon_sym_export, + ACTIONS(67), 1, + anon_sym_interceptor, + ACTIONS(69), 1, + anon_sym_type, + ACTIONS(71), 1, + anon_sym_RBRACE, + STATE(39), 1, + aux_sym_module_body_repeat1, + STATE(120), 1, + sym_annotation, + STATE(140), 1, + aux_sym_module_repeat1, + STATE(143), 1, + sym_module_field, + ACTIONS(65), 2, + anon_sym_query, + anon_sym_mutation, + STATE(142), 3, + sym_module_method, + sym_interceptor, + sym_type, + [2155] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(75), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(73), 10, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_DOT, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2177] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(53), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(49), 10, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_DOT, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2199] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(79), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(77), 10, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_DOT, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2221] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(83), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(81), 10, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_DOT, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2243] = 12, + ACTIONS(3), 1, + sym_comment, + ACTIONS(85), 1, + anon_sym_RBRACE, + ACTIONS(87), 1, + anon_sym_export, + ACTIONS(93), 1, + anon_sym_interceptor, + ACTIONS(96), 1, + anon_sym_type, + ACTIONS(99), 1, + anon_sym_AT, + STATE(45), 1, + aux_sym_module_body_repeat1, + STATE(120), 1, + sym_annotation, + STATE(140), 1, + aux_sym_module_repeat1, + STATE(143), 1, + sym_module_field, + ACTIONS(90), 2, + anon_sym_query, + anon_sym_mutation, + STATE(142), 3, + sym_module_method, + sym_interceptor, + sym_type, + [2283] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(106), 1, + anon_sym_DOT, + ACTIONS(104), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(102), 9, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2307] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(59), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(55), 10, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_DOT, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2329] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(110), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(108), 9, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2350] = 10, + ACTIONS(3), 1, + sym_comment, + ACTIONS(114), 1, + anon_sym_LT, + ACTIONS(116), 1, + anon_sym_GT, + ACTIONS(118), 1, + anon_sym_EQ_EQ, + ACTIONS(120), 1, + anon_sym_BANG_EQ, + ACTIONS(122), 1, + anon_sym_LT_EQ, + ACTIONS(124), 1, + anon_sym_GT_EQ, + ACTIONS(126), 1, + anon_sym_in, + ACTIONS(128), 1, + sym_term, + ACTIONS(112), 5, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + [2385] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(132), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(130), 9, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2406] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(134), 1, + anon_sym_LPAREN, + ACTIONS(53), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(49), 10, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_DOT, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [2429] = 12, + ACTIONS(3), 1, + sym_comment, + ACTIONS(114), 1, + anon_sym_LT, + ACTIONS(116), 1, + anon_sym_GT, + ACTIONS(118), 1, + anon_sym_EQ_EQ, + ACTIONS(120), 1, + anon_sym_BANG_EQ, + ACTIONS(122), 1, + anon_sym_LT_EQ, + ACTIONS(124), 1, + anon_sym_GT_EQ, + ACTIONS(126), 1, + anon_sym_in, + ACTIONS(138), 1, + anon_sym_PIPE_PIPE, + ACTIONS(140), 1, + anon_sym_AMP_AMP, + ACTIONS(142), 1, + sym_term, + ACTIONS(136), 3, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + [2468] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(146), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(144), 9, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2489] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(150), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(148), 9, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2510] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(154), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(152), 9, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2531] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(158), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(156), 9, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2552] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(162), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(160), 9, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2573] = 10, + ACTIONS(3), 1, + sym_comment, + ACTIONS(114), 1, + anon_sym_LT, + ACTIONS(116), 1, + anon_sym_GT, + ACTIONS(118), 1, + anon_sym_EQ_EQ, + ACTIONS(120), 1, + anon_sym_BANG_EQ, + ACTIONS(122), 1, + anon_sym_LT_EQ, + ACTIONS(124), 1, + anon_sym_GT_EQ, + ACTIONS(126), 1, + anon_sym_in, + ACTIONS(166), 1, + sym_term, + ACTIONS(164), 5, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + [2608] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(104), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(102), 9, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2629] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(170), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(168), 9, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2650] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(104), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(102), 9, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2671] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(174), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(172), 9, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2692] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(178), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(176), 9, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2713] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(104), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(102), 9, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2734] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(182), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(180), 9, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2755] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(186), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(184), 9, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2776] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(47), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(45), 9, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2797] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(190), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_in, + sym_term, + ACTIONS(188), 9, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [2818] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(192), 1, + anon_sym_EQ, + ACTIONS(59), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(55), 10, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_DOT, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [2841] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(59), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(55), 10, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_DOT, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [2861] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(75), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(73), 10, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_DOT, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [2881] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(79), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(77), 10, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_DOT, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [2901] = 13, + ACTIONS(3), 1, + sym_comment, + ACTIONS(194), 1, + anon_sym_COMMA, + ACTIONS(196), 1, + anon_sym_RPAREN, + ACTIONS(198), 1, + anon_sym_LT, + ACTIONS(200), 1, + anon_sym_GT, + ACTIONS(202), 1, + anon_sym_PIPE_PIPE, + ACTIONS(204), 1, + anon_sym_AMP_AMP, + ACTIONS(206), 1, + anon_sym_EQ_EQ, + ACTIONS(208), 1, + anon_sym_BANG_EQ, + ACTIONS(210), 1, + anon_sym_LT_EQ, + ACTIONS(212), 1, + anon_sym_GT_EQ, + ACTIONS(214), 1, + anon_sym_in, + STATE(221), 1, + aux_sym_annotation_multiple_params_repeat1, + [2941] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(53), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(49), 10, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_DOT, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [2961] = 10, + ACTIONS(3), 1, + sym_comment, + ACTIONS(7), 1, + anon_sym_import, + ACTIONS(9), 1, + anon_sym_module, + ACTIONS(11), 1, + anon_sym_context, + ACTIONS(13), 1, + anon_sym_AT, + ACTIONS(216), 1, + ts_builtin_sym_end, + STATE(120), 1, + sym_annotation, + STATE(166), 1, + aux_sym_module_repeat1, + STATE(76), 2, + sym_declaration, + aux_sym_source_file_repeat1, + STATE(169), 3, + sym_import, + sym_module, + sym_context, + [2995] = 10, + ACTIONS(3), 1, + sym_comment, + ACTIONS(218), 1, + ts_builtin_sym_end, + ACTIONS(220), 1, + anon_sym_import, + ACTIONS(223), 1, + anon_sym_module, + ACTIONS(226), 1, + anon_sym_context, + ACTIONS(229), 1, + anon_sym_AT, + STATE(120), 1, + sym_annotation, + STATE(166), 1, + aux_sym_module_repeat1, + STATE(76), 2, + sym_declaration, + aux_sym_source_file_repeat1, + STATE(169), 3, + sym_import, + sym_module, + sym_context, + [3029] = 13, + ACTIONS(3), 1, + sym_comment, + ACTIONS(198), 1, + anon_sym_LT, + ACTIONS(200), 1, + anon_sym_GT, + ACTIONS(202), 1, + anon_sym_PIPE_PIPE, + ACTIONS(204), 1, + anon_sym_AMP_AMP, + ACTIONS(206), 1, + anon_sym_EQ_EQ, + ACTIONS(208), 1, + anon_sym_BANG_EQ, + ACTIONS(210), 1, + anon_sym_LT_EQ, + ACTIONS(212), 1, + anon_sym_GT_EQ, + ACTIONS(214), 1, + anon_sym_in, + ACTIONS(232), 1, + anon_sym_COMMA, + ACTIONS(234), 1, + anon_sym_RPAREN, + STATE(234), 1, + aux_sym_field_default_value_repeat1, + [3069] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(236), 1, + anon_sym_DOT, + ACTIONS(104), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(102), 9, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [3091] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(83), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(81), 10, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_DOT, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [3111] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(154), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(152), 9, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [3130] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(190), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(188), 9, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [3149] = 9, + ACTIONS(3), 1, + sym_comment, + ACTIONS(198), 1, + anon_sym_LT, + ACTIONS(200), 1, + anon_sym_GT, + ACTIONS(206), 1, + anon_sym_EQ_EQ, + ACTIONS(208), 1, + anon_sym_BANG_EQ, + ACTIONS(210), 1, + anon_sym_LT_EQ, + ACTIONS(212), 1, + anon_sym_GT_EQ, + ACTIONS(214), 1, + anon_sym_in, + ACTIONS(112), 4, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + [3180] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(110), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(108), 9, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [3199] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(182), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(180), 9, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [3218] = 9, + ACTIONS(3), 1, + sym_comment, + ACTIONS(198), 1, + anon_sym_LT, + ACTIONS(200), 1, + anon_sym_GT, + ACTIONS(206), 1, + anon_sym_EQ_EQ, + ACTIONS(208), 1, + anon_sym_BANG_EQ, + ACTIONS(210), 1, + anon_sym_LT_EQ, + ACTIONS(212), 1, + anon_sym_GT_EQ, + ACTIONS(214), 1, + anon_sym_in, + ACTIONS(164), 4, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + [3249] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(178), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(176), 9, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [3268] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(132), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(130), 9, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [3287] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(104), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(102), 9, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [3306] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(170), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(168), 9, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [3325] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(104), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(102), 9, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [3344] = 11, + ACTIONS(3), 1, + sym_comment, + ACTIONS(198), 1, + anon_sym_LT, + ACTIONS(200), 1, + anon_sym_GT, + ACTIONS(202), 1, + anon_sym_PIPE_PIPE, + ACTIONS(204), 1, + anon_sym_AMP_AMP, + ACTIONS(206), 1, + anon_sym_EQ_EQ, + ACTIONS(208), 1, + anon_sym_BANG_EQ, + ACTIONS(210), 1, + anon_sym_LT_EQ, + ACTIONS(212), 1, + anon_sym_GT_EQ, + ACTIONS(214), 1, + anon_sym_in, + ACTIONS(238), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + [3379] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(240), 11, + ts_builtin_sym_end, + anon_sym_import, + anon_sym_module, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_context, + anon_sym_type, + anon_sym_AT, + [3396] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(186), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(184), 9, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [3415] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(242), 11, + ts_builtin_sym_end, + anon_sym_import, + anon_sym_module, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_context, + anon_sym_type, + anon_sym_AT, + [3432] = 11, + ACTIONS(3), 1, + sym_comment, + ACTIONS(198), 1, + anon_sym_LT, + ACTIONS(200), 1, + anon_sym_GT, + ACTIONS(202), 1, + anon_sym_PIPE_PIPE, + ACTIONS(204), 1, + anon_sym_AMP_AMP, + ACTIONS(206), 1, + anon_sym_EQ_EQ, + ACTIONS(208), 1, + anon_sym_BANG_EQ, + ACTIONS(210), 1, + anon_sym_LT_EQ, + ACTIONS(212), 1, + anon_sym_GT_EQ, + ACTIONS(214), 1, + anon_sym_in, + ACTIONS(244), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + [3467] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(174), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(172), 9, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [3486] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(104), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(102), 9, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [3505] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(146), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(144), 9, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [3524] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(150), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(148), 9, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [3543] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(248), 1, + anon_sym_RPAREN, + ACTIONS(250), 1, + anon_sym_LT, + ACTIONS(246), 9, + anon_sym_RBRACE, + anon_sym_COMMA, + anon_sym_RPAREN_COLON, + anon_sym_AT, + anon_sym_EQ, + anon_sym_SEMI, + anon_sym_GT, + anon_sym_QMARK, + sym_term, + [3564] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(162), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(160), 9, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [3583] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(158), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(156), 9, + anon_sym_COMMA, + anon_sym_RPAREN, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_in, + [3602] = 11, + ACTIONS(3), 1, + sym_comment, + ACTIONS(198), 1, + anon_sym_LT, + ACTIONS(200), 1, + anon_sym_GT, + ACTIONS(202), 1, + anon_sym_PIPE_PIPE, + ACTIONS(204), 1, + anon_sym_AMP_AMP, + ACTIONS(206), 1, + anon_sym_EQ_EQ, + ACTIONS(208), 1, + anon_sym_BANG_EQ, + ACTIONS(210), 1, + anon_sym_LT_EQ, + ACTIONS(212), 1, + anon_sym_GT_EQ, + ACTIONS(214), 1, + anon_sym_in, + ACTIONS(252), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + [3637] = 11, + ACTIONS(3), 1, + sym_comment, + ACTIONS(198), 1, + anon_sym_LT, + ACTIONS(200), 1, + anon_sym_GT, + ACTIONS(202), 1, + anon_sym_PIPE_PIPE, + ACTIONS(204), 1, + anon_sym_AMP_AMP, + ACTIONS(206), 1, + anon_sym_EQ_EQ, + ACTIONS(208), 1, + anon_sym_BANG_EQ, + ACTIONS(210), 1, + anon_sym_LT_EQ, + ACTIONS(212), 1, + anon_sym_GT_EQ, + ACTIONS(214), 1, + anon_sym_in, + ACTIONS(254), 1, + anon_sym_RPAREN, + [3671] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(258), 1, + anon_sym_RPAREN, + ACTIONS(256), 9, + anon_sym_RBRACE, + anon_sym_COMMA, + anon_sym_RPAREN_COLON, + anon_sym_AT, + anon_sym_EQ, + anon_sym_SEMI, + anon_sym_GT, + anon_sym_QMARK, + sym_term, + [3689] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(248), 1, + anon_sym_RPAREN, + ACTIONS(246), 9, + anon_sym_RBRACE, + anon_sym_COMMA, + anon_sym_RPAREN_COLON, + anon_sym_AT, + anon_sym_EQ, + anon_sym_SEMI, + anon_sym_GT, + anon_sym_QMARK, + sym_term, + [3707] = 11, + ACTIONS(3), 1, + sym_comment, + ACTIONS(198), 1, + anon_sym_LT, + ACTIONS(200), 1, + anon_sym_GT, + ACTIONS(202), 1, + anon_sym_PIPE_PIPE, + ACTIONS(204), 1, + anon_sym_AMP_AMP, + ACTIONS(206), 1, + anon_sym_EQ_EQ, + ACTIONS(208), 1, + anon_sym_BANG_EQ, + ACTIONS(210), 1, + anon_sym_LT_EQ, + ACTIONS(212), 1, + anon_sym_GT_EQ, + ACTIONS(214), 1, + anon_sym_in, + ACTIONS(260), 1, + anon_sym_RPAREN, + [3741] = 11, + ACTIONS(3), 1, + sym_comment, + ACTIONS(198), 1, + anon_sym_LT, + ACTIONS(200), 1, + anon_sym_GT, + ACTIONS(202), 1, + anon_sym_PIPE_PIPE, + ACTIONS(204), 1, + anon_sym_AMP_AMP, + ACTIONS(206), 1, + anon_sym_EQ_EQ, + ACTIONS(208), 1, + anon_sym_BANG_EQ, + ACTIONS(210), 1, + anon_sym_LT_EQ, + ACTIONS(212), 1, + anon_sym_GT_EQ, + ACTIONS(214), 1, + anon_sym_in, + ACTIONS(262), 1, + anon_sym_RPAREN, + [3775] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(266), 1, + anon_sym_RPAREN, + ACTIONS(264), 9, + anon_sym_RBRACE, + anon_sym_COMMA, + anon_sym_RPAREN_COLON, + anon_sym_AT, + anon_sym_EQ, + anon_sym_SEMI, + anon_sym_GT, + anon_sym_QMARK, + sym_term, + [3793] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(270), 1, + anon_sym_RPAREN, + ACTIONS(268), 9, + anon_sym_RBRACE, + anon_sym_COMMA, + anon_sym_RPAREN_COLON, + anon_sym_AT, + anon_sym_EQ, + anon_sym_SEMI, + anon_sym_GT, + anon_sym_QMARK, + sym_term, + [3811] = 11, + ACTIONS(3), 1, + sym_comment, + ACTIONS(198), 1, + anon_sym_LT, + ACTIONS(200), 1, + anon_sym_GT, + ACTIONS(202), 1, + anon_sym_PIPE_PIPE, + ACTIONS(204), 1, + anon_sym_AMP_AMP, + ACTIONS(206), 1, + anon_sym_EQ_EQ, + ACTIONS(208), 1, + anon_sym_BANG_EQ, + ACTIONS(210), 1, + anon_sym_LT_EQ, + ACTIONS(212), 1, + anon_sym_GT_EQ, + ACTIONS(214), 1, + anon_sym_in, + ACTIONS(272), 1, + anon_sym_RPAREN, + [3845] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(276), 1, + anon_sym_AT, + STATE(112), 1, + aux_sym_module_repeat1, + STATE(120), 1, + sym_annotation, + ACTIONS(274), 7, + anon_sym_module, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_context, + anon_sym_type, + [3867] = 11, + ACTIONS(3), 1, + sym_comment, + ACTIONS(198), 1, + anon_sym_LT, + ACTIONS(200), 1, + anon_sym_GT, + ACTIONS(202), 1, + anon_sym_PIPE_PIPE, + ACTIONS(204), 1, + anon_sym_AMP_AMP, + ACTIONS(206), 1, + anon_sym_EQ_EQ, + ACTIONS(208), 1, + anon_sym_BANG_EQ, + ACTIONS(210), 1, + anon_sym_LT_EQ, + ACTIONS(212), 1, + anon_sym_GT_EQ, + ACTIONS(214), 1, + anon_sym_in, + ACTIONS(279), 1, + anon_sym_RPAREN, + [3901] = 11, + ACTIONS(3), 1, + sym_comment, + ACTIONS(198), 1, + anon_sym_LT, + ACTIONS(200), 1, + anon_sym_GT, + ACTIONS(202), 1, + anon_sym_PIPE_PIPE, + ACTIONS(204), 1, + anon_sym_AMP_AMP, + ACTIONS(206), 1, + anon_sym_EQ_EQ, + ACTIONS(208), 1, + anon_sym_BANG_EQ, + ACTIONS(210), 1, + anon_sym_LT_EQ, + ACTIONS(212), 1, + anon_sym_GT_EQ, + ACTIONS(214), 1, + anon_sym_in, + ACTIONS(281), 1, + anon_sym_RPAREN, + [3935] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(285), 1, + anon_sym_LPAREN, + ACTIONS(283), 8, + anon_sym_module, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_context, + anon_sym_type, + anon_sym_AT, + [3952] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(287), 1, + anon_sym_LT, + ACTIONS(246), 8, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + anon_sym_QMARK, + [3969] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(291), 1, + anon_sym_QMARK, + ACTIONS(289), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [3985] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(291), 1, + anon_sym_QMARK, + ACTIONS(293), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4001] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(291), 1, + anon_sym_QMARK, + ACTIONS(295), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4017] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(297), 8, + anon_sym_module, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_context, + anon_sym_type, + anon_sym_AT, + [4031] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(291), 1, + anon_sym_QMARK, + ACTIONS(299), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4047] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(291), 1, + anon_sym_QMARK, + ACTIONS(301), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4063] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(291), 1, + anon_sym_QMARK, + ACTIONS(303), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4079] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(305), 8, + anon_sym_module, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_context, + anon_sym_type, + anon_sym_AT, + [4093] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(268), 8, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + anon_sym_QMARK, + [4107] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(264), 8, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + anon_sym_QMARK, + [4121] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(291), 1, + anon_sym_QMARK, + ACTIONS(295), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4137] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(256), 8, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + anon_sym_QMARK, + [4151] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(291), 1, + anon_sym_QMARK, + ACTIONS(307), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4167] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(291), 1, + anon_sym_QMARK, + ACTIONS(289), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4183] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(291), 1, + anon_sym_QMARK, + ACTIONS(303), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4199] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(291), 1, + anon_sym_QMARK, + ACTIONS(309), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4215] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(291), 1, + anon_sym_QMARK, + ACTIONS(311), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4231] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(291), 1, + anon_sym_QMARK, + ACTIONS(311), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4247] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(246), 8, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + anon_sym_QMARK, + [4261] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(291), 1, + anon_sym_QMARK, + ACTIONS(301), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4277] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(291), 1, + anon_sym_QMARK, + ACTIONS(313), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4293] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(291), 1, + anon_sym_QMARK, + ACTIONS(315), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4309] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(291), 1, + anon_sym_QMARK, + ACTIONS(315), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4325] = 9, + ACTIONS(3), 1, + sym_comment, + ACTIONS(13), 1, + anon_sym_AT, + ACTIONS(317), 1, + anon_sym_export, + ACTIONS(319), 1, + anon_sym_query, + ACTIONS(321), 1, + anon_sym_mutation, + ACTIONS(323), 1, + anon_sym_interceptor, + ACTIONS(325), 1, + anon_sym_type, + STATE(112), 1, + aux_sym_module_repeat1, + STATE(120), 1, + sym_annotation, + [4353] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(291), 1, + anon_sym_QMARK, + ACTIONS(327), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4369] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(329), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4382] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(331), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4395] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(333), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4408] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(335), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4421] = 8, + ACTIONS(3), 1, + sym_comment, + ACTIONS(337), 1, + anon_sym_RBRACE, + ACTIONS(339), 1, + anon_sym_AT, + ACTIONS(341), 1, + sym_term, + STATE(152), 1, + aux_sym_type_body_repeat1, + STATE(183), 1, + aux_sym_module_repeat1, + STATE(204), 1, + sym_field, + STATE(249), 1, + sym_annotation, + [4446] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(343), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4459] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(345), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4472] = 8, + ACTIONS(3), 1, + sym_comment, + ACTIONS(339), 1, + anon_sym_AT, + ACTIONS(341), 1, + sym_term, + ACTIONS(347), 1, + anon_sym_RBRACE, + STATE(146), 1, + aux_sym_type_body_repeat1, + STATE(183), 1, + aux_sym_module_repeat1, + STATE(204), 1, + sym_field, + STATE(249), 1, + sym_annotation, + [4497] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(349), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4510] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(351), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4523] = 8, + ACTIONS(3), 1, + sym_comment, + ACTIONS(353), 1, + anon_sym_RBRACE, + ACTIONS(355), 1, + anon_sym_AT, + ACTIONS(358), 1, + sym_term, + STATE(152), 1, + aux_sym_type_body_repeat1, + STATE(183), 1, + aux_sym_module_repeat1, + STATE(204), 1, + sym_field, + STATE(249), 1, + sym_annotation, + [4548] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(361), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4561] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(363), 7, + anon_sym_RBRACE, + anon_sym_export, + anon_sym_query, + anon_sym_mutation, + anon_sym_interceptor, + anon_sym_type, + anon_sym_AT, + [4574] = 7, + ACTIONS(3), 1, + sym_comment, + ACTIONS(339), 1, + anon_sym_AT, + ACTIONS(365), 1, + anon_sym_RPAREN_COLON, + ACTIONS(367), 1, + sym_term, + STATE(177), 1, + aux_sym_module_repeat1, + STATE(237), 1, + sym_argument, + STATE(249), 1, + sym_annotation, + [4596] = 7, + ACTIONS(3), 1, + sym_comment, + ACTIONS(339), 1, + anon_sym_AT, + ACTIONS(367), 1, + sym_term, + ACTIONS(369), 1, + anon_sym_RPAREN_COLON, + STATE(177), 1, + aux_sym_module_repeat1, + STATE(247), 1, + sym_argument, + STATE(249), 1, + sym_annotation, + [4618] = 7, + ACTIONS(3), 1, + sym_comment, + ACTIONS(339), 1, + anon_sym_AT, + ACTIONS(367), 1, + sym_term, + ACTIONS(371), 1, + anon_sym_RPAREN_COLON, + STATE(177), 1, + aux_sym_module_repeat1, + STATE(194), 1, + sym_argument, + STATE(249), 1, + sym_annotation, + [4640] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(375), 1, + anon_sym_EQ, + ACTIONS(377), 1, + anon_sym_SEMI, + ACTIONS(379), 1, + anon_sym_QMARK, + ACTIONS(373), 3, + anon_sym_RBRACE, + anon_sym_AT, + sym_term, + [4658] = 7, + ACTIONS(3), 1, + sym_comment, + ACTIONS(339), 1, + anon_sym_AT, + ACTIONS(367), 1, + sym_term, + ACTIONS(381), 1, + anon_sym_RPAREN_COLON, + STATE(177), 1, + aux_sym_module_repeat1, + STATE(225), 1, + sym_argument, + STATE(249), 1, + sym_annotation, + [4680] = 7, + ACTIONS(3), 1, + sym_comment, + ACTIONS(339), 1, + anon_sym_AT, + ACTIONS(367), 1, + sym_term, + ACTIONS(383), 1, + anon_sym_RPAREN_COLON, + STATE(177), 1, + aux_sym_module_repeat1, + STATE(192), 1, + sym_argument, + STATE(249), 1, + sym_annotation, + [4702] = 7, + ACTIONS(3), 1, + sym_comment, + ACTIONS(339), 1, + anon_sym_AT, + ACTIONS(367), 1, + sym_term, + ACTIONS(385), 1, + anon_sym_RPAREN_COLON, + STATE(177), 1, + aux_sym_module_repeat1, + STATE(233), 1, + sym_argument, + STATE(249), 1, + sym_annotation, + [4724] = 7, + ACTIONS(3), 1, + sym_comment, + ACTIONS(339), 1, + anon_sym_AT, + ACTIONS(367), 1, + sym_term, + ACTIONS(387), 1, + anon_sym_RPAREN, + STATE(177), 1, + aux_sym_module_repeat1, + STATE(232), 1, + sym_argument, + STATE(249), 1, + sym_annotation, + [4746] = 7, + ACTIONS(3), 1, + sym_comment, + ACTIONS(339), 1, + anon_sym_AT, + ACTIONS(367), 1, + sym_term, + ACTIONS(389), 1, + anon_sym_RPAREN, + STATE(177), 1, + aux_sym_module_repeat1, + STATE(244), 1, + sym_argument, + STATE(249), 1, + sym_annotation, + [4768] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(379), 1, + anon_sym_QMARK, + ACTIONS(393), 1, + anon_sym_EQ, + ACTIONS(395), 1, + anon_sym_SEMI, + ACTIONS(391), 3, + anon_sym_RBRACE, + anon_sym_AT, + sym_term, + [4786] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(397), 5, + ts_builtin_sym_end, + anon_sym_import, + anon_sym_module, + anon_sym_context, + anon_sym_AT, + [4797] = 6, + ACTIONS(3), 1, + sym_comment, + ACTIONS(13), 1, + anon_sym_AT, + ACTIONS(399), 1, + anon_sym_module, + ACTIONS(401), 1, + anon_sym_context, + STATE(112), 1, + aux_sym_module_repeat1, + STATE(120), 1, + sym_annotation, + [4816] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(403), 5, + ts_builtin_sym_end, + anon_sym_import, + anon_sym_module, + anon_sym_context, + anon_sym_AT, + [4827] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(405), 5, + ts_builtin_sym_end, + anon_sym_import, + anon_sym_module, + anon_sym_context, + anon_sym_AT, + [4838] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(407), 5, + ts_builtin_sym_end, + anon_sym_import, + anon_sym_module, + anon_sym_context, + anon_sym_AT, + [4849] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(409), 5, + ts_builtin_sym_end, + anon_sym_import, + anon_sym_module, + anon_sym_context, + anon_sym_AT, + [4860] = 6, + ACTIONS(3), 1, + sym_comment, + ACTIONS(339), 1, + anon_sym_AT, + ACTIONS(367), 1, + sym_term, + STATE(177), 1, + aux_sym_module_repeat1, + STATE(212), 1, + sym_argument, + STATE(249), 1, + sym_annotation, + [4879] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(411), 5, + ts_builtin_sym_end, + anon_sym_import, + anon_sym_module, + anon_sym_context, + anon_sym_AT, + [4890] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(413), 5, + ts_builtin_sym_end, + anon_sym_import, + anon_sym_module, + anon_sym_context, + anon_sym_AT, + [4901] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(415), 5, + ts_builtin_sym_end, + anon_sym_import, + anon_sym_module, + anon_sym_context, + anon_sym_AT, + [4912] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(379), 1, + anon_sym_QMARK, + ACTIONS(419), 1, + anon_sym_RPAREN, + ACTIONS(417), 2, + anon_sym_COMMA, + anon_sym_RPAREN_COLON, + [4926] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(423), 1, + anon_sym_SEMI, + ACTIONS(421), 3, + anon_sym_RBRACE, + anon_sym_AT, + sym_term, + [4938] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(339), 1, + anon_sym_AT, + ACTIONS(425), 1, + sym_term, + STATE(178), 1, + aux_sym_module_repeat1, + STATE(249), 1, + sym_annotation, + [4954] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(274), 1, + sym_term, + ACTIONS(427), 1, + anon_sym_AT, + STATE(178), 1, + aux_sym_module_repeat1, + STATE(249), 1, + sym_annotation, + [4970] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(430), 1, + anon_sym_COMMA, + ACTIONS(433), 1, + anon_sym_RPAREN_COLON, + ACTIONS(435), 1, + anon_sym_RPAREN, + STATE(179), 1, + aux_sym_module_method_repeat1, + [4986] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(437), 4, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + sym_term, + [4996] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(439), 4, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + sym_term, + [5006] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(379), 1, + anon_sym_QMARK, + ACTIONS(441), 1, + anon_sym_COMMA, + ACTIONS(443), 1, + anon_sym_GT, + STATE(202), 1, + aux_sym_field_type_repeat1, + [5022] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(339), 1, + anon_sym_AT, + ACTIONS(445), 1, + sym_term, + STATE(178), 1, + aux_sym_module_repeat1, + STATE(249), 1, + sym_annotation, + [5038] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(449), 1, + anon_sym_SEMI, + ACTIONS(447), 3, + anon_sym_RBRACE, + anon_sym_AT, + sym_term, + [5050] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(379), 1, + anon_sym_QMARK, + ACTIONS(441), 1, + anon_sym_COMMA, + ACTIONS(451), 1, + anon_sym_GT, + STATE(220), 1, + aux_sym_field_type_repeat1, + [5066] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(453), 4, + anon_sym_RBRACE, + anon_sym_AT, + anon_sym_SEMI, + sym_term, + [5076] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(379), 1, + anon_sym_QMARK, + ACTIONS(457), 1, + anon_sym_RPAREN, + ACTIONS(455), 2, + anon_sym_COMMA, + anon_sym_RPAREN_COLON, + [5090] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(459), 1, + anon_sym_COMMA, + ACTIONS(461), 1, + anon_sym_RPAREN_COLON, + STATE(179), 1, + aux_sym_module_method_repeat1, + [5103] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(463), 3, + anon_sym_RBRACE, + anon_sym_AT, + sym_term, + [5112] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(465), 1, + sym_term, + STATE(106), 1, + sym_optional_field_type, + STATE(187), 1, + sym_field_type, + [5125] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(467), 1, + sym_term, + STATE(123), 1, + sym_field_type, + STATE(135), 1, + sym_optional_field_type, + [5138] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(459), 1, + anon_sym_COMMA, + ACTIONS(469), 1, + anon_sym_RPAREN_COLON, + STATE(208), 1, + aux_sym_module_method_repeat1, + [5151] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(467), 1, + sym_term, + STATE(131), 1, + sym_field_type, + STATE(135), 1, + sym_optional_field_type, + [5164] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(459), 1, + anon_sym_COMMA, + ACTIONS(471), 1, + anon_sym_RPAREN_COLON, + STATE(188), 1, + aux_sym_module_method_repeat1, + [5177] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(467), 1, + sym_term, + STATE(133), 1, + sym_field_type, + STATE(135), 1, + sym_optional_field_type, + [5190] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(459), 1, + anon_sym_COMMA, + ACTIONS(473), 1, + anon_sym_RPAREN_COLON, + STATE(179), 1, + aux_sym_module_method_repeat1, + [5203] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(467), 1, + sym_term, + STATE(134), 1, + sym_field_type, + STATE(135), 1, + sym_optional_field_type, + [5216] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(459), 1, + anon_sym_COMMA, + ACTIONS(475), 1, + anon_sym_RPAREN_COLON, + STATE(179), 1, + aux_sym_module_method_repeat1, + [5229] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(459), 1, + anon_sym_COMMA, + ACTIONS(477), 1, + anon_sym_RPAREN, + STATE(179), 1, + aux_sym_module_method_repeat1, + [5242] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(465), 1, + sym_term, + STATE(106), 1, + sym_optional_field_type, + STATE(217), 1, + sym_field_type, + [5255] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(479), 3, + anon_sym_RBRACE, + anon_sym_AT, + sym_term, + [5264] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(441), 1, + anon_sym_COMMA, + ACTIONS(481), 1, + anon_sym_GT, + STATE(219), 1, + aux_sym_field_type_repeat1, + [5277] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(483), 3, + anon_sym_RBRACE, + anon_sym_AT, + sym_term, + [5286] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(485), 3, + anon_sym_RBRACE, + anon_sym_AT, + sym_term, + [5295] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(465), 1, + sym_term, + STATE(106), 1, + sym_optional_field_type, + STATE(185), 1, + sym_field_type, + [5308] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(467), 1, + sym_term, + STATE(135), 1, + sym_optional_field_type, + STATE(141), 1, + sym_field_type, + [5321] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(467), 1, + sym_term, + STATE(135), 1, + sym_optional_field_type, + STATE(139), 1, + sym_field_type, + [5334] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(459), 1, + anon_sym_COMMA, + ACTIONS(487), 1, + anon_sym_RPAREN_COLON, + STATE(179), 1, + aux_sym_module_method_repeat1, + [5347] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(467), 1, + sym_term, + STATE(135), 1, + sym_optional_field_type, + STATE(137), 1, + sym_field_type, + [5360] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(467), 1, + sym_term, + STATE(135), 1, + sym_optional_field_type, + STATE(138), 1, + sym_field_type, + [5373] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(465), 1, + sym_term, + STATE(106), 1, + sym_optional_field_type, + STATE(164), 1, + sym_field_type, + [5386] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(491), 1, + anon_sym_RPAREN, + ACTIONS(489), 2, + anon_sym_COMMA, + anon_sym_RPAREN_COLON, + [5397] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(467), 1, + sym_term, + STATE(117), 1, + sym_field_type, + STATE(135), 1, + sym_optional_field_type, + [5410] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(459), 1, + anon_sym_COMMA, + ACTIONS(493), 1, + anon_sym_RPAREN_COLON, + STATE(179), 1, + aux_sym_module_method_repeat1, + [5423] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(467), 1, + sym_term, + STATE(130), 1, + sym_field_type, + STATE(135), 1, + sym_optional_field_type, + [5436] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(467), 1, + sym_term, + STATE(118), 1, + sym_field_type, + STATE(135), 1, + sym_optional_field_type, + [5449] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(379), 1, + anon_sym_QMARK, + ACTIONS(495), 2, + anon_sym_COMMA, + anon_sym_GT, + [5460] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(497), 1, + sym_term, + STATE(71), 1, + sym_selection_element, + STATE(74), 1, + sym_hof_call, + [5473] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(499), 1, + anon_sym_COMMA, + ACTIONS(502), 1, + anon_sym_GT, + STATE(219), 1, + aux_sym_field_type_repeat1, + [5486] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(441), 1, + anon_sym_COMMA, + ACTIONS(504), 1, + anon_sym_GT, + STATE(219), 1, + aux_sym_field_type_repeat1, + [5499] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(194), 1, + anon_sym_COMMA, + ACTIONS(506), 1, + anon_sym_RPAREN, + STATE(236), 1, + aux_sym_annotation_multiple_params_repeat1, + [5512] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(508), 3, + anon_sym_RBRACE, + anon_sym_AT, + sym_term, + [5521] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(510), 1, + sym_term, + STATE(41), 1, + sym_selection_element, + STATE(42), 1, + sym_hof_call, + [5534] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(512), 1, + anon_sym_COMMA, + ACTIONS(514), 1, + anon_sym_RPAREN, + STATE(228), 1, + aux_sym_annotation_map_params_repeat1, + [5547] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(459), 1, + anon_sym_COMMA, + ACTIONS(516), 1, + anon_sym_RPAREN_COLON, + STATE(214), 1, + aux_sym_module_method_repeat1, + [5560] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(465), 1, + sym_term, + STATE(106), 1, + sym_optional_field_type, + STATE(182), 1, + sym_field_type, + [5573] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(467), 1, + sym_term, + STATE(135), 1, + sym_optional_field_type, + STATE(136), 1, + sym_field_type, + [5586] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(518), 1, + anon_sym_COMMA, + ACTIONS(521), 1, + anon_sym_RPAREN, + STATE(228), 1, + aux_sym_annotation_map_params_repeat1, + [5599] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(467), 1, + sym_term, + STATE(122), 1, + sym_field_type, + STATE(135), 1, + sym_optional_field_type, + [5612] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(512), 1, + anon_sym_COMMA, + ACTIONS(523), 1, + anon_sym_RPAREN, + STATE(224), 1, + aux_sym_annotation_map_params_repeat1, + [5625] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(465), 1, + sym_term, + STATE(106), 1, + sym_optional_field_type, + STATE(175), 1, + sym_field_type, + [5638] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(459), 1, + anon_sym_COMMA, + ACTIONS(525), 1, + anon_sym_RPAREN, + STATE(199), 1, + aux_sym_module_method_repeat1, + [5651] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(459), 1, + anon_sym_COMMA, + ACTIONS(527), 1, + anon_sym_RPAREN_COLON, + STATE(198), 1, + aux_sym_module_method_repeat1, + [5664] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(232), 1, + anon_sym_COMMA, + ACTIONS(529), 1, + anon_sym_RPAREN, + STATE(241), 1, + aux_sym_field_default_value_repeat1, + [5677] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(467), 1, + sym_term, + STATE(127), 1, + sym_field_type, + STATE(135), 1, + sym_optional_field_type, + [5690] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(531), 1, + anon_sym_COMMA, + ACTIONS(534), 1, + anon_sym_RPAREN, + STATE(236), 1, + aux_sym_annotation_multiple_params_repeat1, + [5703] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(459), 1, + anon_sym_COMMA, + ACTIONS(536), 1, + anon_sym_RPAREN_COLON, + STATE(196), 1, + aux_sym_module_method_repeat1, + [5716] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(467), 1, + sym_term, + STATE(119), 1, + sym_field_type, + STATE(135), 1, + sym_optional_field_type, + [5729] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(465), 1, + sym_term, + STATE(106), 1, + sym_optional_field_type, + STATE(158), 1, + sym_field_type, + [5742] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(459), 1, + anon_sym_COMMA, + ACTIONS(538), 1, + anon_sym_RPAREN, + STATE(179), 1, + aux_sym_module_method_repeat1, + [5755] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(540), 1, + anon_sym_COMMA, + ACTIONS(543), 1, + anon_sym_RPAREN, + STATE(241), 1, + aux_sym_field_default_value_repeat1, + [5768] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(467), 1, + sym_term, + STATE(132), 1, + sym_field_type, + STATE(135), 1, + sym_optional_field_type, + [5781] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(467), 1, + sym_term, + STATE(129), 1, + sym_field_type, + STATE(135), 1, + sym_optional_field_type, + [5794] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(459), 1, + anon_sym_COMMA, + ACTIONS(545), 1, + anon_sym_RPAREN, + STATE(240), 1, + aux_sym_module_method_repeat1, + [5807] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(547), 1, + anon_sym_LPAREN, + ACTIONS(283), 2, + anon_sym_AT, + sym_term, + [5818] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(459), 1, + anon_sym_COMMA, + ACTIONS(549), 1, + anon_sym_RPAREN_COLON, + STATE(179), 1, + aux_sym_module_method_repeat1, + [5831] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(459), 1, + anon_sym_COMMA, + ACTIONS(551), 1, + anon_sym_RPAREN_COLON, + STATE(246), 1, + aux_sym_module_method_repeat1, + [5844] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(467), 1, + sym_term, + STATE(121), 1, + sym_field_type, + STATE(135), 1, + sym_optional_field_type, + [5857] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(297), 2, + anon_sym_AT, + sym_term, + [5865] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(553), 1, + anon_sym_query, + ACTIONS(555), 1, + anon_sym_mutation, + [5875] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(557), 1, + anon_sym_LBRACE, + STATE(144), 1, + sym_type_body, + [5885] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(559), 1, + anon_sym_LBRACE, + STATE(167), 1, + sym_module_body, + [5895] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(557), 1, + anon_sym_LBRACE, + STATE(165), 1, + sym_type_body, + [5905] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(561), 2, + anon_sym_query, + anon_sym_mutation, + [5913] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(557), 1, + anon_sym_LBRACE, + STATE(172), 1, + sym_type_body, + [5923] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(559), 1, + anon_sym_LBRACE, + STATE(170), 1, + sym_module_body, + [5933] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(563), 1, + sym_term, + STATE(259), 1, + sym_annotation_map_param, + [5943] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(305), 2, + anon_sym_AT, + sym_term, + [5951] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(565), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + [5959] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(557), 1, + anon_sym_LBRACE, + STATE(145), 1, + sym_type_body, + [5969] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(567), 1, + anon_sym_LPAREN, + ACTIONS(569), 1, + sym_term, + [5979] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(571), 1, + anon_sym_LPAREN, + ACTIONS(573), 1, + sym_term, + [5989] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(23), 1, + anon_sym_DQUOTE, + STATE(168), 1, + sym_literal_str, + [5999] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(575), 1, + sym_term, + [6006] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(577), 1, + anon_sym_RPAREN, + [6013] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(579), 1, + anon_sym_LPAREN, + [6020] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(581), 1, + anon_sym_RPAREN, + [6027] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(583), 1, + sym_term, + [6034] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(585), 1, + anon_sym_COLON, + [6041] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(587), 1, + sym_term, + [6048] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(589), 1, + sym_term, + [6055] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(591), 1, + anon_sym_RPAREN, + [6062] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(593), 1, + anon_sym_LPAREN, + [6069] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(595), 1, + sym_term, + [6076] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(597), 1, + anon_sym_LPAREN, + [6083] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(599), 1, + anon_sym_LPAREN, + [6090] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(601), 1, + anon_sym_LPAREN, + [6097] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(603), 1, + sym_term, + [6104] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(605), 1, + anon_sym_DQUOTE, + [6111] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(607), 1, + sym_term, + [6118] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(609), 1, + sym_term, + [6125] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(611), 1, + sym_term, + [6132] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(613), 1, + anon_sym_COLON, + [6139] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(615), 1, + sym_term, + [6146] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(617), 1, + anon_sym_COLON, + [6153] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(619), 1, + anon_sym_COLON, + [6160] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(621), 1, + sym_term, + [6167] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(623), 1, + sym_term, + [6174] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(625), 1, + anon_sym_DQUOTE, + [6181] = 2, + ACTIONS(627), 1, + sym_str, + ACTIONS(629), 1, + sym_comment, + [6188] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(631), 1, + anon_sym_RPAREN, + [6195] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(633), 1, + sym_term, + [6202] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(635), 1, + sym_term, + [6209] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(637), 1, + anon_sym_EQ, + [6216] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(639), 1, + anon_sym_EQ_GT, + [6223] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(641), 1, + anon_sym_EQ_GT, + [6230] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(643), 1, + anon_sym_LPAREN, + [6237] = 2, + ACTIONS(629), 1, + sym_comment, + ACTIONS(645), 1, + sym_str, + [6244] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(647), 1, + ts_builtin_sym_end, + [6251] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(649), 1, + sym_term, + [6258] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(651), 1, + anon_sym_LPAREN, + [6265] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(653), 1, + sym_term, + [6272] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(655), 1, + sym_term, + [6279] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(657), 1, + anon_sym_EQ_GT, + [6286] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(659), 1, + anon_sym_EQ_GT, + [6293] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(661), 1, + anon_sym_LPAREN, + [6300] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(663), 1, + anon_sym_RPAREN, + [6307] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(665), 1, + sym_term, +}; + +static const uint32_t ts_small_parse_table_map[] = { + [SMALL_STATE(2)] = 0, + [SMALL_STATE(3)] = 68, + [SMALL_STATE(4)] = 136, + [SMALL_STATE(5)] = 197, + [SMALL_STATE(6)] = 258, + [SMALL_STATE(7)] = 319, + [SMALL_STATE(8)] = 377, + [SMALL_STATE(9)] = 435, + [SMALL_STATE(10)] = 493, + [SMALL_STATE(11)] = 551, + [SMALL_STATE(12)] = 609, + [SMALL_STATE(13)] = 667, + [SMALL_STATE(14)] = 725, + [SMALL_STATE(15)] = 783, + [SMALL_STATE(16)] = 841, + [SMALL_STATE(17)] = 899, + [SMALL_STATE(18)] = 957, + [SMALL_STATE(19)] = 1015, + [SMALL_STATE(20)] = 1073, + [SMALL_STATE(21)] = 1131, + [SMALL_STATE(22)] = 1189, + [SMALL_STATE(23)] = 1247, + [SMALL_STATE(24)] = 1305, + [SMALL_STATE(25)] = 1363, + [SMALL_STATE(26)] = 1421, + [SMALL_STATE(27)] = 1479, + [SMALL_STATE(28)] = 1537, + [SMALL_STATE(29)] = 1595, + [SMALL_STATE(30)] = 1653, + [SMALL_STATE(31)] = 1711, + [SMALL_STATE(32)] = 1769, + [SMALL_STATE(33)] = 1827, + [SMALL_STATE(34)] = 1885, + [SMALL_STATE(35)] = 1943, + [SMALL_STATE(36)] = 2001, + [SMALL_STATE(37)] = 2025, + [SMALL_STATE(38)] = 2050, + [SMALL_STATE(39)] = 2075, + [SMALL_STATE(40)] = 2115, + [SMALL_STATE(41)] = 2155, + [SMALL_STATE(42)] = 2177, + [SMALL_STATE(43)] = 2199, + [SMALL_STATE(44)] = 2221, + [SMALL_STATE(45)] = 2243, + [SMALL_STATE(46)] = 2283, + [SMALL_STATE(47)] = 2307, + [SMALL_STATE(48)] = 2329, + [SMALL_STATE(49)] = 2350, + [SMALL_STATE(50)] = 2385, + [SMALL_STATE(51)] = 2406, + [SMALL_STATE(52)] = 2429, + [SMALL_STATE(53)] = 2468, + [SMALL_STATE(54)] = 2489, + [SMALL_STATE(55)] = 2510, + [SMALL_STATE(56)] = 2531, + [SMALL_STATE(57)] = 2552, + [SMALL_STATE(58)] = 2573, + [SMALL_STATE(59)] = 2608, + [SMALL_STATE(60)] = 2629, + [SMALL_STATE(61)] = 2650, + [SMALL_STATE(62)] = 2671, + [SMALL_STATE(63)] = 2692, + [SMALL_STATE(64)] = 2713, + [SMALL_STATE(65)] = 2734, + [SMALL_STATE(66)] = 2755, + [SMALL_STATE(67)] = 2776, + [SMALL_STATE(68)] = 2797, + [SMALL_STATE(69)] = 2818, + [SMALL_STATE(70)] = 2841, + [SMALL_STATE(71)] = 2861, + [SMALL_STATE(72)] = 2881, + [SMALL_STATE(73)] = 2901, + [SMALL_STATE(74)] = 2941, + [SMALL_STATE(75)] = 2961, + [SMALL_STATE(76)] = 2995, + [SMALL_STATE(77)] = 3029, + [SMALL_STATE(78)] = 3069, + [SMALL_STATE(79)] = 3091, + [SMALL_STATE(80)] = 3111, + [SMALL_STATE(81)] = 3130, + [SMALL_STATE(82)] = 3149, + [SMALL_STATE(83)] = 3180, + [SMALL_STATE(84)] = 3199, + [SMALL_STATE(85)] = 3218, + [SMALL_STATE(86)] = 3249, + [SMALL_STATE(87)] = 3268, + [SMALL_STATE(88)] = 3287, + [SMALL_STATE(89)] = 3306, + [SMALL_STATE(90)] = 3325, + [SMALL_STATE(91)] = 3344, + [SMALL_STATE(92)] = 3379, + [SMALL_STATE(93)] = 3396, + [SMALL_STATE(94)] = 3415, + [SMALL_STATE(95)] = 3432, + [SMALL_STATE(96)] = 3467, + [SMALL_STATE(97)] = 3486, + [SMALL_STATE(98)] = 3505, + [SMALL_STATE(99)] = 3524, + [SMALL_STATE(100)] = 3543, + [SMALL_STATE(101)] = 3564, + [SMALL_STATE(102)] = 3583, + [SMALL_STATE(103)] = 3602, + [SMALL_STATE(104)] = 3637, + [SMALL_STATE(105)] = 3671, + [SMALL_STATE(106)] = 3689, + [SMALL_STATE(107)] = 3707, + [SMALL_STATE(108)] = 3741, + [SMALL_STATE(109)] = 3775, + [SMALL_STATE(110)] = 3793, + [SMALL_STATE(111)] = 3811, + [SMALL_STATE(112)] = 3845, + [SMALL_STATE(113)] = 3867, + [SMALL_STATE(114)] = 3901, + [SMALL_STATE(115)] = 3935, + [SMALL_STATE(116)] = 3952, + [SMALL_STATE(117)] = 3969, + [SMALL_STATE(118)] = 3985, + [SMALL_STATE(119)] = 4001, + [SMALL_STATE(120)] = 4017, + [SMALL_STATE(121)] = 4031, + [SMALL_STATE(122)] = 4047, + [SMALL_STATE(123)] = 4063, + [SMALL_STATE(124)] = 4079, + [SMALL_STATE(125)] = 4093, + [SMALL_STATE(126)] = 4107, + [SMALL_STATE(127)] = 4121, + [SMALL_STATE(128)] = 4137, + [SMALL_STATE(129)] = 4151, + [SMALL_STATE(130)] = 4167, + [SMALL_STATE(131)] = 4183, + [SMALL_STATE(132)] = 4199, + [SMALL_STATE(133)] = 4215, + [SMALL_STATE(134)] = 4231, + [SMALL_STATE(135)] = 4247, + [SMALL_STATE(136)] = 4261, + [SMALL_STATE(137)] = 4277, + [SMALL_STATE(138)] = 4293, + [SMALL_STATE(139)] = 4309, + [SMALL_STATE(140)] = 4325, + [SMALL_STATE(141)] = 4353, + [SMALL_STATE(142)] = 4369, + [SMALL_STATE(143)] = 4382, + [SMALL_STATE(144)] = 4395, + [SMALL_STATE(145)] = 4408, + [SMALL_STATE(146)] = 4421, + [SMALL_STATE(147)] = 4446, + [SMALL_STATE(148)] = 4459, + [SMALL_STATE(149)] = 4472, + [SMALL_STATE(150)] = 4497, + [SMALL_STATE(151)] = 4510, + [SMALL_STATE(152)] = 4523, + [SMALL_STATE(153)] = 4548, + [SMALL_STATE(154)] = 4561, + [SMALL_STATE(155)] = 4574, + [SMALL_STATE(156)] = 4596, + [SMALL_STATE(157)] = 4618, + [SMALL_STATE(158)] = 4640, + [SMALL_STATE(159)] = 4658, + [SMALL_STATE(160)] = 4680, + [SMALL_STATE(161)] = 4702, + [SMALL_STATE(162)] = 4724, + [SMALL_STATE(163)] = 4746, + [SMALL_STATE(164)] = 4768, + [SMALL_STATE(165)] = 4786, + [SMALL_STATE(166)] = 4797, + [SMALL_STATE(167)] = 4816, + [SMALL_STATE(168)] = 4827, + [SMALL_STATE(169)] = 4838, + [SMALL_STATE(170)] = 4849, + [SMALL_STATE(171)] = 4860, + [SMALL_STATE(172)] = 4879, + [SMALL_STATE(173)] = 4890, + [SMALL_STATE(174)] = 4901, + [SMALL_STATE(175)] = 4912, + [SMALL_STATE(176)] = 4926, + [SMALL_STATE(177)] = 4938, + [SMALL_STATE(178)] = 4954, + [SMALL_STATE(179)] = 4970, + [SMALL_STATE(180)] = 4986, + [SMALL_STATE(181)] = 4996, + [SMALL_STATE(182)] = 5006, + [SMALL_STATE(183)] = 5022, + [SMALL_STATE(184)] = 5038, + [SMALL_STATE(185)] = 5050, + [SMALL_STATE(186)] = 5066, + [SMALL_STATE(187)] = 5076, + [SMALL_STATE(188)] = 5090, + [SMALL_STATE(189)] = 5103, + [SMALL_STATE(190)] = 5112, + [SMALL_STATE(191)] = 5125, + [SMALL_STATE(192)] = 5138, + [SMALL_STATE(193)] = 5151, + [SMALL_STATE(194)] = 5164, + [SMALL_STATE(195)] = 5177, + [SMALL_STATE(196)] = 5190, + [SMALL_STATE(197)] = 5203, + [SMALL_STATE(198)] = 5216, + [SMALL_STATE(199)] = 5229, + [SMALL_STATE(200)] = 5242, + [SMALL_STATE(201)] = 5255, + [SMALL_STATE(202)] = 5264, + [SMALL_STATE(203)] = 5277, + [SMALL_STATE(204)] = 5286, + [SMALL_STATE(205)] = 5295, + [SMALL_STATE(206)] = 5308, + [SMALL_STATE(207)] = 5321, + [SMALL_STATE(208)] = 5334, + [SMALL_STATE(209)] = 5347, + [SMALL_STATE(210)] = 5360, + [SMALL_STATE(211)] = 5373, + [SMALL_STATE(212)] = 5386, + [SMALL_STATE(213)] = 5397, + [SMALL_STATE(214)] = 5410, + [SMALL_STATE(215)] = 5423, + [SMALL_STATE(216)] = 5436, + [SMALL_STATE(217)] = 5449, + [SMALL_STATE(218)] = 5460, + [SMALL_STATE(219)] = 5473, + [SMALL_STATE(220)] = 5486, + [SMALL_STATE(221)] = 5499, + [SMALL_STATE(222)] = 5512, + [SMALL_STATE(223)] = 5521, + [SMALL_STATE(224)] = 5534, + [SMALL_STATE(225)] = 5547, + [SMALL_STATE(226)] = 5560, + [SMALL_STATE(227)] = 5573, + [SMALL_STATE(228)] = 5586, + [SMALL_STATE(229)] = 5599, + [SMALL_STATE(230)] = 5612, + [SMALL_STATE(231)] = 5625, + [SMALL_STATE(232)] = 5638, + [SMALL_STATE(233)] = 5651, + [SMALL_STATE(234)] = 5664, + [SMALL_STATE(235)] = 5677, + [SMALL_STATE(236)] = 5690, + [SMALL_STATE(237)] = 5703, + [SMALL_STATE(238)] = 5716, + [SMALL_STATE(239)] = 5729, + [SMALL_STATE(240)] = 5742, + [SMALL_STATE(241)] = 5755, + [SMALL_STATE(242)] = 5768, + [SMALL_STATE(243)] = 5781, + [SMALL_STATE(244)] = 5794, + [SMALL_STATE(245)] = 5807, + [SMALL_STATE(246)] = 5818, + [SMALL_STATE(247)] = 5831, + [SMALL_STATE(248)] = 5844, + [SMALL_STATE(249)] = 5857, + [SMALL_STATE(250)] = 5865, + [SMALL_STATE(251)] = 5875, + [SMALL_STATE(252)] = 5885, + [SMALL_STATE(253)] = 5895, + [SMALL_STATE(254)] = 5905, + [SMALL_STATE(255)] = 5913, + [SMALL_STATE(256)] = 5923, + [SMALL_STATE(257)] = 5933, + [SMALL_STATE(258)] = 5943, + [SMALL_STATE(259)] = 5951, + [SMALL_STATE(260)] = 5959, + [SMALL_STATE(261)] = 5969, + [SMALL_STATE(262)] = 5979, + [SMALL_STATE(263)] = 5989, + [SMALL_STATE(264)] = 5999, + [SMALL_STATE(265)] = 6006, + [SMALL_STATE(266)] = 6013, + [SMALL_STATE(267)] = 6020, + [SMALL_STATE(268)] = 6027, + [SMALL_STATE(269)] = 6034, + [SMALL_STATE(270)] = 6041, + [SMALL_STATE(271)] = 6048, + [SMALL_STATE(272)] = 6055, + [SMALL_STATE(273)] = 6062, + [SMALL_STATE(274)] = 6069, + [SMALL_STATE(275)] = 6076, + [SMALL_STATE(276)] = 6083, + [SMALL_STATE(277)] = 6090, + [SMALL_STATE(278)] = 6097, + [SMALL_STATE(279)] = 6104, + [SMALL_STATE(280)] = 6111, + [SMALL_STATE(281)] = 6118, + [SMALL_STATE(282)] = 6125, + [SMALL_STATE(283)] = 6132, + [SMALL_STATE(284)] = 6139, + [SMALL_STATE(285)] = 6146, + [SMALL_STATE(286)] = 6153, + [SMALL_STATE(287)] = 6160, + [SMALL_STATE(288)] = 6167, + [SMALL_STATE(289)] = 6174, + [SMALL_STATE(290)] = 6181, + [SMALL_STATE(291)] = 6188, + [SMALL_STATE(292)] = 6195, + [SMALL_STATE(293)] = 6202, + [SMALL_STATE(294)] = 6209, + [SMALL_STATE(295)] = 6216, + [SMALL_STATE(296)] = 6223, + [SMALL_STATE(297)] = 6230, + [SMALL_STATE(298)] = 6237, + [SMALL_STATE(299)] = 6244, + [SMALL_STATE(300)] = 6251, + [SMALL_STATE(301)] = 6258, + [SMALL_STATE(302)] = 6265, + [SMALL_STATE(303)] = 6272, + [SMALL_STATE(304)] = 6279, + [SMALL_STATE(305)] = 6286, + [SMALL_STATE(306)] = 6293, + [SMALL_STATE(307)] = 6300, + [SMALL_STATE(308)] = 6307, +}; + +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 = true}}, SHIFT(263), + [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(303), + [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(302), + [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(300), + [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), + [17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), + [19] = {.entry = {.count = 1, .reusable = false}}, SHIFT(69), + [21] = {.entry = {.count = 1, .reusable = true}}, SHIFT(93), + [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(290), + [25] = {.entry = {.count = 1, .reusable = false}}, SHIFT(84), + [27] = {.entry = {.count = 1, .reusable = true}}, SHIFT(181), + [29] = {.entry = {.count = 1, .reusable = false}}, SHIFT(70), + [31] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), + [33] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), + [35] = {.entry = {.count = 1, .reusable = false}}, SHIFT(38), + [37] = {.entry = {.count = 1, .reusable = true}}, SHIFT(66), + [39] = {.entry = {.count = 1, .reusable = true}}, SHIFT(298), + [41] = {.entry = {.count = 1, .reusable = false}}, SHIFT(65), + [43] = {.entry = {.count = 1, .reusable = false}}, SHIFT(47), + [45] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_literal_str, 3, 0, 6), + [47] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_literal_str, 3, 0, 6), + [49] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_selection_element, 1, 0, 0), + [51] = {.entry = {.count = 1, .reusable = true}}, SHIFT(261), + [53] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_selection_element, 1, 0, 0), + [55] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_selection, 1, 0, 0), + [57] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), + [59] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_selection, 1, 0, 0), + [61] = {.entry = {.count = 1, .reusable = true}}, SHIFT(173), + [63] = {.entry = {.count = 1, .reusable = true}}, SHIFT(254), + [65] = {.entry = {.count = 1, .reusable = true}}, SHIFT(271), + [67] = {.entry = {.count = 1, .reusable = true}}, SHIFT(270), + [69] = {.entry = {.count = 1, .reusable = true}}, SHIFT(268), + [71] = {.entry = {.count = 1, .reusable = true}}, SHIFT(174), + [73] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_selection_select, 3, 0, 25), + [75] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_selection_select, 3, 0, 25), + [77] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_hof_call, 6, 0, 57), + [79] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_hof_call, 6, 0, 57), + [81] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_hof_call, 8, 0, 62), + [83] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_hof_call, 8, 0, 62), + [85] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_module_body_repeat1, 2, 0, 13), + [87] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_module_body_repeat1, 2, 0, 13), SHIFT_REPEAT(254), + [90] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_module_body_repeat1, 2, 0, 13), SHIFT_REPEAT(271), + [93] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_module_body_repeat1, 2, 0, 13), SHIFT_REPEAT(270), + [96] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_module_body_repeat1, 2, 0, 13), SHIFT_REPEAT(268), + [99] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_module_body_repeat1, 2, 0, 13), SHIFT_REPEAT(300), + [102] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 1, 0, 0), + [104] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 1, 0, 0), + [106] = {.entry = {.count = 1, .reusable = true}}, SHIFT(223), + [108] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_relational_gt, 3, 0, 23), + [110] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_relational_gt, 3, 0, 23), + [112] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_logical_or, 3, 0, 23), + [114] = {.entry = {.count = 1, .reusable = false}}, SHIFT(28), + [116] = {.entry = {.count = 1, .reusable = false}}, SHIFT(12), + [118] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), + [120] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), + [122] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35), + [124] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), + [126] = {.entry = {.count = 1, .reusable = false}}, SHIFT(33), + [128] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_logical_or, 3, 0, 23), + [130] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_relational_op, 1, 0, 0), + [132] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_relational_op, 1, 0, 0), + [134] = {.entry = {.count = 1, .reusable = true}}, SHIFT(262), + [136] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field_default_value, 1, 0, 32), + [138] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), + [140] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), + [142] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_field_default_value, 1, 0, 32), + [144] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_relational_in, 3, 0, 23), + [146] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_relational_in, 3, 0, 23), + [148] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_relational_gte, 3, 0, 23), + [150] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_relational_gte, 3, 0, 23), + [152] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_relational_lte, 3, 0, 23), + [154] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_relational_lte, 3, 0, 23), + [156] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_relational_neq, 3, 0, 23), + [158] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_relational_neq, 3, 0, 23), + [160] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_relational_eq, 3, 0, 23), + [162] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_relational_eq, 3, 0, 23), + [164] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_logical_and, 3, 0, 23), + [166] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_logical_and, 3, 0, 23), + [168] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_logical_op, 1, 0, 0), + [170] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_logical_op, 1, 0, 0), + [172] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_logical_not, 2, 0, 6), + [174] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_logical_not, 2, 0, 6), + [176] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_relational_lt, 3, 0, 23), + [178] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_relational_lt, 3, 0, 23), + [180] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_literal_boolean, 1, 0, 0), + [182] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_literal_boolean, 1, 0, 0), + [184] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_literal_number, 1, 0, 8), + [186] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_literal_number, 1, 0, 8), + [188] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parenthetical, 3, 0, 18), + [190] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_parenthetical, 3, 0, 18), + [192] = {.entry = {.count = 1, .reusable = false}}, SHIFT(31), + [194] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29), + [196] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_annotation_multiple_params, 1, 0, 10), + [198] = {.entry = {.count = 1, .reusable = false}}, SHIFT(27), + [200] = {.entry = {.count = 1, .reusable = false}}, SHIFT(26), + [202] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24), + [204] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), + [206] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), + [208] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), + [210] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), + [212] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), + [214] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), + [216] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1, 0, 0), + [218] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), + [220] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(263), + [223] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(303), + [226] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(302), + [229] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(300), + [232] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32), + [234] = {.entry = {.count = 1, .reusable = true}}, SHIFT(180), + [236] = {.entry = {.count = 1, .reusable = true}}, SHIFT(218), + [238] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_annotation_multiple_params_repeat1, 2, 0, 22), + [240] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type_body, 3, 0, 12), + [242] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type_body, 2, 0, 0), + [244] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_annotation_map_param, 3, 0, 19), + [246] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field_type, 1, 0, 0), + [248] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_field_type, 1, 0, 0), + [250] = {.entry = {.count = 1, .reusable = true}}, SHIFT(226), + [252] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_field_default_value_repeat1, 2, 0, 59), + [254] = {.entry = {.count = 1, .reusable = true}}, SHIFT(43), + [256] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_optional_field_type, 2, 0, 26), + [258] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_optional_field_type, 2, 0, 26), + [260] = {.entry = {.count = 1, .reusable = true}}, SHIFT(68), + [262] = {.entry = {.count = 1, .reusable = true}}, SHIFT(81), + [264] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field_type, 4, 0, 41), + [266] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_field_type, 4, 0, 41), + [268] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field_type, 5, 0, 50), + [270] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_field_type, 5, 0, 50), + [272] = {.entry = {.count = 1, .reusable = true}}, SHIFT(79), + [274] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_module_repeat1, 2, 0, 4), + [276] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_module_repeat1, 2, 0, 4), SHIFT_REPEAT(300), + [279] = {.entry = {.count = 1, .reusable = true}}, SHIFT(44), + [281] = {.entry = {.count = 1, .reusable = true}}, SHIFT(72), + [283] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_annotation, 2, 0, 3), + [285] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2), + [287] = {.entry = {.count = 1, .reusable = true}}, SHIFT(205), + [289] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_method, 8, 0, 55), + [291] = {.entry = {.count = 1, .reusable = true}}, SHIFT(128), + [293] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_method, 7, 0, 43), + [295] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_method, 6, 0, 39), + [297] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_module_repeat1, 1, 0, 1), + [299] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_method, 7, 0, 44), + [301] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_method, 9, 0, 58), + [303] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_method, 7, 0, 46), + [305] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_annotation, 5, 0, 14), + [307] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_method, 6, 0, 36), + [309] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_method, 5, 0, 28), + [311] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_method, 7, 0, 47), + [313] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_method, 6, 0, 33), + [315] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_method, 8, 0, 54), + [317] = {.entry = {.count = 1, .reusable = true}}, SHIFT(250), + [319] = {.entry = {.count = 1, .reusable = true}}, SHIFT(278), + [321] = {.entry = {.count = 1, .reusable = true}}, SHIFT(264), + [323] = {.entry = {.count = 1, .reusable = true}}, SHIFT(282), + [325] = {.entry = {.count = 1, .reusable = true}}, SHIFT(284), + [327] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_method, 8, 0, 53), + [329] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_field, 1, 0, 0), + [331] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_module_body_repeat1, 1, 0, 7), + [333] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type, 3, 0, 5), + [335] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type, 4, 0, 11), + [337] = {.entry = {.count = 1, .reusable = true}}, SHIFT(92), + [339] = {.entry = {.count = 1, .reusable = true}}, SHIFT(288), + [341] = {.entry = {.count = 1, .reusable = true}}, SHIFT(269), + [343] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_interceptor, 7, 0, 48), + [345] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_interceptor, 4, 0, 3), + [347] = {.entry = {.count = 1, .reusable = true}}, SHIFT(94), + [349] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_interceptor, 5, 0, 30), + [351] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_interceptor, 6, 0, 38), + [353] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_type_body_repeat1, 2, 0, 13), + [355] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_type_body_repeat1, 2, 0, 13), SHIFT_REPEAT(288), + [358] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_type_body_repeat1, 2, 0, 13), SHIFT_REPEAT(269), + [361] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_interceptor, 5, 0, 29), + [363] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_interceptor, 6, 0, 40), + [365] = {.entry = {.count = 1, .reusable = true}}, SHIFT(238), + [367] = {.entry = {.count = 1, .reusable = true}}, SHIFT(283), + [369] = {.entry = {.count = 1, .reusable = true}}, SHIFT(242), + [371] = {.entry = {.count = 1, .reusable = true}}, SHIFT(193), + [373] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field, 3, 0, 17), + [375] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), + [377] = {.entry = {.count = 1, .reusable = true}}, SHIFT(201), + [379] = {.entry = {.count = 1, .reusable = true}}, SHIFT(105), + [381] = {.entry = {.count = 1, .reusable = true}}, SHIFT(209), + [383] = {.entry = {.count = 1, .reusable = true}}, SHIFT(191), + [385] = {.entry = {.count = 1, .reusable = true}}, SHIFT(235), + [387] = {.entry = {.count = 1, .reusable = true}}, SHIFT(150), + [389] = {.entry = {.count = 1, .reusable = true}}, SHIFT(148), + [391] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field, 4, 0, 27), + [393] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), + [395] = {.entry = {.count = 1, .reusable = true}}, SHIFT(189), + [397] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_context, 4, 0, 11), + [399] = {.entry = {.count = 1, .reusable = true}}, SHIFT(281), + [401] = {.entry = {.count = 1, .reusable = true}}, SHIFT(280), + [403] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module, 4, 0, 11), + [405] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_import, 2, 0, 2), + [407] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_declaration, 1, 0, 0), + [409] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module, 3, 0, 5), + [411] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_context, 3, 0, 5), + [413] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_body, 3, 0, 12), + [415] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_body, 2, 0, 0), + [417] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_argument, 3, 0, 34), + [419] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_argument, 3, 0, 34), + [421] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field, 5, 0, 31), + [423] = {.entry = {.count = 1, .reusable = true}}, SHIFT(203), + [425] = {.entry = {.count = 1, .reusable = true}}, SHIFT(285), + [427] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_module_repeat1, 2, 0, 4), SHIFT_REPEAT(288), + [430] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_module_method_repeat1, 2, 0, 37), SHIFT_REPEAT(171), + [433] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_module_method_repeat1, 2, 0, 37), + [435] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_module_method_repeat1, 2, 0, 37), + [437] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field_default_value, 4, 0, 56), + [439] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field_default_value, 3, 0, 52), + [441] = {.entry = {.count = 1, .reusable = true}}, SHIFT(200), + [443] = {.entry = {.count = 1, .reusable = true}}, SHIFT(109), + [445] = {.entry = {.count = 1, .reusable = true}}, SHIFT(286), + [447] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field, 6, 0, 42), + [449] = {.entry = {.count = 1, .reusable = true}}, SHIFT(222), + [451] = {.entry = {.count = 1, .reusable = true}}, SHIFT(126), + [453] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field_default_value, 5, 0, 60), + [455] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_argument, 4, 0, 45), + [457] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_argument, 4, 0, 45), + [459] = {.entry = {.count = 1, .reusable = true}}, SHIFT(171), + [461] = {.entry = {.count = 1, .reusable = true}}, SHIFT(229), + [463] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field, 5, 0, 27), + [465] = {.entry = {.count = 1, .reusable = true}}, SHIFT(100), + [467] = {.entry = {.count = 1, .reusable = true}}, SHIFT(116), + [469] = {.entry = {.count = 1, .reusable = true}}, SHIFT(207), + [471] = {.entry = {.count = 1, .reusable = true}}, SHIFT(210), + [473] = {.entry = {.count = 1, .reusable = true}}, SHIFT(213), + [475] = {.entry = {.count = 1, .reusable = true}}, SHIFT(215), + [477] = {.entry = {.count = 1, .reusable = true}}, SHIFT(147), + [479] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field, 4, 0, 17), + [481] = {.entry = {.count = 1, .reusable = true}}, SHIFT(110), + [483] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field, 6, 0, 31), + [485] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_type_body_repeat1, 1, 0, 7), + [487] = {.entry = {.count = 1, .reusable = true}}, SHIFT(227), + [489] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_module_method_repeat1, 2, 0, 35), + [491] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_module_method_repeat1, 2, 0, 35), + [493] = {.entry = {.count = 1, .reusable = true}}, SHIFT(206), + [495] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_field_type_repeat1, 2, 0, 49), + [497] = {.entry = {.count = 1, .reusable = true}}, SHIFT(51), + [499] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_field_type_repeat1, 2, 0, 51), SHIFT_REPEAT(200), + [502] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_field_type_repeat1, 2, 0, 51), + [504] = {.entry = {.count = 1, .reusable = true}}, SHIFT(125), + [506] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_annotation_multiple_params, 2, 0, 16), + [508] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field, 7, 0, 42), + [510] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37), + [512] = {.entry = {.count = 1, .reusable = true}}, SHIFT(257), + [514] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_annotation_map_params, 2, 0, 15), + [516] = {.entry = {.count = 1, .reusable = true}}, SHIFT(216), + [518] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_annotation_map_params_repeat1, 2, 0, 21), SHIFT_REPEAT(257), + [521] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_annotation_map_params_repeat1, 2, 0, 21), + [523] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_annotation_map_params, 1, 0, 9), + [525] = {.entry = {.count = 1, .reusable = true}}, SHIFT(154), + [527] = {.entry = {.count = 1, .reusable = true}}, SHIFT(197), + [529] = {.entry = {.count = 1, .reusable = true}}, SHIFT(186), + [531] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_annotation_multiple_params_repeat1, 2, 0, 24), SHIFT_REPEAT(29), + [534] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_annotation_multiple_params_repeat1, 2, 0, 24), + [536] = {.entry = {.count = 1, .reusable = true}}, SHIFT(195), + [538] = {.entry = {.count = 1, .reusable = true}}, SHIFT(151), + [540] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_field_default_value_repeat1, 2, 0, 61), SHIFT_REPEAT(32), + [543] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_field_default_value_repeat1, 2, 0, 61), + [545] = {.entry = {.count = 1, .reusable = true}}, SHIFT(153), + [547] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3), + [549] = {.entry = {.count = 1, .reusable = true}}, SHIFT(248), + [551] = {.entry = {.count = 1, .reusable = true}}, SHIFT(243), + [553] = {.entry = {.count = 1, .reusable = true}}, SHIFT(292), + [555] = {.entry = {.count = 1, .reusable = true}}, SHIFT(287), + [557] = {.entry = {.count = 1, .reusable = true}}, SHIFT(149), + [559] = {.entry = {.count = 1, .reusable = true}}, SHIFT(40), + [561] = {.entry = {.count = 1, .reusable = true}}, SHIFT(274), + [563] = {.entry = {.count = 1, .reusable = true}}, SHIFT(294), + [565] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_annotation_map_params_repeat1, 2, 0, 20), + [567] = {.entry = {.count = 1, .reusable = true}}, SHIFT(308), + [569] = {.entry = {.count = 1, .reusable = true}}, SHIFT(304), + [571] = {.entry = {.count = 1, .reusable = true}}, SHIFT(293), + [573] = {.entry = {.count = 1, .reusable = true}}, SHIFT(296), + [575] = {.entry = {.count = 1, .reusable = true}}, SHIFT(297), + [577] = {.entry = {.count = 1, .reusable = true}}, SHIFT(124), + [579] = {.entry = {.count = 1, .reusable = true}}, SHIFT(155), + [581] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_annotation_params, 1, 0, 0), + [583] = {.entry = {.count = 1, .reusable = true}}, SHIFT(251), + [585] = {.entry = {.count = 1, .reusable = true}}, SHIFT(239), + [587] = {.entry = {.count = 1, .reusable = true}}, SHIFT(277), + [589] = {.entry = {.count = 1, .reusable = true}}, SHIFT(275), + [591] = {.entry = {.count = 1, .reusable = true}}, SHIFT(295), + [593] = {.entry = {.count = 1, .reusable = true}}, SHIFT(157), + [595] = {.entry = {.count = 1, .reusable = true}}, SHIFT(306), + [597] = {.entry = {.count = 1, .reusable = true}}, SHIFT(156), + [599] = {.entry = {.count = 1, .reusable = true}}, SHIFT(160), + [601] = {.entry = {.count = 1, .reusable = true}}, SHIFT(163), + [603] = {.entry = {.count = 1, .reusable = true}}, SHIFT(266), + [605] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36), + [607] = {.entry = {.count = 1, .reusable = true}}, SHIFT(253), + [609] = {.entry = {.count = 1, .reusable = true}}, SHIFT(252), + [611] = {.entry = {.count = 1, .reusable = true}}, SHIFT(301), + [613] = {.entry = {.count = 1, .reusable = true}}, SHIFT(231), + [615] = {.entry = {.count = 1, .reusable = true}}, SHIFT(260), + [617] = {.entry = {.count = 1, .reusable = true}}, SHIFT(190), + [619] = {.entry = {.count = 1, .reusable = true}}, SHIFT(211), + [621] = {.entry = {.count = 1, .reusable = true}}, SHIFT(273), + [623] = {.entry = {.count = 1, .reusable = true}}, SHIFT(245), + [625] = {.entry = {.count = 1, .reusable = true}}, SHIFT(67), + [627] = {.entry = {.count = 1, .reusable = false}}, SHIFT(279), + [629] = {.entry = {.count = 1, .reusable = false}}, SHIFT_EXTRA(), + [631] = {.entry = {.count = 1, .reusable = true}}, SHIFT(258), + [633] = {.entry = {.count = 1, .reusable = true}}, SHIFT(276), + [635] = {.entry = {.count = 1, .reusable = true}}, SHIFT(272), + [637] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31), + [639] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), + [641] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), + [643] = {.entry = {.count = 1, .reusable = true}}, SHIFT(161), + [645] = {.entry = {.count = 1, .reusable = false}}, SHIFT(289), + [647] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [649] = {.entry = {.count = 1, .reusable = true}}, SHIFT(115), + [651] = {.entry = {.count = 1, .reusable = true}}, SHIFT(162), + [653] = {.entry = {.count = 1, .reusable = true}}, SHIFT(255), + [655] = {.entry = {.count = 1, .reusable = true}}, SHIFT(256), + [657] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30), + [659] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), + [661] = {.entry = {.count = 1, .reusable = true}}, SHIFT(159), + [663] = {.entry = {.count = 1, .reusable = true}}, SHIFT(305), + [665] = {.entry = {.count = 1, .reusable = true}}, SHIFT(307), +}; + +#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_exograph(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, + .primary_state_ids = ts_primary_state_ids, + }; + return &language; +} +#ifdef __cplusplus +} +#endif diff --git a/src/tree_sitter/alloc.h b/src/tree_sitter/alloc.h new file mode 100644 index 0000000..1f4466d --- /dev/null +++ b/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/src/tree_sitter/array.h b/src/tree_sitter/array.h new file mode 100644 index 0000000..15a3b23 --- /dev/null +++ b/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/src/tree_sitter/parser.h b/src/tree_sitter/parser.h new file mode 100644 index 0000000..17f0e94 --- /dev/null +++ b/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_