diff --git a/.editorconfig b/.editorconfig index d3a8b5b..f363cc5 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,9 +2,6 @@ root = true [*] charset = utf-8 -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true [*.{json,toml,yml,gyp}] indent_style = space @@ -14,11 +11,11 @@ indent_size = 2 indent_style = space indent_size = 2 -[*.rs] +[*.{c,cc,h}] indent_style = space indent_size = 4 -[*.{c,cc,h}] +[*.rs] indent_style = space indent_size = 4 @@ -37,3 +34,6 @@ indent_size = 8 [Makefile] indent_style = tab indent_size = 8 + +[parser.c] +indent_size = 2 diff --git a/.gitattributes b/.gitattributes index ffb52ab..4cb1058 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ -* text eol=lf +* text=auto eol=lf src/*.json linguist-generated src/parser.c linguist-generated diff --git a/.gitignore b/.gitignore index 27fc43f..2fd9dac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ # Rust artifacts -Cargo.lock target/ # Node artifacts @@ -10,9 +9,9 @@ node_modules/ # Swift artifacts .build/ +Package.resolved # Go artifacts -go.sum _obj/ # Python artifacts diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..fc2db0f --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,89 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aho-corasick" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a" +dependencies = [ + "memchr", +] + +[[package]] +name = "cc" +version = "1.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" +dependencies = [ + "shlex", +] + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "regex" +version = "1.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "tree-sitter" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20f4cd3642c47a85052a887d86704f4eac272969f61b686bdd3f772122aabaff" +dependencies = [ + "cc", + "regex", + "regex-syntax", + "tree-sitter-language", +] + +[[package]] +name = "tree-sitter-jsdoc" +version = "0.21.0" +dependencies = [ + "cc", + "tree-sitter", + "tree-sitter-language", +] + +[[package]] +name = "tree-sitter-language" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2545046bd1473dac6c626659cc2567c6c0ff302fc8b84a56c4243378276f7f57" diff --git a/Cargo.toml b/Cargo.toml index 934b5c9..3645f7f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,10 @@ include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*"] path = "bindings/rust/lib.rs" [dependencies] -tree-sitter = ">=0.21.0" +tree-sitter-language = "0.1.0" [build-dependencies] cc = "1.0.96" + +[dev-dependencies] +tree-sitter = "0.23" diff --git a/Makefile b/Makefile index bcb6b3a..ddce6df 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,8 @@ -VERSION := 0.21.0 +ifeq ($(OS),Windows_NT) +$(error Windows is not supported) +endif + +VERSION := 0.0.1 LANGUAGE_NAME := tree-sitter-jsdoc @@ -17,10 +21,6 @@ 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 @@ -36,27 +36,29 @@ OBJS := $(patsubst %.c,%.o,$(PARSER) $(EXTRAS)) ARFLAGS ?= rcs override CFLAGS += -I$(SRC_DIR) -std=c11 -fPIC +# ABI versioning +SONAME_MAJOR := $(word 1,$(subst ., ,$(VERSION))) +SONAME_MINOR := $(shell sed -n 's/#define LANGUAGE_VERSION //p' $(PARSER)) + # OS-specific bits -ifeq ($(OS),Windows_NT) - $(error "Windows is not supported") -else ifeq ($(shell uname),Darwin) +ifeq ($(shell uname),Darwin) SOEXT = dylib - SOEXTVER_MAJOR = $(SONAME_MAJOR).dylib - SOEXTVER = $(SONAME_MAJOR).$(SONAME_MINOR).dylib + SOEXTVER_MAJOR = $(SONAME_MAJOR).$(SOEXT) + SOEXTVER = $(SONAME_MAJOR).$(SONAME_MINOR).$(SOEXT) 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 + LINKSHARED := $(LINKSHARED)-install_name,$(LIBDIR)/lib$(LANGUAGE_NAME).$(SOEXTVER),-rpath,@executable_path/../Frameworks else SOEXT = so - SOEXTVER_MAJOR = so.$(SONAME_MAJOR) - SOEXTVER = so.$(SONAME_MAJOR).$(SONAME_MINOR) + SOEXTVER_MAJOR = $(SOEXT).$(SONAME_MAJOR) + SOEXTVER = $(SOEXT).$(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) + LINKSHARED := $(LINKSHARED)-soname,lib$(LANGUAGE_NAME).$(SOEXTVER) endif ifneq ($(filter $(shell uname),FreeBSD NetBSD DragonFly),) PCLIBDIR := $(PREFIX)/libdata/pkgconfig diff --git a/Package.swift b/Package.swift index 88f1cf3..0231c90 100644 --- a/Package.swift +++ b/Package.swift @@ -6,42 +6,55 @@ let package = Package( products: [ .library(name: "TreeSitterJsdoc", targets: ["TreeSitterJsdoc"]), ], - dependencies: [], + dependencies: [ + .package(url: "https://github.com/ChimeHQ/SwiftTreeSitter", from: "0.8.0"), + ], targets: [ - .target(name: "TreeSitterJsdoc", - 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", - "src/scanner.c", - ], - resources: [ - .copy("queries") - ], - publicHeadersPath: "bindings/swift", - cSettings: [.headerSearchPath("src")]) + .target( + name: "TreeSitterJsdoc", + dependencies: [], + 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", + "src/scanner.c", + ], + resources: [ + .copy("queries") + ], + publicHeadersPath: "bindings/swift", + cSettings: [.headerSearchPath("src")] + ), + .testTarget( + name: "TreeSitterJsdocTests", + dependencies: [ + "SwiftTreeSitter", + "TreeSitterJsdoc", + ], + path: "bindings/swift/TreeSitterJsdocTests" + ) ], cLanguageStandard: .c11 ) diff --git a/bindings/go/binding_test.go b/bindings/go/binding_test.go index ea16ed2..9ca2563 100644 --- a/bindings/go/binding_test.go +++ b/bindings/go/binding_test.go @@ -3,8 +3,8 @@ package tree_sitter_jsdoc_test import ( "testing" - tree_sitter "github.com/smacker/go-tree-sitter" - "github.com/tree-sitter/tree-sitter-jsdoc" + tree_sitter "github.com/tree-sitter/go-tree-sitter" + tree_sitter_jsdoc "github.com/tree-sitter/tree-sitter-jsdoc/bindings/go" ) func TestCanLoadGrammar(t *testing.T) { diff --git a/bindings/go/go.mod b/bindings/go/go.mod deleted file mode 100644 index b6159a3..0000000 --- a/bindings/go/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module github.com/tree-sitter/tree-sitter-jsdoc - -go 1.22 - -require github.com/smacker/go-tree-sitter v0.0.0-20230720070738-0d0a9f78d8f8 diff --git a/bindings/node/binding.cc b/bindings/node/binding.cc index 1b8ce7d..d8f2308 100644 --- a/bindings/node/binding.cc +++ b/bindings/node/binding.cc @@ -6,7 +6,7 @@ extern "C" TSLanguage *tree_sitter_jsdoc(); // "tree-sitter", "language" hashed with BLAKE2 const napi_type_tag LANGUAGE_TYPE_TAG = { - 0x8AF2E5212AD58ABF, 0xD5006CAD83ABBA16 + 0x8AF2E5212AD58ABF, 0xD5006CAD83ABBA16 }; Napi::Object Init(Napi::Env env, Napi::Object exports) { diff --git a/bindings/node/binding_test.js b/bindings/node/binding_test.js new file mode 100644 index 0000000..afede30 --- /dev/null +++ b/bindings/node/binding_test.js @@ -0,0 +1,9 @@ +/// + +const assert = require("node:assert"); +const { test } = require("node:test"); + +test("can load grammar", () => { + const parser = new (require("tree-sitter"))(); + assert.doesNotThrow(() => parser.setLanguage(require("."))); +}); diff --git a/bindings/python/tests/test_binding.py b/bindings/python/tests/test_binding.py new file mode 100644 index 0000000..71da4ac --- /dev/null +++ b/bindings/python/tests/test_binding.py @@ -0,0 +1,11 @@ +from unittest import TestCase + +import tree_sitter, tree_sitter_jsdoc + + +class TestLanguage(TestCase): + def test_can_load_grammar(self): + try: + tree_sitter.Language(tree_sitter_jsdoc.language()) + except Exception: + self.fail("Error loading JSDoc grammar") diff --git a/bindings/python/tree_sitter_jsdoc/__init__.py b/bindings/python/tree_sitter_jsdoc/__init__.py index e67e3ec..a73961c 100644 --- a/bindings/python/tree_sitter_jsdoc/__init__.py +++ b/bindings/python/tree_sitter_jsdoc/__init__.py @@ -1,5 +1,31 @@ -"JSDoc grammar for tree-sitter" +"""JSDoc grammar for tree-sitter""" + +from importlib.resources import files as _files from ._binding import language -__all__ = ["language"] + +def _get_query(name, file): + query = _files(f"{__package__}.queries") / file + globals()[name] = query.read_text() + return globals()[name] + + +def __getattr__(name): + if name == "HIGHLIGHTS_QUERY": + return _get_query("HIGHLIGHTS_QUERY", "highlights.scm") + + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") + + +__all__ = [ + "language", + "HIGHLIGHTS_QUERY", +] + + +def __dir__(): + return sorted(__all__ + [ + "__all__", "__builtins__", "__cached__", "__doc__", "__file__", + "__loader__", "__name__", "__package__", "__path__", "__spec__", + ]) diff --git a/bindings/python/tree_sitter_jsdoc/__init__.pyi b/bindings/python/tree_sitter_jsdoc/__init__.pyi index 5416666..9a5b00a 100644 --- a/bindings/python/tree_sitter_jsdoc/__init__.pyi +++ b/bindings/python/tree_sitter_jsdoc/__init__.pyi @@ -1 +1,5 @@ -def language() -> int: ... +from typing import Final + +HIGHLIGHTS_QUERY: Final[str] + +def language() -> object: ... diff --git a/bindings/python/tree_sitter_jsdoc/binding.c b/bindings/python/tree_sitter_jsdoc/binding.c index 3b8f6a3..2f5adcf 100644 --- a/bindings/python/tree_sitter_jsdoc/binding.c +++ b/bindings/python/tree_sitter_jsdoc/binding.c @@ -4,8 +4,8 @@ typedef struct TSLanguage TSLanguage; TSLanguage *tree_sitter_jsdoc(void); -static PyObject* _binding_language(PyObject *self, PyObject *args) { - return PyLong_FromVoidPtr(tree_sitter_jsdoc()); +static PyObject* _binding_language(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(args)) { + return PyCapsule_New(tree_sitter_jsdoc(), "tree_sitter.Language", NULL); } static PyMethodDef methods[] = { diff --git a/bindings/rust/lib.rs b/bindings/rust/lib.rs index 0cba2e9..db5d02f 100644 --- a/bindings/rust/lib.rs +++ b/bindings/rust/lib.rs @@ -4,6 +4,8 @@ //! tree-sitter [Parser][], and then use the parser to parse some code: //! //! ``` +//! use tree_sitter::Parser; +//! //! let code = r#" //! /** //! * This is a JSDoc comment @@ -11,8 +13,11 @@ //! * @param {string} foo //! */ //! "#; -//! let mut parser = tree_sitter::Parser::new(); -//! parser.set_language(&tree_sitter_jsdoc::language()).expect("Error loading JSDoc grammar"); +//! let mut parser = Parser::new(); +//! let language = tree_sitter_jsdoc::LANGUAGE; +//! parser +//! .set_language(&language.into()) +//! .expect("Error loading JSDoc parser"); //! let tree = parser.parse(code, None).unwrap(); //! assert!(!tree.root_node().has_error()); //! ``` @@ -22,18 +27,14 @@ //! [Parser]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Parser.html //! [tree-sitter]: https://tree-sitter.github.io/ -use tree_sitter::Language; +use tree_sitter_language::LanguageFn; extern "C" { - fn tree_sitter_jsdoc() -> Language; + fn tree_sitter_jsdoc() -> *const (); } -/// 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_jsdoc() } -} +/// The tree-sitter [`LanguageFn`] for this grammar. +pub const LANGUAGE: LanguageFn = unsafe { LanguageFn::from_raw(tree_sitter_jsdoc) }; /// The content of the [`node-types.json`][] file for this grammar. /// @@ -49,7 +50,7 @@ mod tests { fn test_can_load_grammar() { let mut parser = tree_sitter::Parser::new(); parser - .set_language(&super::language()) - .expect("Error loading JSDoc grammar"); + .set_language(&super::LANGUAGE.into()) + .expect("Error loading JSDoc parser"); } } diff --git a/bindings/swift/TreeSitterJSDoc/jsdoc.h b/bindings/swift/TreeSitterJsdoc/jsdoc.h similarity index 100% rename from bindings/swift/TreeSitterJSDoc/jsdoc.h rename to bindings/swift/TreeSitterJsdoc/jsdoc.h diff --git a/bindings/swift/TreeSitterJsdocTests/TreeSitterJsdocTests.swift b/bindings/swift/TreeSitterJsdocTests/TreeSitterJsdocTests.swift new file mode 100644 index 0000000..824a962 --- /dev/null +++ b/bindings/swift/TreeSitterJsdocTests/TreeSitterJsdocTests.swift @@ -0,0 +1,12 @@ +import XCTest +import SwiftTreeSitter +import TreeSitterJsdoc + +final class TreeSitterJsdocTests: XCTestCase { + func testCanLoadGrammar() throws { + let parser = Parser() + let language = Language(language: tree_sitter_jsdoc()) + XCTAssertNoThrow(try parser.setLanguage(language), + "Error loading JSDoc grammar") + } +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..475f486 --- /dev/null +++ b/go.mod @@ -0,0 +1,7 @@ +module github.com/tree-sitter/tree-sitter-jsdoc + +go 1.23 + +require github.com/tree-sitter/go-tree-sitter v0.23.1 + +require github.com/mattn/go-pointer v0.0.1 // indirect diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..d775361 --- /dev/null +++ b/go.sum @@ -0,0 +1,36 @@ +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/mattn/go-pointer v0.0.1 h1:n+XhsuGeVO6MEAp7xyEukFINEa+Quek5psIR/ylA6o0= +github.com/mattn/go-pointer v0.0.1/go.mod h1:2zXcozF6qYGgmsG+SeTZz3oAbFLdD3OWqnUbNvJZAlc= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/tree-sitter/go-tree-sitter v0.23.1 h1:HCfaE19sKfG7q190xfM1loUZf6wEHa4TDqDEW46s9Lg= +github.com/tree-sitter/go-tree-sitter v0.23.1/go.mod h1:EvIVhMvvPNvhu9x+ddSPxSnUEU5AnsSwi1LMqXIVE3A= +github.com/tree-sitter/tree-sitter-c v0.21.5-0.20240818205408-927da1f210eb h1:A8425heRM8mylnv4H58FPUiH+aYivyitre0PzxrfmWs= +github.com/tree-sitter/tree-sitter-c v0.21.5-0.20240818205408-927da1f210eb/go.mod h1:dOF6gtQiF9UwNh995T5OphYmtIypkjsp3ap7r9AN/iA= +github.com/tree-sitter/tree-sitter-cpp v0.22.4-0.20240818224355-b1a4e2b25148 h1:AfFPZwtwGN01BW1jDdqBVqscTwetvMpydqYZz57RSlc= +github.com/tree-sitter/tree-sitter-cpp v0.22.4-0.20240818224355-b1a4e2b25148/go.mod h1:Bh6U3viD57rFXRYIQ+kmiYtr+1Bx0AceypDLJJSyi9s= +github.com/tree-sitter/tree-sitter-embedded-template v0.21.1-0.20240819044651-ffbf64942c33 h1:TwqSV3qLp3tKSqirGLRHnjFk9Tc2oy57LIl+FQ4GjI4= +github.com/tree-sitter/tree-sitter-embedded-template v0.21.1-0.20240819044651-ffbf64942c33/go.mod h1:CvCKCt3v04Ufos1zZnNCelBDeCGRpPucaN8QczoUsN4= +github.com/tree-sitter/tree-sitter-go v0.21.3-0.20240818010209-8c0f0e7a6012 h1:Xvxck3tE5FW7F7bTS97iNM2ADMyCMJztVqn5HYKdJGo= +github.com/tree-sitter/tree-sitter-go v0.21.3-0.20240818010209-8c0f0e7a6012/go.mod h1:T40D0O1cPvUU/+AmiXVXy1cncYQT6wem4Z0g4SfAYvY= +github.com/tree-sitter/tree-sitter-html v0.20.5-0.20240818004741-d11201a263d0 h1:c46K6uh5Dz00zJeU9BfjXdb8I+E4RkUdfnWJpQADXFo= +github.com/tree-sitter/tree-sitter-html v0.20.5-0.20240818004741-d11201a263d0/go.mod h1:hcNt/kOJHcIcuMvouE7LJcYdeFUFbVpBJ6d4wmOA+tU= +github.com/tree-sitter/tree-sitter-java v0.21.1-0.20240824015150-576d8097e495 h1:jrt4qbJVEFs4H93/ITxygHc6u0TGqAkkate7TQ4wFSA= +github.com/tree-sitter/tree-sitter-java v0.21.1-0.20240824015150-576d8097e495/go.mod h1:oyaR7fLnRV0hT9z6qwE9GkaeTom/hTDwK3H2idcOJFc= +github.com/tree-sitter/tree-sitter-javascript v0.21.5-0.20240818005344-15887341e5b5 h1:om4X9AVg3asL8gxNJDcz4e/Wp+VpQj1PY3uJXKr6EOg= +github.com/tree-sitter/tree-sitter-javascript v0.21.5-0.20240818005344-15887341e5b5/go.mod h1:nNqgPoV/h9uYWk6kYEFdEAhNVOacpfpRW5SFmdaP4tU= +github.com/tree-sitter/tree-sitter-json v0.21.1-0.20240818005659-bdd69eb8c8a5 h1:pfV3G3k7NCKqKk8THBmyuh2zA33lgYHS3GVrzRR8ry4= +github.com/tree-sitter/tree-sitter-json v0.21.1-0.20240818005659-bdd69eb8c8a5/go.mod h1:GbMKRjLfk0H+PI7nLi1Sx5lHf5wCpLz9al8tQYSxpEk= +github.com/tree-sitter/tree-sitter-php v0.22.9-0.20240819002312-a552625b56c1 h1:ZXZMDwE+IhUtGug4Brv6NjJWUU3rfkZBKpemf6RY8/g= +github.com/tree-sitter/tree-sitter-php v0.22.9-0.20240819002312-a552625b56c1/go.mod h1:UKCLuYnJ312Mei+3cyTmGOHzn0YAnaPRECgJmHtzrqs= +github.com/tree-sitter/tree-sitter-python v0.21.1-0.20240818005537-55a9b8a4fbfb h1:EXEM82lFM7JjJb6qiKZXkpIDaCcbV2obNn82ghwj9lw= +github.com/tree-sitter/tree-sitter-python v0.21.1-0.20240818005537-55a9b8a4fbfb/go.mod h1:lXCF1nGG5Dr4J3BTS0ObN4xJCCICiSu/b+Xe/VqMV7g= +github.com/tree-sitter/tree-sitter-ruby v0.21.1-0.20240818211811-7dbc1e2d0e2d h1:fcYCvoXdcP1uRQYXqJHRy6Hec+uKScQdKVtMwK9JeCI= +github.com/tree-sitter/tree-sitter-ruby v0.21.1-0.20240818211811-7dbc1e2d0e2d/go.mod h1:T1nShQ4v5AJtozZ8YyAS4uzUtDAJj/iv4YfwXSbUHzg= +github.com/tree-sitter/tree-sitter-rust v0.21.3-0.20240818005432-2b43eafe6447 h1:o9alBu1J/WjrcTKEthYtXmdkDc5OVXD+PqlvnEZ0Lzc= +github.com/tree-sitter/tree-sitter-rust v0.21.3-0.20240818005432-2b43eafe6447/go.mod h1:1Oh95COkkTn6Ezp0vcMbvfhRP5gLeqqljR0BYnBzWvc= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/package-lock.json b/package-lock.json index c744d41..deea564 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,20 +10,20 @@ "hasInstallScript": true, "license": "MIT", "dependencies": { - "node-addon-api": "^8.0.0", - "node-gyp-build": "^4.8.1" + "node-addon-api": "^8.1.0", + "node-gyp-build": "^4.8.2" }, "devDependencies": { "eslint": ">=8.57.0", "eslint-config-google": "^0.14.0", "prebuildify": "^6.0.1", - "tree-sitter-cli": "^0.22.6" + "tree-sitter-cli": "^0.23.0" }, "peerDependencies": { "tree-sitter": "^0.21.0" }, "peerDependenciesMeta": { - "tree_sitter": { + "tree-sitter": { "optional": true } } @@ -976,17 +976,17 @@ } }, "node_modules/node-addon-api": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.0.0.tgz", - "integrity": "sha512-ipO7rsHEBqa9STO5C5T10fj732ml+5kLN1cAG8/jdHd56ldQeGj3Q7+scUS+VHK/qy1zLEwC4wMK5+yM0btPvw==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.1.0.tgz", + "integrity": "sha512-yBY+qqWSv3dWKGODD6OGE6GnTX7Q2r+4+DfpqxHSHh8x0B4EKP9+wVGLS6U/AM1vxSNNmUEuIV5EGhYwPpfOwQ==", "engines": { "node": "^18 || ^20 || >= 21" } }, "node_modules/node-gyp-build": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.1.tgz", - "integrity": "sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==", + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.2.tgz", + "integrity": "sha512-IRUxE4BVsHWXkV/SFOut4qTlagw2aM8T5/vnTsmrHJvVoKueJHRc/JaFND7QDDc61kLYUJ6qlZM3sqTSyx2dTw==", "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -1376,6 +1376,7 @@ "resolved": "https://registry.npmjs.org/tree-sitter/-/tree-sitter-0.21.1.tgz", "integrity": "sha512-7dxoA6kYvtgWw80265MyqJlkRl4yawIjO7S5MigytjELkX43fV2WsAXzsNfO7sBpPPCF5Gp0+XzHk0DwLCq3xQ==", "hasInstallScript": true, + "optional": true, "peer": true, "dependencies": { "node-addon-api": "^8.0.0", @@ -1383,13 +1384,16 @@ } }, "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==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/tree-sitter-cli/-/tree-sitter-cli-0.23.0.tgz", + "integrity": "sha512-/DdQaPCCOrOYGp9FxGdhFUnHIrjhfbYatQXgNIcmaAOpPunpnDj2vsO/H+svsfQLaFsQ1C+BjgPhpbV28zka1w==", "dev": true, "hasInstallScript": true, "bin": { "tree-sitter": "cli.js" + }, + "engines": { + "node": ">=12.0.0" } }, "node_modules/type-check": { diff --git a/package.json b/package.json index 6b0f5e0..800fb92 100644 --- a/package.json +++ b/package.json @@ -25,31 +25,29 @@ "src/**" ], "dependencies": { - "node-addon-api": "^8.0.0", - "node-gyp-build": "^4.8.1" + "node-addon-api": "^8.1.0", + "node-gyp-build": "^4.8.2" }, "peerDependencies": { "tree-sitter": "^0.21.0" }, "peerDependenciesMeta": { - "tree_sitter": { + "tree-sitter": { "optional": true } }, "devDependencies": { "eslint": ">=8.57.0", "eslint-config-google": "^0.14.0", - "tree-sitter-cli": "^0.22.6", + "tree-sitter-cli": "^0.23.0", "prebuildify": "^6.0.1" }, "scripts": { "install": "node-gyp-build", - "prebuildify": "prebuildify --napi --strip", - "build": "tree-sitter generate --no-bindings", - "build-wasm": "tree-sitter build --wasm", "lint": "eslint grammar.js", - "parse": "tree-sitter parse", - "test": "tree-sitter test" + "prestart": "tree-sitter build --wasm", + "start": "tree-sitter playground", + "test": "node --test bindings/node/*_test.js" }, "tree-sitter": [ { diff --git a/pyproject.toml b/pyproject.toml index 76e75a1..19da83f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ authors = [ { name = "Max Brunsfeld", email = "maxbrunsfeld@gmail.com" }, { name = "Amaan Qureshi", email = "amaanq12@gmail.com" }, ] -requires-python = ">=3.8" +requires-python = ">=3.9" license.text = "MIT" readme = "README.md" @@ -29,5 +29,5 @@ Homepage = "https://github.com/tree-sitter/tree-sitter-jsdoc" core = ["tree-sitter~=0.21"] [tool.cibuildwheel] -build = "cp38-*" +build = "cp39-*" build-frontend = "build" diff --git a/setup.py b/setup.py index 4678079..e4379bf 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ class BdistWheel(bdist_wheel): def get_tag(self): python, abi, platform = super().get_tag() if python.startswith("cp"): - python, abi = "cp38", "abi3" + python, abi = "cp39", "abi3" return python, abi, platform @@ -40,13 +40,15 @@ def get_tag(self): ], extra_compile_args=[ "-std=c11", + "-fvisibility=hidden", ] if system() != "Windows" else [ "/std:c11", "/utf-8", ], define_macros=[ - ("Py_LIMITED_API", "0x03080000"), - ("PY_SSIZE_T_CLEAN", None) + ("Py_LIMITED_API", "0x03090000"), + ("PY_SSIZE_T_CLEAN", None), + ("TREE_SITTER_HIDE_SYMBOLS", None), ], include_dirs=["src"], py_limited_api=True, diff --git a/src/parser.c b/src/parser.c index 8bba29f..8886b5c 100644 --- a/src/parser.c +++ b/src/parser.c @@ -7,7 +7,7 @@ #define LANGUAGE_VERSION 14 #define STATE_COUNT 51 #define LARGE_STATE_COUNT 2 -#define SYMBOL_COUNT 30 +#define SYMBOL_COUNT 31 #define ALIAS_COUNT 0 #define TOKEN_COUNT 19 #define EXTERNAL_TOKEN_COUNT 1 @@ -32,7 +32,7 @@ enum ts_symbol_identifiers { sym_identifier = 14, sym__text = 15, sym__begin = 16, - sym__end = 17, + anon_sym_SLASH2 = 17, sym_type = 18, sym_document = 19, sym_description = 20, @@ -43,8 +43,9 @@ enum ts_symbol_identifiers { sym_path_expression = 25, sym_member_expression = 26, sym_optional_identifier = 27, - aux_sym_document_repeat1 = 28, - aux_sym_description_repeat1 = 29, + sym__end = 28, + aux_sym_document_repeat1 = 29, + aux_sym_description_repeat1 = 30, }; static const char * const ts_symbol_names[] = { @@ -65,7 +66,7 @@ static const char * const ts_symbol_names[] = { [sym_identifier] = "identifier", [sym__text] = "_text", [sym__begin] = "_begin", - [sym__end] = "_end", + [anon_sym_SLASH2] = "/", [sym_type] = "type", [sym_document] = "document", [sym_description] = "description", @@ -76,6 +77,7 @@ static const char * const ts_symbol_names[] = { [sym_path_expression] = "path_expression", [sym_member_expression] = "member_expression", [sym_optional_identifier] = "optional_identifier", + [sym__end] = "_end", [aux_sym_document_repeat1] = "document_repeat1", [aux_sym_description_repeat1] = "description_repeat1", }; @@ -98,7 +100,7 @@ static const TSSymbol ts_symbol_map[] = { [sym_identifier] = sym_identifier, [sym__text] = sym__text, [sym__begin] = sym__begin, - [sym__end] = sym__end, + [anon_sym_SLASH2] = anon_sym_SLASH, [sym_type] = sym_type, [sym_document] = sym_document, [sym_description] = sym_description, @@ -109,6 +111,7 @@ static const TSSymbol ts_symbol_map[] = { [sym_path_expression] = sym_path_expression, [sym_member_expression] = sym_member_expression, [sym_optional_identifier] = sym_optional_identifier, + [sym__end] = sym__end, [aux_sym_document_repeat1] = aux_sym_document_repeat1, [aux_sym_description_repeat1] = aux_sym_description_repeat1, }; @@ -182,9 +185,9 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = false, .named = true, }, - [sym__end] = { - .visible = false, - .named = true, + [anon_sym_SLASH2] = { + .visible = true, + .named = false, }, [sym_type] = { .visible = true, @@ -226,6 +229,10 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, + [sym__end] = { + .visible = false, + .named = true, + }, [aux_sym_document_repeat1] = { .visible = false, .named = false, @@ -267,17 +274,17 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [19] = 19, [20] = 20, [21] = 21, - [22] = 6, - [23] = 10, - [24] = 7, + [22] = 9, + [23] = 23, + [24] = 24, [25] = 25, - [26] = 26, - [27] = 27, + [26] = 8, + [27] = 5, [28] = 28, [29] = 29, [30] = 30, - [31] = 31, - [32] = 16, + [31] = 16, + [32] = 32, [33] = 33, [34] = 34, [35] = 33, @@ -293,9 +300,9 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [45] = 45, [46] = 46, [47] = 47, - [48] = 39, - [49] = 49, - [50] = 45, + [48] = 48, + [49] = 47, + [50] = 48, }; static bool ts_lex(TSLexer *lexer, TSStateId state) { @@ -1393,10 +1400,10 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (lookahead == '*') ADVANCE(139); END_STATE(); case 140: - ACCEPT_TOKEN(sym__end); + ACCEPT_TOKEN(anon_sym_SLASH2); END_STATE(); case 141: - ACCEPT_TOKEN(sym__end); + ACCEPT_TOKEN(anon_sym_SLASH2); if (lookahead == '*') ADVANCE(139); END_STATE(); default: @@ -1410,50 +1417,50 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [2] = {.lex_state = 4}, [3] = {.lex_state = 4}, [4] = {.lex_state = 7}, - [5] = {.lex_state = 6}, - [6] = {.lex_state = 9}, + [5] = {.lex_state = 9}, + [6] = {.lex_state = 11}, [7] = {.lex_state = 9}, - [8] = {.lex_state = 11}, - [9] = {.lex_state = 11}, - [10] = {.lex_state = 9}, - [11] = {.lex_state = 9}, + [8] = {.lex_state = 9}, + [9] = {.lex_state = 9}, + [10] = {.lex_state = 6}, + [11] = {.lex_state = 11}, [12] = {.lex_state = 11}, [13] = {.lex_state = 11}, [14] = {.lex_state = 11}, [15] = {.lex_state = 11}, [16] = {.lex_state = 9}, [17] = {.lex_state = 15}, - [18] = {.lex_state = 0}, - [19] = {.lex_state = 4}, + [18] = {.lex_state = 4}, + [19] = {.lex_state = 0}, [20] = {.lex_state = 4}, [21] = {.lex_state = 4}, [22] = {.lex_state = 13}, - [23] = {.lex_state = 13}, - [24] = {.lex_state = 13}, - [25] = {.lex_state = 4}, - [26] = {.lex_state = 9}, - [27] = {.lex_state = 9}, + [23] = {.lex_state = 4}, + [24] = {.lex_state = 9}, + [25] = {.lex_state = 9}, + [26] = {.lex_state = 13}, + [27] = {.lex_state = 13}, [28] = {.lex_state = 4}, [29] = {.lex_state = 4}, [30] = {.lex_state = 4}, - [31] = {.lex_state = 4}, - [32] = {.lex_state = 13}, + [31] = {.lex_state = 13}, + [32] = {.lex_state = 4}, [33] = {.lex_state = 13}, [34] = {.lex_state = 0}, [35] = {.lex_state = 13}, - [36] = {.lex_state = 0, .external_lex_state = 1}, + [36] = {.lex_state = 0}, [37] = {.lex_state = 0}, [38] = {.lex_state = 0}, [39] = {.lex_state = 0}, [40] = {.lex_state = 0}, [41] = {.lex_state = 0}, - [42] = {.lex_state = 2}, - [43] = {.lex_state = 0}, + [42] = {.lex_state = 0}, + [43] = {.lex_state = 0, .external_lex_state = 1}, [44] = {.lex_state = 0}, [45] = {.lex_state = 2}, [46] = {.lex_state = 0, .external_lex_state = 1}, [47] = {.lex_state = 0}, - [48] = {.lex_state = 0}, + [48] = {.lex_state = 2}, [49] = {.lex_state = 0}, [50] = {.lex_state = 2}, }; @@ -1477,11 +1484,11 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [sym_identifier] = ACTIONS(1), [sym__text] = ACTIONS(1), [sym__begin] = ACTIONS(1), - [sym__end] = ACTIONS(1), + [anon_sym_SLASH2] = ACTIONS(1), [sym_type] = ACTIONS(1), }, [1] = { - [sym_document] = STATE(40), + [sym_document] = STATE(39), [sym__begin] = ACTIONS(3), }, }; @@ -1497,14 +1504,14 @@ static const uint16_t ts_small_parse_table[] = { ACTIONS(13), 1, sym__text, ACTIONS(15), 1, - sym__end, - STATE(31), 1, + anon_sym_SLASH2, + STATE(29), 1, sym_description, ACTIONS(7), 3, sym_tag_name_with_argument, sym_tag_name_with_type, sym_tag_name, - STATE(8), 5, + STATE(6), 5, sym__expression, sym_qualified_expression, sym_path_expression, @@ -1518,14 +1525,14 @@ static const uint16_t ts_small_parse_table[] = { ACTIONS(13), 1, sym__text, ACTIONS(19), 1, - sym__end, - STATE(29), 1, + anon_sym_SLASH2, + STATE(32), 1, sym_description, ACTIONS(17), 3, sym_tag_name_with_argument, sym_tag_name_with_type, sym_tag_name, - STATE(9), 5, + STATE(11), 5, sym__expression, sym_qualified_expression, sym_path_expression, @@ -1545,126 +1552,117 @@ static const uint16_t ts_small_parse_table[] = { sym_tag_name_with_type, sym_tag_name, sym__text, - sym__end, - [78] = 3, - ACTIONS(23), 1, - anon_sym_COLON, - ACTIONS(29), 4, - sym_tag_name_with_argument, - sym_tag_name_with_type, - sym_tag_name, - sym__text, - ACTIONS(31), 4, - anon_sym_DOT, - anon_sym_POUND, - anon_sym_TILDE, - sym__end, - [94] = 6, - ACTIONS(33), 1, + anon_sym_SLASH2, + [78] = 6, + ACTIONS(29), 1, anon_sym_LBRACE, - ACTIONS(35), 1, + ACTIONS(31), 1, sym__inline_tag_false_positive, - ACTIONS(39), 1, - sym__text, - ACTIONS(41), 1, - sym__end, - STATE(10), 2, - sym_inline_tag, - aux_sym_description_repeat1, - ACTIONS(37), 3, - sym_tag_name_with_argument, - sym_tag_name_with_type, - sym_tag_name, - [116] = 6, - ACTIONS(43), 1, - anon_sym_LBRACE, - ACTIONS(46), 1, - sym__inline_tag_false_positive, - ACTIONS(51), 1, + ACTIONS(35), 1, sym__text, - ACTIONS(54), 1, - sym__end, - STATE(7), 2, + ACTIONS(37), 1, + anon_sym_SLASH2, + STATE(9), 2, sym_inline_tag, aux_sym_description_repeat1, - ACTIONS(49), 3, + ACTIONS(33), 3, sym_tag_name_with_argument, sym_tag_name_with_type, sym_tag_name, - [138] = 5, + [100] = 5, ACTIONS(13), 1, sym__text, - ACTIONS(60), 1, - sym__end, - STATE(30), 1, + ACTIONS(43), 1, + anon_sym_SLASH2, + STATE(28), 1, sym_description, - ACTIONS(56), 3, + ACTIONS(39), 3, sym_tag_name_with_argument, sym_tag_name_with_type, sym_tag_name, - ACTIONS(58), 3, + ACTIONS(41), 3, anon_sym_DOT, anon_sym_POUND, anon_sym_TILDE, - [158] = 5, + [120] = 8, ACTIONS(13), 1, sym__text, - ACTIONS(64), 1, - sym__end, - STATE(28), 1, + ACTIONS(45), 1, + sym_tag_name_with_argument, + ACTIONS(47), 1, + sym_tag_name_with_type, + ACTIONS(49), 1, + sym_tag_name, + ACTIONS(51), 1, + anon_sym_SLASH2, + STATE(20), 1, sym_description, - ACTIONS(58), 3, - anon_sym_DOT, - anon_sym_POUND, - anon_sym_TILDE, - ACTIONS(62), 3, + STATE(41), 1, + sym__end, + STATE(21), 2, + sym_tag, + aux_sym_document_repeat1, + [146] = 6, + ACTIONS(53), 1, + anon_sym_LBRACE, + ACTIONS(56), 1, + sym__inline_tag_false_positive, + ACTIONS(61), 1, + sym__text, + ACTIONS(64), 1, + anon_sym_SLASH2, + STATE(8), 2, + sym_inline_tag, + aux_sym_description_repeat1, + ACTIONS(59), 3, sym_tag_name_with_argument, sym_tag_name_with_type, sym_tag_name, - [178] = 6, - ACTIONS(33), 1, + [168] = 6, + ACTIONS(29), 1, anon_sym_LBRACE, ACTIONS(66), 1, sym__inline_tag_false_positive, ACTIONS(70), 1, sym__text, ACTIONS(72), 1, - sym__end, - STATE(7), 2, + anon_sym_SLASH2, + STATE(8), 2, sym_inline_tag, aux_sym_description_repeat1, ACTIONS(68), 3, sym_tag_name_with_argument, sym_tag_name_with_type, sym_tag_name, - [200] = 7, - ACTIONS(13), 1, - sym__text, - ACTIONS(74), 1, + [190] = 3, + ACTIONS(23), 1, + anon_sym_COLON, + ACTIONS(74), 4, sym_tag_name_with_argument, - ACTIONS(76), 1, sym_tag_name_with_type, - ACTIONS(78), 1, sym_tag_name, + sym__text, + ACTIONS(76), 4, + anon_sym_DOT, + anon_sym_POUND, + anon_sym_TILDE, + anon_sym_SLASH2, + [206] = 5, + ACTIONS(13), 1, + sym__text, ACTIONS(80), 1, - sym__end, - STATE(19), 1, + anon_sym_SLASH2, + STATE(30), 1, sym_description, - STATE(25), 2, - sym_tag, - aux_sym_document_repeat1, - [223] = 2, - ACTIONS(29), 4, - sym_tag_name_with_argument, - sym_tag_name_with_type, - sym_tag_name, - sym__text, - ACTIONS(31), 4, + ACTIONS(41), 3, anon_sym_DOT, anon_sym_POUND, anon_sym_TILDE, - sym__end, - [236] = 2, + ACTIONS(78), 3, + sym_tag_name_with_argument, + sym_tag_name_with_type, + sym_tag_name, + [226] = 2, ACTIONS(82), 4, sym_tag_name_with_argument, sym_tag_name_with_type, @@ -1674,8 +1672,8 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_DOT, anon_sym_POUND, anon_sym_TILDE, - sym__end, - [249] = 2, + anon_sym_SLASH2, + [239] = 2, ACTIONS(86), 4, sym_tag_name_with_argument, sym_tag_name_with_type, @@ -1685,8 +1683,8 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_DOT, anon_sym_POUND, anon_sym_TILDE, - sym__end, - [262] = 2, + anon_sym_SLASH2, + [252] = 2, ACTIONS(90), 4, sym_tag_name_with_argument, sym_tag_name_with_type, @@ -1696,237 +1694,254 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_DOT, anon_sym_POUND, anon_sym_TILDE, - sym__end, - [275] = 2, + anon_sym_SLASH2, + [265] = 2, + ACTIONS(74), 4, + sym_tag_name_with_argument, + sym_tag_name_with_type, + sym_tag_name, + sym__text, + ACTIONS(76), 4, + anon_sym_DOT, + anon_sym_POUND, + anon_sym_TILDE, + anon_sym_SLASH2, + [278] = 2, ACTIONS(96), 2, sym__inline_tag_false_positive, - sym__end, + anon_sym_SLASH2, ACTIONS(94), 5, anon_sym_LBRACE, sym_tag_name_with_argument, sym_tag_name_with_type, sym_tag_name, sym__text, - [287] = 5, + [290] = 5, ACTIONS(13), 1, sym__text, ACTIONS(15), 1, - sym__end, + anon_sym_SLASH2, ACTIONS(98), 1, anon_sym_LBRACE, - STATE(31), 1, + STATE(29), 1, sym_description, ACTIONS(7), 3, sym_tag_name_with_argument, sym_tag_name_with_type, sym_tag_name, - [305] = 3, + [308] = 6, + ACTIONS(45), 1, + sym_tag_name_with_argument, + ACTIONS(47), 1, + sym_tag_name_with_type, + ACTIONS(49), 1, + sym_tag_name, + ACTIONS(100), 1, + anon_sym_SLASH2, + STATE(40), 1, + sym__end, + STATE(23), 2, + sym_tag, + aux_sym_document_repeat1, + [328] = 3, ACTIONS(9), 1, anon_sym_LBRACK, ACTIONS(11), 1, sym_identifier, - STATE(14), 5, + STATE(13), 5, sym__expression, sym_qualified_expression, sym_path_expression, sym_member_expression, sym_optional_identifier, - [319] = 5, - ACTIONS(74), 1, + [342] = 6, + ACTIONS(45), 1, sym_tag_name_with_argument, - ACTIONS(76), 1, + ACTIONS(47), 1, sym_tag_name_with_type, - ACTIONS(78), 1, - sym_tag_name, - ACTIONS(100), 1, - sym__end, - STATE(20), 2, - sym_tag, - aux_sym_document_repeat1, - [336] = 5, - ACTIONS(74), 1, - sym_tag_name_with_argument, - ACTIONS(76), 1, - sym_tag_name_with_type, - ACTIONS(78), 1, + ACTIONS(49), 1, sym_tag_name, ACTIONS(102), 1, + anon_sym_SLASH2, + STATE(38), 1, sym__end, - STATE(21), 2, + STATE(18), 2, sym_tag, aux_sym_document_repeat1, - [353] = 5, - ACTIONS(104), 1, + [362] = 6, + ACTIONS(45), 1, sym_tag_name_with_argument, - ACTIONS(107), 1, + ACTIONS(47), 1, sym_tag_name_with_type, - ACTIONS(110), 1, + ACTIONS(49), 1, sym_tag_name, - ACTIONS(113), 1, + ACTIONS(102), 1, + anon_sym_SLASH2, + STATE(38), 1, sym__end, - STATE(21), 2, + STATE(23), 2, sym_tag, aux_sym_document_repeat1, - [370] = 4, - ACTIONS(41), 1, - anon_sym_RBRACE, - ACTIONS(115), 1, - anon_sym_LBRACE, - ACTIONS(117), 2, - sym__inline_tag_false_positive, - sym__text, - STATE(23), 2, - sym_inline_tag, - aux_sym_description_repeat1, - [385] = 4, + [382] = 4, ACTIONS(72), 1, anon_sym_RBRACE, - ACTIONS(115), 1, - anon_sym_LBRACE, - ACTIONS(119), 2, - sym__inline_tag_false_positive, - sym__text, - STATE(24), 2, - sym_inline_tag, - aux_sym_description_repeat1, - [400] = 4, - ACTIONS(54), 1, - anon_sym_RBRACE, - ACTIONS(121), 1, + ACTIONS(104), 1, anon_sym_LBRACE, - ACTIONS(124), 2, + ACTIONS(106), 2, sym__inline_tag_false_positive, sym__text, - STATE(24), 2, + STATE(26), 2, sym_inline_tag, aux_sym_description_repeat1, - [415] = 5, - ACTIONS(74), 1, + [397] = 5, + ACTIONS(108), 1, sym_tag_name_with_argument, - ACTIONS(76), 1, + ACTIONS(111), 1, sym_tag_name_with_type, - ACTIONS(78), 1, + ACTIONS(114), 1, sym_tag_name, - ACTIONS(100), 1, - sym__end, - STATE(21), 2, + ACTIONS(117), 1, + anon_sym_SLASH2, + STATE(23), 2, sym_tag, aux_sym_document_repeat1, - [432] = 4, + [414] = 4, ACTIONS(13), 1, sym__text, - ACTIONS(19), 1, - sym__end, + ACTIONS(15), 1, + anon_sym_SLASH2, STATE(29), 1, sym_description, - ACTIONS(17), 3, + ACTIONS(7), 3, sym_tag_name_with_argument, sym_tag_name_with_type, sym_tag_name, - [447] = 4, + [429] = 4, ACTIONS(13), 1, sym__text, - ACTIONS(15), 1, - sym__end, - STATE(31), 1, + ACTIONS(19), 1, + anon_sym_SLASH2, + STATE(32), 1, sym_description, - ACTIONS(7), 3, + ACTIONS(17), 3, sym_tag_name_with_argument, sym_tag_name_with_type, sym_tag_name, - [462] = 2, + [444] = 4, + ACTIONS(64), 1, + anon_sym_RBRACE, + ACTIONS(119), 1, + anon_sym_LBRACE, + ACTIONS(122), 2, + sym__inline_tag_false_positive, + sym__text, + STATE(26), 2, + sym_inline_tag, + aux_sym_description_repeat1, + [459] = 4, + ACTIONS(37), 1, + anon_sym_RBRACE, + ACTIONS(104), 1, + anon_sym_LBRACE, + ACTIONS(125), 2, + sym__inline_tag_false_positive, + sym__text, + STATE(22), 2, + sym_inline_tag, + aux_sym_description_repeat1, + [474] = 2, ACTIONS(129), 1, - sym__end, + anon_sym_SLASH2, ACTIONS(127), 3, sym_tag_name_with_argument, sym_tag_name_with_type, sym_tag_name, - [471] = 2, - ACTIONS(64), 1, - sym__end, - ACTIONS(62), 3, + [483] = 2, + ACTIONS(43), 1, + anon_sym_SLASH2, + ACTIONS(39), 3, sym_tag_name_with_argument, sym_tag_name_with_type, sym_tag_name, - [480] = 2, + [492] = 2, ACTIONS(133), 1, - sym__end, + anon_sym_SLASH2, ACTIONS(131), 3, sym_tag_name_with_argument, sym_tag_name_with_type, sym_tag_name, - [489] = 2, - ACTIONS(60), 1, - sym__end, - ACTIONS(56), 3, - sym_tag_name_with_argument, - sym_tag_name_with_type, - sym_tag_name, - [498] = 2, + [501] = 2, ACTIONS(94), 1, anon_sym_LBRACE, ACTIONS(96), 3, anon_sym_RBRACE, sym__inline_tag_false_positive, sym__text, - [507] = 2, + [510] = 2, + ACTIONS(80), 1, + anon_sym_SLASH2, + ACTIONS(78), 3, + sym_tag_name_with_argument, + sym_tag_name_with_type, + sym_tag_name, + [519] = 2, ACTIONS(135), 1, sym__text, - STATE(48), 1, + STATE(47), 1, sym_description, - [514] = 2, + [526] = 2, ACTIONS(137), 1, sym_identifier, - STATE(12), 1, + STATE(15), 1, sym_qualified_expression, - [521] = 2, + [533] = 2, ACTIONS(135), 1, sym__text, - STATE(39), 1, + STATE(49), 1, sym_description, - [528] = 1, + [540] = 1, ACTIONS(139), 1, - sym_type, - [532] = 1, + sym_identifier, + [544] = 1, ACTIONS(141), 1, - ts_builtin_sym_end, - [536] = 1, - ACTIONS(143), 1, anon_sym_RBRACE, - [540] = 1, - ACTIONS(145), 1, - anon_sym_RBRACE, - [544] = 1, - ACTIONS(147), 1, - ts_builtin_sym_end, [548] = 1, - ACTIONS(149), 1, - sym_identifier, + ACTIONS(143), 1, + ts_builtin_sym_end, [552] = 1, - ACTIONS(151), 1, - anon_sym_RBRACK, + ACTIONS(145), 1, + ts_builtin_sym_end, [556] = 1, - ACTIONS(153), 1, - anon_sym_RBRACE, + ACTIONS(147), 1, + ts_builtin_sym_end, [560] = 1, - ACTIONS(155), 1, + ACTIONS(149), 1, ts_builtin_sym_end, [564] = 1, - ACTIONS(157), 1, - sym_tag_name, + ACTIONS(151), 1, + anon_sym_RBRACE, [568] = 1, - ACTIONS(159), 1, + ACTIONS(153), 1, sym_type, [572] = 1, - ACTIONS(161), 1, + ACTIONS(155), 1, sym_identifier, [576] = 1, - ACTIONS(163), 1, - anon_sym_RBRACE, + ACTIONS(157), 1, + anon_sym_RBRACK, [580] = 1, - ACTIONS(165), 1, - ts_builtin_sym_end, + ACTIONS(159), 1, + sym_type, [584] = 1, + ACTIONS(161), 1, + anon_sym_RBRACE, + [588] = 1, + ACTIONS(163), 1, + sym_tag_name, + [592] = 1, + ACTIONS(165), 1, + anon_sym_RBRACE, + [596] = 1, ACTIONS(167), 1, sym_tag_name, }; @@ -1936,135 +1951,135 @@ static const uint32_t ts_small_parse_table_map[] = { [SMALL_STATE(3)] = 31, [SMALL_STATE(4)] = 59, [SMALL_STATE(5)] = 78, - [SMALL_STATE(6)] = 94, - [SMALL_STATE(7)] = 116, - [SMALL_STATE(8)] = 138, - [SMALL_STATE(9)] = 158, - [SMALL_STATE(10)] = 178, - [SMALL_STATE(11)] = 200, - [SMALL_STATE(12)] = 223, - [SMALL_STATE(13)] = 236, - [SMALL_STATE(14)] = 249, - [SMALL_STATE(15)] = 262, - [SMALL_STATE(16)] = 275, - [SMALL_STATE(17)] = 287, - [SMALL_STATE(18)] = 305, - [SMALL_STATE(19)] = 319, - [SMALL_STATE(20)] = 336, - [SMALL_STATE(21)] = 353, - [SMALL_STATE(22)] = 370, - [SMALL_STATE(23)] = 385, - [SMALL_STATE(24)] = 400, - [SMALL_STATE(25)] = 415, - [SMALL_STATE(26)] = 432, - [SMALL_STATE(27)] = 447, - [SMALL_STATE(28)] = 462, - [SMALL_STATE(29)] = 471, - [SMALL_STATE(30)] = 480, - [SMALL_STATE(31)] = 489, - [SMALL_STATE(32)] = 498, - [SMALL_STATE(33)] = 507, - [SMALL_STATE(34)] = 514, - [SMALL_STATE(35)] = 521, - [SMALL_STATE(36)] = 528, - [SMALL_STATE(37)] = 532, - [SMALL_STATE(38)] = 536, - [SMALL_STATE(39)] = 540, - [SMALL_STATE(40)] = 544, - [SMALL_STATE(41)] = 548, - [SMALL_STATE(42)] = 552, - [SMALL_STATE(43)] = 556, - [SMALL_STATE(44)] = 560, - [SMALL_STATE(45)] = 564, - [SMALL_STATE(46)] = 568, - [SMALL_STATE(47)] = 572, - [SMALL_STATE(48)] = 576, - [SMALL_STATE(49)] = 580, - [SMALL_STATE(50)] = 584, + [SMALL_STATE(6)] = 100, + [SMALL_STATE(7)] = 120, + [SMALL_STATE(8)] = 146, + [SMALL_STATE(9)] = 168, + [SMALL_STATE(10)] = 190, + [SMALL_STATE(11)] = 206, + [SMALL_STATE(12)] = 226, + [SMALL_STATE(13)] = 239, + [SMALL_STATE(14)] = 252, + [SMALL_STATE(15)] = 265, + [SMALL_STATE(16)] = 278, + [SMALL_STATE(17)] = 290, + [SMALL_STATE(18)] = 308, + [SMALL_STATE(19)] = 328, + [SMALL_STATE(20)] = 342, + [SMALL_STATE(21)] = 362, + [SMALL_STATE(22)] = 382, + [SMALL_STATE(23)] = 397, + [SMALL_STATE(24)] = 414, + [SMALL_STATE(25)] = 429, + [SMALL_STATE(26)] = 444, + [SMALL_STATE(27)] = 459, + [SMALL_STATE(28)] = 474, + [SMALL_STATE(29)] = 483, + [SMALL_STATE(30)] = 492, + [SMALL_STATE(31)] = 501, + [SMALL_STATE(32)] = 510, + [SMALL_STATE(33)] = 519, + [SMALL_STATE(34)] = 526, + [SMALL_STATE(35)] = 533, + [SMALL_STATE(36)] = 540, + [SMALL_STATE(37)] = 544, + [SMALL_STATE(38)] = 548, + [SMALL_STATE(39)] = 552, + [SMALL_STATE(40)] = 556, + [SMALL_STATE(41)] = 560, + [SMALL_STATE(42)] = 564, + [SMALL_STATE(43)] = 568, + [SMALL_STATE(44)] = 572, + [SMALL_STATE(45)] = 576, + [SMALL_STATE(46)] = 580, + [SMALL_STATE(47)] = 584, + [SMALL_STATE(48)] = 588, + [SMALL_STATE(49)] = 592, + [SMALL_STATE(50)] = 596, }; 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(11), - [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36), + [3] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), + [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(43), [7] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tag, 1, 0, 0), - [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(47), + [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(44), [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), - [13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(6), + [13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(5), [15] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tag, 1, 0, 0), [17] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tag, 4, 0, 0), [19] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tag, 4, 0, 0), [21] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__expression, 1, 0, 0), - [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), - [25] = {.entry = {.count = 1, .reusable = true}}, SHIFT(41), + [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), + [25] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36), [27] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__expression, 1, 0, 0), - [29] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_member_expression, 3, 0, 0), - [31] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_member_expression, 3, 0, 0), - [33] = {.entry = {.count = 1, .reusable = false}}, SHIFT(45), - [35] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), - [37] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_description, 1, 0, 0), - [39] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10), - [41] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_description, 1, 0, 0), - [43] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_description_repeat1, 2, 0, 0), SHIFT_REPEAT(45), - [46] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_description_repeat1, 2, 0, 0), SHIFT_REPEAT(7), - [49] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_description_repeat1, 2, 0, 0), - [51] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_description_repeat1, 2, 0, 0), SHIFT_REPEAT(7), - [54] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_description_repeat1, 2, 0, 0), - [56] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tag, 2, 0, 0), - [58] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), - [60] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tag, 2, 0, 0), - [62] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tag, 5, 0, 0), - [64] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tag, 5, 0, 0), - [66] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), + [29] = {.entry = {.count = 1, .reusable = false}}, SHIFT(48), + [31] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), + [33] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_description, 1, 0, 0), + [35] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9), + [37] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_description, 1, 0, 0), + [39] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tag, 2, 0, 0), + [41] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), + [43] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tag, 2, 0, 0), + [45] = {.entry = {.count = 1, .reusable = false}}, SHIFT(2), + [47] = {.entry = {.count = 1, .reusable = false}}, SHIFT(17), + [49] = {.entry = {.count = 1, .reusable = false}}, SHIFT(24), + [51] = {.entry = {.count = 1, .reusable = true}}, SHIFT(41), + [53] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_description_repeat1, 2, 0, 0), SHIFT_REPEAT(48), + [56] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_description_repeat1, 2, 0, 0), SHIFT_REPEAT(8), + [59] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_description_repeat1, 2, 0, 0), + [61] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_description_repeat1, 2, 0, 0), SHIFT_REPEAT(8), + [64] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_description_repeat1, 2, 0, 0), + [66] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), [68] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_description, 2, 0, 0), - [70] = {.entry = {.count = 1, .reusable = false}}, SHIFT(7), + [70] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8), [72] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_description, 2, 0, 0), - [74] = {.entry = {.count = 1, .reusable = false}}, SHIFT(2), - [76] = {.entry = {.count = 1, .reusable = false}}, SHIFT(17), - [78] = {.entry = {.count = 1, .reusable = false}}, SHIFT(27), - [80] = {.entry = {.count = 1, .reusable = true}}, SHIFT(49), - [82] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_path_expression, 3, 0, 0), - [84] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_path_expression, 3, 0, 0), + [74] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_member_expression, 3, 0, 0), + [76] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_member_expression, 3, 0, 0), + [78] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tag, 5, 0, 0), + [80] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tag, 5, 0, 0), + [82] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_optional_identifier, 3, 0, 0), + [84] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_optional_identifier, 3, 0, 0), [86] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_qualified_expression, 3, 0, 0), [88] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_qualified_expression, 3, 0, 0), - [90] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_optional_identifier, 3, 0, 0), - [92] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_optional_identifier, 3, 0, 0), + [90] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_path_expression, 3, 0, 0), + [92] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_path_expression, 3, 0, 0), [94] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_inline_tag, 4, 0, 0), [96] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_inline_tag, 4, 0, 0), [98] = {.entry = {.count = 1, .reusable = true}}, SHIFT(46), - [100] = {.entry = {.count = 1, .reusable = true}}, SHIFT(44), - [102] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37), - [104] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_document_repeat1, 2, 0, 0), SHIFT_REPEAT(2), - [107] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_document_repeat1, 2, 0, 0), SHIFT_REPEAT(17), - [110] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_document_repeat1, 2, 0, 0), SHIFT_REPEAT(27), - [113] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_document_repeat1, 2, 0, 0), - [115] = {.entry = {.count = 1, .reusable = false}}, SHIFT(50), - [117] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), - [119] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24), - [121] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_description_repeat1, 2, 0, 0), SHIFT_REPEAT(50), - [124] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_description_repeat1, 2, 0, 0), SHIFT_REPEAT(24), - [127] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tag, 6, 0, 0), - [129] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tag, 6, 0, 0), - [131] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tag, 3, 0, 0), - [133] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tag, 3, 0, 0), - [135] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), - [137] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), - [139] = {.entry = {.count = 1, .reusable = true}}, SHIFT(43), - [141] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_document, 4, 0, 0), - [143] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), - [145] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), - [147] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), - [149] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), - [151] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), - [153] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3), - [155] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_document, 3, 0, 0), - [157] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35), - [159] = {.entry = {.count = 1, .reusable = true}}, SHIFT(38), - [161] = {.entry = {.count = 1, .reusable = true}}, SHIFT(42), - [163] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32), - [165] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_document, 2, 0, 0), - [167] = {.entry = {.count = 1, .reusable = true}}, SHIFT(33), + [100] = {.entry = {.count = 1, .reusable = true}}, SHIFT(40), + [102] = {.entry = {.count = 1, .reusable = true}}, SHIFT(38), + [104] = {.entry = {.count = 1, .reusable = false}}, SHIFT(50), + [106] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), + [108] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_document_repeat1, 2, 0, 0), SHIFT_REPEAT(2), + [111] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_document_repeat1, 2, 0, 0), SHIFT_REPEAT(17), + [114] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_document_repeat1, 2, 0, 0), SHIFT_REPEAT(24), + [117] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_document_repeat1, 2, 0, 0), + [119] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_description_repeat1, 2, 0, 0), SHIFT_REPEAT(50), + [122] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_description_repeat1, 2, 0, 0), SHIFT_REPEAT(26), + [125] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), + [127] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tag, 3, 0, 0), + [129] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tag, 3, 0, 0), + [131] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tag, 6, 0, 0), + [133] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tag, 6, 0, 0), + [135] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), + [137] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), + [139] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), + [141] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), + [143] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_document, 3, 0, 0), + [145] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [147] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_document, 4, 0, 0), + [149] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_document, 2, 0, 0), + [151] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3), + [153] = {.entry = {.count = 1, .reusable = true}}, SHIFT(42), + [155] = {.entry = {.count = 1, .reusable = true}}, SHIFT(45), + [157] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), + [159] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37), + [161] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), + [163] = {.entry = {.count = 1, .reusable = true}}, SHIFT(33), + [165] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31), + [167] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35), }; enum ts_external_scanner_symbol_identifiers { diff --git a/src/tree_sitter/parser.h b/src/tree_sitter/parser.h index 17f0e94..799f599 100644 --- a/src/tree_sitter/parser.h +++ b/src/tree_sitter/parser.h @@ -47,6 +47,7 @@ struct TSLexer { uint32_t (*get_column)(TSLexer *); bool (*is_at_included_range_start)(const TSLexer *); bool (*eof)(const TSLexer *); + void (*log)(const TSLexer *, const char *, ...); }; typedef enum {