[
  {
    "path": ".editorconfig",
    "content": "root = true\n\n[*]\ncharset = utf-8\n\n[*.{json,toml,yml,gyp}]\nindent_style = space\nindent_size = 2\n\n[*.js]\nindent_style = space\nindent_size = 2\n\n[*.scm]\nindent_style = space\nindent_size = 2\n\n[*.{c,cc,h}]\nindent_style = space\nindent_size = 4\n\n[*.rs]\nindent_style = space\nindent_size = 4\n\n[*.{py,pyi}]\nindent_style = space\nindent_size = 4\n\n[*.swift]\nindent_style = space\nindent_size = 4\n\n[*.go]\nindent_style = tab\nindent_size = 8\n\n[Makefile]\nindent_style = tab\nindent_size = 8\n\n[parser.c]\nindent_size = 2\n\n[{alloc,array,parser}.h]\nindent_size = 2\n"
  },
  {
    "path": ".gitattributes",
    "content": "* text=auto eol=lf\n\n# Generated source files\nsrc/*.json linguist-generated\nsrc/parser.c linguist-generated\nsrc/tree_sitter/* linguist-generated\n\n# C bindings\nbindings/c/** linguist-generated\nCMakeLists.txt linguist-generated\nMakefile linguist-generated\n\n# Rust bindings\nbindings/rust/* linguist-generated\nCargo.toml linguist-generated\nCargo.lock linguist-generated\n\n# Node.js bindings\nbindings/node/* linguist-generated\nbinding.gyp linguist-generated\npackage.json linguist-generated\npackage-lock.json linguist-generated\n\n# Python bindings\nbindings/python/** linguist-generated\nsetup.py linguist-generated\npyproject.toml linguist-generated\n\n# Go bindings\nbindings/go/* linguist-generated\ngo.mod linguist-generated\ngo.sum linguist-generated\n\n# Swift bindings\nbindings/swift/** linguist-generated\nPackage.swift linguist-generated\nPackage.resolved linguist-generated\n\n# Zig bindings\nbuild.zig linguist-generated\nbuild.zig.zon linguist-generated\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "github: stsewd\ncustom:\n  - https://paypal.me/stsewd\n  - https://www.buymeacoffee.com/stsewd\n"
  },
  {
    "path": ".github/workflows/ci.yaml",
    "content": "name: CI\n\non:\n  push:\n    branches: [ master ]\n  pull_request:\n    branches: [ master ]\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - name: Set up tree-sitter\n        uses: tree-sitter/setup-action/cli@v2\n      - name: Run tests\n        uses: tree-sitter/parser-test-action@v2\n        with:\n          test-rust: true\n          test-node: false\n          test-python: true\n          test-go: false\n          test-swift: false\n  windows:\n    runs-on: windows-latest\n    steps:\n      - uses: actions/checkout@v4\n      - name: Set up tree-sitter\n        uses: tree-sitter/setup-action/cli@v2\n      - name: Run tests\n        uses: tree-sitter/parser-test-action@v2\n        with:\n          test-rust: true\n          test-node: false\n          test-python: true\n          test-go: false\n          test-swift: false\n  mac:\n    runs-on: macos-latest\n    steps:\n      - uses: actions/checkout@v4\n      - name: Set up tree-sitter\n        uses: tree-sitter/setup-action/cli@v2\n      - name: Run tests\n        uses: tree-sitter/parser-test-action@v2\n        with:\n          test-rust: true\n          test-node: false\n          test-python: true\n          test-go: false\n          test-swift: false\n"
  },
  {
    "path": ".github/workflows/publish.yml",
    "content": "name: Publish package\n\non:\n  push:\n    tags: [\"*\"]\n\nconcurrency:\n  group: ${{github.workflow}}-${{github.ref}}\n  cancel-in-progress: true\n\njobs:\n  npm:\n    uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main\n    secrets:\n      NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}\n    with:\n      package-name: \"tree-sitter-comment\"\n  crates:\n    uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main\n    secrets:\n      CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_TOKEN}}\n    with:\n      package-name: \"tree-sitter-comment\"\n  pypi:\n    uses: tree-sitter/workflows/.github/workflows/package-pypi.yml@main\n    secrets:\n      PYPI_API_TOKEN: ${{secrets.PYPI_TOKEN}}\n    with:\n      package-name: \"tree-sitter-comment\"\n"
  },
  {
    "path": ".gitignore",
    "content": "/log.html\n\n# Rust artifacts\n/target\nbuild/\n\n# Node artifacts\nbuild/\nprebuilds/\nnode_modules/\n\n# Swift artifacts\n.build/\n\n# Go artifacts\n_obj/\n\n# Python artifacts\n.venv/\ndist/\n*.egg-info\n*.whl\n\n# C artifacts\n*.a\n*.so\n*.so.*\n*.dylib\n*.dll\n*.pc\n*.exp\n*.lib\n\n# Zig artifacts\n.zig-cache/\nzig-cache/\nzig-out/\n\n# Example dirs\n/examples/*/\n\n# Grammar volatiles\n*.wasm\n*.obj\n*.o\n\n# Archives\n*.tar.gz\n*.tgz\n*.zip\n"
  },
  {
    "path": "CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 3.13)\n\nproject(tree-sitter-comment\n        VERSION \"0.3.0\"\n        DESCRIPTION \"Grammar for code tags like TODO:, FIXME(user): for the tree-sitter parsing library\"\n        HOMEPAGE_URL \"https://github.com/stsewd/tree-sitter-comment\"\n        LANGUAGES C)\n\noption(BUILD_SHARED_LIBS \"Build using shared libraries\" ON)\noption(TREE_SITTER_REUSE_ALLOCATOR \"Reuse the library allocator\" OFF)\n\nset(TREE_SITTER_ABI_VERSION 15 CACHE STRING \"Tree-sitter ABI version\")\nif(NOT ${TREE_SITTER_ABI_VERSION} MATCHES \"^[0-9]+$\")\n    unset(TREE_SITTER_ABI_VERSION CACHE)\n    message(FATAL_ERROR \"TREE_SITTER_ABI_VERSION must be an integer\")\nendif()\n\nfind_program(TREE_SITTER_CLI tree-sitter DOC \"Tree-sitter CLI\")\n\nadd_custom_command(OUTPUT \"${CMAKE_CURRENT_SOURCE_DIR}/src/parser.c\"\n                   DEPENDS \"${CMAKE_CURRENT_SOURCE_DIR}/src/grammar.json\"\n                   COMMAND \"${TREE_SITTER_CLI}\" generate src/grammar.json\n                            --abi=${TREE_SITTER_ABI_VERSION}\n                   WORKING_DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}\"\n                   COMMENT \"Generating parser.c\")\n\nadd_library(tree-sitter-comment src/parser.c)\nif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/scanner.c)\n  target_sources(tree-sitter-comment PRIVATE src/scanner.c)\nendif()\ntarget_include_directories(tree-sitter-comment\n                           PRIVATE src\n                           INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/bindings/c>\n                                     $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)\n\ntarget_compile_definitions(tree-sitter-comment PRIVATE\n                           $<$<BOOL:${TREE_SITTER_REUSE_ALLOCATOR}>:TREE_SITTER_REUSE_ALLOCATOR>\n                           $<$<CONFIG:Debug>:TREE_SITTER_DEBUG>)\n\nset_target_properties(tree-sitter-comment\n                      PROPERTIES\n                      C_STANDARD 11\n                      POSITION_INDEPENDENT_CODE ON\n                      SOVERSION \"${TREE_SITTER_ABI_VERSION}.${PROJECT_VERSION_MAJOR}\"\n                      DEFINE_SYMBOL \"\")\n\nconfigure_file(bindings/c/tree-sitter-comment.pc.in\n               \"${CMAKE_CURRENT_BINARY_DIR}/tree-sitter-comment.pc\" @ONLY)\n\ninclude(GNUInstallDirs)\n\ninstall(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/bindings/c/tree_sitter\"\n        DESTINATION \"${CMAKE_INSTALL_INCLUDEDIR}\"\n        FILES_MATCHING PATTERN \"*.h\")\ninstall(FILES \"${CMAKE_CURRENT_BINARY_DIR}/tree-sitter-comment.pc\"\n        DESTINATION \"${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig\")\ninstall(TARGETS tree-sitter-comment\n        LIBRARY DESTINATION \"${CMAKE_INSTALL_LIBDIR}\")\n\nfile(GLOB QUERIES queries/*.scm)\ninstall(FILES ${QUERIES}\n        DESTINATION \"${CMAKE_INSTALL_DATADIR}/tree-sitter/queries/comment\")\n\nadd_custom_target(ts-test \"${TREE_SITTER_CLI}\" test\n                  WORKING_DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}\"\n                  COMMENT \"tree-sitter test\")\n"
  },
  {
    "path": "Cargo.toml",
    "content": "[package]\nname = \"tree-sitter-comment\"\ndescription = \"Grammar for code tags like TODO:, FIXME(user): for the tree-sitter parsing library\"\nversion = \"0.3.0\"\nauthors = [\"Santos Gallegos <stsewd@proton.me>\"]\nlicense = \"MIT\"\nreadme = \"README.md\"\nkeywords = [\"incremental\", \"parsing\", \"tree-sitter\", \"comment\"]\ncategories = [\"parser-implementations\", \"parsing\", \"text-editors\"]\nrepository = \"https://github.com/stsewd/tree-sitter-comment\"\nedition = \"2021\"\nautoexamples = false\n\nbuild = \"bindings/rust/build.rs\"\ninclude = [\n  \"bindings/rust/*\",\n  \"grammar.js\",\n  \"queries/*\",\n  \"src/*\",\n  \"tree-sitter.json\",\n  \"LICENSE\",\n]\n\n[lib]\npath = \"bindings/rust/lib.rs\"\n\n[dependencies]\ntree-sitter-language = \"0.1\"\n\n[build-dependencies]\ncc = \"1.2\"\n\n[dev-dependencies]\ntree-sitter = \"0.25.3\"\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2021 Santos Gallegos\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "Makefile",
    "content": "ifeq ($(OS),Windows_NT)\n$(error Windows is not supported)\nendif\n\nLANGUAGE_NAME := tree-sitter-comment\nHOMEPAGE_URL := https://github.com/stsewd/tree-sitter-comment\nVERSION := 0.3.0\n\n# repository\nSRC_DIR := src\n\nTS ?= tree-sitter\n\n# install directory layout\nPREFIX ?= /usr/local\nDATADIR ?= $(PREFIX)/share\nINCLUDEDIR ?= $(PREFIX)/include\nLIBDIR ?= $(PREFIX)/lib\nPCLIBDIR ?= $(LIBDIR)/pkgconfig\n\n# source/object files\nPARSER := $(SRC_DIR)/parser.c\nEXTRAS := $(filter-out $(PARSER),$(wildcard $(SRC_DIR)/*.c))\nOBJS := $(patsubst %.c,%.o,$(PARSER) $(EXTRAS))\n\n# flags\nARFLAGS ?= rcs\noverride CFLAGS += -I$(SRC_DIR) -std=c11 -fPIC\n\n# ABI versioning\nSONAME_MAJOR = $(shell sed -n 's/\\#define LANGUAGE_VERSION //p' $(PARSER))\nSONAME_MINOR = $(word 1,$(subst ., ,$(VERSION)))\n\n# OS-specific bits\nifeq ($(shell uname),Darwin)\n\tSOEXT = dylib\n\tSOEXTVER_MAJOR = $(SONAME_MAJOR).$(SOEXT)\n\tSOEXTVER = $(SONAME_MAJOR).$(SONAME_MINOR).$(SOEXT)\n\tLINKSHARED = -dynamiclib -Wl,-install_name,$(LIBDIR)/lib$(LANGUAGE_NAME).$(SOEXTVER),-rpath,@executable_path/../Frameworks\nelse\n\tSOEXT = so\n\tSOEXTVER_MAJOR = $(SOEXT).$(SONAME_MAJOR)\n\tSOEXTVER = $(SOEXT).$(SONAME_MAJOR).$(SONAME_MINOR)\n\tLINKSHARED = -shared -Wl,-soname,lib$(LANGUAGE_NAME).$(SOEXTVER)\nendif\nifneq ($(filter $(shell uname),FreeBSD NetBSD DragonFly),)\n\tPCLIBDIR := $(PREFIX)/libdata/pkgconfig\nendif\n\nall: lib$(LANGUAGE_NAME).a lib$(LANGUAGE_NAME).$(SOEXT) $(LANGUAGE_NAME).pc\n\nlib$(LANGUAGE_NAME).a: $(OBJS)\n\t$(AR) $(ARFLAGS) $@ $^\n\nlib$(LANGUAGE_NAME).$(SOEXT): $(OBJS)\n\t$(CC) $(LDFLAGS) $(LINKSHARED) $^ $(LDLIBS) -o $@\nifneq ($(STRIP),)\n\t$(STRIP) $@\nendif\n\n$(LANGUAGE_NAME).pc: bindings/c/$(LANGUAGE_NAME).pc.in\n\tsed -e 's|@PROJECT_VERSION@|$(VERSION)|' \\\n\t\t-e 's|@CMAKE_INSTALL_LIBDIR@|$(LIBDIR:$(PREFIX)/%=%)|' \\\n\t\t-e 's|@CMAKE_INSTALL_INCLUDEDIR@|$(INCLUDEDIR:$(PREFIX)/%=%)|' \\\n\t\t-e 's|@PROJECT_DESCRIPTION@|$(DESCRIPTION)|' \\\n\t\t-e 's|@PROJECT_HOMEPAGE_URL@|$(HOMEPAGE_URL)|' \\\n\t\t-e 's|@CMAKE_INSTALL_PREFIX@|$(PREFIX)|' $< > $@\n\n$(PARSER): $(SRC_DIR)/grammar.json\n\t$(TS) generate $^\n\ninstall: all\n\tinstall -d '$(DESTDIR)$(DATADIR)'/tree-sitter/queries/comment '$(DESTDIR)$(INCLUDEDIR)'/tree_sitter '$(DESTDIR)$(PCLIBDIR)' '$(DESTDIR)$(LIBDIR)'\n\tinstall -m644 bindings/c/tree_sitter/$(LANGUAGE_NAME).h '$(DESTDIR)$(INCLUDEDIR)'/tree_sitter/$(LANGUAGE_NAME).h\n\tinstall -m644 $(LANGUAGE_NAME).pc '$(DESTDIR)$(PCLIBDIR)'/$(LANGUAGE_NAME).pc\n\tinstall -m644 lib$(LANGUAGE_NAME).a '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).a\n\tinstall -m755 lib$(LANGUAGE_NAME).$(SOEXT) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER)\n\tln -sf lib$(LANGUAGE_NAME).$(SOEXTVER) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER_MAJOR)\n\tln -sf lib$(LANGUAGE_NAME).$(SOEXTVER_MAJOR) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXT)\n\tinstall -m644 queries/*.scm '$(DESTDIR)$(DATADIR)'/tree-sitter/queries/comment\n\nuninstall:\n\t$(RM) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).a \\\n\t\t'$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER) \\\n\t\t'$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER_MAJOR) \\\n\t\t'$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXT) \\\n\t\t'$(DESTDIR)$(INCLUDEDIR)'/tree_sitter/$(LANGUAGE_NAME).h \\\n\t\t'$(DESTDIR)$(PCLIBDIR)'/$(LANGUAGE_NAME).pc\n\t$(RM) -r '$(DESTDIR)$(DATADIR)'/tree-sitter/queries/comment\n\nclean:\n\t$(RM) $(OBJS) $(LANGUAGE_NAME).pc lib$(LANGUAGE_NAME).a lib$(LANGUAGE_NAME).$(SOEXT)\n\ntest:\n\t$(TS) test\n\nserve: all\n\tnpm run build\n\tnpm run prestart\n\tnpm run start\n\nrelease: all format\n\tnpm run build\n\tnpm run prestart\n\t# GitHub pages doesn't like symbolic links\n\tcp tree-sitter-comment.wasm docs/js/tree-sitter-parser.wasm\n\nformat:\n\tclang-format -i \\\n\t  --style=\"{BasedOnStyle: webkit, IndentWidth: 2}\" \\\n\t  src/scanner.c \\\n\t  src/tree_sitter_comment/*\n\n.PHONY: all install uninstall clean test serve release format\n"
  },
  {
    "path": "Package.swift",
    "content": "// swift-tools-version:5.3\n\nimport Foundation\nimport PackageDescription\n\nvar sources = [\"src/parser.c\"]\nif FileManager.default.fileExists(atPath: \"src/scanner.c\") {\n    sources.append(\"src/scanner.c\")\n}\n\nlet package = Package(\n    name: \"TreeSitterComment\",\n    products: [\n        .library(name: \"TreeSitterComment\", targets: [\"TreeSitterComment\"]),\n    ],\n    dependencies: [\n        .package(url: \"https://github.com/tree-sitter/swift-tree-sitter\", from: \"0.8.0\"),\n    ],\n    targets: [\n        .target(\n            name: \"TreeSitterComment\",\n            dependencies: [],\n            path: \".\",\n            sources: sources,\n            resources: [\n                .copy(\"queries\")\n            ],\n            publicHeadersPath: \"bindings/swift\",\n            cSettings: [.headerSearchPath(\"src\")]\n        ),\n        .testTarget(\n            name: \"TreeSitterCommentTests\",\n            dependencies: [\n                \"SwiftTreeSitter\",\n                \"TreeSitterComment\",\n            ],\n            path: \"bindings/swift/TreeSitterCommentTests\"\n        )\n    ],\n    cLanguageStandard: .c11\n)\n"
  },
  {
    "path": "README.md",
    "content": "# tree-sitter-comment\n\n[![CI](https://github.com/stsewd/tree-sitter-comment/workflows/CI/badge.svg)](https://github.com/stsewd/tree-sitter-comment/actions?query=workflow%3ACI+branch%3Amaster)\n\n[Tree-sitter](https://github.com/tree-sitter/tree-sitter) grammar for comment tags like `TODO:`, `FIXME(user):`, etc.\nUseful to be embedded inside comments.\n\nCheck the playground at <https://stsewd.dev/tree-sitter-comment/>.\n\n## Syntax\n\nSince comment tags aren't a programming language or have a standard,\nI have chosen to follow popular conventions for the syntax.\n\n### Comment tags\n\n* Comment tags can contain:\n  - Upper case ascii letters\n  - Numbers (can't start with one)\n  - `-`, `_` (they can't start or end with these characters)\n* Optionally can have an user linked to the tag inside parentheses `()`\n* The name must be followed by `:` and a whitespace\n\n### URIs\n\n* http and https links are recognized\n\nIf you think there are other popular conventions this syntax doesn't cover,\nfeel free to open a issue.\n\n## Examples\n\n```\nTODO: something needs to be done\nTODO(stsewd): something needs to be done by @stsewd\n\nXXX: fix something else.\nXXX:    extra white spaces.\n\n(NOTE: this works too).\n\nNOTE-BUG (stsewd): tags can be separated by `-`\nNOTE_BUG: or by `_`.\n\nThis will be recognized as a URI\nhttps://github.com/stsewd/\n```\n\n## FAQ\n\n### Can I match a tag that doesn't end in `:`, like `TODO`?\n\nThis grammar doesn't provide a specific token for it,\nbut you can match it with this query:\n\n```scm\n(\"text\" @todo\n (#eq? @todo \"TODO\"))\n```\n\n### Can I highlight references to issues, PRs, MRs, like `#10` or `!10`?\n\nThis grammar doesn't provide a specific token for it,\nbut you can match it with this query:\n\n```scm\n(\"text\" @issue\n (#match? @issue \"^#[0-9]+$\"))\n\n;; NOTE: This matches `!10` and `! 10`.\n(\"text\" @symbol . \"text\" @issue\n (#eq? @symbol \"!\")\n (#match? @issue \"^[0-9]+$\"))\n```\n\n### I'm using Neovim and don't see all tags highlighted\n\nTo avoid false positives, Neovim doesn't highlight all tags,\nbut a list of specific ones,\nsee the list at [`queries/comment/highlights.scm`](https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/comment/highlights.scm).\n\nIf you want your tag highlighted, you can extend the query locally, see `:h treesitter-query`.\nOr if you think it's very common, you can suggest it [upstream](https://github.com/nvim-treesitter/nvim-treesitter).\n\n## Why C?\n\nTree-sitter is a [LR parser](https://en.wikipedia.org/wiki/LR_parser) for context-free grammars,\nthat means it works great for grammars that don't require backtracking,\nor to keep a state for whitespaces (like indentation).\nFor these reasons, parsing _languages_ that need to keep a state or falling back to a general token,\nit requires some manual parsing in C.\n\n## Projects using this grammar\n\n- [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter)\n- [helix](https://github.com/helix-editor/helix)\n- [zed-comment](https://github.com/thedadams/zed-comment)\n- [zed-todo-tree](https://github.com/alexandretrotel/zed-todo-tree)\n- Yours?\n\n## Other grammars\n\n- [tree-sitter-rst](https://github.com/stsewd/tree-sitter-rst): reStructuredText grammar.\n"
  },
  {
    "path": "binding.gyp",
    "content": "{\n  \"targets\": [\n    {\n      \"target_name\": \"tree_sitter_comment_binding\",\n      \"dependencies\": [\n        \"<!(node -p \\\"require('node-addon-api').targets\\\"):node_addon_api_except\",\n      ],\n      \"include_dirs\": [\n        \"src\",\n      ],\n      \"sources\": [\n        \"bindings/node/binding.cc\",\n        \"src/parser.c\",\n      ],\n      \"variables\": {\n        \"has_scanner\": \"<!(node -p \\\"fs.existsSync('src/scanner.c')\\\")\"\n      },\n      \"conditions\": [\n        [\"has_scanner=='true'\", {\n          \"sources+\": [\"src/scanner.c\"],\n        }],\n        [\"OS!='win'\", {\n          \"cflags_c\": [\n            \"-std=c11\",\n          ],\n        }, { # OS == \"win\"\n          \"cflags_c\": [\n            \"/std:c11\",\n            \"/utf-8\",\n          ],\n        }],\n      ],\n    }\n  ]\n}\n"
  },
  {
    "path": "bindings/c/tree-sitter-comment.pc.in",
    "content": "prefix=@CMAKE_INSTALL_PREFIX@\nlibdir=${prefix}/@CMAKE_INSTALL_LIBDIR@\nincludedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@\n\nName: tree-sitter-comment\nDescription: @PROJECT_DESCRIPTION@\nURL: @PROJECT_HOMEPAGE_URL@\nVersion: @PROJECT_VERSION@\nLibs: -L${libdir} -ltree-sitter-comment\nCflags: -I${includedir}\n"
  },
  {
    "path": "bindings/c/tree_sitter/tree-sitter-comment.h",
    "content": "#ifndef TREE_SITTER_COMMENT_H_\n#define TREE_SITTER_COMMENT_H_\n\ntypedef struct TSLanguage TSLanguage;\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nconst TSLanguage *tree_sitter_comment(void);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif // TREE_SITTER_COMMENT_H_\n"
  },
  {
    "path": "bindings/go/binding.go",
    "content": "package tree_sitter_comment\n\n// #cgo CFLAGS: -std=c11 -fPIC\n// #include \"../../src/parser.c\"\n// #if __has_include(\"../../src/scanner.c\")\n// #include \"../../src/scanner.c\"\n// #endif\nimport \"C\"\n\nimport \"unsafe\"\n\n// Get the tree-sitter Language for this grammar.\nfunc Language() unsafe.Pointer {\n\treturn unsafe.Pointer(C.tree_sitter_comment())\n}\n"
  },
  {
    "path": "bindings/go/binding_test.go",
    "content": "package tree_sitter_comment_test\n\nimport (\n\t\"testing\"\n\n\ttree_sitter \"github.com/tree-sitter/go-tree-sitter\"\n\ttree_sitter_comment \"github.com/stsewd/tree-sitter-comment/bindings/go\"\n)\n\nfunc TestCanLoadGrammar(t *testing.T) {\n\tlanguage := tree_sitter.NewLanguage(tree_sitter_comment.Language())\n\tif language == nil {\n\t\tt.Errorf(\"Error loading Comment grammar\")\n\t}\n}\n"
  },
  {
    "path": "bindings/node/binding.cc",
    "content": "#include <napi.h>\n\ntypedef struct TSLanguage TSLanguage;\n\nextern \"C\" TSLanguage *tree_sitter_comment();\n\n// \"tree-sitter\", \"language\" hashed with BLAKE2\nconst napi_type_tag LANGUAGE_TYPE_TAG = {\n    0x8AF2E5212AD58ABF, 0xD5006CAD83ABBA16\n};\n\nNapi::Object Init(Napi::Env env, Napi::Object exports) {\n    auto language = Napi::External<TSLanguage>::New(env, tree_sitter_comment());\n    language.TypeTag(&LANGUAGE_TYPE_TAG);\n    exports[\"language\"] = language;\n    return exports;\n}\n\nNODE_API_MODULE(tree_sitter_comment_binding, Init)\n"
  },
  {
    "path": "bindings/node/binding_test.js",
    "content": "const assert = require(\"node:assert\");\nconst { test } = require(\"node:test\");\n\nconst Parser = require(\"tree-sitter\");\n\ntest(\"can load grammar\", () => {\n  const parser = new Parser();\n  assert.doesNotThrow(() => parser.setLanguage(require(\".\")));\n});\n"
  },
  {
    "path": "bindings/node/index.d.ts",
    "content": "type BaseNode = {\n  type: string;\n  named: boolean;\n};\n\ntype ChildNode = {\n  multiple: boolean;\n  required: boolean;\n  types: BaseNode[];\n};\n\ntype NodeInfo =\n  | (BaseNode & {\n      subtypes: BaseNode[];\n    })\n  | (BaseNode & {\n      fields: { [name: string]: ChildNode };\n      children: ChildNode[];\n    });\n\ntype Language = {\n  language: unknown;\n  nodeTypeInfo: NodeInfo[];\n};\n\ndeclare const language: Language;\nexport = language;\n"
  },
  {
    "path": "bindings/node/index.js",
    "content": "const root = require(\"path\").join(__dirname, \"..\", \"..\");\n\nmodule.exports =\n  typeof process.versions.bun === \"string\"\n    // Support `bun build --compile` by being statically analyzable enough to find the .node file at build-time\n    ? require(`../../prebuilds/${process.platform}-${process.arch}/tree-sitter-comment.node`)\n    : require(\"node-gyp-build\")(root);\n\ntry {\n  module.exports.nodeTypeInfo = require(\"../../src/node-types.json\");\n} catch (_) {}\n"
  },
  {
    "path": "bindings/python/tests/test_binding.py",
    "content": "from unittest import TestCase\n\nimport tree_sitter\nimport tree_sitter_comment\n\n\nclass TestLanguage(TestCase):\n    def test_can_load_grammar(self):\n        try:\n            tree_sitter.Language(tree_sitter_comment.language())\n        except Exception:\n            self.fail(\"Error loading Comment grammar\")\n"
  },
  {
    "path": "bindings/python/tree_sitter_comment/__init__.py",
    "content": "\"\"\"Grammar for code tags like TODO:, FIXME(user): for the tree-sitter parsing library\"\"\"\n\nfrom importlib.resources import files as _files\n\nfrom ._binding import language\n\n\ndef _get_query(name, file):\n    query = _files(f\"{__package__}.queries\") / file\n    globals()[name] = query.read_text()\n    return globals()[name]\n\n\ndef __getattr__(name):\n    # NOTE: uncomment these to include any queries that this grammar contains:\n\n    # if name == \"HIGHLIGHTS_QUERY\":\n    #     return _get_query(\"HIGHLIGHTS_QUERY\", \"highlights.scm\")\n    # if name == \"INJECTIONS_QUERY\":\n    #     return _get_query(\"INJECTIONS_QUERY\", \"injections.scm\")\n    # if name == \"LOCALS_QUERY\":\n    #     return _get_query(\"LOCALS_QUERY\", \"locals.scm\")\n    # if name == \"TAGS_QUERY\":\n    #     return _get_query(\"TAGS_QUERY\", \"tags.scm\")\n\n    raise AttributeError(f\"module {__name__!r} has no attribute {name!r}\")\n\n\n__all__ = [\n    \"language\",\n    # \"HIGHLIGHTS_QUERY\",\n    # \"INJECTIONS_QUERY\",\n    # \"LOCALS_QUERY\",\n    # \"TAGS_QUERY\",\n]\n\n\ndef __dir__():\n    return sorted(__all__ + [\n        \"__all__\", \"__builtins__\", \"__cached__\", \"__doc__\", \"__file__\",\n        \"__loader__\", \"__name__\", \"__package__\", \"__path__\", \"__spec__\",\n    ])\n"
  },
  {
    "path": "bindings/python/tree_sitter_comment/__init__.pyi",
    "content": "from typing import Final\n\n# NOTE: uncomment these to include any queries that this grammar contains:\n\n# HIGHLIGHTS_QUERY: Final[str]\n# INJECTIONS_QUERY: Final[str]\n# LOCALS_QUERY: Final[str]\n# TAGS_QUERY: Final[str]\n\ndef language() -> object: ...\n"
  },
  {
    "path": "bindings/python/tree_sitter_comment/binding.c",
    "content": "#include <Python.h>\n\ntypedef struct TSLanguage TSLanguage;\n\nTSLanguage *tree_sitter_comment(void);\n\nstatic PyObject* _binding_language(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(args)) {\n    return PyCapsule_New(tree_sitter_comment(), \"tree_sitter.Language\", NULL);\n}\n\nstatic struct PyModuleDef_Slot slots[] = {\n#ifdef Py_GIL_DISABLED\n    {Py_mod_gil, Py_MOD_GIL_NOT_USED},\n#endif\n    {0, NULL}\n};\n\nstatic PyMethodDef methods[] = {\n    {\"language\", _binding_language, METH_NOARGS,\n     \"Get the tree-sitter language for this grammar.\"},\n    {NULL, NULL, 0, NULL}\n};\n\nstatic struct PyModuleDef module = {\n    .m_base = PyModuleDef_HEAD_INIT,\n    .m_name = \"_binding\",\n    .m_doc = NULL,\n    .m_size = 0,\n    .m_methods = methods,\n    .m_slots = slots,\n};\n\nPyMODINIT_FUNC PyInit__binding(void) {\n    return PyModuleDef_Init(&module);\n}\n"
  },
  {
    "path": "bindings/python/tree_sitter_comment/py.typed",
    "content": ""
  },
  {
    "path": "bindings/rust/build.rs",
    "content": "fn main() {\n    let src_dir = std::path::Path::new(\"src\");\n\n    let mut c_config = cc::Build::new();\n    c_config.std(\"c11\").include(src_dir);\n\n    #[cfg(target_env = \"msvc\")]\n    c_config.flag(\"-utf-8\");\n\n    let parser_path = src_dir.join(\"parser.c\");\n    c_config.file(&parser_path);\n    println!(\"cargo:rerun-if-changed={}\", parser_path.to_str().unwrap());\n\n    let scanner_path = src_dir.join(\"scanner.c\");\n    if scanner_path.exists() {\n        c_config.file(&scanner_path);\n        println!(\"cargo:rerun-if-changed={}\", scanner_path.to_str().unwrap());\n    }\n\n    c_config.compile(\"tree-sitter-comment\");\n}\n"
  },
  {
    "path": "bindings/rust/lib.rs",
    "content": "//! This crate provides Comment language support for the [tree-sitter][] parsing library.\n//!\n//! Typically, you will use the [LANGUAGE][] constant to add this language to a\n//! tree-sitter [Parser][], and then use the parser to parse some code:\n//!\n//! ```\n//! let code = r#\"\n//! \"#;\n//! let mut parser = tree_sitter::Parser::new();\n//! let language = tree_sitter_comment::LANGUAGE;\n//! parser\n//!     .set_language(&language.into())\n//!     .expect(\"Error loading Comment parser\");\n//! let tree = parser.parse(code, None).unwrap();\n//! assert!(!tree.root_node().has_error());\n//! ```\n//!\n//! [Parser]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Parser.html\n//! [tree-sitter]: https://tree-sitter.github.io/\n\nuse tree_sitter_language::LanguageFn;\n\nextern \"C\" {\n    fn tree_sitter_comment() -> *const ();\n}\n\n/// The tree-sitter [`LanguageFn`][LanguageFn] for this grammar.\n///\n/// [LanguageFn]: https://docs.rs/tree-sitter-language/*/tree_sitter_language/struct.LanguageFn.html\npub const LANGUAGE: LanguageFn = unsafe { LanguageFn::from_raw(tree_sitter_comment) };\n\n/// The content of the [`node-types.json`][] file for this grammar.\n///\n/// [`node-types.json`]: https://tree-sitter.github.io/tree-sitter/using-parsers/6-static-node-types\npub const NODE_TYPES: &str = include_str!(\"../../src/node-types.json\");\n\n// NOTE: uncomment these to include any queries that this grammar contains:\n\n// pub const HIGHLIGHTS_QUERY: &str = include_str!(\"../../queries/highlights.scm\");\n// pub const INJECTIONS_QUERY: &str = include_str!(\"../../queries/injections.scm\");\n// pub const LOCALS_QUERY: &str = include_str!(\"../../queries/locals.scm\");\n// pub const TAGS_QUERY: &str = include_str!(\"../../queries/tags.scm\");\n\n#[cfg(test)]\nmod tests {\n    #[test]\n    fn test_can_load_grammar() {\n        let mut parser = tree_sitter::Parser::new();\n        parser\n            .set_language(&super::LANGUAGE.into())\n            .expect(\"Error loading Comment parser\");\n    }\n}\n"
  },
  {
    "path": "bindings/swift/TreeSitterComment/comment.h",
    "content": "#ifndef TREE_SITTER_COMMENT_H_\n#define TREE_SITTER_COMMENT_H_\n\ntypedef struct TSLanguage TSLanguage;\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nconst TSLanguage *tree_sitter_comment(void);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif // TREE_SITTER_COMMENT_H_\n"
  },
  {
    "path": "bindings/swift/TreeSitterCommentTests/TreeSitterCommentTests.swift",
    "content": "import XCTest\nimport SwiftTreeSitter\nimport TreeSitterComment\n\nfinal class TreeSitterCommentTests: XCTestCase {\n    func testCanLoadGrammar() throws {\n        let parser = Parser()\n        let language = Language(language: tree_sitter_comment())\n        XCTAssertNoThrow(try parser.setLanguage(language),\n                         \"Error loading Comment grammar\")\n    }\n}\n"
  },
  {
    "path": "compile_flags.txt",
    "content": "-Isrc/\n-std=c99\n"
  },
  {
    "path": "docs/.nojekyll",
    "content": ""
  },
  {
    "path": "docs/index.html",
    "content": "<!-- Extracted from the `tree-sitter playground` command. -->\n<head>\n  <meta charset=\"utf-8\">\n  <title>Tree-sitter grammar for code tags like TODO:, FIXME(user): - tree-sitter-comment</title>\n  <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/codemirror.min.css\">\n  <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/clusterize.js/0.19.0/clusterize.min.css\">\n  <link rel=\"icon\" type=\"image/png\" href=\"https://tree-sitter.github.io/tree-sitter/assets/images/favicon-32x32.png\"\n    sizes=\"32x32\" />\n  <link rel=\"icon\" type=\"image/png\" href=\"https://tree-sitter.github.io/tree-sitter/assets/images/favicon-16x16.png\"\n    sizes=\"16x16\" />\n</head>\n\n<body>\n  <div id=\"playground-container\" style=\"visibility: hidden;\">\n    <header>\n      <div class=\"header-item\">\n        <span class=\"language-name\">\n          <a href=\"https://github.com/stsewd/tree-sitter-comment\" target=\"_blank\">\n            tree-sitter-comment\n          </a>\n        </span>\n      </div>\n\n      <div class=\"header-item\">\n        <input id=\"logging-checkbox\" type=\"checkbox\">\n        <label for=\"logging-checkbox\">log</label>\n      </div>\n\n      <div class=\"header-item\">\n        <input id=\"anonymous-nodes-checkbox\" type=\"checkbox\">\n        <label for=\"anonymous-nodes-checkbox\">show anonymous nodes</label>\n      </div>\n\n      <div class=\"header-item\">\n        <input id=\"query-checkbox\" type=\"checkbox\">\n        <label for=\"query-checkbox\">query</label>\n      </div>\n\n      <div class=\"header-item\">\n        <input id=\"accessibility-checkbox\" type=\"checkbox\">\n        <label for=\"accessibility-checkbox\">accessibility</label>\n      </div>\n\n      <div class=\"header-item\">\n        <label for=\"update-time\">parse time: </label>\n        <span id=\"update-time\"></span>\n      </div>\n\n      <div class=\"header-item\">\n        <a href=\"https://tree-sitter.github.io/tree-sitter/7-playground.html#about\">(?)</a>\n      </div>\n\n      <select id=\"language-select\" style=\"display: none;\">\n        <option value=\"parser\">Parser</option>\n      </select>\n\n      <div class=\"header-item\">\n        <button id=\"theme-toggle\" class=\"theme-toggle\" aria-label=\"Toggle theme\">\n          <svg class=\"sun-icon\" viewBox=\"0 0 24 24\" width=\"16\" height=\"16\">\n            <path fill=\"currentColor\"\n              d=\"M12 17.5a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11zm0 1.5a7 7 0 1 1 0-14 7 7 0 0 1 0 14zm0-16a1 1 0 0 1 1 1v2a1 1 0 1 1-2 0V4a1 1 0 0 1 1-1zm0 15a1 1 0 0 1 1 1v2a1 1 0 1 1-2 0v-2a1 1 0 0 1 1-1zm9-9a1 1 0 0 1-1 1h-2a1 1 0 1 1 0-2h2a1 1 0 0 1 1 1zM4 12a1 1 0 0 1-1 1H1a1 1 0 1 1 0-2h2a1 1 0 0 1 1 1z\" />\n          </svg>\n          <svg class=\"moon-icon\" viewBox=\"0 0 24 24\" width=\"16\" height=\"16\">\n            <path fill=\"currentColor\"\n              d=\"M12.1 22c-5.5 0-10-4.5-10-10s4.5-10 10-10c.2 0 .3 0 .5.1-1.3 1.4-2 3.2-2 5.2 0 4.1 3.4 7.5 7.5 7.5 2 0 3.8-.7 5.2-2 .1.2.1.3.1.5 0 5.4-4.5 9.7-10 9.7z\" />\n          </svg>\n        </button>\n      </div>\n    </header>\n\n    <main>\n      <div id=\"input-pane\">\n        <div class=\"panel-header\">Code</div>\n        <div id=\"code-container\">\n          <textarea id=\"code-input\"></textarea>\n        </div>\n\n        <div id=\"query-container\" style=\"visibility: hidden; position: absolute;\">\n          <div class=\"panel-header\">Query</div>\n          <textarea id=\"query-input\"></textarea>\n        </div>\n      </div>\n\n      <div id=\"output-container-scroll\">\n        <div class=\"panel-header\">Tree</div>\n        <pre id=\"output-container\" class=\"highlight\"></pre>\n      </div>\n    </main>\n  </div>\n\n  <script src=\"https://code.jquery.com/jquery-3.3.1.min.js\" crossorigin=\"anonymous\">\n  </script>\n\n  <script src=\"https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/codemirror.min.js\"></script>\n  <script src=\"https://cdnjs.cloudflare.com/ajax/libs/clusterize.js/0.19.0/clusterize.min.js\"></script>\n\n  <script>LANGUAGE_BASE_URL = \"js\";</script>\n  <script type=\"module\" src=\"js/playground.js\"></script>\n  <script type=\"module\">\n    import * as TreeSitter from './js/tree-sitter.js';\n    window.TreeSitter = TreeSitter;\n    setTimeout(() => window.initializePlayground({local: true}), 1)\n  </script>\n\n  <script>\n    (codeExample => {\n      const handle = setInterval(() => {\n        const $codeEditor = document.querySelector('.CodeMirror');\n        if ($codeEditor) {\n          $codeEditor.CodeMirror.setValue(codeExample);\n          clearInterval(handle);\n        }\n      }, 500);\n    })(`TODO: something needs to be done\nTODO(stsewd): something needs to be done by @stsewd\n\nXXX: fix something else.\nXXX:    extra white spaces.\n\n(NOTE: this works too).\n\nNOTE-BUG (stsewd): tags can be separated by \\`-\\`\nNOTE_BUG: or by \\`_\\`.\n\nNOTE: check https://github.com/stsewd/tree-sitter-comment`);\n  </script>\n\n\n  <style>\n    /* Base Variables */\n    :root {\n      --light-bg: #f9f9f9;\n      --light-border: #e0e0e0;\n      --light-text: #333;\n      --light-hover-border: #c1c1c1;\n      --light-scrollbar-track: #f1f1f1;\n      --light-scrollbar-thumb: #c1c1c1;\n      --light-scrollbar-thumb-hover: #a8a8a8;\n\n      --dark-bg: #1d1f21;\n      --dark-border: #2d2d2d;\n      --dark-text: #c5c8c6;\n      --dark-panel-bg: #252526;\n      --dark-code-bg: #1e1e1e;\n      --dark-scrollbar-track: #25282c;\n      --dark-scrollbar-thumb: #4a4d51;\n      --dark-scrollbar-thumb-hover: #5a5d61;\n\n      --primary-color: #0550ae;\n      --primary-color-alpha: rgba(5, 80, 174, 0.1);\n      --primary-color-alpha-dark: rgba(121, 192, 255, 0.1);\n      --selection-color: rgba(39, 95, 255, 0.3);\n    }\n\n    /* Theme Colors */\n    [data-theme=\"dark\"] {\n      --bg-color: var(--dark-bg);\n      --border-color: var(--dark-border);\n      --text-color: var(--dark-text);\n      --panel-bg: var(--dark-panel-bg);\n      --code-bg: var(--dark-code-bg);\n    }\n\n    [data-theme=\"light\"] {\n      --bg-color: var(--light-bg);\n      --border-color: var(--light-border);\n      --text-color: var(--light-text);\n      --panel-bg: white;\n      --code-bg: white;\n    }\n\n    /* Base Styles */\n    body {\n      margin: 0;\n      padding: 0;\n      font-family: system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;\n      background-color: var(--bg-color);\n      color: var(--text-color);\n    }\n\n    /* Layout */\n    #playground-container {\n      width: 100%;\n      height: 100vh;\n      display: flex;\n      flex-direction: column;\n      background-color: var(--bg-color);\n    }\n\n    header {\n      padding: 16px 24px;\n      border-bottom: 1px solid var(--border-color);\n      display: flex;\n      align-items: center;\n      gap: 20px;\n      background-color: var(--panel-bg);\n      font-size: 14px;\n    }\n\n    .header-item {\n      display: flex;\n      align-items: center;\n      gap: 8px;\n    }\n\n    .language-name {\n      font-weight: 600;\n    }\n\n    main {\n      flex: 1;\n      display: flex;\n      overflow: hidden;\n    }\n\n    #input-pane {\n      width: 50%;\n      display: flex;\n      flex-direction: column;\n      border-right: 1px solid var(--border-color);\n      background-color: var(--panel-bg);\n      overflow: hidden;\n    }\n\n    #code-container {\n      flex: 1;\n      min-height: 0;\n      position: relative;\n      border-bottom: 1px solid var(--border-color);\n      display: flex;\n      flex-direction: column;\n    }\n\n    #query-container:not([style*=\"visibility: hidden\"]) {\n      flex: 1;\n      min-height: 0;\n      display: flex;\n      flex-direction: column;\n    }\n\n    #query-container .panel-header {\n      flex: 0 0 auto;\n    }\n\n    #query-container .CodeMirror {\n      flex: 1;\n      position: relative;\n      min-height: 0;\n    }\n\n    #output-container-scroll {\n      width: 50%;\n      overflow: auto;\n      background-color: var(--panel-bg);\n      padding: 0;\n      display: flex;\n      flex-direction: column;\n    }\n\n    #output-container {\n      font-family: ui-monospace, \"SF Mono\", Menlo, Consolas, monospace;\n      line-height: 1.5;\n      margin: 0;\n      padding: 16px;\n    }\n\n    .panel-header {\n      padding: 8px 16px;\n      font-weight: 600;\n      font-size: 14px;\n      border-bottom: 1px solid var(--border-color);\n      background-color: var(--panel-bg);\n    }\n\n    .CodeMirror {\n      position: absolute;\n      top: 0;\n      left: 0;\n      right: 0;\n      bottom: 0;\n      height: 100%;\n      font-family: ui-monospace, \"SF Mono\", Menlo, Consolas, monospace;\n      font-size: 14px;\n      line-height: 1.6;\n      background-color: var(--code-bg) !important;\n      color: var(--text-color) !important;\n    }\n\n    .query-error {\n      text-decoration: underline red dashed;\n      -webkit-text-decoration: underline red dashed;\n    }\n\n    /* Scrollbars */\n    ::-webkit-scrollbar {\n      width: 8px;\n      height: 8px;\n    }\n\n    ::-webkit-scrollbar-track {\n      border-radius: 4px;\n      background: var(--light-scrollbar-track);\n    }\n\n    ::-webkit-scrollbar-thumb {\n      border-radius: 4px;\n      background: var(--light-scrollbar-thumb);\n    }\n\n    ::-webkit-scrollbar-thumb:hover {\n      background: var(--light-scrollbar-thumb-hover);\n    }\n\n    [data-theme=\"dark\"] {\n      ::-webkit-scrollbar-track {\n        background: var(--dark-scrollbar-track) !important;\n      }\n\n      ::-webkit-scrollbar-thumb {\n        background: var(--dark-scrollbar-thumb) !important;\n      }\n\n      ::-webkit-scrollbar-thumb:hover {\n        background: var(--dark-scrollbar-thumb-hover) !important;\n      }\n    }\n\n    /* Theme Toggle */\n    .theme-toggle {\n      background: none;\n      border: 1px solid var(--border-color);\n      border-radius: 4px;\n      padding: 6px;\n      cursor: pointer;\n      color: var(--text-color);\n    }\n\n    .theme-toggle:hover {\n      background-color: var(--primary-color-alpha);\n    }\n\n    [data-theme=\"light\"] .moon-icon,\n    [data-theme=\"dark\"] .sun-icon {\n      display: none;\n    }\n\n    /* Form Elements */\n    input[type=\"checkbox\"] {\n      margin-right: 6px;\n      vertical-align: middle;\n    }\n\n    label {\n      font-size: 14px;\n      margin-right: 16px;\n      cursor: pointer;\n    }\n\n    #output-container a {\n      cursor: pointer;\n      text-decoration: none;\n      color: #040404;\n      padding: 2px;\n    }\n\n    #output-container a:hover {\n      text-decoration: underline;\n    }\n\n    #output-container a.node-link.named {\n      color: #0550ae;\n    }\n\n    #output-container a.node-link.anonymous {\n      color: #116329;\n    }\n\n    #output-container a.node-link.anonymous:before {\n      content: '\"';\n    }\n\n    #output-container a.node-link.anonymous:after {\n      content: '\"';\n    }\n\n    #output-container a.node-link.error {\n      color: #cf222e;\n    }\n\n    #output-container a.highlighted {\n      background-color: #d9d9d9;\n      color: red;\n      border-radius: 3px;\n      text-decoration: underline;\n    }\n\n    /* Dark Theme Node Colors */\n    [data-theme=\"dark\"] {\n      & #output-container a {\n        color: #d4d4d4;\n      }\n\n      & #output-container a.node-link.named {\n        color: #79c0ff;\n      }\n\n      & #output-container a.node-link.anonymous {\n        color: #7ee787;\n      }\n\n      & #output-container a.node-link.error {\n        color: #ff7b72;\n      }\n\n      & #output-container a.highlighted {\n        background-color: #373b41;\n        color: red;\n      }\n\n      & .CodeMirror {\n        background-color: var(--dark-code-bg) !important;\n        color: var(--dark-text) !important;\n      }\n\n      & .CodeMirror-gutters {\n        background-color: var(--dark-panel-bg) !important;\n        border-color: var(--dark-border) !important;\n      }\n\n      & .CodeMirror-cursor {\n        border-color: var(--dark-text) !important;\n      }\n\n      & .CodeMirror-selected {\n        background-color: rgba(255, 255, 255, 0.1) !important;\n      }\n    }\n  </style>\n</body>\n"
  },
  {
    "path": "docs/js/playground.js",
    "content": "function initializeLocalTheme() {\n  const themeToggle = document.getElementById('theme-toggle');\n  if (!themeToggle) return;\n\n  // Load saved theme or use system preference\n  const savedTheme = localStorage.getItem('theme');\n  const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;\n  const initialTheme = savedTheme || (prefersDark ? 'dark' : 'light');\n\n  // Set initial theme\n  document.documentElement.setAttribute('data-theme', initialTheme);\n\n  themeToggle.addEventListener('click', () => {\n    const currentTheme = document.documentElement.getAttribute('data-theme');\n    const newTheme = currentTheme === 'light' ? 'dark' : 'light';\n    document.documentElement.setAttribute('data-theme', newTheme);\n    localStorage.setItem('theme', newTheme);\n  });\n}\n\nfunction initializeCustomSelect({ initialValue = null, addListeners = false }) {\n  const button = document.getElementById('language-button');\n  const select = document.getElementById('language-select');\n  if (!button || !select) return;\n\n  const dropdown = button.nextElementSibling;\n  const selectedValue = button.querySelector('.selected-value');\n\n  if (initialValue) {\n    select.value = initialValue;\n  }\n  if (select.selectedIndex >= 0 && select.options[select.selectedIndex]) {\n    selectedValue.textContent = select.options[select.selectedIndex].text;\n  } else {\n    selectedValue.textContent = 'JavaScript';\n  }\n\n  if (addListeners) {\n    button.addEventListener('click', (e) => {\n      e.preventDefault(); // Prevent form submission\n      dropdown.classList.toggle('show');\n    });\n\n    document.addEventListener('click', (e) => {\n      if (!button.contains(e.target)) {\n        dropdown.classList.remove('show');\n      }\n    });\n\n    dropdown.querySelectorAll('.option').forEach(option => {\n      option.addEventListener('click', () => {\n        selectedValue.textContent = option.textContent;\n        select.value = option.dataset.value;\n        dropdown.classList.remove('show');\n\n        const event = new Event('change');\n        select.dispatchEvent(event);\n      });\n    });\n  }\n}\n\nwindow.initializePlayground = async (opts) => {\n  const { Parser, Language } = window.TreeSitter;\n\n  const { local } = opts;\n  if (local) {\n    initializeLocalTheme();\n  }\n  initializeCustomSelect({ addListeners: true });\n\n  let tree;\n\n  const CAPTURE_REGEX = /@\\s*([\\w\\._-]+)/g;\n  const LIGHT_COLORS = [\n    \"#0550ae\", // blue\n    \"#ab5000\", // rust brown\n    \"#116329\", // forest green\n    \"#844708\", // warm brown\n    \"#6639ba\", // purple\n    \"#7d4e00\", // orange brown\n    \"#0969da\", // bright blue\n    \"#1a7f37\", // green\n    \"#cf222e\", // red\n    \"#8250df\", // violet\n    \"#6e7781\", // gray\n    \"#953800\", // dark orange\n    \"#1b7c83\"  // teal\n  ];\n\n  const DARK_COLORS = [\n    \"#79c0ff\", // light blue\n    \"#ffa657\", // orange\n    \"#7ee787\", // light green\n    \"#ff7b72\", // salmon\n    \"#d2a8ff\", // light purple\n    \"#ffa198\", // pink\n    \"#a5d6ff\", // pale blue\n    \"#56d364\", // bright green\n    \"#ff9492\", // light red\n    \"#e0b8ff\", // pale purple\n    \"#9ca3af\", // gray\n    \"#ffb757\", // yellow orange\n    \"#80cbc4\"  // light teal\n  ];\n\n  const codeInput = document.getElementById(\"code-input\");\n  const languageSelect = document.getElementById(\"language-select\");\n  const loggingCheckbox = document.getElementById(\"logging-checkbox\");\n  const anonymousNodes = document.getElementById('anonymous-nodes-checkbox');\n  const outputContainer = document.getElementById(\"output-container\");\n  const outputContainerScroll = document.getElementById(\n    \"output-container-scroll\",\n  );\n  const playgroundContainer = document.getElementById(\"playground-container\");\n  const queryCheckbox = document.getElementById(\"query-checkbox\");\n  const queryContainer = document.getElementById(\"query-container\");\n  const queryInput = document.getElementById(\"query-input\");\n  const accessibilityCheckbox = document.getElementById(\"accessibility-checkbox\");\n  const updateTimeSpan = document.getElementById(\"update-time\");\n  const languagesByName = {};\n\n  loadState();\n\n  await Parser.init();\n\n  const parser = new Parser();\n\n  console.log(parser, codeInput, queryInput);\n\n  const codeEditor = CodeMirror.fromTextArea(codeInput, {\n    lineNumbers: true,\n    showCursorWhenSelecting: true\n  });\n\n  codeEditor.on('keydown', (_, event) => {\n    if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {\n      event.stopPropagation(); // Prevent mdBook from going back/forward\n    }\n  });\n\n  const queryEditor = CodeMirror.fromTextArea(queryInput, {\n    lineNumbers: true,\n    showCursorWhenSelecting: true,\n  });\n\n  queryEditor.on('keydown', (_, event) => {\n    if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {\n      event.stopPropagation(); // Prevent mdBook from going back/forward\n    }\n  });\n\n  const cluster = new Clusterize({\n    rows: [],\n    noDataText: null,\n    contentElem: outputContainer,\n    scrollElem: outputContainerScroll,\n  });\n  const renderTreeOnCodeChange = debounce(renderTree, 50);\n  const saveStateOnChange = debounce(saveState, 2000);\n  const runTreeQueryOnChange = debounce(runTreeQuery, 50);\n\n  let languageName = languageSelect.value;\n  let treeRows = null;\n  let treeRowHighlightedIndex = -1;\n  let parseCount = 0;\n  let isRendering = 0;\n  let query;\n\n  codeEditor.on(\"changes\", handleCodeChange);\n  codeEditor.on(\"viewportChange\", runTreeQueryOnChange);\n  codeEditor.on(\"cursorActivity\", debounce(handleCursorMovement, 150));\n  queryEditor.on(\"changes\", debounce(handleQueryChange, 150));\n\n  loggingCheckbox.addEventListener(\"change\", handleLoggingChange);\n  anonymousNodes.addEventListener('change', renderTree);\n  queryCheckbox.addEventListener(\"change\", handleQueryEnableChange);\n  accessibilityCheckbox.addEventListener(\"change\", handleQueryChange);\n  languageSelect.addEventListener(\"change\", handleLanguageChange);\n  outputContainer.addEventListener(\"click\", handleTreeClick);\n\n  handleQueryEnableChange();\n  await handleLanguageChange();\n\n  playgroundContainer.style.visibility = \"visible\";\n\n  async function handleLanguageChange() {\n    const newLanguageName = languageSelect.value;\n    if (!languagesByName[newLanguageName]) {\n      const url = `${LANGUAGE_BASE_URL}/tree-sitter-${newLanguageName}.wasm`;\n      languageSelect.disabled = true;\n      try {\n        languagesByName[newLanguageName] = await Language.load(url);\n      } catch (e) {\n        console.error(e);\n        languageSelect.value = languageName;\n        return;\n      } finally {\n        languageSelect.disabled = false;\n      }\n    }\n\n    tree = null;\n    languageName = newLanguageName;\n    parser.setLanguage(languagesByName[newLanguageName]);\n    handleCodeChange();\n    handleQueryChange();\n  }\n\n  async function handleCodeChange(editor, changes) {\n    const newText = codeEditor.getValue() + \"\\n\";\n    const edits = tree && changes && changes.map(treeEditForEditorChange);\n\n    const start = performance.now();\n    if (edits) {\n      for (const edit of edits) {\n        tree.edit(edit);\n      }\n    }\n    const newTree = parser.parse(newText, tree);\n    const duration = (performance.now() - start).toFixed(1);\n\n    updateTimeSpan.innerText = `${duration} ms`;\n    if (tree) tree.delete();\n    tree = newTree;\n    parseCount++;\n    renderTreeOnCodeChange();\n    runTreeQueryOnChange();\n    saveStateOnChange();\n  }\n\n  async function renderTree() {\n    isRendering++;\n    const cursor = tree.walk();\n\n    let currentRenderCount = parseCount;\n    let row = \"\";\n    let rows = [];\n    let finishedRow = false;\n    let visitedChildren = false;\n    let indentLevel = 0;\n\n    for (let i = 0; ; i++) {\n      if (i > 0 && i % 10000 === 0) {\n        await new Promise((r) => setTimeout(r, 0));\n        if (parseCount !== currentRenderCount) {\n          cursor.delete();\n          isRendering--;\n          return;\n        }\n      }\n\n      let displayName;\n      if (cursor.nodeIsMissing) {\n        const nodeTypeText = cursor.nodeIsNamed ? cursor.nodeType : `\"${cursor.nodeType}\"`;\n        displayName = `MISSING ${nodeTypeText}`;\n      } else if (cursor.nodeIsNamed) {\n        displayName = cursor.nodeType;\n      } else if (anonymousNodes.checked) {\n        displayName = cursor.nodeType\n      }\n\n      if (visitedChildren) {\n        if (displayName) {\n          finishedRow = true;\n        }\n\n        if (cursor.gotoNextSibling()) {\n          visitedChildren = false;\n        } else if (cursor.gotoParent()) {\n          visitedChildren = true;\n          indentLevel--;\n        } else {\n          break;\n        }\n      } else {\n        if (displayName) {\n          if (finishedRow) {\n            row += \"</div>\";\n            rows.push(row);\n            finishedRow = false;\n          }\n          const start = cursor.startPosition;\n          const end = cursor.endPosition;\n          const id = cursor.nodeId;\n          let fieldName = cursor.currentFieldName;\n          if (fieldName) {\n            fieldName += \": \";\n          } else {\n            fieldName = \"\";\n          }\n\n          const nodeClass =\n            displayName === 'ERROR' || displayName.startsWith('MISSING')\n              ? 'node-link error'\n              : cursor.nodeIsNamed\n                ? 'node-link named'\n                : 'node-link anonymous';\n\n          row = `<div class=\"tree-row\">${\"  \".repeat(indentLevel)}${fieldName}` +\n            `<a class='${nodeClass}' href=\"#\" data-id=${id} ` +\n            `data-range=\"${start.row},${start.column},${end.row},${end.column}\">` +\n            `${displayName}</a> <span class=\"position-info\">` +\n            `[${start.row}, ${start.column}] - [${end.row}, ${end.column}]</span>`;\n          finishedRow = true;\n        }\n\n        if (cursor.gotoFirstChild()) {\n          visitedChildren = false;\n          indentLevel++;\n        } else {\n          visitedChildren = true;\n        }\n      }\n    }\n    if (finishedRow) {\n      row += \"</div>\";\n      rows.push(row);\n    }\n\n    cursor.delete();\n    cluster.update(rows);\n    treeRows = rows;\n    isRendering--;\n    handleCursorMovement();\n  }\n\n  function getCaptureCSS(name) {\n    if (accessibilityCheckbox.checked) {\n      return `color: white; background-color: ${colorForCaptureName(name)}`;\n    } else {\n      return `color: ${colorForCaptureName(name)}`;\n    }\n  }\n\n  function runTreeQuery(_, startRow, endRow) {\n    if (endRow == null) {\n      const viewport = codeEditor.getViewport();\n      startRow = viewport.from;\n      endRow = viewport.to;\n    }\n\n    codeEditor.operation(() => {\n      const marks = codeEditor.getAllMarks();\n      marks.forEach((m) => m.clear());\n\n      if (tree && query) {\n        const captures = query.captures(\n          tree.rootNode,\n          { row: startRow, column: 0 },\n          { row: endRow, column: 0 },\n        );\n        let lastNodeId;\n        for (const { name, node } of captures) {\n          if (node.id === lastNodeId) continue;\n          lastNodeId = node.id;\n          const { startPosition, endPosition } = node;\n          codeEditor.markText(\n            { line: startPosition.row, ch: startPosition.column },\n            { line: endPosition.row, ch: endPosition.column },\n            {\n              inclusiveLeft: true,\n              inclusiveRight: true,\n              css: getCaptureCSS(name),\n            },\n          );\n        }\n      }\n    });\n  }\n\n  // When we change from a dark theme to a light theme (and vice versa), the colors of the\n  // captures need to be updated.\n  const observer = new MutationObserver((mutations) => {\n    mutations.forEach((mutation) => {\n      if (mutation.attributeName === 'class') {\n        handleQueryChange();\n      }\n    });\n  });\n\n  observer.observe(document.documentElement, {\n    attributes: true,\n    attributeFilter: ['class']\n  });\n\n  function handleQueryChange() {\n    if (query) {\n      query.delete();\n      query.deleted = true;\n      query = null;\n    }\n\n    queryEditor.operation(() => {\n      queryEditor.getAllMarks().forEach((m) => m.clear());\n      if (!queryCheckbox.checked) return;\n\n      const queryText = queryEditor.getValue();\n\n      try {\n        query = parser.language.query(queryText);\n        let match;\n\n        let row = 0;\n        queryEditor.eachLine((line) => {\n          while ((match = CAPTURE_REGEX.exec(line.text))) {\n            queryEditor.markText(\n              { line: row, ch: match.index },\n              { line: row, ch: match.index + match[0].length },\n              {\n                inclusiveLeft: true,\n                inclusiveRight: true,\n                css: `color: ${colorForCaptureName(match[1])}`,\n              },\n            );\n          }\n          row++;\n        });\n      } catch (error) {\n        const startPosition = queryEditor.posFromIndex(error.index);\n        const endPosition = {\n          line: startPosition.line,\n          ch: startPosition.ch + (error.length || Infinity),\n        };\n\n        if (error.index === queryText.length) {\n          if (startPosition.ch > 0) {\n            startPosition.ch--;\n          } else if (startPosition.row > 0) {\n            startPosition.row--;\n            startPosition.column = Infinity;\n          }\n        }\n\n        queryEditor.markText(startPosition, endPosition, {\n          className: \"query-error\",\n          inclusiveLeft: true,\n          inclusiveRight: true,\n          attributes: { title: error.message },\n        });\n      }\n    });\n\n    runTreeQuery();\n    saveQueryState();\n  }\n\n  function handleCursorMovement() {\n    if (isRendering) return;\n\n    const selection = codeEditor.getDoc().listSelections()[0];\n    let start = { row: selection.anchor.line, column: selection.anchor.ch };\n    let end = { row: selection.head.line, column: selection.head.ch };\n    if (\n      start.row > end.row ||\n      (start.row === end.row && start.column > end.column)\n    ) {\n      let swap = end;\n      end = start;\n      start = swap;\n    }\n    const node = tree.rootNode.namedDescendantForPosition(start, end);\n    if (treeRows) {\n      if (treeRowHighlightedIndex !== -1) {\n        const row = treeRows[treeRowHighlightedIndex];\n        if (row)\n          treeRows[treeRowHighlightedIndex] = row.replace(\n            \"highlighted\",\n            \"plain\",\n          );\n      }\n      treeRowHighlightedIndex = treeRows.findIndex((row) =>\n        row.includes(`data-id=${node.id}`),\n      );\n      if (treeRowHighlightedIndex !== -1) {\n        const row = treeRows[treeRowHighlightedIndex];\n        if (row)\n          treeRows[treeRowHighlightedIndex] = row.replace(\n            \"plain\",\n            \"highlighted\",\n          );\n      }\n      cluster.update(treeRows);\n      const lineHeight = cluster.options.item_height;\n      const scrollTop = outputContainerScroll.scrollTop;\n      const containerHeight = outputContainerScroll.clientHeight;\n      const offset = treeRowHighlightedIndex * lineHeight;\n      if (scrollTop > offset - 20) {\n        $(outputContainerScroll).animate({ scrollTop: offset - 20 }, 150);\n      } else if (scrollTop < offset + lineHeight + 40 - containerHeight) {\n        $(outputContainerScroll).animate(\n          { scrollTop: offset - containerHeight + 40 },\n          150,\n        );\n      }\n    }\n  }\n\n  function handleTreeClick(event) {\n    if (event.target.tagName === \"A\") {\n      event.preventDefault();\n      const [startRow, startColumn, endRow, endColumn] =\n        event.target.dataset.range.split(\",\").map((n) => parseInt(n));\n      codeEditor.focus();\n      codeEditor.setSelection(\n        { line: startRow, ch: startColumn },\n        { line: endRow, ch: endColumn },\n      );\n    }\n  }\n\n  function handleLoggingChange() {\n    if (loggingCheckbox.checked) {\n      parser.setLogger((message, lexing) => {\n        if (lexing) {\n          console.log(\"  \", message);\n        } else {\n          console.log(message);\n        }\n      });\n    } else {\n      parser.setLogger(null);\n    }\n  }\n\n  function handleQueryEnableChange() {\n    if (queryCheckbox.checked) {\n      queryContainer.style.visibility = \"\";\n      queryContainer.style.position = \"\";\n    } else {\n      queryContainer.style.visibility = \"hidden\";\n      queryContainer.style.position = \"absolute\";\n    }\n    handleQueryChange();\n  }\n\n  function treeEditForEditorChange(change) {\n    const oldLineCount = change.removed.length;\n    const newLineCount = change.text.length;\n    const lastLineLength = change.text[newLineCount - 1].length;\n\n    const startPosition = { row: change.from.line, column: change.from.ch };\n    const oldEndPosition = { row: change.to.line, column: change.to.ch };\n    const newEndPosition = {\n      row: startPosition.row + newLineCount - 1,\n      column:\n        newLineCount === 1\n          ? startPosition.column + lastLineLength\n          : lastLineLength,\n    };\n\n    const startIndex = codeEditor.indexFromPos(change.from);\n    let newEndIndex = startIndex + newLineCount - 1;\n    let oldEndIndex = startIndex + oldLineCount - 1;\n    for (let i = 0; i < newLineCount; i++) newEndIndex += change.text[i].length;\n    for (let i = 0; i < oldLineCount; i++)\n      oldEndIndex += change.removed[i].length;\n\n    return {\n      startIndex,\n      oldEndIndex,\n      newEndIndex,\n      startPosition,\n      oldEndPosition,\n      newEndPosition,\n    };\n  }\n\n  function colorForCaptureName(capture) {\n    const id = query.captureNames.indexOf(capture);\n    const isDark = document.querySelector('html').classList.contains('ayu') ||\n      document.querySelector('html').classList.contains('coal') ||\n      document.querySelector('html').classList.contains('navy');\n\n    const colors = isDark ? DARK_COLORS : LIGHT_COLORS;\n    return colors[id % colors.length];\n  }\n\n  function loadState() {\n    const language = localStorage.getItem(\"language\");\n    const sourceCode = localStorage.getItem(\"sourceCode\");\n    const anonNodes = localStorage.getItem(\"anonymousNodes\");\n    const query = localStorage.getItem(\"query\");\n    const queryEnabled = localStorage.getItem(\"queryEnabled\");\n    if (language != null && sourceCode != null && query != null) {\n      queryInput.value = query;\n      codeInput.value = sourceCode;\n      languageSelect.value = language;\n      initializeCustomSelect({ initialValue: language });\n      anonymousNodes.checked = anonNodes === \"true\";\n      queryCheckbox.checked = queryEnabled === \"true\";\n    }\n  }\n\n  function saveState() {\n    localStorage.setItem(\"language\", languageSelect.value);\n    localStorage.setItem(\"sourceCode\", codeEditor.getValue());\n    localStorage.setItem(\"anonymousNodes\", anonymousNodes.checked);\n    saveQueryState();\n  }\n\n  function saveQueryState() {\n    localStorage.setItem(\"queryEnabled\", queryCheckbox.checked);\n    localStorage.setItem(\"query\", queryEditor.getValue());\n  }\n\n  function debounce(func, wait, immediate) {\n    var timeout;\n    return function () {\n      var context = this,\n        args = arguments;\n      var later = function () {\n        timeout = null;\n        if (!immediate) func.apply(context, args);\n      };\n      var callNow = immediate && !timeout;\n      clearTimeout(timeout);\n      timeout = setTimeout(later, wait);\n      if (callNow) func.apply(context, args);\n    };\n  }\n};\n"
  },
  {
    "path": "docs/js/tree-sitter.js",
    "content": "var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __require = /* @__PURE__ */ ((x) => typeof require !== \"undefined\" ? require : typeof Proxy !== \"undefined\" ? new Proxy(x, {\n  get: (a, b) => (typeof require !== \"undefined\" ? require : a)[b]\n}) : x)(function(x) {\n  if (typeof require !== \"undefined\") return require.apply(this, arguments);\n  throw Error('Dynamic require of \"' + x + '\" is not supported');\n});\n\n// src/constants.ts\nvar SIZE_OF_SHORT = 2;\nvar SIZE_OF_INT = 4;\nvar SIZE_OF_CURSOR = 4 * SIZE_OF_INT;\nvar SIZE_OF_NODE = 5 * SIZE_OF_INT;\nvar SIZE_OF_POINT = 2 * SIZE_OF_INT;\nvar SIZE_OF_RANGE = 2 * SIZE_OF_INT + 2 * SIZE_OF_POINT;\nvar ZERO_POINT = { row: 0, column: 0 };\nvar INTERNAL = Symbol(\"INTERNAL\");\nfunction assertInternal(x) {\n  if (x !== INTERNAL) throw new Error(\"Illegal constructor\");\n}\n__name(assertInternal, \"assertInternal\");\nfunction isPoint(point) {\n  return !!point && typeof point.row === \"number\" && typeof point.column === \"number\";\n}\n__name(isPoint, \"isPoint\");\nfunction setModule(module2) {\n  C = module2;\n}\n__name(setModule, \"setModule\");\nvar C;\n\n// src/lookahead_iterator.ts\nvar LookaheadIterator = class {\n  static {\n    __name(this, \"LookaheadIterator\");\n  }\n  /** @internal */\n  [0] = 0;\n  // Internal handle for WASM\n  /** @internal */\n  language;\n  /** @internal */\n  constructor(internal, address, language) {\n    assertInternal(internal);\n    this[0] = address;\n    this.language = language;\n  }\n  /** Get the current symbol of the lookahead iterator. */\n  get currentTypeId() {\n    return C._ts_lookahead_iterator_current_symbol(this[0]);\n  }\n  /** Get the current symbol name of the lookahead iterator. */\n  get currentType() {\n    return this.language.types[this.currentTypeId] || \"ERROR\";\n  }\n  /** Delete the lookahead iterator, freeing its resources. */\n  delete() {\n    C._ts_lookahead_iterator_delete(this[0]);\n    this[0] = 0;\n  }\n  /**\n   * Reset the lookahead iterator.\n   *\n   * This returns `true` if the language was set successfully and `false`\n   * otherwise.\n   */\n  reset(language, stateId) {\n    if (C._ts_lookahead_iterator_reset(this[0], language[0], stateId)) {\n      this.language = language;\n      return true;\n    }\n    return false;\n  }\n  /**\n   * Reset the lookahead iterator to another state.\n   *\n   * This returns `true` if the iterator was reset to the given state and\n   * `false` otherwise.\n   */\n  resetState(stateId) {\n    return Boolean(C._ts_lookahead_iterator_reset_state(this[0], stateId));\n  }\n  /**\n   * Returns an iterator that iterates over the symbols of the lookahead iterator.\n   *\n   * The iterator will yield the current symbol name as a string for each step\n   * until there are no more symbols to iterate over.\n   */\n  [Symbol.iterator]() {\n    return {\n      next: /* @__PURE__ */ __name(() => {\n        if (C._ts_lookahead_iterator_next(this[0])) {\n          return { done: false, value: this.currentType };\n        }\n        return { done: true, value: \"\" };\n      }, \"next\")\n    };\n  }\n};\n\n// src/tree.ts\nfunction getText(tree, startIndex, endIndex, startPosition) {\n  const length = endIndex - startIndex;\n  let result = tree.textCallback(startIndex, startPosition);\n  if (result) {\n    startIndex += result.length;\n    while (startIndex < endIndex) {\n      const string = tree.textCallback(startIndex, startPosition);\n      if (string && string.length > 0) {\n        startIndex += string.length;\n        result += string;\n      } else {\n        break;\n      }\n    }\n    if (startIndex > endIndex) {\n      result = result.slice(0, length);\n    }\n  }\n  return result ?? \"\";\n}\n__name(getText, \"getText\");\nvar Tree = class _Tree {\n  static {\n    __name(this, \"Tree\");\n  }\n  /** @internal */\n  [0] = 0;\n  // Internal handle for WASM\n  /** @internal */\n  textCallback;\n  /** The language that was used to parse the syntax tree. */\n  language;\n  /** @internal */\n  constructor(internal, address, language, textCallback) {\n    assertInternal(internal);\n    this[0] = address;\n    this.language = language;\n    this.textCallback = textCallback;\n  }\n  /** Create a shallow copy of the syntax tree. This is very fast. */\n  copy() {\n    const address = C._ts_tree_copy(this[0]);\n    return new _Tree(INTERNAL, address, this.language, this.textCallback);\n  }\n  /** Delete the syntax tree, freeing its resources. */\n  delete() {\n    C._ts_tree_delete(this[0]);\n    this[0] = 0;\n  }\n  /** Get the root node of the syntax tree. */\n  get rootNode() {\n    C._ts_tree_root_node_wasm(this[0]);\n    return unmarshalNode(this);\n  }\n  /**\n   * Get the root node of the syntax tree, but with its position shifted\n   * forward by the given offset.\n   */\n  rootNodeWithOffset(offsetBytes, offsetExtent) {\n    const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n    C.setValue(address, offsetBytes, \"i32\");\n    marshalPoint(address + SIZE_OF_INT, offsetExtent);\n    C._ts_tree_root_node_with_offset_wasm(this[0]);\n    return unmarshalNode(this);\n  }\n  /**\n   * Edit the syntax tree to keep it in sync with source code that has been\n   * edited.\n   *\n   * You must describe the edit both in terms of byte offsets and in terms of\n   * row/column coordinates.\n   */\n  edit(edit) {\n    marshalEdit(edit);\n    C._ts_tree_edit_wasm(this[0]);\n  }\n  /** Create a new {@link TreeCursor} starting from the root of the tree. */\n  walk() {\n    return this.rootNode.walk();\n  }\n  /**\n   * Compare this old edited syntax tree to a new syntax tree representing\n   * the same document, returning a sequence of ranges whose syntactic\n   * structure has changed.\n   *\n   * For this to work correctly, this syntax tree must have been edited such\n   * that its ranges match up to the new tree. Generally, you'll want to\n   * call this method right after calling one of the [`Parser::parse`]\n   * functions. Call it on the old tree that was passed to parse, and\n   * pass the new tree that was returned from `parse`.\n   */\n  getChangedRanges(other) {\n    if (!(other instanceof _Tree)) {\n      throw new TypeError(\"Argument must be a Tree\");\n    }\n    C._ts_tree_get_changed_ranges_wasm(this[0], other[0]);\n    const count = C.getValue(TRANSFER_BUFFER, \"i32\");\n    const buffer = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, \"i32\");\n    const result = new Array(count);\n    if (count > 0) {\n      let address = buffer;\n      for (let i2 = 0; i2 < count; i2++) {\n        result[i2] = unmarshalRange(address);\n        address += SIZE_OF_RANGE;\n      }\n      C._free(buffer);\n    }\n    return result;\n  }\n  /** Get the included ranges that were used to parse the syntax tree. */\n  getIncludedRanges() {\n    C._ts_tree_included_ranges_wasm(this[0]);\n    const count = C.getValue(TRANSFER_BUFFER, \"i32\");\n    const buffer = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, \"i32\");\n    const result = new Array(count);\n    if (count > 0) {\n      let address = buffer;\n      for (let i2 = 0; i2 < count; i2++) {\n        result[i2] = unmarshalRange(address);\n        address += SIZE_OF_RANGE;\n      }\n      C._free(buffer);\n    }\n    return result;\n  }\n};\n\n// src/tree_cursor.ts\nvar TreeCursor = class _TreeCursor {\n  static {\n    __name(this, \"TreeCursor\");\n  }\n  /** @internal */\n  [0] = 0;\n  // Internal handle for WASM\n  /** @internal */\n  [1] = 0;\n  // Internal handle for WASM\n  /** @internal */\n  [2] = 0;\n  // Internal handle for WASM\n  /** @internal */\n  [3] = 0;\n  // Internal handle for WASM\n  /** @internal */\n  tree;\n  /** @internal */\n  constructor(internal, tree) {\n    assertInternal(internal);\n    this.tree = tree;\n    unmarshalTreeCursor(this);\n  }\n  /** Creates a deep copy of the tree cursor. This allocates new memory. */\n  copy() {\n    const copy = new _TreeCursor(INTERNAL, this.tree);\n    C._ts_tree_cursor_copy_wasm(this.tree[0]);\n    unmarshalTreeCursor(copy);\n    return copy;\n  }\n  /** Delete the tree cursor, freeing its resources. */\n  delete() {\n    marshalTreeCursor(this);\n    C._ts_tree_cursor_delete_wasm(this.tree[0]);\n    this[0] = this[1] = this[2] = 0;\n  }\n  /** Get the tree cursor's current {@link Node}. */\n  get currentNode() {\n    marshalTreeCursor(this);\n    C._ts_tree_cursor_current_node_wasm(this.tree[0]);\n    return unmarshalNode(this.tree);\n  }\n  /**\n   * Get the numerical field id of this tree cursor's current node.\n   *\n   * See also {@link TreeCursor#currentFieldName}.\n   */\n  get currentFieldId() {\n    marshalTreeCursor(this);\n    return C._ts_tree_cursor_current_field_id_wasm(this.tree[0]);\n  }\n  /** Get the field name of this tree cursor's current node. */\n  get currentFieldName() {\n    return this.tree.language.fields[this.currentFieldId];\n  }\n  /**\n   * Get the depth of the cursor's current node relative to the original\n   * node that the cursor was constructed with.\n   */\n  get currentDepth() {\n    marshalTreeCursor(this);\n    return C._ts_tree_cursor_current_depth_wasm(this.tree[0]);\n  }\n  /**\n   * Get the index of the cursor's current node out of all of the\n   * descendants of the original node that the cursor was constructed with.\n   */\n  get currentDescendantIndex() {\n    marshalTreeCursor(this);\n    return C._ts_tree_cursor_current_descendant_index_wasm(this.tree[0]);\n  }\n  /** Get the type of the cursor's current node. */\n  get nodeType() {\n    return this.tree.language.types[this.nodeTypeId] || \"ERROR\";\n  }\n  /** Get the type id of the cursor's current node. */\n  get nodeTypeId() {\n    marshalTreeCursor(this);\n    return C._ts_tree_cursor_current_node_type_id_wasm(this.tree[0]);\n  }\n  /** Get the state id of the cursor's current node. */\n  get nodeStateId() {\n    marshalTreeCursor(this);\n    return C._ts_tree_cursor_current_node_state_id_wasm(this.tree[0]);\n  }\n  /** Get the id of the cursor's current node. */\n  get nodeId() {\n    marshalTreeCursor(this);\n    return C._ts_tree_cursor_current_node_id_wasm(this.tree[0]);\n  }\n  /**\n   * Check if the cursor's current node is *named*.\n   *\n   * Named nodes correspond to named rules in the grammar, whereas\n   * *anonymous* nodes correspond to string literals in the grammar.\n   */\n  get nodeIsNamed() {\n    marshalTreeCursor(this);\n    return C._ts_tree_cursor_current_node_is_named_wasm(this.tree[0]) === 1;\n  }\n  /**\n   * Check if the cursor's current node is *missing*.\n   *\n   * Missing nodes are inserted by the parser in order to recover from\n   * certain kinds of syntax errors.\n   */\n  get nodeIsMissing() {\n    marshalTreeCursor(this);\n    return C._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0]) === 1;\n  }\n  /** Get the string content of the cursor's current node. */\n  get nodeText() {\n    marshalTreeCursor(this);\n    const startIndex = C._ts_tree_cursor_start_index_wasm(this.tree[0]);\n    const endIndex = C._ts_tree_cursor_end_index_wasm(this.tree[0]);\n    C._ts_tree_cursor_start_position_wasm(this.tree[0]);\n    const startPosition = unmarshalPoint(TRANSFER_BUFFER);\n    return getText(this.tree, startIndex, endIndex, startPosition);\n  }\n  /** Get the start position of the cursor's current node. */\n  get startPosition() {\n    marshalTreeCursor(this);\n    C._ts_tree_cursor_start_position_wasm(this.tree[0]);\n    return unmarshalPoint(TRANSFER_BUFFER);\n  }\n  /** Get the end position of the cursor's current node. */\n  get endPosition() {\n    marshalTreeCursor(this);\n    C._ts_tree_cursor_end_position_wasm(this.tree[0]);\n    return unmarshalPoint(TRANSFER_BUFFER);\n  }\n  /** Get the start index of the cursor's current node. */\n  get startIndex() {\n    marshalTreeCursor(this);\n    return C._ts_tree_cursor_start_index_wasm(this.tree[0]);\n  }\n  /** Get the end index of the cursor's current node. */\n  get endIndex() {\n    marshalTreeCursor(this);\n    return C._ts_tree_cursor_end_index_wasm(this.tree[0]);\n  }\n  /**\n   * Move this cursor to the first child of its current node.\n   *\n   * This returns `true` if the cursor successfully moved, and returns\n   * `false` if there were no children.\n   */\n  gotoFirstChild() {\n    marshalTreeCursor(this);\n    const result = C._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);\n    unmarshalTreeCursor(this);\n    return result === 1;\n  }\n  /**\n   * Move this cursor to the last child of its current node.\n   *\n   * This returns `true` if the cursor successfully moved, and returns\n   * `false` if there were no children.\n   *\n   * Note that this function may be slower than\n   * {@link TreeCursor#gotoFirstChild} because it needs to\n   * iterate through all the children to compute the child's position.\n   */\n  gotoLastChild() {\n    marshalTreeCursor(this);\n    const result = C._ts_tree_cursor_goto_last_child_wasm(this.tree[0]);\n    unmarshalTreeCursor(this);\n    return result === 1;\n  }\n  /**\n   * Move this cursor to the parent of its current node.\n   *\n   * This returns `true` if the cursor successfully moved, and returns\n   * `false` if there was no parent node (the cursor was already on the\n   * root node).\n   *\n   * Note that the node the cursor was constructed with is considered the root\n   * of the cursor, and the cursor cannot walk outside this node.\n   */\n  gotoParent() {\n    marshalTreeCursor(this);\n    const result = C._ts_tree_cursor_goto_parent_wasm(this.tree[0]);\n    unmarshalTreeCursor(this);\n    return result === 1;\n  }\n  /**\n   * Move this cursor to the next sibling of its current node.\n   *\n   * This returns `true` if the cursor successfully moved, and returns\n   * `false` if there was no next sibling node.\n   *\n   * Note that the node the cursor was constructed with is considered the root\n   * of the cursor, and the cursor cannot walk outside this node.\n   */\n  gotoNextSibling() {\n    marshalTreeCursor(this);\n    const result = C._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);\n    unmarshalTreeCursor(this);\n    return result === 1;\n  }\n  /**\n   * Move this cursor to the previous sibling of its current node.\n   *\n   * This returns `true` if the cursor successfully moved, and returns\n   * `false` if there was no previous sibling node.\n   *\n   * Note that this function may be slower than\n   * {@link TreeCursor#gotoNextSibling} due to how node\n   * positions are stored. In the worst case, this will need to iterate\n   * through all the children up to the previous sibling node to recalculate\n   * its position. Also note that the node the cursor was constructed with is\n   * considered the root of the cursor, and the cursor cannot walk outside this node.\n   */\n  gotoPreviousSibling() {\n    marshalTreeCursor(this);\n    const result = C._ts_tree_cursor_goto_previous_sibling_wasm(this.tree[0]);\n    unmarshalTreeCursor(this);\n    return result === 1;\n  }\n  /**\n   * Move the cursor to the node that is the nth descendant of\n   * the original node that the cursor was constructed with, where\n   * zero represents the original node itself.\n   */\n  gotoDescendant(goalDescendantIndex) {\n    marshalTreeCursor(this);\n    C._ts_tree_cursor_goto_descendant_wasm(this.tree[0], goalDescendantIndex);\n    unmarshalTreeCursor(this);\n  }\n  /**\n   * Move this cursor to the first child of its current node that contains or\n   * starts after the given byte offset.\n   *\n   * This returns `true` if the cursor successfully moved to a child node, and returns\n   * `false` if no such child was found.\n   */\n  gotoFirstChildForIndex(goalIndex) {\n    marshalTreeCursor(this);\n    C.setValue(TRANSFER_BUFFER + SIZE_OF_CURSOR, goalIndex, \"i32\");\n    const result = C._ts_tree_cursor_goto_first_child_for_index_wasm(this.tree[0]);\n    unmarshalTreeCursor(this);\n    return result === 1;\n  }\n  /**\n   * Move this cursor to the first child of its current node that contains or\n   * starts after the given byte offset.\n   *\n   * This returns the index of the child node if one was found, and returns\n   * `null` if no such child was found.\n   */\n  gotoFirstChildForPosition(goalPosition) {\n    marshalTreeCursor(this);\n    marshalPoint(TRANSFER_BUFFER + SIZE_OF_CURSOR, goalPosition);\n    const result = C._ts_tree_cursor_goto_first_child_for_position_wasm(this.tree[0]);\n    unmarshalTreeCursor(this);\n    return result === 1;\n  }\n  /**\n   * Re-initialize this tree cursor to start at the original node that the\n   * cursor was constructed with.\n   */\n  reset(node) {\n    marshalNode(node);\n    marshalTreeCursor(this, TRANSFER_BUFFER + SIZE_OF_NODE);\n    C._ts_tree_cursor_reset_wasm(this.tree[0]);\n    unmarshalTreeCursor(this);\n  }\n  /**\n   * Re-initialize a tree cursor to the same position as another cursor.\n   *\n   * Unlike {@link TreeCursor#reset}, this will not lose parent\n   * information and allows reusing already created cursors.\n   */\n  resetTo(cursor) {\n    marshalTreeCursor(this, TRANSFER_BUFFER);\n    marshalTreeCursor(cursor, TRANSFER_BUFFER + SIZE_OF_CURSOR);\n    C._ts_tree_cursor_reset_to_wasm(this.tree[0], cursor.tree[0]);\n    unmarshalTreeCursor(this);\n  }\n};\n\n// src/node.ts\nvar Node = class {\n  static {\n    __name(this, \"Node\");\n  }\n  /** @internal */\n  [0] = 0;\n  // Internal handle for WASM\n  /** @internal */\n  _children;\n  /** @internal */\n  _namedChildren;\n  /** @internal */\n  constructor(internal, {\n    id,\n    tree,\n    startIndex,\n    startPosition,\n    other\n  }) {\n    assertInternal(internal);\n    this[0] = other;\n    this.id = id;\n    this.tree = tree;\n    this.startIndex = startIndex;\n    this.startPosition = startPosition;\n  }\n  /**\n   * The numeric id for this node that is unique.\n   *\n   * Within a given syntax tree, no two nodes have the same id. However:\n   *\n   * * If a new tree is created based on an older tree, and a node from the old tree is reused in\n   *   the process, then that node will have the same id in both trees.\n   *\n   * * A node not marked as having changes does not guarantee it was reused.\n   *\n   * * If a node is marked as having changed in the old tree, it will not be reused.\n   */\n  id;\n  /** The byte index where this node starts. */\n  startIndex;\n  /** The position where this node starts. */\n  startPosition;\n  /** The tree that this node belongs to. */\n  tree;\n  /** Get this node's type as a numerical id. */\n  get typeId() {\n    marshalNode(this);\n    return C._ts_node_symbol_wasm(this.tree[0]);\n  }\n  /**\n   * Get the node's type as a numerical id as it appears in the grammar,\n   * ignoring aliases.\n   */\n  get grammarId() {\n    marshalNode(this);\n    return C._ts_node_grammar_symbol_wasm(this.tree[0]);\n  }\n  /** Get this node's type as a string. */\n  get type() {\n    return this.tree.language.types[this.typeId] || \"ERROR\";\n  }\n  /**\n   * Get this node's symbol name as it appears in the grammar, ignoring\n   * aliases as a string.\n   */\n  get grammarType() {\n    return this.tree.language.types[this.grammarId] || \"ERROR\";\n  }\n  /**\n   * Check if this node is *named*.\n   *\n   * Named nodes correspond to named rules in the grammar, whereas\n   * *anonymous* nodes correspond to string literals in the grammar.\n   */\n  get isNamed() {\n    marshalNode(this);\n    return C._ts_node_is_named_wasm(this.tree[0]) === 1;\n  }\n  /**\n   * Check if this node is *extra*.\n   *\n   * Extra nodes represent things like comments, which are not required\n   * by the grammar, but can appear anywhere.\n   */\n  get isExtra() {\n    marshalNode(this);\n    return C._ts_node_is_extra_wasm(this.tree[0]) === 1;\n  }\n  /**\n   * Check if this node represents a syntax error.\n   *\n   * Syntax errors represent parts of the code that could not be incorporated\n   * into a valid syntax tree.\n   */\n  get isError() {\n    marshalNode(this);\n    return C._ts_node_is_error_wasm(this.tree[0]) === 1;\n  }\n  /**\n   * Check if this node is *missing*.\n   *\n   * Missing nodes are inserted by the parser in order to recover from\n   * certain kinds of syntax errors.\n   */\n  get isMissing() {\n    marshalNode(this);\n    return C._ts_node_is_missing_wasm(this.tree[0]) === 1;\n  }\n  /** Check if this node has been edited. */\n  get hasChanges() {\n    marshalNode(this);\n    return C._ts_node_has_changes_wasm(this.tree[0]) === 1;\n  }\n  /**\n   * Check if this node represents a syntax error or contains any syntax\n   * errors anywhere within it.\n   */\n  get hasError() {\n    marshalNode(this);\n    return C._ts_node_has_error_wasm(this.tree[0]) === 1;\n  }\n  /** Get the byte index where this node ends. */\n  get endIndex() {\n    marshalNode(this);\n    return C._ts_node_end_index_wasm(this.tree[0]);\n  }\n  /** Get the position where this node ends. */\n  get endPosition() {\n    marshalNode(this);\n    C._ts_node_end_point_wasm(this.tree[0]);\n    return unmarshalPoint(TRANSFER_BUFFER);\n  }\n  /** Get the string content of this node. */\n  get text() {\n    return getText(this.tree, this.startIndex, this.endIndex, this.startPosition);\n  }\n  /** Get this node's parse state. */\n  get parseState() {\n    marshalNode(this);\n    return C._ts_node_parse_state_wasm(this.tree[0]);\n  }\n  /** Get the parse state after this node. */\n  get nextParseState() {\n    marshalNode(this);\n    return C._ts_node_next_parse_state_wasm(this.tree[0]);\n  }\n  /** Check if this node is equal to another node. */\n  equals(other) {\n    return this.tree === other.tree && this.id === other.id;\n  }\n  /**\n   * Get the node's child at the given index, where zero represents the first child.\n   *\n   * This method is fairly fast, but its cost is technically log(n), so if\n   * you might be iterating over a long list of children, you should use\n   * {@link Node#children} instead.\n   */\n  child(index) {\n    marshalNode(this);\n    C._ts_node_child_wasm(this.tree[0], index);\n    return unmarshalNode(this.tree);\n  }\n  /**\n   * Get this node's *named* child at the given index.\n   *\n   * See also {@link Node#isNamed}.\n   * This method is fairly fast, but its cost is technically log(n), so if\n   * you might be iterating over a long list of children, you should use\n   * {@link Node#namedChildren} instead.\n   */\n  namedChild(index) {\n    marshalNode(this);\n    C._ts_node_named_child_wasm(this.tree[0], index);\n    return unmarshalNode(this.tree);\n  }\n  /**\n   * Get this node's child with the given numerical field id.\n   *\n   * See also {@link Node#childForFieldName}. You can\n   * convert a field name to an id using {@link Language#fieldIdForName}.\n   */\n  childForFieldId(fieldId) {\n    marshalNode(this);\n    C._ts_node_child_by_field_id_wasm(this.tree[0], fieldId);\n    return unmarshalNode(this.tree);\n  }\n  /**\n   * Get the first child with the given field name.\n   *\n   * If multiple children may have the same field name, access them using\n   * {@link Node#childrenForFieldName}.\n   */\n  childForFieldName(fieldName) {\n    const fieldId = this.tree.language.fields.indexOf(fieldName);\n    if (fieldId !== -1) return this.childForFieldId(fieldId);\n    return null;\n  }\n  /** Get the field name of this node's child at the given index. */\n  fieldNameForChild(index) {\n    marshalNode(this);\n    const address = C._ts_node_field_name_for_child_wasm(this.tree[0], index);\n    if (!address) return null;\n    return C.AsciiToString(address);\n  }\n  /** Get the field name of this node's named child at the given index. */\n  fieldNameForNamedChild(index) {\n    marshalNode(this);\n    const address = C._ts_node_field_name_for_named_child_wasm(this.tree[0], index);\n    if (!address) return null;\n    return C.AsciiToString(address);\n  }\n  /**\n   * Get an array of this node's children with a given field name.\n   *\n   * See also {@link Node#children}.\n   */\n  childrenForFieldName(fieldName) {\n    const fieldId = this.tree.language.fields.indexOf(fieldName);\n    if (fieldId !== -1 && fieldId !== 0) return this.childrenForFieldId(fieldId);\n    return [];\n  }\n  /**\n    * Get an array of this node's children with a given field id.\n    *\n    * See also {@link Node#childrenForFieldName}.\n    */\n  childrenForFieldId(fieldId) {\n    marshalNode(this);\n    C._ts_node_children_by_field_id_wasm(this.tree[0], fieldId);\n    const count = C.getValue(TRANSFER_BUFFER, \"i32\");\n    const buffer = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, \"i32\");\n    const result = new Array(count);\n    if (count > 0) {\n      let address = buffer;\n      for (let i2 = 0; i2 < count; i2++) {\n        result[i2] = unmarshalNode(this.tree, address);\n        address += SIZE_OF_NODE;\n      }\n      C._free(buffer);\n    }\n    return result;\n  }\n  /** Get the node's first child that contains or starts after the given byte offset. */\n  firstChildForIndex(index) {\n    marshalNode(this);\n    const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n    C.setValue(address, index, \"i32\");\n    C._ts_node_first_child_for_byte_wasm(this.tree[0]);\n    return unmarshalNode(this.tree);\n  }\n  /** Get the node's first named child that contains or starts after the given byte offset. */\n  firstNamedChildForIndex(index) {\n    marshalNode(this);\n    const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n    C.setValue(address, index, \"i32\");\n    C._ts_node_first_named_child_for_byte_wasm(this.tree[0]);\n    return unmarshalNode(this.tree);\n  }\n  /** Get this node's number of children. */\n  get childCount() {\n    marshalNode(this);\n    return C._ts_node_child_count_wasm(this.tree[0]);\n  }\n  /**\n   * Get this node's number of *named* children.\n   *\n   * See also {@link Node#isNamed}.\n   */\n  get namedChildCount() {\n    marshalNode(this);\n    return C._ts_node_named_child_count_wasm(this.tree[0]);\n  }\n  /** Get this node's first child. */\n  get firstChild() {\n    return this.child(0);\n  }\n  /**\n   * Get this node's first named child.\n   *\n   * See also {@link Node#isNamed}.\n   */\n  get firstNamedChild() {\n    return this.namedChild(0);\n  }\n  /** Get this node's last child. */\n  get lastChild() {\n    return this.child(this.childCount - 1);\n  }\n  /**\n   * Get this node's last named child.\n   *\n   * See also {@link Node#isNamed}.\n   */\n  get lastNamedChild() {\n    return this.namedChild(this.namedChildCount - 1);\n  }\n  /**\n   * Iterate over this node's children.\n   *\n   * If you're walking the tree recursively, you may want to use the\n   * {@link TreeCursor} APIs directly instead.\n   */\n  get children() {\n    if (!this._children) {\n      marshalNode(this);\n      C._ts_node_children_wasm(this.tree[0]);\n      const count = C.getValue(TRANSFER_BUFFER, \"i32\");\n      const buffer = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, \"i32\");\n      this._children = new Array(count);\n      if (count > 0) {\n        let address = buffer;\n        for (let i2 = 0; i2 < count; i2++) {\n          this._children[i2] = unmarshalNode(this.tree, address);\n          address += SIZE_OF_NODE;\n        }\n        C._free(buffer);\n      }\n    }\n    return this._children;\n  }\n  /**\n   * Iterate over this node's named children.\n   *\n   * See also {@link Node#children}.\n   */\n  get namedChildren() {\n    if (!this._namedChildren) {\n      marshalNode(this);\n      C._ts_node_named_children_wasm(this.tree[0]);\n      const count = C.getValue(TRANSFER_BUFFER, \"i32\");\n      const buffer = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, \"i32\");\n      this._namedChildren = new Array(count);\n      if (count > 0) {\n        let address = buffer;\n        for (let i2 = 0; i2 < count; i2++) {\n          this._namedChildren[i2] = unmarshalNode(this.tree, address);\n          address += SIZE_OF_NODE;\n        }\n        C._free(buffer);\n      }\n    }\n    return this._namedChildren;\n  }\n  /**\n   * Get the descendants of this node that are the given type, or in the given types array.\n   *\n   * The types array should contain node type strings, which can be retrieved from {@link Language#types}.\n   *\n   * Additionally, a `startPosition` and `endPosition` can be passed in to restrict the search to a byte range.\n   */\n  descendantsOfType(types, startPosition = ZERO_POINT, endPosition = ZERO_POINT) {\n    if (!Array.isArray(types)) types = [types];\n    const symbols = [];\n    const typesBySymbol = this.tree.language.types;\n    for (const node_type of types) {\n      if (node_type == \"ERROR\") {\n        symbols.push(65535);\n      }\n    }\n    for (let i2 = 0, n = typesBySymbol.length; i2 < n; i2++) {\n      if (types.includes(typesBySymbol[i2])) {\n        symbols.push(i2);\n      }\n    }\n    const symbolsAddress = C._malloc(SIZE_OF_INT * symbols.length);\n    for (let i2 = 0, n = symbols.length; i2 < n; i2++) {\n      C.setValue(symbolsAddress + i2 * SIZE_OF_INT, symbols[i2], \"i32\");\n    }\n    marshalNode(this);\n    C._ts_node_descendants_of_type_wasm(\n      this.tree[0],\n      symbolsAddress,\n      symbols.length,\n      startPosition.row,\n      startPosition.column,\n      endPosition.row,\n      endPosition.column\n    );\n    const descendantCount = C.getValue(TRANSFER_BUFFER, \"i32\");\n    const descendantAddress = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, \"i32\");\n    const result = new Array(descendantCount);\n    if (descendantCount > 0) {\n      let address = descendantAddress;\n      for (let i2 = 0; i2 < descendantCount; i2++) {\n        result[i2] = unmarshalNode(this.tree, address);\n        address += SIZE_OF_NODE;\n      }\n    }\n    C._free(descendantAddress);\n    C._free(symbolsAddress);\n    return result;\n  }\n  /** Get this node's next sibling. */\n  get nextSibling() {\n    marshalNode(this);\n    C._ts_node_next_sibling_wasm(this.tree[0]);\n    return unmarshalNode(this.tree);\n  }\n  /** Get this node's previous sibling. */\n  get previousSibling() {\n    marshalNode(this);\n    C._ts_node_prev_sibling_wasm(this.tree[0]);\n    return unmarshalNode(this.tree);\n  }\n  /**\n   * Get this node's next *named* sibling.\n   *\n   * See also {@link Node#isNamed}.\n   */\n  get nextNamedSibling() {\n    marshalNode(this);\n    C._ts_node_next_named_sibling_wasm(this.tree[0]);\n    return unmarshalNode(this.tree);\n  }\n  /**\n   * Get this node's previous *named* sibling.\n   *\n   * See also {@link Node#isNamed}.\n   */\n  get previousNamedSibling() {\n    marshalNode(this);\n    C._ts_node_prev_named_sibling_wasm(this.tree[0]);\n    return unmarshalNode(this.tree);\n  }\n  /** Get the node's number of descendants, including one for the node itself. */\n  get descendantCount() {\n    marshalNode(this);\n    return C._ts_node_descendant_count_wasm(this.tree[0]);\n  }\n  /**\n   * Get this node's immediate parent.\n   * Prefer {@link Node#childWithDescendant} for iterating over this node's ancestors.\n   */\n  get parent() {\n    marshalNode(this);\n    C._ts_node_parent_wasm(this.tree[0]);\n    return unmarshalNode(this.tree);\n  }\n  /**\n   * Get the node that contains `descendant`.\n   *\n   * Note that this can return `descendant` itself.\n   */\n  childWithDescendant(descendant) {\n    marshalNode(this);\n    marshalNode(descendant);\n    C._ts_node_child_with_descendant_wasm(this.tree[0]);\n    return unmarshalNode(this.tree);\n  }\n  /** Get the smallest node within this node that spans the given byte range. */\n  descendantForIndex(start2, end = start2) {\n    if (typeof start2 !== \"number\" || typeof end !== \"number\") {\n      throw new Error(\"Arguments must be numbers\");\n    }\n    marshalNode(this);\n    const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n    C.setValue(address, start2, \"i32\");\n    C.setValue(address + SIZE_OF_INT, end, \"i32\");\n    C._ts_node_descendant_for_index_wasm(this.tree[0]);\n    return unmarshalNode(this.tree);\n  }\n  /** Get the smallest named node within this node that spans the given byte range. */\n  namedDescendantForIndex(start2, end = start2) {\n    if (typeof start2 !== \"number\" || typeof end !== \"number\") {\n      throw new Error(\"Arguments must be numbers\");\n    }\n    marshalNode(this);\n    const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n    C.setValue(address, start2, \"i32\");\n    C.setValue(address + SIZE_OF_INT, end, \"i32\");\n    C._ts_node_named_descendant_for_index_wasm(this.tree[0]);\n    return unmarshalNode(this.tree);\n  }\n  /** Get the smallest node within this node that spans the given point range. */\n  descendantForPosition(start2, end = start2) {\n    if (!isPoint(start2) || !isPoint(end)) {\n      throw new Error(\"Arguments must be {row, column} objects\");\n    }\n    marshalNode(this);\n    const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n    marshalPoint(address, start2);\n    marshalPoint(address + SIZE_OF_POINT, end);\n    C._ts_node_descendant_for_position_wasm(this.tree[0]);\n    return unmarshalNode(this.tree);\n  }\n  /** Get the smallest named node within this node that spans the given point range. */\n  namedDescendantForPosition(start2, end = start2) {\n    if (!isPoint(start2) || !isPoint(end)) {\n      throw new Error(\"Arguments must be {row, column} objects\");\n    }\n    marshalNode(this);\n    const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n    marshalPoint(address, start2);\n    marshalPoint(address + SIZE_OF_POINT, end);\n    C._ts_node_named_descendant_for_position_wasm(this.tree[0]);\n    return unmarshalNode(this.tree);\n  }\n  /**\n   * Create a new {@link TreeCursor} starting from this node.\n   *\n   * Note that the given node is considered the root of the cursor,\n   * and the cursor cannot walk outside this node.\n   */\n  walk() {\n    marshalNode(this);\n    C._ts_tree_cursor_new_wasm(this.tree[0]);\n    return new TreeCursor(INTERNAL, this.tree);\n  }\n  /**\n   * Edit this node to keep it in-sync with source code that has been edited.\n   *\n   * This function is only rarely needed. When you edit a syntax tree with\n   * the {@link Tree#edit} method, all of the nodes that you retrieve from\n   * the tree afterward will already reflect the edit. You only need to\n   * use {@link Node#edit} when you have a specific {@link Node} instance that\n   * you want to keep and continue to use after an edit.\n   */\n  edit(edit) {\n    if (this.startIndex >= edit.oldEndIndex) {\n      this.startIndex = edit.newEndIndex + (this.startIndex - edit.oldEndIndex);\n      let subbedPointRow;\n      let subbedPointColumn;\n      if (this.startPosition.row > edit.oldEndPosition.row) {\n        subbedPointRow = this.startPosition.row - edit.oldEndPosition.row;\n        subbedPointColumn = this.startPosition.column;\n      } else {\n        subbedPointRow = 0;\n        subbedPointColumn = this.startPosition.column;\n        if (this.startPosition.column >= edit.oldEndPosition.column) {\n          subbedPointColumn = this.startPosition.column - edit.oldEndPosition.column;\n        }\n      }\n      if (subbedPointRow > 0) {\n        this.startPosition.row += subbedPointRow;\n        this.startPosition.column = subbedPointColumn;\n      } else {\n        this.startPosition.column += subbedPointColumn;\n      }\n    } else if (this.startIndex > edit.startIndex) {\n      this.startIndex = edit.newEndIndex;\n      this.startPosition.row = edit.newEndPosition.row;\n      this.startPosition.column = edit.newEndPosition.column;\n    }\n  }\n  /** Get the S-expression representation of this node. */\n  toString() {\n    marshalNode(this);\n    const address = C._ts_node_to_string_wasm(this.tree[0]);\n    const result = C.AsciiToString(address);\n    C._free(address);\n    return result;\n  }\n};\n\n// src/marshal.ts\nfunction unmarshalCaptures(query, tree, address, patternIndex, result) {\n  for (let i2 = 0, n = result.length; i2 < n; i2++) {\n    const captureIndex = C.getValue(address, \"i32\");\n    address += SIZE_OF_INT;\n    const node = unmarshalNode(tree, address);\n    address += SIZE_OF_NODE;\n    result[i2] = { patternIndex, name: query.captureNames[captureIndex], node };\n  }\n  return address;\n}\n__name(unmarshalCaptures, \"unmarshalCaptures\");\nfunction marshalNode(node) {\n  let address = TRANSFER_BUFFER;\n  C.setValue(address, node.id, \"i32\");\n  address += SIZE_OF_INT;\n  C.setValue(address, node.startIndex, \"i32\");\n  address += SIZE_OF_INT;\n  C.setValue(address, node.startPosition.row, \"i32\");\n  address += SIZE_OF_INT;\n  C.setValue(address, node.startPosition.column, \"i32\");\n  address += SIZE_OF_INT;\n  C.setValue(address, node[0], \"i32\");\n}\n__name(marshalNode, \"marshalNode\");\nfunction unmarshalNode(tree, address = TRANSFER_BUFFER) {\n  const id = C.getValue(address, \"i32\");\n  address += SIZE_OF_INT;\n  if (id === 0) return null;\n  const index = C.getValue(address, \"i32\");\n  address += SIZE_OF_INT;\n  const row = C.getValue(address, \"i32\");\n  address += SIZE_OF_INT;\n  const column = C.getValue(address, \"i32\");\n  address += SIZE_OF_INT;\n  const other = C.getValue(address, \"i32\");\n  const result = new Node(INTERNAL, {\n    id,\n    tree,\n    startIndex: index,\n    startPosition: { row, column },\n    other\n  });\n  return result;\n}\n__name(unmarshalNode, \"unmarshalNode\");\nfunction marshalTreeCursor(cursor, address = TRANSFER_BUFFER) {\n  C.setValue(address + 0 * SIZE_OF_INT, cursor[0], \"i32\");\n  C.setValue(address + 1 * SIZE_OF_INT, cursor[1], \"i32\");\n  C.setValue(address + 2 * SIZE_OF_INT, cursor[2], \"i32\");\n  C.setValue(address + 3 * SIZE_OF_INT, cursor[3], \"i32\");\n}\n__name(marshalTreeCursor, \"marshalTreeCursor\");\nfunction unmarshalTreeCursor(cursor) {\n  cursor[0] = C.getValue(TRANSFER_BUFFER + 0 * SIZE_OF_INT, \"i32\");\n  cursor[1] = C.getValue(TRANSFER_BUFFER + 1 * SIZE_OF_INT, \"i32\");\n  cursor[2] = C.getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, \"i32\");\n  cursor[3] = C.getValue(TRANSFER_BUFFER + 3 * SIZE_OF_INT, \"i32\");\n}\n__name(unmarshalTreeCursor, \"unmarshalTreeCursor\");\nfunction marshalPoint(address, point) {\n  C.setValue(address, point.row, \"i32\");\n  C.setValue(address + SIZE_OF_INT, point.column, \"i32\");\n}\n__name(marshalPoint, \"marshalPoint\");\nfunction unmarshalPoint(address) {\n  const result = {\n    row: C.getValue(address, \"i32\") >>> 0,\n    column: C.getValue(address + SIZE_OF_INT, \"i32\") >>> 0\n  };\n  return result;\n}\n__name(unmarshalPoint, \"unmarshalPoint\");\nfunction marshalRange(address, range) {\n  marshalPoint(address, range.startPosition);\n  address += SIZE_OF_POINT;\n  marshalPoint(address, range.endPosition);\n  address += SIZE_OF_POINT;\n  C.setValue(address, range.startIndex, \"i32\");\n  address += SIZE_OF_INT;\n  C.setValue(address, range.endIndex, \"i32\");\n  address += SIZE_OF_INT;\n}\n__name(marshalRange, \"marshalRange\");\nfunction unmarshalRange(address) {\n  const result = {};\n  result.startPosition = unmarshalPoint(address);\n  address += SIZE_OF_POINT;\n  result.endPosition = unmarshalPoint(address);\n  address += SIZE_OF_POINT;\n  result.startIndex = C.getValue(address, \"i32\") >>> 0;\n  address += SIZE_OF_INT;\n  result.endIndex = C.getValue(address, \"i32\") >>> 0;\n  return result;\n}\n__name(unmarshalRange, \"unmarshalRange\");\nfunction marshalEdit(edit, address = TRANSFER_BUFFER) {\n  marshalPoint(address, edit.startPosition);\n  address += SIZE_OF_POINT;\n  marshalPoint(address, edit.oldEndPosition);\n  address += SIZE_OF_POINT;\n  marshalPoint(address, edit.newEndPosition);\n  address += SIZE_OF_POINT;\n  C.setValue(address, edit.startIndex, \"i32\");\n  address += SIZE_OF_INT;\n  C.setValue(address, edit.oldEndIndex, \"i32\");\n  address += SIZE_OF_INT;\n  C.setValue(address, edit.newEndIndex, \"i32\");\n  address += SIZE_OF_INT;\n}\n__name(marshalEdit, \"marshalEdit\");\nfunction unmarshalLanguageMetadata(address) {\n  const result = {};\n  result.major_version = C.getValue(address, \"i32\");\n  address += SIZE_OF_INT;\n  result.minor_version = C.getValue(address, \"i32\");\n  address += SIZE_OF_INT;\n  result.field_count = C.getValue(address, \"i32\");\n  return result;\n}\n__name(unmarshalLanguageMetadata, \"unmarshalLanguageMetadata\");\n\n// src/query.ts\nvar PREDICATE_STEP_TYPE_CAPTURE = 1;\nvar PREDICATE_STEP_TYPE_STRING = 2;\nvar QUERY_WORD_REGEX = /[\\w-]+/g;\nvar CaptureQuantifier = {\n  Zero: 0,\n  ZeroOrOne: 1,\n  ZeroOrMore: 2,\n  One: 3,\n  OneOrMore: 4\n};\nvar isCaptureStep = /* @__PURE__ */ __name((step) => step.type === \"capture\", \"isCaptureStep\");\nvar isStringStep = /* @__PURE__ */ __name((step) => step.type === \"string\", \"isStringStep\");\nvar QueryErrorKind = {\n  Syntax: 1,\n  NodeName: 2,\n  FieldName: 3,\n  CaptureName: 4,\n  PatternStructure: 5\n};\nvar QueryError = class _QueryError extends Error {\n  constructor(kind, info2, index, length) {\n    super(_QueryError.formatMessage(kind, info2));\n    this.kind = kind;\n    this.info = info2;\n    this.index = index;\n    this.length = length;\n    this.name = \"QueryError\";\n  }\n  static {\n    __name(this, \"QueryError\");\n  }\n  /** Formats an error message based on the error kind and info */\n  static formatMessage(kind, info2) {\n    switch (kind) {\n      case QueryErrorKind.NodeName:\n        return `Bad node name '${info2.word}'`;\n      case QueryErrorKind.FieldName:\n        return `Bad field name '${info2.word}'`;\n      case QueryErrorKind.CaptureName:\n        return `Bad capture name @${info2.word}`;\n      case QueryErrorKind.PatternStructure:\n        return `Bad pattern structure at offset ${info2.suffix}`;\n      case QueryErrorKind.Syntax:\n        return `Bad syntax at offset ${info2.suffix}`;\n    }\n  }\n};\nfunction parseAnyPredicate(steps, index, operator, textPredicates) {\n  if (steps.length !== 3) {\n    throw new Error(\n      `Wrong number of arguments to \\`#${operator}\\` predicate. Expected 2, got ${steps.length - 1}`\n    );\n  }\n  if (!isCaptureStep(steps[1])) {\n    throw new Error(\n      `First argument of \\`#${operator}\\` predicate must be a capture. Got \"${steps[1].value}\"`\n    );\n  }\n  const isPositive = operator === \"eq?\" || operator === \"any-eq?\";\n  const matchAll = !operator.startsWith(\"any-\");\n  if (isCaptureStep(steps[2])) {\n    const captureName1 = steps[1].name;\n    const captureName2 = steps[2].name;\n    textPredicates[index].push((captures) => {\n      const nodes1 = [];\n      const nodes2 = [];\n      for (const c of captures) {\n        if (c.name === captureName1) nodes1.push(c.node);\n        if (c.name === captureName2) nodes2.push(c.node);\n      }\n      const compare = /* @__PURE__ */ __name((n1, n2, positive) => {\n        return positive ? n1.text === n2.text : n1.text !== n2.text;\n      }, \"compare\");\n      return matchAll ? nodes1.every((n1) => nodes2.some((n2) => compare(n1, n2, isPositive))) : nodes1.some((n1) => nodes2.some((n2) => compare(n1, n2, isPositive)));\n    });\n  } else {\n    const captureName = steps[1].name;\n    const stringValue = steps[2].value;\n    const matches = /* @__PURE__ */ __name((n) => n.text === stringValue, \"matches\");\n    const doesNotMatch = /* @__PURE__ */ __name((n) => n.text !== stringValue, \"doesNotMatch\");\n    textPredicates[index].push((captures) => {\n      const nodes = [];\n      for (const c of captures) {\n        if (c.name === captureName) nodes.push(c.node);\n      }\n      const test = isPositive ? matches : doesNotMatch;\n      return matchAll ? nodes.every(test) : nodes.some(test);\n    });\n  }\n}\n__name(parseAnyPredicate, \"parseAnyPredicate\");\nfunction parseMatchPredicate(steps, index, operator, textPredicates) {\n  if (steps.length !== 3) {\n    throw new Error(\n      `Wrong number of arguments to \\`#${operator}\\` predicate. Expected 2, got ${steps.length - 1}.`\n    );\n  }\n  if (steps[1].type !== \"capture\") {\n    throw new Error(\n      `First argument of \\`#${operator}\\` predicate must be a capture. Got \"${steps[1].value}\".`\n    );\n  }\n  if (steps[2].type !== \"string\") {\n    throw new Error(\n      `Second argument of \\`#${operator}\\` predicate must be a string. Got @${steps[2].name}.`\n    );\n  }\n  const isPositive = operator === \"match?\" || operator === \"any-match?\";\n  const matchAll = !operator.startsWith(\"any-\");\n  const captureName = steps[1].name;\n  const regex = new RegExp(steps[2].value);\n  textPredicates[index].push((captures) => {\n    const nodes = [];\n    for (const c of captures) {\n      if (c.name === captureName) nodes.push(c.node.text);\n    }\n    const test = /* @__PURE__ */ __name((text, positive) => {\n      return positive ? regex.test(text) : !regex.test(text);\n    }, \"test\");\n    if (nodes.length === 0) return !isPositive;\n    return matchAll ? nodes.every((text) => test(text, isPositive)) : nodes.some((text) => test(text, isPositive));\n  });\n}\n__name(parseMatchPredicate, \"parseMatchPredicate\");\nfunction parseAnyOfPredicate(steps, index, operator, textPredicates) {\n  if (steps.length < 2) {\n    throw new Error(\n      `Wrong number of arguments to \\`#${operator}\\` predicate. Expected at least 1. Got ${steps.length - 1}.`\n    );\n  }\n  if (steps[1].type !== \"capture\") {\n    throw new Error(\n      `First argument of \\`#${operator}\\` predicate must be a capture. Got \"${steps[1].value}\".`\n    );\n  }\n  const isPositive = operator === \"any-of?\";\n  const captureName = steps[1].name;\n  const stringSteps = steps.slice(2);\n  if (!stringSteps.every(isStringStep)) {\n    throw new Error(\n      `Arguments to \\`#${operator}\\` predicate must be strings.\".`\n    );\n  }\n  const values = stringSteps.map((s) => s.value);\n  textPredicates[index].push((captures) => {\n    const nodes = [];\n    for (const c of captures) {\n      if (c.name === captureName) nodes.push(c.node.text);\n    }\n    if (nodes.length === 0) return !isPositive;\n    return nodes.every((text) => values.includes(text)) === isPositive;\n  });\n}\n__name(parseAnyOfPredicate, \"parseAnyOfPredicate\");\nfunction parseIsPredicate(steps, index, operator, assertedProperties, refutedProperties) {\n  if (steps.length < 2 || steps.length > 3) {\n    throw new Error(\n      `Wrong number of arguments to \\`#${operator}\\` predicate. Expected 1 or 2. Got ${steps.length - 1}.`\n    );\n  }\n  if (!steps.every(isStringStep)) {\n    throw new Error(\n      `Arguments to \\`#${operator}\\` predicate must be strings.\".`\n    );\n  }\n  const properties = operator === \"is?\" ? assertedProperties : refutedProperties;\n  if (!properties[index]) properties[index] = {};\n  properties[index][steps[1].value] = steps[2]?.value ?? null;\n}\n__name(parseIsPredicate, \"parseIsPredicate\");\nfunction parseSetDirective(steps, index, setProperties) {\n  if (steps.length < 2 || steps.length > 3) {\n    throw new Error(`Wrong number of arguments to \\`#set!\\` predicate. Expected 1 or 2. Got ${steps.length - 1}.`);\n  }\n  if (!steps.every(isStringStep)) {\n    throw new Error(`Arguments to \\`#set!\\` predicate must be strings.\".`);\n  }\n  if (!setProperties[index]) setProperties[index] = {};\n  setProperties[index][steps[1].value] = steps[2]?.value ?? null;\n}\n__name(parseSetDirective, \"parseSetDirective\");\nfunction parsePattern(index, stepType, stepValueId, captureNames, stringValues, steps, textPredicates, predicates, setProperties, assertedProperties, refutedProperties) {\n  if (stepType === PREDICATE_STEP_TYPE_CAPTURE) {\n    const name2 = captureNames[stepValueId];\n    steps.push({ type: \"capture\", name: name2 });\n  } else if (stepType === PREDICATE_STEP_TYPE_STRING) {\n    steps.push({ type: \"string\", value: stringValues[stepValueId] });\n  } else if (steps.length > 0) {\n    if (steps[0].type !== \"string\") {\n      throw new Error(\"Predicates must begin with a literal value\");\n    }\n    const operator = steps[0].value;\n    switch (operator) {\n      case \"any-not-eq?\":\n      case \"not-eq?\":\n      case \"any-eq?\":\n      case \"eq?\":\n        parseAnyPredicate(steps, index, operator, textPredicates);\n        break;\n      case \"any-not-match?\":\n      case \"not-match?\":\n      case \"any-match?\":\n      case \"match?\":\n        parseMatchPredicate(steps, index, operator, textPredicates);\n        break;\n      case \"not-any-of?\":\n      case \"any-of?\":\n        parseAnyOfPredicate(steps, index, operator, textPredicates);\n        break;\n      case \"is?\":\n      case \"is-not?\":\n        parseIsPredicate(steps, index, operator, assertedProperties, refutedProperties);\n        break;\n      case \"set!\":\n        parseSetDirective(steps, index, setProperties);\n        break;\n      default:\n        predicates[index].push({ operator, operands: steps.slice(1) });\n    }\n    steps.length = 0;\n  }\n}\n__name(parsePattern, \"parsePattern\");\nvar Query = class {\n  static {\n    __name(this, \"Query\");\n  }\n  /** @internal */\n  [0] = 0;\n  // Internal handle for WASM\n  /** @internal */\n  exceededMatchLimit;\n  /** @internal */\n  textPredicates;\n  /** The names of the captures used in the query. */\n  captureNames;\n  /** The quantifiers of the captures used in the query. */\n  captureQuantifiers;\n  /**\n   * The other user-defined predicates associated with the given index.\n   *\n   * This includes predicates with operators other than:\n   * - `match?`\n   * - `eq?` and `not-eq?`\n   * - `any-of?` and `not-any-of?`\n   * - `is?` and `is-not?`\n   * - `set!`\n   */\n  predicates;\n  /** The properties for predicates with the operator `set!`. */\n  setProperties;\n  /** The properties for predicates with the operator `is?`. */\n  assertedProperties;\n  /** The properties for predicates with the operator `is-not?`. */\n  refutedProperties;\n  /** The maximum number of in-progress matches for this cursor. */\n  matchLimit;\n  /**\n   * Create a new query from a string containing one or more S-expression\n   * patterns.\n   *\n   * The query is associated with a particular language, and can only be run\n   * on syntax nodes parsed with that language. References to Queries can be\n   * shared between multiple threads.\n   *\n   * @link {@see https://tree-sitter.github.io/tree-sitter/using-parsers/queries}\n   */\n  constructor(language, source) {\n    const sourceLength = C.lengthBytesUTF8(source);\n    const sourceAddress = C._malloc(sourceLength + 1);\n    C.stringToUTF8(source, sourceAddress, sourceLength + 1);\n    const address = C._ts_query_new(\n      language[0],\n      sourceAddress,\n      sourceLength,\n      TRANSFER_BUFFER,\n      TRANSFER_BUFFER + SIZE_OF_INT\n    );\n    if (!address) {\n      const errorId = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, \"i32\");\n      const errorByte = C.getValue(TRANSFER_BUFFER, \"i32\");\n      const errorIndex = C.UTF8ToString(sourceAddress, errorByte).length;\n      const suffix = source.slice(errorIndex, errorIndex + 100).split(\"\\n\")[0];\n      const word = suffix.match(QUERY_WORD_REGEX)?.[0] ?? \"\";\n      C._free(sourceAddress);\n      switch (errorId) {\n        case QueryErrorKind.Syntax:\n          throw new QueryError(QueryErrorKind.Syntax, { suffix: `${errorIndex}: '${suffix}'...` }, errorIndex, 0);\n        case QueryErrorKind.NodeName:\n          throw new QueryError(errorId, { word }, errorIndex, word.length);\n        case QueryErrorKind.FieldName:\n          throw new QueryError(errorId, { word }, errorIndex, word.length);\n        case QueryErrorKind.CaptureName:\n          throw new QueryError(errorId, { word }, errorIndex, word.length);\n        case QueryErrorKind.PatternStructure:\n          throw new QueryError(errorId, { suffix: `${errorIndex}: '${suffix}'...` }, errorIndex, 0);\n      }\n    }\n    const stringCount = C._ts_query_string_count(address);\n    const captureCount = C._ts_query_capture_count(address);\n    const patternCount = C._ts_query_pattern_count(address);\n    const captureNames = new Array(captureCount);\n    const captureQuantifiers = new Array(patternCount);\n    const stringValues = new Array(stringCount);\n    for (let i2 = 0; i2 < captureCount; i2++) {\n      const nameAddress = C._ts_query_capture_name_for_id(\n        address,\n        i2,\n        TRANSFER_BUFFER\n      );\n      const nameLength = C.getValue(TRANSFER_BUFFER, \"i32\");\n      captureNames[i2] = C.UTF8ToString(nameAddress, nameLength);\n    }\n    for (let i2 = 0; i2 < patternCount; i2++) {\n      const captureQuantifiersArray = new Array(captureCount);\n      for (let j = 0; j < captureCount; j++) {\n        const quantifier = C._ts_query_capture_quantifier_for_id(address, i2, j);\n        captureQuantifiersArray[j] = quantifier;\n      }\n      captureQuantifiers[i2] = captureQuantifiersArray;\n    }\n    for (let i2 = 0; i2 < stringCount; i2++) {\n      const valueAddress = C._ts_query_string_value_for_id(\n        address,\n        i2,\n        TRANSFER_BUFFER\n      );\n      const nameLength = C.getValue(TRANSFER_BUFFER, \"i32\");\n      stringValues[i2] = C.UTF8ToString(valueAddress, nameLength);\n    }\n    const setProperties = new Array(patternCount);\n    const assertedProperties = new Array(patternCount);\n    const refutedProperties = new Array(patternCount);\n    const predicates = new Array(patternCount);\n    const textPredicates = new Array(patternCount);\n    for (let i2 = 0; i2 < patternCount; i2++) {\n      const predicatesAddress = C._ts_query_predicates_for_pattern(address, i2, TRANSFER_BUFFER);\n      const stepCount = C.getValue(TRANSFER_BUFFER, \"i32\");\n      predicates[i2] = [];\n      textPredicates[i2] = [];\n      const steps = new Array();\n      let stepAddress = predicatesAddress;\n      for (let j = 0; j < stepCount; j++) {\n        const stepType = C.getValue(stepAddress, \"i32\");\n        stepAddress += SIZE_OF_INT;\n        const stepValueId = C.getValue(stepAddress, \"i32\");\n        stepAddress += SIZE_OF_INT;\n        parsePattern(\n          i2,\n          stepType,\n          stepValueId,\n          captureNames,\n          stringValues,\n          steps,\n          textPredicates,\n          predicates,\n          setProperties,\n          assertedProperties,\n          refutedProperties\n        );\n      }\n      Object.freeze(textPredicates[i2]);\n      Object.freeze(predicates[i2]);\n      Object.freeze(setProperties[i2]);\n      Object.freeze(assertedProperties[i2]);\n      Object.freeze(refutedProperties[i2]);\n    }\n    C._free(sourceAddress);\n    this[0] = address;\n    this.captureNames = captureNames;\n    this.captureQuantifiers = captureQuantifiers;\n    this.textPredicates = textPredicates;\n    this.predicates = predicates;\n    this.setProperties = setProperties;\n    this.assertedProperties = assertedProperties;\n    this.refutedProperties = refutedProperties;\n    this.exceededMatchLimit = false;\n  }\n  /** Delete the query, freeing its resources. */\n  delete() {\n    C._ts_query_delete(this[0]);\n    this[0] = 0;\n  }\n  /**\n   * Iterate over all of the matches in the order that they were found.\n   *\n   * Each match contains the index of the pattern that matched, and a list of\n   * captures. Because multiple patterns can match the same set of nodes,\n   * one match may contain captures that appear *before* some of the\n   * captures from a previous match.\n   *\n   * @param {Node} node - The node to execute the query on.\n   *\n   * @param {QueryOptions} options - Options for query execution.\n   */\n  matches(node, options = {}) {\n    const startPosition = options.startPosition ?? ZERO_POINT;\n    const endPosition = options.endPosition ?? ZERO_POINT;\n    const startIndex = options.startIndex ?? 0;\n    const endIndex = options.endIndex ?? 0;\n    const matchLimit = options.matchLimit ?? 4294967295;\n    const maxStartDepth = options.maxStartDepth ?? 4294967295;\n    const timeoutMicros = options.timeoutMicros ?? 0;\n    const progressCallback = options.progressCallback;\n    if (typeof matchLimit !== \"number\") {\n      throw new Error(\"Arguments must be numbers\");\n    }\n    this.matchLimit = matchLimit;\n    if (endIndex !== 0 && startIndex > endIndex) {\n      throw new Error(\"`startIndex` cannot be greater than `endIndex`\");\n    }\n    if (endPosition !== ZERO_POINT && (startPosition.row > endPosition.row || startPosition.row === endPosition.row && startPosition.column > endPosition.column)) {\n      throw new Error(\"`startPosition` cannot be greater than `endPosition`\");\n    }\n    if (progressCallback) {\n      C.currentQueryProgressCallback = progressCallback;\n    }\n    marshalNode(node);\n    C._ts_query_matches_wasm(\n      this[0],\n      node.tree[0],\n      startPosition.row,\n      startPosition.column,\n      endPosition.row,\n      endPosition.column,\n      startIndex,\n      endIndex,\n      matchLimit,\n      maxStartDepth,\n      timeoutMicros\n    );\n    const rawCount = C.getValue(TRANSFER_BUFFER, \"i32\");\n    const startAddress = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, \"i32\");\n    const didExceedMatchLimit = C.getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, \"i32\");\n    const result = new Array(rawCount);\n    this.exceededMatchLimit = Boolean(didExceedMatchLimit);\n    let filteredCount = 0;\n    let address = startAddress;\n    for (let i2 = 0; i2 < rawCount; i2++) {\n      const patternIndex = C.getValue(address, \"i32\");\n      address += SIZE_OF_INT;\n      const captureCount = C.getValue(address, \"i32\");\n      address += SIZE_OF_INT;\n      const captures = new Array(captureCount);\n      address = unmarshalCaptures(this, node.tree, address, patternIndex, captures);\n      if (this.textPredicates[patternIndex].every((p) => p(captures))) {\n        result[filteredCount] = { pattern: patternIndex, patternIndex, captures };\n        const setProperties = this.setProperties[patternIndex];\n        result[filteredCount].setProperties = setProperties;\n        const assertedProperties = this.assertedProperties[patternIndex];\n        result[filteredCount].assertedProperties = assertedProperties;\n        const refutedProperties = this.refutedProperties[patternIndex];\n        result[filteredCount].refutedProperties = refutedProperties;\n        filteredCount++;\n      }\n    }\n    result.length = filteredCount;\n    C._free(startAddress);\n    C.currentQueryProgressCallback = null;\n    return result;\n  }\n  /**\n   * Iterate over all of the individual captures in the order that they\n   * appear.\n   *\n   * This is useful if you don't care about which pattern matched, and just\n   * want a single, ordered sequence of captures.\n   *\n   * @param {Node} node - The node to execute the query on.\n   *\n   * @param {QueryOptions} options - Options for query execution.\n   */\n  captures(node, options = {}) {\n    const startPosition = options.startPosition ?? ZERO_POINT;\n    const endPosition = options.endPosition ?? ZERO_POINT;\n    const startIndex = options.startIndex ?? 0;\n    const endIndex = options.endIndex ?? 0;\n    const matchLimit = options.matchLimit ?? 4294967295;\n    const maxStartDepth = options.maxStartDepth ?? 4294967295;\n    const timeoutMicros = options.timeoutMicros ?? 0;\n    const progressCallback = options.progressCallback;\n    if (typeof matchLimit !== \"number\") {\n      throw new Error(\"Arguments must be numbers\");\n    }\n    this.matchLimit = matchLimit;\n    if (endIndex !== 0 && startIndex > endIndex) {\n      throw new Error(\"`startIndex` cannot be greater than `endIndex`\");\n    }\n    if (endPosition !== ZERO_POINT && (startPosition.row > endPosition.row || startPosition.row === endPosition.row && startPosition.column > endPosition.column)) {\n      throw new Error(\"`startPosition` cannot be greater than `endPosition`\");\n    }\n    if (progressCallback) {\n      C.currentQueryProgressCallback = progressCallback;\n    }\n    marshalNode(node);\n    C._ts_query_captures_wasm(\n      this[0],\n      node.tree[0],\n      startPosition.row,\n      startPosition.column,\n      endPosition.row,\n      endPosition.column,\n      startIndex,\n      endIndex,\n      matchLimit,\n      maxStartDepth,\n      timeoutMicros\n    );\n    const count = C.getValue(TRANSFER_BUFFER, \"i32\");\n    const startAddress = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, \"i32\");\n    const didExceedMatchLimit = C.getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, \"i32\");\n    const result = new Array();\n    this.exceededMatchLimit = Boolean(didExceedMatchLimit);\n    const captures = new Array();\n    let address = startAddress;\n    for (let i2 = 0; i2 < count; i2++) {\n      const patternIndex = C.getValue(address, \"i32\");\n      address += SIZE_OF_INT;\n      const captureCount = C.getValue(address, \"i32\");\n      address += SIZE_OF_INT;\n      const captureIndex = C.getValue(address, \"i32\");\n      address += SIZE_OF_INT;\n      captures.length = captureCount;\n      address = unmarshalCaptures(this, node.tree, address, patternIndex, captures);\n      if (this.textPredicates[patternIndex].every((p) => p(captures))) {\n        const capture = captures[captureIndex];\n        const setProperties = this.setProperties[patternIndex];\n        capture.setProperties = setProperties;\n        const assertedProperties = this.assertedProperties[patternIndex];\n        capture.assertedProperties = assertedProperties;\n        const refutedProperties = this.refutedProperties[patternIndex];\n        capture.refutedProperties = refutedProperties;\n        result.push(capture);\n      }\n    }\n    C._free(startAddress);\n    C.currentQueryProgressCallback = null;\n    return result;\n  }\n  /** Get the predicates for a given pattern. */\n  predicatesForPattern(patternIndex) {\n    return this.predicates[patternIndex];\n  }\n  /**\n   * Disable a certain capture within a query.\n   *\n   * This prevents the capture from being returned in matches, and also\n   * avoids any resource usage associated with recording the capture.\n   */\n  disableCapture(captureName) {\n    const captureNameLength = C.lengthBytesUTF8(captureName);\n    const captureNameAddress = C._malloc(captureNameLength + 1);\n    C.stringToUTF8(captureName, captureNameAddress, captureNameLength + 1);\n    C._ts_query_disable_capture(this[0], captureNameAddress, captureNameLength);\n    C._free(captureNameAddress);\n  }\n  /**\n   * Disable a certain pattern within a query.\n   *\n   * This prevents the pattern from matching, and also avoids any resource\n   * usage associated with the pattern. This throws an error if the pattern\n   * index is out of bounds.\n   */\n  disablePattern(patternIndex) {\n    if (patternIndex >= this.predicates.length) {\n      throw new Error(\n        `Pattern index is ${patternIndex} but the pattern count is ${this.predicates.length}`\n      );\n    }\n    C._ts_query_disable_pattern(this[0], patternIndex);\n  }\n  /**\n   * Check if, on its last execution, this cursor exceeded its maximum number\n   * of in-progress matches.\n   */\n  didExceedMatchLimit() {\n    return this.exceededMatchLimit;\n  }\n  /** Get the byte offset where the given pattern starts in the query's source. */\n  startIndexForPattern(patternIndex) {\n    if (patternIndex >= this.predicates.length) {\n      throw new Error(\n        `Pattern index is ${patternIndex} but the pattern count is ${this.predicates.length}`\n      );\n    }\n    return C._ts_query_start_byte_for_pattern(this[0], patternIndex);\n  }\n  /** Get the byte offset where the given pattern ends in the query's source. */\n  endIndexForPattern(patternIndex) {\n    if (patternIndex >= this.predicates.length) {\n      throw new Error(\n        `Pattern index is ${patternIndex} but the pattern count is ${this.predicates.length}`\n      );\n    }\n    return C._ts_query_end_byte_for_pattern(this[0], patternIndex);\n  }\n  /** Get the number of patterns in the query. */\n  patternCount() {\n    return C._ts_query_pattern_count(this[0]);\n  }\n  /** Get the index for a given capture name. */\n  captureIndexForName(captureName) {\n    return this.captureNames.indexOf(captureName);\n  }\n  /** Check if a given pattern within a query has a single root node. */\n  isPatternRooted(patternIndex) {\n    return C._ts_query_is_pattern_rooted(this[0], patternIndex) === 1;\n  }\n  /** Check if a given pattern within a query has a single root node. */\n  isPatternNonLocal(patternIndex) {\n    return C._ts_query_is_pattern_non_local(this[0], patternIndex) === 1;\n  }\n  /**\n   * Check if a given step in a query is 'definite'.\n   *\n   * A query step is 'definite' if its parent pattern will be guaranteed to\n   * match successfully once it reaches the step.\n   */\n  isPatternGuaranteedAtStep(byteIndex) {\n    return C._ts_query_is_pattern_guaranteed_at_step(this[0], byteIndex) === 1;\n  }\n};\n\n// src/language.ts\nvar LANGUAGE_FUNCTION_REGEX = /^tree_sitter_\\w+$/;\nvar Language = class _Language {\n  static {\n    __name(this, \"Language\");\n  }\n  /** @internal */\n  [0] = 0;\n  // Internal handle for WASM\n  /**\n   * A list of all node types in the language. The index of each type in this\n   * array is its node type id.\n   */\n  types;\n  /**\n   * A list of all field names in the language. The index of each field name in\n   * this array is its field id.\n   */\n  fields;\n  /** @internal */\n  constructor(internal, address) {\n    assertInternal(internal);\n    this[0] = address;\n    this.types = new Array(C._ts_language_symbol_count(this[0]));\n    for (let i2 = 0, n = this.types.length; i2 < n; i2++) {\n      if (C._ts_language_symbol_type(this[0], i2) < 2) {\n        this.types[i2] = C.UTF8ToString(C._ts_language_symbol_name(this[0], i2));\n      }\n    }\n    this.fields = new Array(C._ts_language_field_count(this[0]) + 1);\n    for (let i2 = 0, n = this.fields.length; i2 < n; i2++) {\n      const fieldName = C._ts_language_field_name_for_id(this[0], i2);\n      if (fieldName !== 0) {\n        this.fields[i2] = C.UTF8ToString(fieldName);\n      } else {\n        this.fields[i2] = null;\n      }\n    }\n  }\n  /**\n   * Gets the name of the language.\n   */\n  get name() {\n    const ptr = C._ts_language_name(this[0]);\n    if (ptr === 0) return null;\n    return C.UTF8ToString(ptr);\n  }\n  /**\n   * @deprecated since version 0.25.0, use {@link Language#abiVersion} instead\n   * Gets the version of the language.\n   */\n  get version() {\n    return C._ts_language_version(this[0]);\n  }\n  /**\n   * Gets the ABI version of the language.\n   */\n  get abiVersion() {\n    return C._ts_language_abi_version(this[0]);\n  }\n  /**\n  * Get the metadata for this language. This information is generated by the\n  * CLI, and relies on the language author providing the correct metadata in\n  * the language's `tree-sitter.json` file.\n  */\n  get metadata() {\n    C._ts_language_metadata(this[0]);\n    const length = C.getValue(TRANSFER_BUFFER, \"i32\");\n    const address = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, \"i32\");\n    if (length === 0) return null;\n    return unmarshalLanguageMetadata(address);\n  }\n  /**\n   * Gets the number of fields in the language.\n   */\n  get fieldCount() {\n    return this.fields.length - 1;\n  }\n  /**\n   * Gets the number of states in the language.\n   */\n  get stateCount() {\n    return C._ts_language_state_count(this[0]);\n  }\n  /**\n   * Get the field id for a field name.\n   */\n  fieldIdForName(fieldName) {\n    const result = this.fields.indexOf(fieldName);\n    return result !== -1 ? result : null;\n  }\n  /**\n   * Get the field name for a field id.\n   */\n  fieldNameForId(fieldId) {\n    return this.fields[fieldId] ?? null;\n  }\n  /**\n   * Get the node type id for a node type name.\n   */\n  idForNodeType(type, named) {\n    const typeLength = C.lengthBytesUTF8(type);\n    const typeAddress = C._malloc(typeLength + 1);\n    C.stringToUTF8(type, typeAddress, typeLength + 1);\n    const result = C._ts_language_symbol_for_name(this[0], typeAddress, typeLength, named ? 1 : 0);\n    C._free(typeAddress);\n    return result || null;\n  }\n  /**\n   * Gets the number of node types in the language.\n   */\n  get nodeTypeCount() {\n    return C._ts_language_symbol_count(this[0]);\n  }\n  /**\n   * Get the node type name for a node type id.\n   */\n  nodeTypeForId(typeId) {\n    const name2 = C._ts_language_symbol_name(this[0], typeId);\n    return name2 ? C.UTF8ToString(name2) : null;\n  }\n  /**\n   * Check if a node type is named.\n   *\n   * @see {@link https://tree-sitter.github.io/tree-sitter/using-parsers/2-basic-parsing.html#named-vs-anonymous-nodes}\n   */\n  nodeTypeIsNamed(typeId) {\n    return C._ts_language_type_is_named_wasm(this[0], typeId) ? true : false;\n  }\n  /**\n   * Check if a node type is visible.\n   */\n  nodeTypeIsVisible(typeId) {\n    return C._ts_language_type_is_visible_wasm(this[0], typeId) ? true : false;\n  }\n  /**\n   * Get the supertypes ids of this language.\n   *\n   * @see {@link https://tree-sitter.github.io/tree-sitter/using-parsers/6-static-node-types.html?highlight=supertype#supertype-nodes}\n   */\n  get supertypes() {\n    C._ts_language_supertypes_wasm(this[0]);\n    const count = C.getValue(TRANSFER_BUFFER, \"i32\");\n    const buffer = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, \"i32\");\n    const result = new Array(count);\n    if (count > 0) {\n      let address = buffer;\n      for (let i2 = 0; i2 < count; i2++) {\n        result[i2] = C.getValue(address, \"i16\");\n        address += SIZE_OF_SHORT;\n      }\n    }\n    return result;\n  }\n  /**\n   * Get the subtype ids for a given supertype node id.\n   */\n  subtypes(supertype) {\n    C._ts_language_subtypes_wasm(this[0], supertype);\n    const count = C.getValue(TRANSFER_BUFFER, \"i32\");\n    const buffer = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, \"i32\");\n    const result = new Array(count);\n    if (count > 0) {\n      let address = buffer;\n      for (let i2 = 0; i2 < count; i2++) {\n        result[i2] = C.getValue(address, \"i16\");\n        address += SIZE_OF_SHORT;\n      }\n    }\n    return result;\n  }\n  /**\n   * Get the next state id for a given state id and node type id.\n   */\n  nextState(stateId, typeId) {\n    return C._ts_language_next_state(this[0], stateId, typeId);\n  }\n  /**\n   * Create a new lookahead iterator for this language and parse state.\n   *\n   * This returns `null` if state is invalid for this language.\n   *\n   * Iterating {@link LookaheadIterator} will yield valid symbols in the given\n   * parse state. Newly created lookahead iterators will return the `ERROR`\n   * symbol from {@link LookaheadIterator#currentType}.\n   *\n   * Lookahead iterators can be useful for generating suggestions and improving\n   * syntax error diagnostics. To get symbols valid in an `ERROR` node, use the\n   * lookahead iterator on its first leaf node state. For `MISSING` nodes, a\n   * lookahead iterator created on the previous non-extra leaf node may be\n   * appropriate.\n   */\n  lookaheadIterator(stateId) {\n    const address = C._ts_lookahead_iterator_new(this[0], stateId);\n    if (address) return new LookaheadIterator(INTERNAL, address, this);\n    return null;\n  }\n  /**\n   * @deprecated since version 0.25.0, call `new` on a {@link Query} instead\n   *\n   * Create a new query from a string containing one or more S-expression\n   * patterns.\n   *\n   * The query is associated with a particular language, and can only be run\n   * on syntax nodes parsed with that language. References to Queries can be\n   * shared between multiple threads.\n   *\n   * @link {@see https://tree-sitter.github.io/tree-sitter/using-parsers/queries}\n   */\n  query(source) {\n    console.warn(\"Language.query is deprecated. Use new Query(language, source) instead.\");\n    return new Query(this, source);\n  }\n  /**\n   * Load a language from a WebAssembly module.\n   * The module can be provided as a path to a file or as a buffer.\n   */\n  static async load(input) {\n    let bytes;\n    if (input instanceof Uint8Array) {\n      bytes = Promise.resolve(input);\n    } else {\n      if (globalThis.process?.versions.node) {\n        const fs2 = __require(\"fs/promises\");\n        bytes = fs2.readFile(input);\n      } else {\n        bytes = fetch(input).then((response) => response.arrayBuffer().then((buffer) => {\n          if (response.ok) {\n            return new Uint8Array(buffer);\n          } else {\n            const body2 = new TextDecoder(\"utf-8\").decode(buffer);\n            throw new Error(`Language.load failed with status ${response.status}.\n\n${body2}`);\n          }\n        }));\n      }\n    }\n    const mod = await C.loadWebAssemblyModule(await bytes, { loadAsync: true });\n    const symbolNames = Object.keys(mod);\n    const functionName = symbolNames.find((key) => LANGUAGE_FUNCTION_REGEX.test(key) && !key.includes(\"external_scanner_\"));\n    if (!functionName) {\n      console.log(`Couldn't find language function in WASM file. Symbols:\n${JSON.stringify(symbolNames, null, 2)}`);\n      throw new Error(\"Language.load failed: no language function found in WASM file\");\n    }\n    const languageAddress = mod[functionName]();\n    return new _Language(INTERNAL, languageAddress);\n  }\n};\n\n// lib/tree-sitter.mjs\nvar Module2 = (() => {\n  var _scriptName = import.meta.url;\n  return async function(moduleArg = {}) {\n    var moduleRtn;\n    var Module = moduleArg;\n    var readyPromiseResolve, readyPromiseReject;\n    var readyPromise = new Promise((resolve, reject) => {\n      readyPromiseResolve = resolve;\n      readyPromiseReject = reject;\n    });\n    var ENVIRONMENT_IS_WEB = typeof window == \"object\";\n    var ENVIRONMENT_IS_WORKER = typeof WorkerGlobalScope != \"undefined\";\n    var ENVIRONMENT_IS_NODE = typeof process == \"object\" && typeof process.versions == \"object\" && typeof process.versions.node == \"string\" && process.type != \"renderer\";\n    var ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;\n    if (ENVIRONMENT_IS_NODE) {\n      const { createRequire } = await import(\"module\");\n      var require = createRequire(\"/\");\n    }\n    Module.currentQueryProgressCallback = null;\n    Module.currentProgressCallback = null;\n    Module.currentLogCallback = null;\n    Module.currentParseCallback = null;\n    var moduleOverrides = Object.assign({}, Module);\n    var arguments_ = [];\n    var thisProgram = \"./this.program\";\n    var quit_ = /* @__PURE__ */ __name((status, toThrow) => {\n      throw toThrow;\n    }, \"quit_\");\n    var scriptDirectory = \"\";\n    function locateFile(path) {\n      if (Module[\"locateFile\"]) {\n        return Module[\"locateFile\"](path, scriptDirectory);\n      }\n      return scriptDirectory + path;\n    }\n    __name(locateFile, \"locateFile\");\n    var readAsync, readBinary;\n    if (ENVIRONMENT_IS_NODE) {\n      var fs = require(\"fs\");\n      var nodePath = require(\"path\");\n      if (!import.meta.url.startsWith(\"data:\")) {\n        scriptDirectory = nodePath.dirname(require(\"url\").fileURLToPath(import.meta.url)) + \"/\";\n      }\n      readBinary = /* @__PURE__ */ __name((filename) => {\n        filename = isFileURI(filename) ? new URL(filename) : filename;\n        var ret = fs.readFileSync(filename);\n        return ret;\n      }, \"readBinary\");\n      readAsync = /* @__PURE__ */ __name(async (filename, binary2 = true) => {\n        filename = isFileURI(filename) ? new URL(filename) : filename;\n        var ret = fs.readFileSync(filename, binary2 ? void 0 : \"utf8\");\n        return ret;\n      }, \"readAsync\");\n      if (!Module[\"thisProgram\"] && process.argv.length > 1) {\n        thisProgram = process.argv[1].replace(/\\\\/g, \"/\");\n      }\n      arguments_ = process.argv.slice(2);\n      quit_ = /* @__PURE__ */ __name((status, toThrow) => {\n        process.exitCode = status;\n        throw toThrow;\n      }, \"quit_\");\n    } else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {\n      if (ENVIRONMENT_IS_WORKER) {\n        scriptDirectory = self.location.href;\n      } else if (typeof document != \"undefined\" && document.currentScript) {\n        scriptDirectory = document.currentScript.src;\n      }\n      if (_scriptName) {\n        scriptDirectory = _scriptName;\n      }\n      if (scriptDirectory.startsWith(\"blob:\")) {\n        scriptDirectory = \"\";\n      } else {\n        scriptDirectory = scriptDirectory.substr(0, scriptDirectory.replace(/[?#].*/, \"\").lastIndexOf(\"/\") + 1);\n      }\n      {\n        if (ENVIRONMENT_IS_WORKER) {\n          readBinary = /* @__PURE__ */ __name((url) => {\n            var xhr = new XMLHttpRequest();\n            xhr.open(\"GET\", url, false);\n            xhr.responseType = \"arraybuffer\";\n            xhr.send(null);\n            return new Uint8Array(\n              /** @type{!ArrayBuffer} */\n              xhr.response\n            );\n          }, \"readBinary\");\n        }\n        readAsync = /* @__PURE__ */ __name(async (url) => {\n          if (isFileURI(url)) {\n            return new Promise((resolve, reject) => {\n              var xhr = new XMLHttpRequest();\n              xhr.open(\"GET\", url, true);\n              xhr.responseType = \"arraybuffer\";\n              xhr.onload = () => {\n                if (xhr.status == 200 || xhr.status == 0 && xhr.response) {\n                  resolve(xhr.response);\n                  return;\n                }\n                reject(xhr.status);\n              };\n              xhr.onerror = reject;\n              xhr.send(null);\n            });\n          }\n          var response = await fetch(url, {\n            credentials: \"same-origin\"\n          });\n          if (response.ok) {\n            return response.arrayBuffer();\n          }\n          throw new Error(response.status + \" : \" + response.url);\n        }, \"readAsync\");\n      }\n    } else {\n    }\n    var out = Module[\"print\"] || console.log.bind(console);\n    var err = Module[\"printErr\"] || console.error.bind(console);\n    Object.assign(Module, moduleOverrides);\n    moduleOverrides = null;\n    if (Module[\"arguments\"]) arguments_ = Module[\"arguments\"];\n    if (Module[\"thisProgram\"]) thisProgram = Module[\"thisProgram\"];\n    var dynamicLibraries = Module[\"dynamicLibraries\"] || [];\n    var wasmBinary = Module[\"wasmBinary\"];\n    var wasmMemory;\n    var ABORT = false;\n    var EXITSTATUS;\n    function assert(condition, text) {\n      if (!condition) {\n        abort(text);\n      }\n    }\n    __name(assert, \"assert\");\n    var HEAP, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAP64, HEAPU64, HEAPF64;\n    var HEAP_DATA_VIEW;\n    var runtimeInitialized = false;\n    var dataURIPrefix = \"data:application/octet-stream;base64,\";\n    var isDataURI = /* @__PURE__ */ __name((filename) => filename.startsWith(dataURIPrefix), \"isDataURI\");\n    var isFileURI = /* @__PURE__ */ __name((filename) => filename.startsWith(\"file://\"), \"isFileURI\");\n    function updateMemoryViews() {\n      var b = wasmMemory.buffer;\n      Module[\"HEAP_DATA_VIEW\"] = HEAP_DATA_VIEW = new DataView(b);\n      Module[\"HEAP8\"] = HEAP8 = new Int8Array(b);\n      Module[\"HEAP16\"] = HEAP16 = new Int16Array(b);\n      Module[\"HEAPU8\"] = HEAPU8 = new Uint8Array(b);\n      Module[\"HEAPU16\"] = HEAPU16 = new Uint16Array(b);\n      Module[\"HEAP32\"] = HEAP32 = new Int32Array(b);\n      Module[\"HEAPU32\"] = HEAPU32 = new Uint32Array(b);\n      Module[\"HEAPF32\"] = HEAPF32 = new Float32Array(b);\n      Module[\"HEAPF64\"] = HEAPF64 = new Float64Array(b);\n      Module[\"HEAP64\"] = HEAP64 = new BigInt64Array(b);\n      Module[\"HEAPU64\"] = HEAPU64 = new BigUint64Array(b);\n    }\n    __name(updateMemoryViews, \"updateMemoryViews\");\n    if (Module[\"wasmMemory\"]) {\n      wasmMemory = Module[\"wasmMemory\"];\n    } else {\n      var INITIAL_MEMORY = Module[\"INITIAL_MEMORY\"] || 33554432;\n      wasmMemory = new WebAssembly.Memory({\n        \"initial\": INITIAL_MEMORY / 65536,\n        // In theory we should not need to emit the maximum if we want \"unlimited\"\n        // or 4GB of memory, but VMs error on that atm, see\n        // https://github.com/emscripten-core/emscripten/issues/14130\n        // And in the pthreads case we definitely need to emit a maximum. So\n        // always emit one.\n        \"maximum\": 32768\n      });\n    }\n    updateMemoryViews();\n    var __ATPRERUN__ = [];\n    var __ATINIT__ = [];\n    var __ATMAIN__ = [];\n    var __ATEXIT__ = [];\n    var __ATPOSTRUN__ = [];\n    var __RELOC_FUNCS__ = [];\n    function preRun() {\n      if (Module[\"preRun\"]) {\n        if (typeof Module[\"preRun\"] == \"function\") Module[\"preRun\"] = [Module[\"preRun\"]];\n        while (Module[\"preRun\"].length) {\n          addOnPreRun(Module[\"preRun\"].shift());\n        }\n      }\n      callRuntimeCallbacks(__ATPRERUN__);\n    }\n    __name(preRun, \"preRun\");\n    function initRuntime() {\n      runtimeInitialized = true;\n      callRuntimeCallbacks(__RELOC_FUNCS__);\n      callRuntimeCallbacks(__ATINIT__);\n    }\n    __name(initRuntime, \"initRuntime\");\n    function preMain() {\n      callRuntimeCallbacks(__ATMAIN__);\n    }\n    __name(preMain, \"preMain\");\n    function postRun() {\n      if (Module[\"postRun\"]) {\n        if (typeof Module[\"postRun\"] == \"function\") Module[\"postRun\"] = [Module[\"postRun\"]];\n        while (Module[\"postRun\"].length) {\n          addOnPostRun(Module[\"postRun\"].shift());\n        }\n      }\n      callRuntimeCallbacks(__ATPOSTRUN__);\n    }\n    __name(postRun, \"postRun\");\n    function addOnPreRun(cb) {\n      __ATPRERUN__.unshift(cb);\n    }\n    __name(addOnPreRun, \"addOnPreRun\");\n    function addOnInit(cb) {\n      __ATINIT__.unshift(cb);\n    }\n    __name(addOnInit, \"addOnInit\");\n    function addOnPreMain(cb) {\n      __ATMAIN__.unshift(cb);\n    }\n    __name(addOnPreMain, \"addOnPreMain\");\n    function addOnExit(cb) {\n    }\n    __name(addOnExit, \"addOnExit\");\n    function addOnPostRun(cb) {\n      __ATPOSTRUN__.unshift(cb);\n    }\n    __name(addOnPostRun, \"addOnPostRun\");\n    var runDependencies = 0;\n    var dependenciesFulfilled = null;\n    function getUniqueRunDependency(id) {\n      return id;\n    }\n    __name(getUniqueRunDependency, \"getUniqueRunDependency\");\n    function addRunDependency(id) {\n      runDependencies++;\n      Module[\"monitorRunDependencies\"]?.(runDependencies);\n    }\n    __name(addRunDependency, \"addRunDependency\");\n    function removeRunDependency(id) {\n      runDependencies--;\n      Module[\"monitorRunDependencies\"]?.(runDependencies);\n      if (runDependencies == 0) {\n        if (dependenciesFulfilled) {\n          var callback = dependenciesFulfilled;\n          dependenciesFulfilled = null;\n          callback();\n        }\n      }\n    }\n    __name(removeRunDependency, \"removeRunDependency\");\n    function abort(what) {\n      Module[\"onAbort\"]?.(what);\n      what = \"Aborted(\" + what + \")\";\n      err(what);\n      ABORT = true;\n      what += \". Build with -sASSERTIONS for more info.\";\n      var e = new WebAssembly.RuntimeError(what);\n      readyPromiseReject(e);\n      throw e;\n    }\n    __name(abort, \"abort\");\n    var wasmBinaryFile;\n    function findWasmBinary() {\n      if (Module[\"locateFile\"]) {\n        var f = \"tree-sitter.wasm\";\n        if (!isDataURI(f)) {\n          return locateFile(f);\n        }\n        return f;\n      }\n      return new URL(\"tree-sitter.wasm\", import.meta.url).href;\n    }\n    __name(findWasmBinary, \"findWasmBinary\");\n    function getBinarySync(file) {\n      if (file == wasmBinaryFile && wasmBinary) {\n        return new Uint8Array(wasmBinary);\n      }\n      if (readBinary) {\n        return readBinary(file);\n      }\n      throw \"both async and sync fetching of the wasm failed\";\n    }\n    __name(getBinarySync, \"getBinarySync\");\n    async function getWasmBinary(binaryFile) {\n      if (!wasmBinary) {\n        try {\n          var response = await readAsync(binaryFile);\n          return new Uint8Array(response);\n        } catch {\n        }\n      }\n      return getBinarySync(binaryFile);\n    }\n    __name(getWasmBinary, \"getWasmBinary\");\n    async function instantiateArrayBuffer(binaryFile, imports) {\n      try {\n        var binary2 = await getWasmBinary(binaryFile);\n        var instance2 = await WebAssembly.instantiate(binary2, imports);\n        return instance2;\n      } catch (reason) {\n        err(`failed to asynchronously prepare wasm: ${reason}`);\n        abort(reason);\n      }\n    }\n    __name(instantiateArrayBuffer, \"instantiateArrayBuffer\");\n    async function instantiateAsync(binary2, binaryFile, imports) {\n      if (!binary2 && typeof WebAssembly.instantiateStreaming == \"function\" && !isDataURI(binaryFile) && !isFileURI(binaryFile) && !ENVIRONMENT_IS_NODE) {\n        try {\n          var response = fetch(binaryFile, {\n            credentials: \"same-origin\"\n          });\n          var instantiationResult = await WebAssembly.instantiateStreaming(response, imports);\n          return instantiationResult;\n        } catch (reason) {\n          err(`wasm streaming compile failed: ${reason}`);\n          err(\"falling back to ArrayBuffer instantiation\");\n        }\n      }\n      return instantiateArrayBuffer(binaryFile, imports);\n    }\n    __name(instantiateAsync, \"instantiateAsync\");\n    function getWasmImports() {\n      return {\n        \"env\": wasmImports,\n        \"wasi_snapshot_preview1\": wasmImports,\n        \"GOT.mem\": new Proxy(wasmImports, GOTHandler),\n        \"GOT.func\": new Proxy(wasmImports, GOTHandler)\n      };\n    }\n    __name(getWasmImports, \"getWasmImports\");\n    async function createWasm() {\n      function receiveInstance(instance2, module2) {\n        wasmExports = instance2.exports;\n        wasmExports = relocateExports(wasmExports, 1024);\n        var metadata2 = getDylinkMetadata(module2);\n        if (metadata2.neededDynlibs) {\n          dynamicLibraries = metadata2.neededDynlibs.concat(dynamicLibraries);\n        }\n        mergeLibSymbols(wasmExports, \"main\");\n        LDSO.init();\n        loadDylibs();\n        addOnInit(wasmExports[\"__wasm_call_ctors\"]);\n        __RELOC_FUNCS__.push(wasmExports[\"__wasm_apply_data_relocs\"]);\n        removeRunDependency(\"wasm-instantiate\");\n        return wasmExports;\n      }\n      __name(receiveInstance, \"receiveInstance\");\n      addRunDependency(\"wasm-instantiate\");\n      function receiveInstantiationResult(result2) {\n        return receiveInstance(result2[\"instance\"], result2[\"module\"]);\n      }\n      __name(receiveInstantiationResult, \"receiveInstantiationResult\");\n      var info2 = getWasmImports();\n      if (Module[\"instantiateWasm\"]) {\n        try {\n          return Module[\"instantiateWasm\"](info2, receiveInstance);\n        } catch (e) {\n          err(`Module.instantiateWasm callback failed with error: ${e}`);\n          readyPromiseReject(e);\n        }\n      }\n      wasmBinaryFile ??= findWasmBinary();\n      try {\n        var result = await instantiateAsync(wasmBinary, wasmBinaryFile, info2);\n        var exports = receiveInstantiationResult(result);\n        return exports;\n      } catch (e) {\n        readyPromiseReject(e);\n        return Promise.reject(e);\n      }\n    }\n    __name(createWasm, \"createWasm\");\n    var ASM_CONSTS = {};\n    class ExitStatus {\n      static {\n        __name(this, \"ExitStatus\");\n      }\n      name = \"ExitStatus\";\n      constructor(status) {\n        this.message = `Program terminated with exit(${status})`;\n        this.status = status;\n      }\n    }\n    var GOT = {};\n    var currentModuleWeakSymbols = /* @__PURE__ */ new Set([]);\n    var GOTHandler = {\n      get(obj, symName) {\n        var rtn = GOT[symName];\n        if (!rtn) {\n          rtn = GOT[symName] = new WebAssembly.Global({\n            \"value\": \"i32\",\n            \"mutable\": true\n          });\n        }\n        if (!currentModuleWeakSymbols.has(symName)) {\n          rtn.required = true;\n        }\n        return rtn;\n      }\n    };\n    var LE_HEAP_LOAD_F32 = /* @__PURE__ */ __name((byteOffset) => HEAP_DATA_VIEW.getFloat32(byteOffset, true), \"LE_HEAP_LOAD_F32\");\n    var LE_HEAP_LOAD_F64 = /* @__PURE__ */ __name((byteOffset) => HEAP_DATA_VIEW.getFloat64(byteOffset, true), \"LE_HEAP_LOAD_F64\");\n    var LE_HEAP_LOAD_I16 = /* @__PURE__ */ __name((byteOffset) => HEAP_DATA_VIEW.getInt16(byteOffset, true), \"LE_HEAP_LOAD_I16\");\n    var LE_HEAP_LOAD_I32 = /* @__PURE__ */ __name((byteOffset) => HEAP_DATA_VIEW.getInt32(byteOffset, true), \"LE_HEAP_LOAD_I32\");\n    var LE_HEAP_LOAD_U16 = /* @__PURE__ */ __name((byteOffset) => HEAP_DATA_VIEW.getUint16(byteOffset, true), \"LE_HEAP_LOAD_U16\");\n    var LE_HEAP_LOAD_U32 = /* @__PURE__ */ __name((byteOffset) => HEAP_DATA_VIEW.getUint32(byteOffset, true), \"LE_HEAP_LOAD_U32\");\n    var LE_HEAP_STORE_F32 = /* @__PURE__ */ __name((byteOffset, value) => HEAP_DATA_VIEW.setFloat32(byteOffset, value, true), \"LE_HEAP_STORE_F32\");\n    var LE_HEAP_STORE_F64 = /* @__PURE__ */ __name((byteOffset, value) => HEAP_DATA_VIEW.setFloat64(byteOffset, value, true), \"LE_HEAP_STORE_F64\");\n    var LE_HEAP_STORE_I16 = /* @__PURE__ */ __name((byteOffset, value) => HEAP_DATA_VIEW.setInt16(byteOffset, value, true), \"LE_HEAP_STORE_I16\");\n    var LE_HEAP_STORE_I32 = /* @__PURE__ */ __name((byteOffset, value) => HEAP_DATA_VIEW.setInt32(byteOffset, value, true), \"LE_HEAP_STORE_I32\");\n    var LE_HEAP_STORE_U16 = /* @__PURE__ */ __name((byteOffset, value) => HEAP_DATA_VIEW.setUint16(byteOffset, value, true), \"LE_HEAP_STORE_U16\");\n    var LE_HEAP_STORE_U32 = /* @__PURE__ */ __name((byteOffset, value) => HEAP_DATA_VIEW.setUint32(byteOffset, value, true), \"LE_HEAP_STORE_U32\");\n    var callRuntimeCallbacks = /* @__PURE__ */ __name((callbacks) => {\n      while (callbacks.length > 0) {\n        callbacks.shift()(Module);\n      }\n    }, \"callRuntimeCallbacks\");\n    var UTF8Decoder = typeof TextDecoder != \"undefined\" ? new TextDecoder() : void 0;\n    var UTF8ArrayToString = /* @__PURE__ */ __name((heapOrArray, idx = 0, maxBytesToRead = NaN) => {\n      var endIdx = idx + maxBytesToRead;\n      var endPtr = idx;\n      while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr;\n      if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) {\n        return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr));\n      }\n      var str = \"\";\n      while (idx < endPtr) {\n        var u0 = heapOrArray[idx++];\n        if (!(u0 & 128)) {\n          str += String.fromCharCode(u0);\n          continue;\n        }\n        var u1 = heapOrArray[idx++] & 63;\n        if ((u0 & 224) == 192) {\n          str += String.fromCharCode((u0 & 31) << 6 | u1);\n          continue;\n        }\n        var u2 = heapOrArray[idx++] & 63;\n        if ((u0 & 240) == 224) {\n          u0 = (u0 & 15) << 12 | u1 << 6 | u2;\n        } else {\n          u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heapOrArray[idx++] & 63;\n        }\n        if (u0 < 65536) {\n          str += String.fromCharCode(u0);\n        } else {\n          var ch = u0 - 65536;\n          str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023);\n        }\n      }\n      return str;\n    }, \"UTF8ArrayToString\");\n    var getDylinkMetadata = /* @__PURE__ */ __name((binary2) => {\n      var offset = 0;\n      var end = 0;\n      function getU8() {\n        return binary2[offset++];\n      }\n      __name(getU8, \"getU8\");\n      function getLEB() {\n        var ret = 0;\n        var mul = 1;\n        while (1) {\n          var byte = binary2[offset++];\n          ret += (byte & 127) * mul;\n          mul *= 128;\n          if (!(byte & 128)) break;\n        }\n        return ret;\n      }\n      __name(getLEB, \"getLEB\");\n      function getString() {\n        var len = getLEB();\n        offset += len;\n        return UTF8ArrayToString(binary2, offset - len, len);\n      }\n      __name(getString, \"getString\");\n      function failIf(condition, message) {\n        if (condition) throw new Error(message);\n      }\n      __name(failIf, \"failIf\");\n      var name2 = \"dylink.0\";\n      if (binary2 instanceof WebAssembly.Module) {\n        var dylinkSection = WebAssembly.Module.customSections(binary2, name2);\n        if (dylinkSection.length === 0) {\n          name2 = \"dylink\";\n          dylinkSection = WebAssembly.Module.customSections(binary2, name2);\n        }\n        failIf(dylinkSection.length === 0, \"need dylink section\");\n        binary2 = new Uint8Array(dylinkSection[0]);\n        end = binary2.length;\n      } else {\n        var int32View = new Uint32Array(new Uint8Array(binary2.subarray(0, 24)).buffer);\n        var magicNumberFound = int32View[0] == 1836278016 || int32View[0] == 6386541;\n        failIf(!magicNumberFound, \"need to see wasm magic number\");\n        failIf(binary2[8] !== 0, \"need the dylink section to be first\");\n        offset = 9;\n        var section_size = getLEB();\n        end = offset + section_size;\n        name2 = getString();\n      }\n      var customSection = {\n        neededDynlibs: [],\n        tlsExports: /* @__PURE__ */ new Set(),\n        weakImports: /* @__PURE__ */ new Set()\n      };\n      if (name2 == \"dylink\") {\n        customSection.memorySize = getLEB();\n        customSection.memoryAlign = getLEB();\n        customSection.tableSize = getLEB();\n        customSection.tableAlign = getLEB();\n        var neededDynlibsCount = getLEB();\n        for (var i2 = 0; i2 < neededDynlibsCount; ++i2) {\n          var libname = getString();\n          customSection.neededDynlibs.push(libname);\n        }\n      } else {\n        failIf(name2 !== \"dylink.0\");\n        var WASM_DYLINK_MEM_INFO = 1;\n        var WASM_DYLINK_NEEDED = 2;\n        var WASM_DYLINK_EXPORT_INFO = 3;\n        var WASM_DYLINK_IMPORT_INFO = 4;\n        var WASM_SYMBOL_TLS = 256;\n        var WASM_SYMBOL_BINDING_MASK = 3;\n        var WASM_SYMBOL_BINDING_WEAK = 1;\n        while (offset < end) {\n          var subsectionType = getU8();\n          var subsectionSize = getLEB();\n          if (subsectionType === WASM_DYLINK_MEM_INFO) {\n            customSection.memorySize = getLEB();\n            customSection.memoryAlign = getLEB();\n            customSection.tableSize = getLEB();\n            customSection.tableAlign = getLEB();\n          } else if (subsectionType === WASM_DYLINK_NEEDED) {\n            var neededDynlibsCount = getLEB();\n            for (var i2 = 0; i2 < neededDynlibsCount; ++i2) {\n              libname = getString();\n              customSection.neededDynlibs.push(libname);\n            }\n          } else if (subsectionType === WASM_DYLINK_EXPORT_INFO) {\n            var count = getLEB();\n            while (count--) {\n              var symname = getString();\n              var flags2 = getLEB();\n              if (flags2 & WASM_SYMBOL_TLS) {\n                customSection.tlsExports.add(symname);\n              }\n            }\n          } else if (subsectionType === WASM_DYLINK_IMPORT_INFO) {\n            var count = getLEB();\n            while (count--) {\n              var modname = getString();\n              var symname = getString();\n              var flags2 = getLEB();\n              if ((flags2 & WASM_SYMBOL_BINDING_MASK) == WASM_SYMBOL_BINDING_WEAK) {\n                customSection.weakImports.add(symname);\n              }\n            }\n          } else {\n            offset += subsectionSize;\n          }\n        }\n      }\n      return customSection;\n    }, \"getDylinkMetadata\");\n    function getValue(ptr, type = \"i8\") {\n      if (type.endsWith(\"*\")) type = \"*\";\n      switch (type) {\n        case \"i1\":\n          return HEAP8[ptr];\n        case \"i8\":\n          return HEAP8[ptr];\n        case \"i16\":\n          return LE_HEAP_LOAD_I16((ptr >> 1) * 2);\n        case \"i32\":\n          return LE_HEAP_LOAD_I32((ptr >> 2) * 4);\n        case \"i64\":\n          return HEAP64[ptr >> 3];\n        case \"float\":\n          return LE_HEAP_LOAD_F32((ptr >> 2) * 4);\n        case \"double\":\n          return LE_HEAP_LOAD_F64((ptr >> 3) * 8);\n        case \"*\":\n          return LE_HEAP_LOAD_U32((ptr >> 2) * 4);\n        default:\n          abort(`invalid type for getValue: ${type}`);\n      }\n    }\n    __name(getValue, \"getValue\");\n    var newDSO = /* @__PURE__ */ __name((name2, handle2, syms) => {\n      var dso = {\n        refcount: Infinity,\n        name: name2,\n        exports: syms,\n        global: true\n      };\n      LDSO.loadedLibsByName[name2] = dso;\n      if (handle2 != void 0) {\n        LDSO.loadedLibsByHandle[handle2] = dso;\n      }\n      return dso;\n    }, \"newDSO\");\n    var LDSO = {\n      loadedLibsByName: {},\n      loadedLibsByHandle: {},\n      init() {\n        newDSO(\"__main__\", 0, wasmImports);\n      }\n    };\n    var ___heap_base = 78224;\n    var alignMemory = /* @__PURE__ */ __name((size, alignment) => Math.ceil(size / alignment) * alignment, \"alignMemory\");\n    var getMemory = /* @__PURE__ */ __name((size) => {\n      if (runtimeInitialized) {\n        return _calloc(size, 1);\n      }\n      var ret = ___heap_base;\n      var end = ret + alignMemory(size, 16);\n      ___heap_base = end;\n      GOT[\"__heap_base\"].value = end;\n      return ret;\n    }, \"getMemory\");\n    var isInternalSym = /* @__PURE__ */ __name((symName) => [\"__cpp_exception\", \"__c_longjmp\", \"__wasm_apply_data_relocs\", \"__dso_handle\", \"__tls_size\", \"__tls_align\", \"__set_stack_limits\", \"_emscripten_tls_init\", \"__wasm_init_tls\", \"__wasm_call_ctors\", \"__start_em_asm\", \"__stop_em_asm\", \"__start_em_js\", \"__stop_em_js\"].includes(symName) || symName.startsWith(\"__em_js__\"), \"isInternalSym\");\n    var uleb128Encode = /* @__PURE__ */ __name((n, target) => {\n      if (n < 128) {\n        target.push(n);\n      } else {\n        target.push(n % 128 | 128, n >> 7);\n      }\n    }, \"uleb128Encode\");\n    var sigToWasmTypes = /* @__PURE__ */ __name((sig) => {\n      var typeNames = {\n        \"i\": \"i32\",\n        \"j\": \"i64\",\n        \"f\": \"f32\",\n        \"d\": \"f64\",\n        \"e\": \"externref\",\n        \"p\": \"i32\"\n      };\n      var type = {\n        parameters: [],\n        results: sig[0] == \"v\" ? [] : [typeNames[sig[0]]]\n      };\n      for (var i2 = 1; i2 < sig.length; ++i2) {\n        type.parameters.push(typeNames[sig[i2]]);\n      }\n      return type;\n    }, \"sigToWasmTypes\");\n    var generateFuncType = /* @__PURE__ */ __name((sig, target) => {\n      var sigRet = sig.slice(0, 1);\n      var sigParam = sig.slice(1);\n      var typeCodes = {\n        \"i\": 127,\n        // i32\n        \"p\": 127,\n        // i32\n        \"j\": 126,\n        // i64\n        \"f\": 125,\n        // f32\n        \"d\": 124,\n        // f64\n        \"e\": 111\n      };\n      target.push(96);\n      uleb128Encode(sigParam.length, target);\n      for (var i2 = 0; i2 < sigParam.length; ++i2) {\n        target.push(typeCodes[sigParam[i2]]);\n      }\n      if (sigRet == \"v\") {\n        target.push(0);\n      } else {\n        target.push(1, typeCodes[sigRet]);\n      }\n    }, \"generateFuncType\");\n    var convertJsFunctionToWasm = /* @__PURE__ */ __name((func2, sig) => {\n      if (typeof WebAssembly.Function == \"function\") {\n        return new WebAssembly.Function(sigToWasmTypes(sig), func2);\n      }\n      var typeSectionBody = [1];\n      generateFuncType(sig, typeSectionBody);\n      var bytes = [\n        0,\n        97,\n        115,\n        109,\n        // magic (\"\\0asm\")\n        1,\n        0,\n        0,\n        0,\n        // version: 1\n        1\n      ];\n      uleb128Encode(typeSectionBody.length, bytes);\n      bytes.push(...typeSectionBody);\n      bytes.push(\n        2,\n        7,\n        // import section\n        // (import \"e\" \"f\" (func 0 (type 0)))\n        1,\n        1,\n        101,\n        1,\n        102,\n        0,\n        0,\n        7,\n        5,\n        // export section\n        // (export \"f\" (func 0 (type 0)))\n        1,\n        1,\n        102,\n        0,\n        0\n      );\n      var module2 = new WebAssembly.Module(new Uint8Array(bytes));\n      var instance2 = new WebAssembly.Instance(module2, {\n        \"e\": {\n          \"f\": func2\n        }\n      });\n      var wrappedFunc = instance2.exports[\"f\"];\n      return wrappedFunc;\n    }, \"convertJsFunctionToWasm\");\n    var wasmTableMirror = [];\n    var wasmTable = new WebAssembly.Table({\n      \"initial\": 31,\n      \"element\": \"anyfunc\"\n    });\n    var getWasmTableEntry = /* @__PURE__ */ __name((funcPtr) => {\n      var func2 = wasmTableMirror[funcPtr];\n      if (!func2) {\n        if (funcPtr >= wasmTableMirror.length) wasmTableMirror.length = funcPtr + 1;\n        wasmTableMirror[funcPtr] = func2 = wasmTable.get(funcPtr);\n      }\n      return func2;\n    }, \"getWasmTableEntry\");\n    var updateTableMap = /* @__PURE__ */ __name((offset, count) => {\n      if (functionsInTableMap) {\n        for (var i2 = offset; i2 < offset + count; i2++) {\n          var item = getWasmTableEntry(i2);\n          if (item) {\n            functionsInTableMap.set(item, i2);\n          }\n        }\n      }\n    }, \"updateTableMap\");\n    var functionsInTableMap;\n    var getFunctionAddress = /* @__PURE__ */ __name((func2) => {\n      if (!functionsInTableMap) {\n        functionsInTableMap = /* @__PURE__ */ new WeakMap();\n        updateTableMap(0, wasmTable.length);\n      }\n      return functionsInTableMap.get(func2) || 0;\n    }, \"getFunctionAddress\");\n    var freeTableIndexes = [];\n    var getEmptyTableSlot = /* @__PURE__ */ __name(() => {\n      if (freeTableIndexes.length) {\n        return freeTableIndexes.pop();\n      }\n      try {\n        wasmTable.grow(1);\n      } catch (err2) {\n        if (!(err2 instanceof RangeError)) {\n          throw err2;\n        }\n        throw \"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.\";\n      }\n      return wasmTable.length - 1;\n    }, \"getEmptyTableSlot\");\n    var setWasmTableEntry = /* @__PURE__ */ __name((idx, func2) => {\n      wasmTable.set(idx, func2);\n      wasmTableMirror[idx] = wasmTable.get(idx);\n    }, \"setWasmTableEntry\");\n    var addFunction = /* @__PURE__ */ __name((func2, sig) => {\n      var rtn = getFunctionAddress(func2);\n      if (rtn) {\n        return rtn;\n      }\n      var ret = getEmptyTableSlot();\n      try {\n        setWasmTableEntry(ret, func2);\n      } catch (err2) {\n        if (!(err2 instanceof TypeError)) {\n          throw err2;\n        }\n        var wrapped = convertJsFunctionToWasm(func2, sig);\n        setWasmTableEntry(ret, wrapped);\n      }\n      functionsInTableMap.set(func2, ret);\n      return ret;\n    }, \"addFunction\");\n    var updateGOT = /* @__PURE__ */ __name((exports, replace) => {\n      for (var symName in exports) {\n        if (isInternalSym(symName)) {\n          continue;\n        }\n        var value = exports[symName];\n        GOT[symName] ||= new WebAssembly.Global({\n          \"value\": \"i32\",\n          \"mutable\": true\n        });\n        if (replace || GOT[symName].value == 0) {\n          if (typeof value == \"function\") {\n            GOT[symName].value = addFunction(value);\n          } else if (typeof value == \"number\") {\n            GOT[symName].value = value;\n          } else {\n            err(`unhandled export type for '${symName}': ${typeof value}`);\n          }\n        }\n      }\n    }, \"updateGOT\");\n    var relocateExports = /* @__PURE__ */ __name((exports, memoryBase2, replace) => {\n      var relocated = {};\n      for (var e in exports) {\n        var value = exports[e];\n        if (typeof value == \"object\") {\n          value = value.value;\n        }\n        if (typeof value == \"number\") {\n          value += memoryBase2;\n        }\n        relocated[e] = value;\n      }\n      updateGOT(relocated, replace);\n      return relocated;\n    }, \"relocateExports\");\n    var isSymbolDefined = /* @__PURE__ */ __name((symName) => {\n      var existing = wasmImports[symName];\n      if (!existing || existing.stub) {\n        return false;\n      }\n      return true;\n    }, \"isSymbolDefined\");\n    var dynCall = /* @__PURE__ */ __name((sig, ptr, args2 = []) => {\n      var rtn = getWasmTableEntry(ptr)(...args2);\n      return rtn;\n    }, \"dynCall\");\n    var stackSave = /* @__PURE__ */ __name(() => _emscripten_stack_get_current(), \"stackSave\");\n    var stackRestore = /* @__PURE__ */ __name((val) => __emscripten_stack_restore(val), \"stackRestore\");\n    var createInvokeFunction = /* @__PURE__ */ __name((sig) => (ptr, ...args2) => {\n      var sp = stackSave();\n      try {\n        return dynCall(sig, ptr, args2);\n      } catch (e) {\n        stackRestore(sp);\n        if (e !== e + 0) throw e;\n        _setThrew(1, 0);\n        if (sig[0] == \"j\") return 0n;\n      }\n    }, \"createInvokeFunction\");\n    var resolveGlobalSymbol = /* @__PURE__ */ __name((symName, direct = false) => {\n      var sym;\n      if (isSymbolDefined(symName)) {\n        sym = wasmImports[symName];\n      } else if (symName.startsWith(\"invoke_\")) {\n        sym = wasmImports[symName] = createInvokeFunction(symName.split(\"_\")[1]);\n      }\n      return {\n        sym,\n        name: symName\n      };\n    }, \"resolveGlobalSymbol\");\n    var UTF8ToString = /* @__PURE__ */ __name((ptr, maxBytesToRead) => ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : \"\", \"UTF8ToString\");\n    var loadWebAssemblyModule = /* @__PURE__ */ __name((binary, flags, libName, localScope, handle) => {\n      var metadata = getDylinkMetadata(binary);\n      currentModuleWeakSymbols = metadata.weakImports;\n      function loadModule() {\n        var firstLoad = !handle || !HEAP8[handle + 8];\n        if (firstLoad) {\n          var memAlign = Math.pow(2, metadata.memoryAlign);\n          var memoryBase = metadata.memorySize ? alignMemory(getMemory(metadata.memorySize + memAlign), memAlign) : 0;\n          var tableBase = metadata.tableSize ? wasmTable.length : 0;\n          if (handle) {\n            HEAP8[handle + 8] = 1;\n            LE_HEAP_STORE_U32((handle + 12 >> 2) * 4, memoryBase);\n            LE_HEAP_STORE_I32((handle + 16 >> 2) * 4, metadata.memorySize);\n            LE_HEAP_STORE_U32((handle + 20 >> 2) * 4, tableBase);\n            LE_HEAP_STORE_I32((handle + 24 >> 2) * 4, metadata.tableSize);\n          }\n        } else {\n          memoryBase = LE_HEAP_LOAD_U32((handle + 12 >> 2) * 4);\n          tableBase = LE_HEAP_LOAD_U32((handle + 20 >> 2) * 4);\n        }\n        var tableGrowthNeeded = tableBase + metadata.tableSize - wasmTable.length;\n        if (tableGrowthNeeded > 0) {\n          wasmTable.grow(tableGrowthNeeded);\n        }\n        var moduleExports;\n        function resolveSymbol(sym) {\n          var resolved = resolveGlobalSymbol(sym).sym;\n          if (!resolved && localScope) {\n            resolved = localScope[sym];\n          }\n          if (!resolved) {\n            resolved = moduleExports[sym];\n          }\n          return resolved;\n        }\n        __name(resolveSymbol, \"resolveSymbol\");\n        var proxyHandler = {\n          get(stubs, prop) {\n            switch (prop) {\n              case \"__memory_base\":\n                return memoryBase;\n              case \"__table_base\":\n                return tableBase;\n            }\n            if (prop in wasmImports && !wasmImports[prop].stub) {\n              return wasmImports[prop];\n            }\n            if (!(prop in stubs)) {\n              var resolved;\n              stubs[prop] = (...args2) => {\n                resolved ||= resolveSymbol(prop);\n                return resolved(...args2);\n              };\n            }\n            return stubs[prop];\n          }\n        };\n        var proxy = new Proxy({}, proxyHandler);\n        var info = {\n          \"GOT.mem\": new Proxy({}, GOTHandler),\n          \"GOT.func\": new Proxy({}, GOTHandler),\n          \"env\": proxy,\n          \"wasi_snapshot_preview1\": proxy\n        };\n        function postInstantiation(module, instance) {\n          updateTableMap(tableBase, metadata.tableSize);\n          moduleExports = relocateExports(instance.exports, memoryBase);\n          if (!flags.allowUndefined) {\n            reportUndefinedSymbols();\n          }\n          function addEmAsm(addr, body) {\n            var args = [];\n            var arity = 0;\n            for (; arity < 16; arity++) {\n              if (body.indexOf(\"$\" + arity) != -1) {\n                args.push(\"$\" + arity);\n              } else {\n                break;\n              }\n            }\n            args = args.join(\",\");\n            var func = `(${args}) => { ${body} };`;\n            ASM_CONSTS[start] = eval(func);\n          }\n          __name(addEmAsm, \"addEmAsm\");\n          if (\"__start_em_asm\" in moduleExports) {\n            var start = moduleExports[\"__start_em_asm\"];\n            var stop = moduleExports[\"__stop_em_asm\"];\n            while (start < stop) {\n              var jsString = UTF8ToString(start);\n              addEmAsm(start, jsString);\n              start = HEAPU8.indexOf(0, start) + 1;\n            }\n          }\n          function addEmJs(name, cSig, body) {\n            var jsArgs = [];\n            cSig = cSig.slice(1, -1);\n            if (cSig != \"void\") {\n              cSig = cSig.split(\",\");\n              for (var i in cSig) {\n                var jsArg = cSig[i].split(\" \").pop();\n                jsArgs.push(jsArg.replace(\"*\", \"\"));\n              }\n            }\n            var func = `(${jsArgs}) => ${body};`;\n            moduleExports[name] = eval(func);\n          }\n          __name(addEmJs, \"addEmJs\");\n          for (var name in moduleExports) {\n            if (name.startsWith(\"__em_js__\")) {\n              var start = moduleExports[name];\n              var jsString = UTF8ToString(start);\n              var parts = jsString.split(\"<::>\");\n              addEmJs(name.replace(\"__em_js__\", \"\"), parts[0], parts[1]);\n              delete moduleExports[name];\n            }\n          }\n          var applyRelocs = moduleExports[\"__wasm_apply_data_relocs\"];\n          if (applyRelocs) {\n            if (runtimeInitialized) {\n              applyRelocs();\n            } else {\n              __RELOC_FUNCS__.push(applyRelocs);\n            }\n          }\n          var init = moduleExports[\"__wasm_call_ctors\"];\n          if (init) {\n            if (runtimeInitialized) {\n              init();\n            } else {\n              __ATINIT__.push(init);\n            }\n          }\n          return moduleExports;\n        }\n        __name(postInstantiation, \"postInstantiation\");\n        if (flags.loadAsync) {\n          if (binary instanceof WebAssembly.Module) {\n            var instance = new WebAssembly.Instance(binary, info);\n            return Promise.resolve(postInstantiation(binary, instance));\n          }\n          return WebAssembly.instantiate(binary, info).then((result) => postInstantiation(result.module, result.instance));\n        }\n        var module = binary instanceof WebAssembly.Module ? binary : new WebAssembly.Module(binary);\n        var instance = new WebAssembly.Instance(module, info);\n        return postInstantiation(module, instance);\n      }\n      __name(loadModule, \"loadModule\");\n      if (flags.loadAsync) {\n        return metadata.neededDynlibs.reduce((chain, dynNeeded) => chain.then(() => loadDynamicLibrary(dynNeeded, flags, localScope)), Promise.resolve()).then(loadModule);\n      }\n      metadata.neededDynlibs.forEach((needed) => loadDynamicLibrary(needed, flags, localScope));\n      return loadModule();\n    }, \"loadWebAssemblyModule\");\n    var mergeLibSymbols = /* @__PURE__ */ __name((exports, libName2) => {\n      for (var [sym, exp] of Object.entries(exports)) {\n        const setImport = /* @__PURE__ */ __name((target) => {\n          if (!isSymbolDefined(target)) {\n            wasmImports[target] = exp;\n          }\n        }, \"setImport\");\n        setImport(sym);\n        const main_alias = \"__main_argc_argv\";\n        if (sym == \"main\") {\n          setImport(main_alias);\n        }\n        if (sym == main_alias) {\n          setImport(\"main\");\n        }\n      }\n    }, \"mergeLibSymbols\");\n    var asyncLoad = /* @__PURE__ */ __name(async (url) => {\n      var arrayBuffer = await readAsync(url);\n      return new Uint8Array(arrayBuffer);\n    }, \"asyncLoad\");\n    function loadDynamicLibrary(libName2, flags2 = {\n      global: true,\n      nodelete: true\n    }, localScope2, handle2) {\n      var dso = LDSO.loadedLibsByName[libName2];\n      if (dso) {\n        if (!flags2.global) {\n          if (localScope2) {\n            Object.assign(localScope2, dso.exports);\n          }\n        } else if (!dso.global) {\n          dso.global = true;\n          mergeLibSymbols(dso.exports, libName2);\n        }\n        if (flags2.nodelete && dso.refcount !== Infinity) {\n          dso.refcount = Infinity;\n        }\n        dso.refcount++;\n        if (handle2) {\n          LDSO.loadedLibsByHandle[handle2] = dso;\n        }\n        return flags2.loadAsync ? Promise.resolve(true) : true;\n      }\n      dso = newDSO(libName2, handle2, \"loading\");\n      dso.refcount = flags2.nodelete ? Infinity : 1;\n      dso.global = flags2.global;\n      function loadLibData() {\n        if (handle2) {\n          var data = LE_HEAP_LOAD_U32((handle2 + 28 >> 2) * 4);\n          var dataSize = LE_HEAP_LOAD_U32((handle2 + 32 >> 2) * 4);\n          if (data && dataSize) {\n            var libData = HEAP8.slice(data, data + dataSize);\n            return flags2.loadAsync ? Promise.resolve(libData) : libData;\n          }\n        }\n        var libFile = locateFile(libName2);\n        if (flags2.loadAsync) {\n          return asyncLoad(libFile);\n        }\n        if (!readBinary) {\n          throw new Error(`${libFile}: file not found, and synchronous loading of external files is not available`);\n        }\n        return readBinary(libFile);\n      }\n      __name(loadLibData, \"loadLibData\");\n      function getExports() {\n        if (flags2.loadAsync) {\n          return loadLibData().then((libData) => loadWebAssemblyModule(libData, flags2, libName2, localScope2, handle2));\n        }\n        return loadWebAssemblyModule(loadLibData(), flags2, libName2, localScope2, handle2);\n      }\n      __name(getExports, \"getExports\");\n      function moduleLoaded(exports) {\n        if (dso.global) {\n          mergeLibSymbols(exports, libName2);\n        } else if (localScope2) {\n          Object.assign(localScope2, exports);\n        }\n        dso.exports = exports;\n      }\n      __name(moduleLoaded, \"moduleLoaded\");\n      if (flags2.loadAsync) {\n        return getExports().then((exports) => {\n          moduleLoaded(exports);\n          return true;\n        });\n      }\n      moduleLoaded(getExports());\n      return true;\n    }\n    __name(loadDynamicLibrary, \"loadDynamicLibrary\");\n    var reportUndefinedSymbols = /* @__PURE__ */ __name(() => {\n      for (var [symName, entry] of Object.entries(GOT)) {\n        if (entry.value == 0) {\n          var value = resolveGlobalSymbol(symName, true).sym;\n          if (!value && !entry.required) {\n            continue;\n          }\n          if (typeof value == \"function\") {\n            entry.value = addFunction(value, value.sig);\n          } else if (typeof value == \"number\") {\n            entry.value = value;\n          } else {\n            throw new Error(`bad export type for '${symName}': ${typeof value}`);\n          }\n        }\n      }\n    }, \"reportUndefinedSymbols\");\n    var loadDylibs = /* @__PURE__ */ __name(() => {\n      if (!dynamicLibraries.length) {\n        reportUndefinedSymbols();\n        return;\n      }\n      addRunDependency(\"loadDylibs\");\n      dynamicLibraries.reduce((chain, lib) => chain.then(() => loadDynamicLibrary(lib, {\n        loadAsync: true,\n        global: true,\n        nodelete: true,\n        allowUndefined: true\n      })), Promise.resolve()).then(() => {\n        reportUndefinedSymbols();\n        removeRunDependency(\"loadDylibs\");\n      });\n    }, \"loadDylibs\");\n    var noExitRuntime = Module[\"noExitRuntime\"] || true;\n    function setValue(ptr, value, type = \"i8\") {\n      if (type.endsWith(\"*\")) type = \"*\";\n      switch (type) {\n        case \"i1\":\n          HEAP8[ptr] = value;\n          break;\n        case \"i8\":\n          HEAP8[ptr] = value;\n          break;\n        case \"i16\":\n          LE_HEAP_STORE_I16((ptr >> 1) * 2, value);\n          break;\n        case \"i32\":\n          LE_HEAP_STORE_I32((ptr >> 2) * 4, value);\n          break;\n        case \"i64\":\n          HEAP64[ptr >> 3] = BigInt(value);\n          break;\n        case \"float\":\n          LE_HEAP_STORE_F32((ptr >> 2) * 4, value);\n          break;\n        case \"double\":\n          LE_HEAP_STORE_F64((ptr >> 3) * 8, value);\n          break;\n        case \"*\":\n          LE_HEAP_STORE_U32((ptr >> 2) * 4, value);\n          break;\n        default:\n          abort(`invalid type for setValue: ${type}`);\n      }\n    }\n    __name(setValue, \"setValue\");\n    var ___memory_base = new WebAssembly.Global({\n      \"value\": \"i32\",\n      \"mutable\": false\n    }, 1024);\n    var ___stack_pointer = new WebAssembly.Global({\n      \"value\": \"i32\",\n      \"mutable\": true\n    }, 78224);\n    var ___table_base = new WebAssembly.Global({\n      \"value\": \"i32\",\n      \"mutable\": false\n    }, 1);\n    var __abort_js = /* @__PURE__ */ __name(() => abort(\"\"), \"__abort_js\");\n    __abort_js.sig = \"v\";\n    var _emscripten_get_now = /* @__PURE__ */ __name(() => performance.now(), \"_emscripten_get_now\");\n    _emscripten_get_now.sig = \"d\";\n    var _emscripten_date_now = /* @__PURE__ */ __name(() => Date.now(), \"_emscripten_date_now\");\n    _emscripten_date_now.sig = \"d\";\n    var nowIsMonotonic = 1;\n    var checkWasiClock = /* @__PURE__ */ __name((clock_id) => clock_id >= 0 && clock_id <= 3, \"checkWasiClock\");\n    var INT53_MAX = 9007199254740992;\n    var INT53_MIN = -9007199254740992;\n    var bigintToI53Checked = /* @__PURE__ */ __name((num) => num < INT53_MIN || num > INT53_MAX ? NaN : Number(num), \"bigintToI53Checked\");\n    function _clock_time_get(clk_id, ignored_precision, ptime) {\n      ignored_precision = bigintToI53Checked(ignored_precision);\n      if (!checkWasiClock(clk_id)) {\n        return 28;\n      }\n      var now;\n      if (clk_id === 0) {\n        now = _emscripten_date_now();\n      } else if (nowIsMonotonic) {\n        now = _emscripten_get_now();\n      } else {\n        return 52;\n      }\n      var nsec = Math.round(now * 1e3 * 1e3);\n      HEAP64[ptime >> 3] = BigInt(nsec);\n      return 0;\n    }\n    __name(_clock_time_get, \"_clock_time_get\");\n    _clock_time_get.sig = \"iijp\";\n    var getHeapMax = /* @__PURE__ */ __name(() => (\n      // Stay one Wasm page short of 4GB: while e.g. Chrome is able to allocate\n      // full 4GB Wasm memories, the size will wrap back to 0 bytes in Wasm side\n      // for any code that deals with heap sizes, which would require special\n      // casing all heap size related code to treat 0 specially.\n      2147483648\n    ), \"getHeapMax\");\n    var growMemory = /* @__PURE__ */ __name((size) => {\n      var b = wasmMemory.buffer;\n      var pages = (size - b.byteLength + 65535) / 65536 | 0;\n      try {\n        wasmMemory.grow(pages);\n        updateMemoryViews();\n        return 1;\n      } catch (e) {\n      }\n    }, \"growMemory\");\n    var _emscripten_resize_heap = /* @__PURE__ */ __name((requestedSize) => {\n      var oldSize = HEAPU8.length;\n      requestedSize >>>= 0;\n      var maxHeapSize = getHeapMax();\n      if (requestedSize > maxHeapSize) {\n        return false;\n      }\n      for (var cutDown = 1; cutDown <= 4; cutDown *= 2) {\n        var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown);\n        overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296);\n        var newSize = Math.min(maxHeapSize, alignMemory(Math.max(requestedSize, overGrownHeapSize), 65536));\n        var replacement = growMemory(newSize);\n        if (replacement) {\n          return true;\n        }\n      }\n      return false;\n    }, \"_emscripten_resize_heap\");\n    _emscripten_resize_heap.sig = \"ip\";\n    var _fd_close = /* @__PURE__ */ __name((fd) => 52, \"_fd_close\");\n    _fd_close.sig = \"ii\";\n    function _fd_seek(fd, offset, whence, newOffset) {\n      offset = bigintToI53Checked(offset);\n      return 70;\n    }\n    __name(_fd_seek, \"_fd_seek\");\n    _fd_seek.sig = \"iijip\";\n    var printCharBuffers = [null, [], []];\n    var printChar = /* @__PURE__ */ __name((stream, curr) => {\n      var buffer = printCharBuffers[stream];\n      if (curr === 0 || curr === 10) {\n        (stream === 1 ? out : err)(UTF8ArrayToString(buffer));\n        buffer.length = 0;\n      } else {\n        buffer.push(curr);\n      }\n    }, \"printChar\");\n    var flush_NO_FILESYSTEM = /* @__PURE__ */ __name(() => {\n      if (printCharBuffers[1].length) printChar(1, 10);\n      if (printCharBuffers[2].length) printChar(2, 10);\n    }, \"flush_NO_FILESYSTEM\");\n    var SYSCALLS = {\n      varargs: void 0,\n      getStr(ptr) {\n        var ret = UTF8ToString(ptr);\n        return ret;\n      }\n    };\n    var _fd_write = /* @__PURE__ */ __name((fd, iov, iovcnt, pnum) => {\n      var num = 0;\n      for (var i2 = 0; i2 < iovcnt; i2++) {\n        var ptr = LE_HEAP_LOAD_U32((iov >> 2) * 4);\n        var len = LE_HEAP_LOAD_U32((iov + 4 >> 2) * 4);\n        iov += 8;\n        for (var j = 0; j < len; j++) {\n          printChar(fd, HEAPU8[ptr + j]);\n        }\n        num += len;\n      }\n      LE_HEAP_STORE_U32((pnum >> 2) * 4, num);\n      return 0;\n    }, \"_fd_write\");\n    _fd_write.sig = \"iippp\";\n    function _tree_sitter_log_callback(isLexMessage, messageAddress) {\n      if (Module.currentLogCallback) {\n        const message = UTF8ToString(messageAddress);\n        Module.currentLogCallback(message, isLexMessage !== 0);\n      }\n    }\n    __name(_tree_sitter_log_callback, \"_tree_sitter_log_callback\");\n    function _tree_sitter_parse_callback(inputBufferAddress, index, row, column, lengthAddress) {\n      const INPUT_BUFFER_SIZE = 10 * 1024;\n      const string = Module.currentParseCallback(index, {\n        row,\n        column\n      });\n      if (typeof string === \"string\") {\n        setValue(lengthAddress, string.length, \"i32\");\n        stringToUTF16(string, inputBufferAddress, INPUT_BUFFER_SIZE);\n      } else {\n        setValue(lengthAddress, 0, \"i32\");\n      }\n    }\n    __name(_tree_sitter_parse_callback, \"_tree_sitter_parse_callback\");\n    function _tree_sitter_progress_callback(currentOffset, hasError) {\n      if (Module.currentProgressCallback) {\n        return Module.currentProgressCallback({\n          currentOffset,\n          hasError\n        });\n      }\n      return false;\n    }\n    __name(_tree_sitter_progress_callback, \"_tree_sitter_progress_callback\");\n    function _tree_sitter_query_progress_callback(currentOffset) {\n      if (Module.currentQueryProgressCallback) {\n        return Module.currentQueryProgressCallback({\n          currentOffset\n        });\n      }\n      return false;\n    }\n    __name(_tree_sitter_query_progress_callback, \"_tree_sitter_query_progress_callback\");\n    var runtimeKeepaliveCounter = 0;\n    var keepRuntimeAlive = /* @__PURE__ */ __name(() => noExitRuntime || runtimeKeepaliveCounter > 0, \"keepRuntimeAlive\");\n    var _proc_exit = /* @__PURE__ */ __name((code) => {\n      EXITSTATUS = code;\n      if (!keepRuntimeAlive()) {\n        Module[\"onExit\"]?.(code);\n        ABORT = true;\n      }\n      quit_(code, new ExitStatus(code));\n    }, \"_proc_exit\");\n    _proc_exit.sig = \"vi\";\n    var exitJS = /* @__PURE__ */ __name((status, implicit) => {\n      EXITSTATUS = status;\n      _proc_exit(status);\n    }, \"exitJS\");\n    var handleException = /* @__PURE__ */ __name((e) => {\n      if (e instanceof ExitStatus || e == \"unwind\") {\n        return EXITSTATUS;\n      }\n      quit_(1, e);\n    }, \"handleException\");\n    var lengthBytesUTF8 = /* @__PURE__ */ __name((str) => {\n      var len = 0;\n      for (var i2 = 0; i2 < str.length; ++i2) {\n        var c = str.charCodeAt(i2);\n        if (c <= 127) {\n          len++;\n        } else if (c <= 2047) {\n          len += 2;\n        } else if (c >= 55296 && c <= 57343) {\n          len += 4;\n          ++i2;\n        } else {\n          len += 3;\n        }\n      }\n      return len;\n    }, \"lengthBytesUTF8\");\n    var stringToUTF8Array = /* @__PURE__ */ __name((str, heap, outIdx, maxBytesToWrite) => {\n      if (!(maxBytesToWrite > 0)) return 0;\n      var startIdx = outIdx;\n      var endIdx = outIdx + maxBytesToWrite - 1;\n      for (var i2 = 0; i2 < str.length; ++i2) {\n        var u = str.charCodeAt(i2);\n        if (u >= 55296 && u <= 57343) {\n          var u1 = str.charCodeAt(++i2);\n          u = 65536 + ((u & 1023) << 10) | u1 & 1023;\n        }\n        if (u <= 127) {\n          if (outIdx >= endIdx) break;\n          heap[outIdx++] = u;\n        } else if (u <= 2047) {\n          if (outIdx + 1 >= endIdx) break;\n          heap[outIdx++] = 192 | u >> 6;\n          heap[outIdx++] = 128 | u & 63;\n        } else if (u <= 65535) {\n          if (outIdx + 2 >= endIdx) break;\n          heap[outIdx++] = 224 | u >> 12;\n          heap[outIdx++] = 128 | u >> 6 & 63;\n          heap[outIdx++] = 128 | u & 63;\n        } else {\n          if (outIdx + 3 >= endIdx) break;\n          heap[outIdx++] = 240 | u >> 18;\n          heap[outIdx++] = 128 | u >> 12 & 63;\n          heap[outIdx++] = 128 | u >> 6 & 63;\n          heap[outIdx++] = 128 | u & 63;\n        }\n      }\n      heap[outIdx] = 0;\n      return outIdx - startIdx;\n    }, \"stringToUTF8Array\");\n    var stringToUTF8 = /* @__PURE__ */ __name((str, outPtr, maxBytesToWrite) => stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite), \"stringToUTF8\");\n    var stackAlloc = /* @__PURE__ */ __name((sz) => __emscripten_stack_alloc(sz), \"stackAlloc\");\n    var stringToUTF8OnStack = /* @__PURE__ */ __name((str) => {\n      var size = lengthBytesUTF8(str) + 1;\n      var ret = stackAlloc(size);\n      stringToUTF8(str, ret, size);\n      return ret;\n    }, \"stringToUTF8OnStack\");\n    var AsciiToString = /* @__PURE__ */ __name((ptr) => {\n      var str = \"\";\n      while (1) {\n        var ch = HEAPU8[ptr++];\n        if (!ch) return str;\n        str += String.fromCharCode(ch);\n      }\n    }, \"AsciiToString\");\n    var stringToUTF16 = /* @__PURE__ */ __name((str, outPtr, maxBytesToWrite) => {\n      maxBytesToWrite ??= 2147483647;\n      if (maxBytesToWrite < 2) return 0;\n      maxBytesToWrite -= 2;\n      var startPtr = outPtr;\n      var numCharsToWrite = maxBytesToWrite < str.length * 2 ? maxBytesToWrite / 2 : str.length;\n      for (var i2 = 0; i2 < numCharsToWrite; ++i2) {\n        var codeUnit = str.charCodeAt(i2);\n        LE_HEAP_STORE_I16((outPtr >> 1) * 2, codeUnit);\n        outPtr += 2;\n      }\n      LE_HEAP_STORE_I16((outPtr >> 1) * 2, 0);\n      return outPtr - startPtr;\n    }, \"stringToUTF16\");\n    var wasmImports = {\n      /** @export */\n      __heap_base: ___heap_base,\n      /** @export */\n      __indirect_function_table: wasmTable,\n      /** @export */\n      __memory_base: ___memory_base,\n      /** @export */\n      __stack_pointer: ___stack_pointer,\n      /** @export */\n      __table_base: ___table_base,\n      /** @export */\n      _abort_js: __abort_js,\n      /** @export */\n      clock_time_get: _clock_time_get,\n      /** @export */\n      emscripten_resize_heap: _emscripten_resize_heap,\n      /** @export */\n      fd_close: _fd_close,\n      /** @export */\n      fd_seek: _fd_seek,\n      /** @export */\n      fd_write: _fd_write,\n      /** @export */\n      memory: wasmMemory,\n      /** @export */\n      tree_sitter_log_callback: _tree_sitter_log_callback,\n      /** @export */\n      tree_sitter_parse_callback: _tree_sitter_parse_callback,\n      /** @export */\n      tree_sitter_progress_callback: _tree_sitter_progress_callback,\n      /** @export */\n      tree_sitter_query_progress_callback: _tree_sitter_query_progress_callback\n    };\n    var wasmExports = await createWasm();\n    var ___wasm_call_ctors = wasmExports[\"__wasm_call_ctors\"];\n    var _malloc = Module[\"_malloc\"] = wasmExports[\"malloc\"];\n    var _calloc = Module[\"_calloc\"] = wasmExports[\"calloc\"];\n    var _realloc = Module[\"_realloc\"] = wasmExports[\"realloc\"];\n    var _free = Module[\"_free\"] = wasmExports[\"free\"];\n    var _memcmp = Module[\"_memcmp\"] = wasmExports[\"memcmp\"];\n    var _ts_language_symbol_count = Module[\"_ts_language_symbol_count\"] = wasmExports[\"ts_language_symbol_count\"];\n    var _ts_language_state_count = Module[\"_ts_language_state_count\"] = wasmExports[\"ts_language_state_count\"];\n    var _ts_language_version = Module[\"_ts_language_version\"] = wasmExports[\"ts_language_version\"];\n    var _ts_language_abi_version = Module[\"_ts_language_abi_version\"] = wasmExports[\"ts_language_abi_version\"];\n    var _ts_language_metadata = Module[\"_ts_language_metadata\"] = wasmExports[\"ts_language_metadata\"];\n    var _ts_language_name = Module[\"_ts_language_name\"] = wasmExports[\"ts_language_name\"];\n    var _ts_language_field_count = Module[\"_ts_language_field_count\"] = wasmExports[\"ts_language_field_count\"];\n    var _ts_language_next_state = Module[\"_ts_language_next_state\"] = wasmExports[\"ts_language_next_state\"];\n    var _ts_language_symbol_name = Module[\"_ts_language_symbol_name\"] = wasmExports[\"ts_language_symbol_name\"];\n    var _ts_language_symbol_for_name = Module[\"_ts_language_symbol_for_name\"] = wasmExports[\"ts_language_symbol_for_name\"];\n    var _strncmp = Module[\"_strncmp\"] = wasmExports[\"strncmp\"];\n    var _ts_language_symbol_type = Module[\"_ts_language_symbol_type\"] = wasmExports[\"ts_language_symbol_type\"];\n    var _ts_language_field_name_for_id = Module[\"_ts_language_field_name_for_id\"] = wasmExports[\"ts_language_field_name_for_id\"];\n    var _ts_lookahead_iterator_new = Module[\"_ts_lookahead_iterator_new\"] = wasmExports[\"ts_lookahead_iterator_new\"];\n    var _ts_lookahead_iterator_delete = Module[\"_ts_lookahead_iterator_delete\"] = wasmExports[\"ts_lookahead_iterator_delete\"];\n    var _ts_lookahead_iterator_reset_state = Module[\"_ts_lookahead_iterator_reset_state\"] = wasmExports[\"ts_lookahead_iterator_reset_state\"];\n    var _ts_lookahead_iterator_reset = Module[\"_ts_lookahead_iterator_reset\"] = wasmExports[\"ts_lookahead_iterator_reset\"];\n    var _ts_lookahead_iterator_next = Module[\"_ts_lookahead_iterator_next\"] = wasmExports[\"ts_lookahead_iterator_next\"];\n    var _ts_lookahead_iterator_current_symbol = Module[\"_ts_lookahead_iterator_current_symbol\"] = wasmExports[\"ts_lookahead_iterator_current_symbol\"];\n    var _ts_parser_delete = Module[\"_ts_parser_delete\"] = wasmExports[\"ts_parser_delete\"];\n    var _ts_parser_reset = Module[\"_ts_parser_reset\"] = wasmExports[\"ts_parser_reset\"];\n    var _ts_parser_set_language = Module[\"_ts_parser_set_language\"] = wasmExports[\"ts_parser_set_language\"];\n    var _ts_parser_timeout_micros = Module[\"_ts_parser_timeout_micros\"] = wasmExports[\"ts_parser_timeout_micros\"];\n    var _ts_parser_set_timeout_micros = Module[\"_ts_parser_set_timeout_micros\"] = wasmExports[\"ts_parser_set_timeout_micros\"];\n    var _ts_parser_set_included_ranges = Module[\"_ts_parser_set_included_ranges\"] = wasmExports[\"ts_parser_set_included_ranges\"];\n    var _ts_query_new = Module[\"_ts_query_new\"] = wasmExports[\"ts_query_new\"];\n    var _ts_query_delete = Module[\"_ts_query_delete\"] = wasmExports[\"ts_query_delete\"];\n    var _iswspace = Module[\"_iswspace\"] = wasmExports[\"iswspace\"];\n    var _iswalnum = Module[\"_iswalnum\"] = wasmExports[\"iswalnum\"];\n    var _ts_query_pattern_count = Module[\"_ts_query_pattern_count\"] = wasmExports[\"ts_query_pattern_count\"];\n    var _ts_query_capture_count = Module[\"_ts_query_capture_count\"] = wasmExports[\"ts_query_capture_count\"];\n    var _ts_query_string_count = Module[\"_ts_query_string_count\"] = wasmExports[\"ts_query_string_count\"];\n    var _ts_query_capture_name_for_id = Module[\"_ts_query_capture_name_for_id\"] = wasmExports[\"ts_query_capture_name_for_id\"];\n    var _ts_query_capture_quantifier_for_id = Module[\"_ts_query_capture_quantifier_for_id\"] = wasmExports[\"ts_query_capture_quantifier_for_id\"];\n    var _ts_query_string_value_for_id = Module[\"_ts_query_string_value_for_id\"] = wasmExports[\"ts_query_string_value_for_id\"];\n    var _ts_query_predicates_for_pattern = Module[\"_ts_query_predicates_for_pattern\"] = wasmExports[\"ts_query_predicates_for_pattern\"];\n    var _ts_query_start_byte_for_pattern = Module[\"_ts_query_start_byte_for_pattern\"] = wasmExports[\"ts_query_start_byte_for_pattern\"];\n    var _ts_query_end_byte_for_pattern = Module[\"_ts_query_end_byte_for_pattern\"] = wasmExports[\"ts_query_end_byte_for_pattern\"];\n    var _ts_query_is_pattern_rooted = Module[\"_ts_query_is_pattern_rooted\"] = wasmExports[\"ts_query_is_pattern_rooted\"];\n    var _ts_query_is_pattern_non_local = Module[\"_ts_query_is_pattern_non_local\"] = wasmExports[\"ts_query_is_pattern_non_local\"];\n    var _ts_query_is_pattern_guaranteed_at_step = Module[\"_ts_query_is_pattern_guaranteed_at_step\"] = wasmExports[\"ts_query_is_pattern_guaranteed_at_step\"];\n    var _ts_query_disable_capture = Module[\"_ts_query_disable_capture\"] = wasmExports[\"ts_query_disable_capture\"];\n    var _ts_query_disable_pattern = Module[\"_ts_query_disable_pattern\"] = wasmExports[\"ts_query_disable_pattern\"];\n    var _ts_tree_copy = Module[\"_ts_tree_copy\"] = wasmExports[\"ts_tree_copy\"];\n    var _ts_tree_delete = Module[\"_ts_tree_delete\"] = wasmExports[\"ts_tree_delete\"];\n    var _ts_init = Module[\"_ts_init\"] = wasmExports[\"ts_init\"];\n    var _ts_parser_new_wasm = Module[\"_ts_parser_new_wasm\"] = wasmExports[\"ts_parser_new_wasm\"];\n    var _ts_parser_enable_logger_wasm = Module[\"_ts_parser_enable_logger_wasm\"] = wasmExports[\"ts_parser_enable_logger_wasm\"];\n    var _ts_parser_parse_wasm = Module[\"_ts_parser_parse_wasm\"] = wasmExports[\"ts_parser_parse_wasm\"];\n    var _ts_parser_included_ranges_wasm = Module[\"_ts_parser_included_ranges_wasm\"] = wasmExports[\"ts_parser_included_ranges_wasm\"];\n    var _ts_language_type_is_named_wasm = Module[\"_ts_language_type_is_named_wasm\"] = wasmExports[\"ts_language_type_is_named_wasm\"];\n    var _ts_language_type_is_visible_wasm = Module[\"_ts_language_type_is_visible_wasm\"] = wasmExports[\"ts_language_type_is_visible_wasm\"];\n    var _ts_language_supertypes_wasm = Module[\"_ts_language_supertypes_wasm\"] = wasmExports[\"ts_language_supertypes_wasm\"];\n    var _ts_language_subtypes_wasm = Module[\"_ts_language_subtypes_wasm\"] = wasmExports[\"ts_language_subtypes_wasm\"];\n    var _ts_tree_root_node_wasm = Module[\"_ts_tree_root_node_wasm\"] = wasmExports[\"ts_tree_root_node_wasm\"];\n    var _ts_tree_root_node_with_offset_wasm = Module[\"_ts_tree_root_node_with_offset_wasm\"] = wasmExports[\"ts_tree_root_node_with_offset_wasm\"];\n    var _ts_tree_edit_wasm = Module[\"_ts_tree_edit_wasm\"] = wasmExports[\"ts_tree_edit_wasm\"];\n    var _ts_tree_included_ranges_wasm = Module[\"_ts_tree_included_ranges_wasm\"] = wasmExports[\"ts_tree_included_ranges_wasm\"];\n    var _ts_tree_get_changed_ranges_wasm = Module[\"_ts_tree_get_changed_ranges_wasm\"] = wasmExports[\"ts_tree_get_changed_ranges_wasm\"];\n    var _ts_tree_cursor_new_wasm = Module[\"_ts_tree_cursor_new_wasm\"] = wasmExports[\"ts_tree_cursor_new_wasm\"];\n    var _ts_tree_cursor_copy_wasm = Module[\"_ts_tree_cursor_copy_wasm\"] = wasmExports[\"ts_tree_cursor_copy_wasm\"];\n    var _ts_tree_cursor_delete_wasm = Module[\"_ts_tree_cursor_delete_wasm\"] = wasmExports[\"ts_tree_cursor_delete_wasm\"];\n    var _ts_tree_cursor_reset_wasm = Module[\"_ts_tree_cursor_reset_wasm\"] = wasmExports[\"ts_tree_cursor_reset_wasm\"];\n    var _ts_tree_cursor_reset_to_wasm = Module[\"_ts_tree_cursor_reset_to_wasm\"] = wasmExports[\"ts_tree_cursor_reset_to_wasm\"];\n    var _ts_tree_cursor_goto_first_child_wasm = Module[\"_ts_tree_cursor_goto_first_child_wasm\"] = wasmExports[\"ts_tree_cursor_goto_first_child_wasm\"];\n    var _ts_tree_cursor_goto_last_child_wasm = Module[\"_ts_tree_cursor_goto_last_child_wasm\"] = wasmExports[\"ts_tree_cursor_goto_last_child_wasm\"];\n    var _ts_tree_cursor_goto_first_child_for_index_wasm = Module[\"_ts_tree_cursor_goto_first_child_for_index_wasm\"] = wasmExports[\"ts_tree_cursor_goto_first_child_for_index_wasm\"];\n    var _ts_tree_cursor_goto_first_child_for_position_wasm = Module[\"_ts_tree_cursor_goto_first_child_for_position_wasm\"] = wasmExports[\"ts_tree_cursor_goto_first_child_for_position_wasm\"];\n    var _ts_tree_cursor_goto_next_sibling_wasm = Module[\"_ts_tree_cursor_goto_next_sibling_wasm\"] = wasmExports[\"ts_tree_cursor_goto_next_sibling_wasm\"];\n    var _ts_tree_cursor_goto_previous_sibling_wasm = Module[\"_ts_tree_cursor_goto_previous_sibling_wasm\"] = wasmExports[\"ts_tree_cursor_goto_previous_sibling_wasm\"];\n    var _ts_tree_cursor_goto_descendant_wasm = Module[\"_ts_tree_cursor_goto_descendant_wasm\"] = wasmExports[\"ts_tree_cursor_goto_descendant_wasm\"];\n    var _ts_tree_cursor_goto_parent_wasm = Module[\"_ts_tree_cursor_goto_parent_wasm\"] = wasmExports[\"ts_tree_cursor_goto_parent_wasm\"];\n    var _ts_tree_cursor_current_node_type_id_wasm = Module[\"_ts_tree_cursor_current_node_type_id_wasm\"] = wasmExports[\"ts_tree_cursor_current_node_type_id_wasm\"];\n    var _ts_tree_cursor_current_node_state_id_wasm = Module[\"_ts_tree_cursor_current_node_state_id_wasm\"] = wasmExports[\"ts_tree_cursor_current_node_state_id_wasm\"];\n    var _ts_tree_cursor_current_node_is_named_wasm = Module[\"_ts_tree_cursor_current_node_is_named_wasm\"] = wasmExports[\"ts_tree_cursor_current_node_is_named_wasm\"];\n    var _ts_tree_cursor_current_node_is_missing_wasm = Module[\"_ts_tree_cursor_current_node_is_missing_wasm\"] = wasmExports[\"ts_tree_cursor_current_node_is_missing_wasm\"];\n    var _ts_tree_cursor_current_node_id_wasm = Module[\"_ts_tree_cursor_current_node_id_wasm\"] = wasmExports[\"ts_tree_cursor_current_node_id_wasm\"];\n    var _ts_tree_cursor_start_position_wasm = Module[\"_ts_tree_cursor_start_position_wasm\"] = wasmExports[\"ts_tree_cursor_start_position_wasm\"];\n    var _ts_tree_cursor_end_position_wasm = Module[\"_ts_tree_cursor_end_position_wasm\"] = wasmExports[\"ts_tree_cursor_end_position_wasm\"];\n    var _ts_tree_cursor_start_index_wasm = Module[\"_ts_tree_cursor_start_index_wasm\"] = wasmExports[\"ts_tree_cursor_start_index_wasm\"];\n    var _ts_tree_cursor_end_index_wasm = Module[\"_ts_tree_cursor_end_index_wasm\"] = wasmExports[\"ts_tree_cursor_end_index_wasm\"];\n    var _ts_tree_cursor_current_field_id_wasm = Module[\"_ts_tree_cursor_current_field_id_wasm\"] = wasmExports[\"ts_tree_cursor_current_field_id_wasm\"];\n    var _ts_tree_cursor_current_depth_wasm = Module[\"_ts_tree_cursor_current_depth_wasm\"] = wasmExports[\"ts_tree_cursor_current_depth_wasm\"];\n    var _ts_tree_cursor_current_descendant_index_wasm = Module[\"_ts_tree_cursor_current_descendant_index_wasm\"] = wasmExports[\"ts_tree_cursor_current_descendant_index_wasm\"];\n    var _ts_tree_cursor_current_node_wasm = Module[\"_ts_tree_cursor_current_node_wasm\"] = wasmExports[\"ts_tree_cursor_current_node_wasm\"];\n    var _ts_node_symbol_wasm = Module[\"_ts_node_symbol_wasm\"] = wasmExports[\"ts_node_symbol_wasm\"];\n    var _ts_node_field_name_for_child_wasm = Module[\"_ts_node_field_name_for_child_wasm\"] = wasmExports[\"ts_node_field_name_for_child_wasm\"];\n    var _ts_node_field_name_for_named_child_wasm = Module[\"_ts_node_field_name_for_named_child_wasm\"] = wasmExports[\"ts_node_field_name_for_named_child_wasm\"];\n    var _ts_node_children_by_field_id_wasm = Module[\"_ts_node_children_by_field_id_wasm\"] = wasmExports[\"ts_node_children_by_field_id_wasm\"];\n    var _ts_node_first_child_for_byte_wasm = Module[\"_ts_node_first_child_for_byte_wasm\"] = wasmExports[\"ts_node_first_child_for_byte_wasm\"];\n    var _ts_node_first_named_child_for_byte_wasm = Module[\"_ts_node_first_named_child_for_byte_wasm\"] = wasmExports[\"ts_node_first_named_child_for_byte_wasm\"];\n    var _ts_node_grammar_symbol_wasm = Module[\"_ts_node_grammar_symbol_wasm\"] = wasmExports[\"ts_node_grammar_symbol_wasm\"];\n    var _ts_node_child_count_wasm = Module[\"_ts_node_child_count_wasm\"] = wasmExports[\"ts_node_child_count_wasm\"];\n    var _ts_node_named_child_count_wasm = Module[\"_ts_node_named_child_count_wasm\"] = wasmExports[\"ts_node_named_child_count_wasm\"];\n    var _ts_node_child_wasm = Module[\"_ts_node_child_wasm\"] = wasmExports[\"ts_node_child_wasm\"];\n    var _ts_node_named_child_wasm = Module[\"_ts_node_named_child_wasm\"] = wasmExports[\"ts_node_named_child_wasm\"];\n    var _ts_node_child_by_field_id_wasm = Module[\"_ts_node_child_by_field_id_wasm\"] = wasmExports[\"ts_node_child_by_field_id_wasm\"];\n    var _ts_node_next_sibling_wasm = Module[\"_ts_node_next_sibling_wasm\"] = wasmExports[\"ts_node_next_sibling_wasm\"];\n    var _ts_node_prev_sibling_wasm = Module[\"_ts_node_prev_sibling_wasm\"] = wasmExports[\"ts_node_prev_sibling_wasm\"];\n    var _ts_node_next_named_sibling_wasm = Module[\"_ts_node_next_named_sibling_wasm\"] = wasmExports[\"ts_node_next_named_sibling_wasm\"];\n    var _ts_node_prev_named_sibling_wasm = Module[\"_ts_node_prev_named_sibling_wasm\"] = wasmExports[\"ts_node_prev_named_sibling_wasm\"];\n    var _ts_node_descendant_count_wasm = Module[\"_ts_node_descendant_count_wasm\"] = wasmExports[\"ts_node_descendant_count_wasm\"];\n    var _ts_node_parent_wasm = Module[\"_ts_node_parent_wasm\"] = wasmExports[\"ts_node_parent_wasm\"];\n    var _ts_node_child_with_descendant_wasm = Module[\"_ts_node_child_with_descendant_wasm\"] = wasmExports[\"ts_node_child_with_descendant_wasm\"];\n    var _ts_node_descendant_for_index_wasm = Module[\"_ts_node_descendant_for_index_wasm\"] = wasmExports[\"ts_node_descendant_for_index_wasm\"];\n    var _ts_node_named_descendant_for_index_wasm = Module[\"_ts_node_named_descendant_for_index_wasm\"] = wasmExports[\"ts_node_named_descendant_for_index_wasm\"];\n    var _ts_node_descendant_for_position_wasm = Module[\"_ts_node_descendant_for_position_wasm\"] = wasmExports[\"ts_node_descendant_for_position_wasm\"];\n    var _ts_node_named_descendant_for_position_wasm = Module[\"_ts_node_named_descendant_for_position_wasm\"] = wasmExports[\"ts_node_named_descendant_for_position_wasm\"];\n    var _ts_node_start_point_wasm = Module[\"_ts_node_start_point_wasm\"] = wasmExports[\"ts_node_start_point_wasm\"];\n    var _ts_node_end_point_wasm = Module[\"_ts_node_end_point_wasm\"] = wasmExports[\"ts_node_end_point_wasm\"];\n    var _ts_node_start_index_wasm = Module[\"_ts_node_start_index_wasm\"] = wasmExports[\"ts_node_start_index_wasm\"];\n    var _ts_node_end_index_wasm = Module[\"_ts_node_end_index_wasm\"] = wasmExports[\"ts_node_end_index_wasm\"];\n    var _ts_node_to_string_wasm = Module[\"_ts_node_to_string_wasm\"] = wasmExports[\"ts_node_to_string_wasm\"];\n    var _ts_node_children_wasm = Module[\"_ts_node_children_wasm\"] = wasmExports[\"ts_node_children_wasm\"];\n    var _ts_node_named_children_wasm = Module[\"_ts_node_named_children_wasm\"] = wasmExports[\"ts_node_named_children_wasm\"];\n    var _ts_node_descendants_of_type_wasm = Module[\"_ts_node_descendants_of_type_wasm\"] = wasmExports[\"ts_node_descendants_of_type_wasm\"];\n    var _ts_node_is_named_wasm = Module[\"_ts_node_is_named_wasm\"] = wasmExports[\"ts_node_is_named_wasm\"];\n    var _ts_node_has_changes_wasm = Module[\"_ts_node_has_changes_wasm\"] = wasmExports[\"ts_node_has_changes_wasm\"];\n    var _ts_node_has_error_wasm = Module[\"_ts_node_has_error_wasm\"] = wasmExports[\"ts_node_has_error_wasm\"];\n    var _ts_node_is_error_wasm = Module[\"_ts_node_is_error_wasm\"] = wasmExports[\"ts_node_is_error_wasm\"];\n    var _ts_node_is_missing_wasm = Module[\"_ts_node_is_missing_wasm\"] = wasmExports[\"ts_node_is_missing_wasm\"];\n    var _ts_node_is_extra_wasm = Module[\"_ts_node_is_extra_wasm\"] = wasmExports[\"ts_node_is_extra_wasm\"];\n    var _ts_node_parse_state_wasm = Module[\"_ts_node_parse_state_wasm\"] = wasmExports[\"ts_node_parse_state_wasm\"];\n    var _ts_node_next_parse_state_wasm = Module[\"_ts_node_next_parse_state_wasm\"] = wasmExports[\"ts_node_next_parse_state_wasm\"];\n    var _ts_query_matches_wasm = Module[\"_ts_query_matches_wasm\"] = wasmExports[\"ts_query_matches_wasm\"];\n    var _ts_query_captures_wasm = Module[\"_ts_query_captures_wasm\"] = wasmExports[\"ts_query_captures_wasm\"];\n    var _memset = Module[\"_memset\"] = wasmExports[\"memset\"];\n    var _memcpy = Module[\"_memcpy\"] = wasmExports[\"memcpy\"];\n    var _memmove = Module[\"_memmove\"] = wasmExports[\"memmove\"];\n    var _iswalpha = Module[\"_iswalpha\"] = wasmExports[\"iswalpha\"];\n    var _iswblank = Module[\"_iswblank\"] = wasmExports[\"iswblank\"];\n    var _iswdigit = Module[\"_iswdigit\"] = wasmExports[\"iswdigit\"];\n    var _iswlower = Module[\"_iswlower\"] = wasmExports[\"iswlower\"];\n    var _iswupper = Module[\"_iswupper\"] = wasmExports[\"iswupper\"];\n    var _iswxdigit = Module[\"_iswxdigit\"] = wasmExports[\"iswxdigit\"];\n    var _memchr = Module[\"_memchr\"] = wasmExports[\"memchr\"];\n    var _strlen = Module[\"_strlen\"] = wasmExports[\"strlen\"];\n    var _strcmp = Module[\"_strcmp\"] = wasmExports[\"strcmp\"];\n    var _strncat = Module[\"_strncat\"] = wasmExports[\"strncat\"];\n    var _strncpy = Module[\"_strncpy\"] = wasmExports[\"strncpy\"];\n    var _towlower = Module[\"_towlower\"] = wasmExports[\"towlower\"];\n    var _towupper = Module[\"_towupper\"] = wasmExports[\"towupper\"];\n    var _setThrew = wasmExports[\"setThrew\"];\n    var __emscripten_stack_restore = wasmExports[\"_emscripten_stack_restore\"];\n    var __emscripten_stack_alloc = wasmExports[\"_emscripten_stack_alloc\"];\n    var _emscripten_stack_get_current = wasmExports[\"emscripten_stack_get_current\"];\n    var ___wasm_apply_data_relocs = wasmExports[\"__wasm_apply_data_relocs\"];\n    Module[\"setValue\"] = setValue;\n    Module[\"getValue\"] = getValue;\n    Module[\"UTF8ToString\"] = UTF8ToString;\n    Module[\"stringToUTF8\"] = stringToUTF8;\n    Module[\"lengthBytesUTF8\"] = lengthBytesUTF8;\n    Module[\"AsciiToString\"] = AsciiToString;\n    Module[\"stringToUTF16\"] = stringToUTF16;\n    Module[\"loadWebAssemblyModule\"] = loadWebAssemblyModule;\n    function callMain(args2 = []) {\n      var entryFunction = resolveGlobalSymbol(\"main\").sym;\n      if (!entryFunction) return;\n      args2.unshift(thisProgram);\n      var argc = args2.length;\n      var argv = stackAlloc((argc + 1) * 4);\n      var argv_ptr = argv;\n      args2.forEach((arg) => {\n        LE_HEAP_STORE_U32((argv_ptr >> 2) * 4, stringToUTF8OnStack(arg));\n        argv_ptr += 4;\n      });\n      LE_HEAP_STORE_U32((argv_ptr >> 2) * 4, 0);\n      try {\n        var ret = entryFunction(argc, argv);\n        exitJS(\n          ret,\n          /* implicit = */\n          true\n        );\n        return ret;\n      } catch (e) {\n        return handleException(e);\n      }\n    }\n    __name(callMain, \"callMain\");\n    function run(args2 = arguments_) {\n      if (runDependencies > 0) {\n        dependenciesFulfilled = run;\n        return;\n      }\n      preRun();\n      if (runDependencies > 0) {\n        dependenciesFulfilled = run;\n        return;\n      }\n      function doRun() {\n        Module[\"calledRun\"] = true;\n        if (ABORT) return;\n        initRuntime();\n        preMain();\n        readyPromiseResolve(Module);\n        Module[\"onRuntimeInitialized\"]?.();\n        var noInitialRun = Module[\"noInitialRun\"];\n        if (!noInitialRun) callMain(args2);\n        postRun();\n      }\n      __name(doRun, \"doRun\");\n      if (Module[\"setStatus\"]) {\n        Module[\"setStatus\"](\"Running...\");\n        setTimeout(() => {\n          setTimeout(() => Module[\"setStatus\"](\"\"), 1);\n          doRun();\n        }, 1);\n      } else {\n        doRun();\n      }\n    }\n    __name(run, \"run\");\n    if (Module[\"preInit\"]) {\n      if (typeof Module[\"preInit\"] == \"function\") Module[\"preInit\"] = [Module[\"preInit\"]];\n      while (Module[\"preInit\"].length > 0) {\n        Module[\"preInit\"].pop()();\n      }\n    }\n    run();\n    moduleRtn = readyPromise;\n    return moduleRtn;\n  };\n})();\nvar tree_sitter_default = Module2;\n\n// src/bindings.ts\nvar Module3 = null;\nasync function initializeBinding(moduleOptions) {\n  if (!Module3) {\n    Module3 = await tree_sitter_default(moduleOptions);\n  }\n  return Module3;\n}\n__name(initializeBinding, \"initializeBinding\");\nfunction checkModule() {\n  return !!Module3;\n}\n__name(checkModule, \"checkModule\");\n\n// src/parser.ts\nvar TRANSFER_BUFFER;\nvar LANGUAGE_VERSION;\nvar MIN_COMPATIBLE_VERSION;\nvar Parser = class {\n  static {\n    __name(this, \"Parser\");\n  }\n  /** @internal */\n  [0] = 0;\n  // Internal handle for WASM\n  /** @internal */\n  [1] = 0;\n  // Internal handle for WASM\n  /** @internal */\n  logCallback = null;\n  /** The parser's current language. */\n  language = null;\n  /**\n   * This must always be called before creating a Parser.\n   *\n   * You can optionally pass in options to configure the WASM module, the most common\n   * one being `locateFile` to help the module find the `.wasm` file.\n   */\n  static async init(moduleOptions) {\n    setModule(await initializeBinding(moduleOptions));\n    TRANSFER_BUFFER = C._ts_init();\n    LANGUAGE_VERSION = C.getValue(TRANSFER_BUFFER, \"i32\");\n    MIN_COMPATIBLE_VERSION = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, \"i32\");\n  }\n  /**\n   * Create a new parser.\n   */\n  constructor() {\n    this.initialize();\n  }\n  /** @internal */\n  initialize() {\n    if (!checkModule()) {\n      throw new Error(\"cannot construct a Parser before calling `init()`\");\n    }\n    C._ts_parser_new_wasm();\n    this[0] = C.getValue(TRANSFER_BUFFER, \"i32\");\n    this[1] = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, \"i32\");\n  }\n  /** Delete the parser, freeing its resources. */\n  delete() {\n    C._ts_parser_delete(this[0]);\n    C._free(this[1]);\n    this[0] = 0;\n    this[1] = 0;\n  }\n  /**\n   * Set the language that the parser should use for parsing.\n   *\n   * If the language was not successfully assigned, an error will be thrown.\n   * This happens if the language was generated with an incompatible\n   * version of the Tree-sitter CLI. Check the language's version using\n   * {@link Language#version} and compare it to this library's\n   * {@link LANGUAGE_VERSION} and {@link MIN_COMPATIBLE_VERSION} constants.\n   */\n  setLanguage(language) {\n    let address;\n    if (!language) {\n      address = 0;\n      this.language = null;\n    } else if (language.constructor === Language) {\n      address = language[0];\n      const version = C._ts_language_version(address);\n      if (version < MIN_COMPATIBLE_VERSION || LANGUAGE_VERSION < version) {\n        throw new Error(\n          `Incompatible language version ${version}. Compatibility range ${MIN_COMPATIBLE_VERSION} through ${LANGUAGE_VERSION}.`\n        );\n      }\n      this.language = language;\n    } else {\n      throw new Error(\"Argument must be a Language\");\n    }\n    C._ts_parser_set_language(this[0], address);\n    return this;\n  }\n  /**\n   * Parse a slice of UTF8 text.\n   *\n   * @param {string | ParseCallback} callback - The UTF8-encoded text to parse or a callback function.\n   *\n   * @param {Tree | null} [oldTree] - A previous syntax tree parsed from the same document. If the text of the\n   *   document has changed since `oldTree` was created, then you must edit `oldTree` to match\n   *   the new text using {@link Tree#edit}.\n   *\n   * @param {ParseOptions} [options] - Options for parsing the text.\n   *  This can be used to set the included ranges, or a progress callback.\n   *\n   * @returns {Tree | null} A {@link Tree} if parsing succeeded, or `null` if:\n   *  - The parser has not yet had a language assigned with {@link Parser#setLanguage}.\n   *  - The progress callback returned true.\n   */\n  parse(callback, oldTree, options) {\n    if (typeof callback === \"string\") {\n      C.currentParseCallback = (index) => callback.slice(index);\n    } else if (typeof callback === \"function\") {\n      C.currentParseCallback = callback;\n    } else {\n      throw new Error(\"Argument must be a string or a function\");\n    }\n    if (options?.progressCallback) {\n      C.currentProgressCallback = options.progressCallback;\n    } else {\n      C.currentProgressCallback = null;\n    }\n    if (this.logCallback) {\n      C.currentLogCallback = this.logCallback;\n      C._ts_parser_enable_logger_wasm(this[0], 1);\n    } else {\n      C.currentLogCallback = null;\n      C._ts_parser_enable_logger_wasm(this[0], 0);\n    }\n    let rangeCount = 0;\n    let rangeAddress = 0;\n    if (options?.includedRanges) {\n      rangeCount = options.includedRanges.length;\n      rangeAddress = C._calloc(rangeCount, SIZE_OF_RANGE);\n      let address = rangeAddress;\n      for (let i2 = 0; i2 < rangeCount; i2++) {\n        marshalRange(address, options.includedRanges[i2]);\n        address += SIZE_OF_RANGE;\n      }\n    }\n    const treeAddress = C._ts_parser_parse_wasm(\n      this[0],\n      this[1],\n      oldTree ? oldTree[0] : 0,\n      rangeAddress,\n      rangeCount\n    );\n    if (!treeAddress) {\n      C.currentParseCallback = null;\n      C.currentLogCallback = null;\n      C.currentProgressCallback = null;\n      return null;\n    }\n    if (!this.language) {\n      throw new Error(\"Parser must have a language to parse\");\n    }\n    const result = new Tree(INTERNAL, treeAddress, this.language, C.currentParseCallback);\n    C.currentParseCallback = null;\n    C.currentLogCallback = null;\n    C.currentProgressCallback = null;\n    return result;\n  }\n  /**\n   * Instruct the parser to start the next parse from the beginning.\n   *\n   * If the parser previously failed because of a timeout, cancellation,\n   * or callback, then by default, it will resume where it left off on the\n   * next call to {@link Parser#parse} or other parsing functions.\n   * If you don't want to resume, and instead intend to use this parser to\n   * parse some other document, you must call `reset` first.\n   */\n  reset() {\n    C._ts_parser_reset(this[0]);\n  }\n  /** Get the ranges of text that the parser will include when parsing. */\n  getIncludedRanges() {\n    C._ts_parser_included_ranges_wasm(this[0]);\n    const count = C.getValue(TRANSFER_BUFFER, \"i32\");\n    const buffer = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, \"i32\");\n    const result = new Array(count);\n    if (count > 0) {\n      let address = buffer;\n      for (let i2 = 0; i2 < count; i2++) {\n        result[i2] = unmarshalRange(address);\n        address += SIZE_OF_RANGE;\n      }\n      C._free(buffer);\n    }\n    return result;\n  }\n  /**\n   * @deprecated since version 0.25.0, prefer passing a progress callback to {@link Parser#parse}\n   *\n   * Get the duration in microseconds that parsing is allowed to take.\n   *\n   * This is set via {@link Parser#setTimeoutMicros}.\n   */\n  getTimeoutMicros() {\n    return C._ts_parser_timeout_micros(this[0]);\n  }\n  /**\n   * @deprecated since version 0.25.0, prefer passing a progress callback to {@link Parser#parse}\n   *\n   * Set the maximum duration in microseconds that parsing should be allowed\n   * to take before halting.\n   *\n   * If parsing takes longer than this, it will halt early, returning `null`.\n   * See {@link Parser#parse} for more information.\n   */\n  setTimeoutMicros(timeout) {\n    C._ts_parser_set_timeout_micros(this[0], 0, timeout);\n  }\n  /** Set the logging callback that a parser should use during parsing. */\n  setLogger(callback) {\n    if (!callback) {\n      this.logCallback = null;\n    } else if (typeof callback !== \"function\") {\n      throw new Error(\"Logger callback must be a function\");\n    } else {\n      this.logCallback = callback;\n    }\n    return this;\n  }\n  /** Get the parser's current logger. */\n  getLogger() {\n    return this.logCallback;\n  }\n};\nexport {\n  CaptureQuantifier,\n  LANGUAGE_VERSION,\n  Language,\n  LookaheadIterator,\n  MIN_COMPATIBLE_VERSION,\n  Node,\n  Parser,\n  Query,\n  Tree,\n  TreeCursor\n};\n//# sourceMappingURL=tree-sitter.js.map\n"
  },
  {
    "path": "go.mod",
    "content": "module github.com/stsewd/tree-sitter-comment\n\ngo 1.22\n\nrequire github.com/tree-sitter/go-tree-sitter v0.24.0\n"
  },
  {
    "path": "grammar.js",
    "content": "/**\n * @file Grammar for code tags like TODO:, FIXME(user): for the tree-sitter parsing library\n * @author Santos Gallegos <stsewd@proton.me>\n * @license MIT\n */\n\n/// <reference types=\"tree-sitter-cli/dsl\" />\n// @ts-check\n\nconst END_CHARS = [\n  \".\",\n  \",\",\n  \":\",\n  \";\",\n  \"!\",\n  \"?\",\n  \"\\\\\",\n  \"'\",\n  '\"',\n  \"`\",\n  \"}\",\n  \"]\",\n  \")\",\n  \">\",\n];\n\nconst STOP_CHARS = [\n  \"/\",\n  \"'\",\n  '\"',\n  \"`\",\n  \"<\",\n  \"(\",\n  \"[\",\n  \"{\",\n  \".\",\n  \",\",\n  \":\",\n  \";\",\n  \"!\",\n  \"?\",\n  \"\\\\\",\n  \"}\",\n  \"]\",\n  \")\",\n  \">\",\n  // This must be last, so that it isn't interpreted as a range.\n  \"-\",\n];\n\nmodule.exports = grammar({\n  name: \"comment\",\n\n  externals: ($) => [\n    $.name,\n    $.invalid_token\n  ],\n\n  rules: {\n    source: ($) => repeat(\n      choice(\n        $.tag,\n        $._full_uri,\n        alias($._text, \"text\"),\n      ),\n    ),\n\n    tag: ($) => seq(\n      $.name,\n      optional($._user),\n      \":\",\n    ),\n\n    _user: ($) => seq(\n      \"(\",\n      alias(/[^()]+/, $.user),\n      \")\",\n    ),\n\n    // This token is split into two parts so the end character isn't included in the URI itself.\n    _full_uri: ($) => seq($.uri, choice(alias($._end_char, \"text\"), /\\s/)),\n\n    // This token needs to be single regex, otherwise a partial match will result in an error.\n    uri: ($) => get_uri_regex(),\n\n    // Text tokens can be a single character, or a sequence of characters that aren't stop characters.\n    _text: ($) => choice($._stop_char, notmatching(STOP_CHARS)),\n    _stop_char: ($) => choice(...STOP_CHARS),\n    _end_char: ($) => choice(...END_CHARS),\n  },\n});\n\n/**\n * Get a regex that matches a URI.\n *\n * A URI matches if:\n *\n * - It starts with http:// or https://\n * - It contains at least one character that isn't whitespace or an end character.\n * - If it contains an end character, it must be followed by a non-whitespace or non-end character.\n * - It doesn't end with a whitespace or an end character (this marks the end of the URI).\n *\n * An end character is a character that marks the end of a sentence.\n */\nfunction get_uri_regex() {\n  let end_chars = escapeRegExp(END_CHARS.join(\"\"));\n  return new RegExp(\n    `https?://([^\\\\s${end_chars}]|[${end_chars}][^\\\\s${end_chars}])+`,\n  );\n}\n\n/**\n * Match any characters that aren't whitespace or that aren't in the given list.\n */\nfunction notmatching(chars) {\n  chars = escapeRegExp(chars.join(\"\"));\n  return new RegExp(`[^\\\\s${chars}]+`);\n}\n\n/**\n * Escape a string for use in a regular expression.\n *\n * Taken from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping.\n */\nfunction escapeRegExp(string) {\n  return string.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"tree-sitter-comment\",\n  \"version\": \"0.3.0\",\n  \"description\": \"Grammar for code tags like TODO:, FIXME(user): for the tree-sitter parsing library\",\n  \"repository\": \"https://github.com/stsewd/tree-sitter-comment\",\n  \"funding\": \"https://github.com/sponsors/stsewd\",\n  \"license\": \"MIT\",\n  \"author\": {\n    \"name\": \"Santos Gallegos\",\n    \"email\": \"stsewd@proton.me\",\n    \"url\": \"https://stsewd.dev/\"\n  },\n  \"main\": \"bindings/node\",\n  \"types\": \"bindings/node\",\n  \"keywords\": [\n    \"incremental\",\n    \"parsing\",\n    \"tree-sitter\",\n    \"comment\"\n  ],\n  \"files\": [\n    \"grammar.js\",\n    \"tree-sitter.json\",\n    \"binding.gyp\",\n    \"prebuilds/**\",\n    \"bindings/node/*\",\n    \"queries/*\",\n    \"src/**\",\n    \"*.wasm\"\n  ],\n  \"dependencies\": {\n    \"node-addon-api\": \"^8.2.1\",\n    \"node-gyp-build\": \"^4.8.2\"\n  },\n  \"devDependencies\": {\n    \"prebuildify\": \"^6.0.1\",\n    \"tree-sitter-cli\": \"^0.25.3\"\n  },\n  \"peerDependencies\": {\n    \"tree-sitter\": \"^0.21.1\"\n  },\n  \"peerDependenciesMeta\": {\n    \"tree-sitter\": {\n      \"optional\": true\n    }\n  },\n  \"scripts\": {\n    \"install\": \"node-gyp-build\",\n    \"prestart\": \"tree-sitter build --wasm\",\n    \"start\": \"tree-sitter playground\",\n    \"test\": \"node --test bindings/node/*_test.js\",\n    \"build\": \"tree-sitter generate\",\n    \"parse\": \"tree-sitter parse\"\n  }\n}\n"
  },
  {
    "path": "pyproject.toml",
    "content": "[build-system]\nrequires = [\"setuptools>=42\", \"wheel\"]\nbuild-backend = \"setuptools.build_meta\"\n\n[project]\nname = \"tree-sitter-comment\"\ndescription = \"Grammar for code tags like TODO:, FIXME(user): for the tree-sitter parsing library\"\nversion = \"0.3.0\"\nkeywords = [\"incremental\", \"parsing\", \"tree-sitter\", \"comment\"]\nclassifiers = [\n  \"Intended Audience :: Developers\",\n  \"Topic :: Software Development :: Compilers\",\n  \"Topic :: Text Processing :: Linguistic\",\n  \"Typing :: Typed\",\n]\nauthors = [{ name = \"Santos Gallegos\", email = \"stsewd@proton.me\" }]\nrequires-python = \">=3.10\"\nlicense.text = \"MIT\"\nreadme = \"README.md\"\n\n[project.urls]\nHomepage = \"https://github.com/stsewd/tree-sitter-comment\"\nFunding = \"https://github.com/sponsors/stsewd\"\n\n[project.optional-dependencies]\ncore = [\"tree-sitter~=0.24\"]\n\n[tool.cibuildwheel]\nbuild = \"cp310-*\"\nbuild-frontend = \"build\"\n"
  },
  {
    "path": "setup.py",
    "content": "from os import path\nfrom platform import system\nfrom sysconfig import get_config_var\n\nfrom setuptools import Extension, find_packages, setup\nfrom setuptools.command.build import build\nfrom setuptools.command.egg_info import egg_info\nfrom wheel.bdist_wheel import bdist_wheel\n\nsources = [\n    \"bindings/python/tree_sitter_comment/binding.c\",\n    \"src/parser.c\",\n]\nif path.exists(\"src/scanner.c\"):\n    sources.append(\"src/scanner.c\")\n\nmacros: list[tuple[str, str | None]] = [\n    (\"PY_SSIZE_T_CLEAN\", None),\n    (\"TREE_SITTER_HIDE_SYMBOLS\", None),\n]\nif limited_api := not get_config_var(\"Py_GIL_DISABLED\"):\n    macros.append((\"Py_LIMITED_API\", \"0x030A0000\"))\n\nif system() != \"Windows\":\n    cflags = [\"-std=c11\", \"-fvisibility=hidden\"]\nelse:\n    cflags = [\"/std:c11\", \"/utf-8\"]\n\n\nclass Build(build):\n    def run(self):\n        if path.isdir(\"queries\"):\n            dest = path.join(self.build_lib, \"tree_sitter_comment\", \"queries\")\n            self.copy_tree(\"queries\", dest)\n        super().run()\n\n\nclass BdistWheel(bdist_wheel):\n    def get_tag(self):\n        python, abi, platform = super().get_tag()\n        if python.startswith(\"cp\"):\n            python, abi = \"cp310\", \"abi3\"\n        return python, abi, platform\n\n\nclass EggInfo(egg_info):\n    def find_sources(self):\n        super().find_sources()\n        self.filelist.recursive_include(\"queries\", \"*.scm\")\n        self.filelist.include(\"src/tree_sitter/*.h\")\n\n\nsetup(\n    packages=find_packages(\"bindings/python\"),\n    package_dir={\"\": \"bindings/python\"},\n    package_data={\n        \"tree_sitter_comment\": [\"*.pyi\", \"py.typed\"],\n        \"tree_sitter_comment.queries\": [\"*.scm\"],\n    },\n    ext_package=\"tree_sitter_comment\",\n    ext_modules=[\n        Extension(\n            name=\"_binding\",\n            sources=sources,\n            extra_compile_args=cflags,\n            define_macros=macros,\n            include_dirs=[\"src\"],\n            py_limited_api=limited_api,\n        )\n    ],\n    cmdclass={\n        \"build\": Build,\n        \"bdist_wheel\": BdistWheel,\n        \"egg_info\": EggInfo,\n    },\n    zip_safe=False\n)\n"
  },
  {
    "path": "src/grammar.json",
    "content": "{\n  \"$schema\": \"https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json\",\n  \"name\": \"comment\",\n  \"rules\": {\n    \"source\": {\n      \"type\": \"REPEAT\",\n      \"content\": {\n        \"type\": \"CHOICE\",\n        \"members\": [\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"tag\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_full_uri\"\n          },\n          {\n            \"type\": \"ALIAS\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_text\"\n            },\n            \"named\": false,\n            \"value\": \"text\"\n          }\n        ]\n      }\n    },\n    \"tag\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"name\"\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_user\"\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \":\"\n        }\n      ]\n    },\n    \"_user\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"(\"\n        },\n        {\n          \"type\": \"ALIAS\",\n          \"content\": {\n            \"type\": \"PATTERN\",\n            \"value\": \"[^()]+\"\n          },\n          \"named\": true,\n          \"value\": \"user\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \")\"\n        }\n      ]\n    },\n    \"_full_uri\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"uri\"\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"ALIAS\",\n              \"content\": {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_end_char\"\n              },\n              \"named\": false,\n              \"value\": \"text\"\n            },\n            {\n              \"type\": \"PATTERN\",\n              \"value\": \"\\\\s\"\n            }\n          ]\n        }\n      ]\n    },\n    \"uri\": {\n      \"type\": \"PATTERN\",\n      \"value\": \"https?:\\\\/\\\\/([^\\\\s\\\\.,:;!\\\\?\\\\\\\\'\\\"`\\\\}\\\\]\\\\)>]|[\\\\.,:;!\\\\?\\\\\\\\'\\\"`\\\\}\\\\]\\\\)>][^\\\\s\\\\.,:;!\\\\?\\\\\\\\'\\\"`\\\\}\\\\]\\\\)>])+\"\n    },\n    \"_text\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_stop_char\"\n        },\n        {\n          \"type\": \"PATTERN\",\n          \"value\": \"[^\\\\s/'\\\"`<\\\\(\\\\[\\\\{\\\\.,:;!\\\\?\\\\\\\\\\\\}\\\\]\\\\)>-]+\"\n        }\n      ]\n    },\n    \"_stop_char\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"/\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"'\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"\\\"\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"`\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"<\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"(\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"[\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"{\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \".\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \",\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \":\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \";\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"!\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"?\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"\\\\\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"}\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"]\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \")\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \">\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"-\"\n        }\n      ]\n    },\n    \"_end_char\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \".\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \",\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \":\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \";\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"!\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"?\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"\\\\\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"'\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"\\\"\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"`\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"}\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"]\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \")\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \">\"\n        }\n      ]\n    }\n  },\n  \"extras\": [\n    {\n      \"type\": \"PATTERN\",\n      \"value\": \"\\\\s\"\n    }\n  ],\n  \"conflicts\": [],\n  \"precedences\": [],\n  \"externals\": [\n    {\n      \"type\": \"SYMBOL\",\n      \"name\": \"name\"\n    },\n    {\n      \"type\": \"SYMBOL\",\n      \"name\": \"invalid_token\"\n    }\n  ],\n  \"inline\": [],\n  \"supertypes\": [],\n  \"reserved\": {}\n}"
  },
  {
    "path": "src/node-types.json",
    "content": "[\n  {\n    \"type\": \"source\",\n    \"named\": true,\n    \"root\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"tag\",\n          \"named\": true\n        },\n        {\n          \"type\": \"uri\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"tag\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"name\",\n          \"named\": true\n        },\n        {\n          \"type\": \"user\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"text\",\n    \"named\": false,\n    \"fields\": {}\n  },\n  {\n    \"type\": \"!\",\n    \"named\": false\n  },\n  {\n    \"type\": \"\\\"\",\n    \"named\": false\n  },\n  {\n    \"type\": \"'\",\n    \"named\": false\n  },\n  {\n    \"type\": \"(\",\n    \"named\": false\n  },\n  {\n    \"type\": \")\",\n    \"named\": false\n  },\n  {\n    \"type\": \",\",\n    \"named\": false\n  },\n  {\n    \"type\": \"-\",\n    \"named\": false\n  },\n  {\n    \"type\": \".\",\n    \"named\": false\n  },\n  {\n    \"type\": \"/\",\n    \"named\": false\n  },\n  {\n    \"type\": \":\",\n    \"named\": false\n  },\n  {\n    \"type\": \";\",\n    \"named\": false\n  },\n  {\n    \"type\": \"<\",\n    \"named\": false\n  },\n  {\n    \"type\": \">\",\n    \"named\": false\n  },\n  {\n    \"type\": \"?\",\n    \"named\": false\n  },\n  {\n    \"type\": \"[\",\n    \"named\": false\n  },\n  {\n    \"type\": \"\\\\\",\n    \"named\": false\n  },\n  {\n    \"type\": \"]\",\n    \"named\": false\n  },\n  {\n    \"type\": \"`\",\n    \"named\": false\n  },\n  {\n    \"type\": \"name\",\n    \"named\": true\n  },\n  {\n    \"type\": \"uri\",\n    \"named\": true\n  },\n  {\n    \"type\": \"user\",\n    \"named\": true\n  },\n  {\n    \"type\": \"{\",\n    \"named\": false\n  },\n  {\n    \"type\": \"}\",\n    \"named\": false\n  }\n]"
  },
  {
    "path": "src/parser.c",
    "content": "/* Automatically generated by tree-sitter v0.25.3 (2a835ee029dca1c325e6f1c01dbce40396f6123e) */\n\n#include \"tree_sitter/parser.h\"\n\n#if defined(__GNUC__) || defined(__clang__)\n#pragma GCC diagnostic ignored \"-Wmissing-field-initializers\"\n#endif\n\n#define LANGUAGE_VERSION 15\n#define STATE_COUNT 16\n#define LARGE_STATE_COUNT 9\n#define SYMBOL_COUNT 35\n#define ALIAS_COUNT 0\n#define TOKEN_COUNT 27\n#define EXTERNAL_TOKEN_COUNT 2\n#define FIELD_COUNT 0\n#define MAX_ALIAS_SEQUENCE_LENGTH 3\n#define MAX_RESERVED_WORD_SET_SIZE 0\n#define PRODUCTION_ID_COUNT 1\n#define SUPERTYPE_COUNT 0\n\nenum ts_symbol_identifiers {\n  anon_sym_COLON = 1,\n  anon_sym_LPAREN = 2,\n  aux_sym__user_token1 = 3,\n  anon_sym_RPAREN = 4,\n  aux_sym__full_uri_token1 = 5,\n  sym_uri = 6,\n  aux_sym__text_token1 = 7,\n  anon_sym_SLASH = 8,\n  anon_sym_SQUOTE = 9,\n  anon_sym_DQUOTE = 10,\n  anon_sym_BQUOTE = 11,\n  anon_sym_LT = 12,\n  anon_sym_LBRACK = 13,\n  anon_sym_LBRACE = 14,\n  anon_sym_DOT = 15,\n  anon_sym_COMMA = 16,\n  anon_sym_SEMI = 17,\n  anon_sym_BANG = 18,\n  anon_sym_QMARK = 19,\n  anon_sym_BSLASH = 20,\n  anon_sym_RBRACE = 21,\n  anon_sym_RBRACK = 22,\n  anon_sym_GT = 23,\n  anon_sym_DASH = 24,\n  sym_name = 25,\n  sym_invalid_token = 26,\n  sym_source = 27,\n  sym_tag = 28,\n  sym__user = 29,\n  sym__full_uri = 30,\n  sym__text = 31,\n  sym__stop_char = 32,\n  sym__end_char = 33,\n  aux_sym_source_repeat1 = 34,\n};\n\nstatic const char * const ts_symbol_names[] = {\n  [ts_builtin_sym_end] = \"end\",\n  [anon_sym_COLON] = \":\",\n  [anon_sym_LPAREN] = \"(\",\n  [aux_sym__user_token1] = \"user\",\n  [anon_sym_RPAREN] = \")\",\n  [aux_sym__full_uri_token1] = \"_full_uri_token1\",\n  [sym_uri] = \"uri\",\n  [aux_sym__text_token1] = \"_text_token1\",\n  [anon_sym_SLASH] = \"/\",\n  [anon_sym_SQUOTE] = \"'\",\n  [anon_sym_DQUOTE] = \"\\\"\",\n  [anon_sym_BQUOTE] = \"`\",\n  [anon_sym_LT] = \"<\",\n  [anon_sym_LBRACK] = \"[\",\n  [anon_sym_LBRACE] = \"{\",\n  [anon_sym_DOT] = \".\",\n  [anon_sym_COMMA] = \",\",\n  [anon_sym_SEMI] = \";\",\n  [anon_sym_BANG] = \"!\",\n  [anon_sym_QMARK] = \"\\?\",\n  [anon_sym_BSLASH] = \"\\\\\",\n  [anon_sym_RBRACE] = \"}\",\n  [anon_sym_RBRACK] = \"]\",\n  [anon_sym_GT] = \">\",\n  [anon_sym_DASH] = \"-\",\n  [sym_name] = \"name\",\n  [sym_invalid_token] = \"invalid_token\",\n  [sym_source] = \"source\",\n  [sym_tag] = \"tag\",\n  [sym__user] = \"_user\",\n  [sym__full_uri] = \"_full_uri\",\n  [sym__text] = \"text\",\n  [sym__stop_char] = \"_stop_char\",\n  [sym__end_char] = \"text\",\n  [aux_sym_source_repeat1] = \"source_repeat1\",\n};\n\nstatic const TSSymbol ts_symbol_map[] = {\n  [ts_builtin_sym_end] = ts_builtin_sym_end,\n  [anon_sym_COLON] = anon_sym_COLON,\n  [anon_sym_LPAREN] = anon_sym_LPAREN,\n  [aux_sym__user_token1] = aux_sym__user_token1,\n  [anon_sym_RPAREN] = anon_sym_RPAREN,\n  [aux_sym__full_uri_token1] = aux_sym__full_uri_token1,\n  [sym_uri] = sym_uri,\n  [aux_sym__text_token1] = aux_sym__text_token1,\n  [anon_sym_SLASH] = anon_sym_SLASH,\n  [anon_sym_SQUOTE] = anon_sym_SQUOTE,\n  [anon_sym_DQUOTE] = anon_sym_DQUOTE,\n  [anon_sym_BQUOTE] = anon_sym_BQUOTE,\n  [anon_sym_LT] = anon_sym_LT,\n  [anon_sym_LBRACK] = anon_sym_LBRACK,\n  [anon_sym_LBRACE] = anon_sym_LBRACE,\n  [anon_sym_DOT] = anon_sym_DOT,\n  [anon_sym_COMMA] = anon_sym_COMMA,\n  [anon_sym_SEMI] = anon_sym_SEMI,\n  [anon_sym_BANG] = anon_sym_BANG,\n  [anon_sym_QMARK] = anon_sym_QMARK,\n  [anon_sym_BSLASH] = anon_sym_BSLASH,\n  [anon_sym_RBRACE] = anon_sym_RBRACE,\n  [anon_sym_RBRACK] = anon_sym_RBRACK,\n  [anon_sym_GT] = anon_sym_GT,\n  [anon_sym_DASH] = anon_sym_DASH,\n  [sym_name] = sym_name,\n  [sym_invalid_token] = sym_invalid_token,\n  [sym_source] = sym_source,\n  [sym_tag] = sym_tag,\n  [sym__user] = sym__user,\n  [sym__full_uri] = sym__full_uri,\n  [sym__text] = sym__text,\n  [sym__stop_char] = sym__stop_char,\n  [sym__end_char] = sym__text,\n  [aux_sym_source_repeat1] = aux_sym_source_repeat1,\n};\n\nstatic const TSSymbolMetadata ts_symbol_metadata[] = {\n  [ts_builtin_sym_end] = {\n    .visible = false,\n    .named = true,\n  },\n  [anon_sym_COLON] = {\n    .visible = true,\n    .named = false,\n  },\n  [anon_sym_LPAREN] = {\n    .visible = true,\n    .named = false,\n  },\n  [aux_sym__user_token1] = {\n    .visible = true,\n    .named = true,\n  },\n  [anon_sym_RPAREN] = {\n    .visible = true,\n    .named = false,\n  },\n  [aux_sym__full_uri_token1] = {\n    .visible = false,\n    .named = false,\n  },\n  [sym_uri] = {\n    .visible = true,\n    .named = true,\n  },\n  [aux_sym__text_token1] = {\n    .visible = false,\n    .named = false,\n  },\n  [anon_sym_SLASH] = {\n    .visible = true,\n    .named = false,\n  },\n  [anon_sym_SQUOTE] = {\n    .visible = true,\n    .named = false,\n  },\n  [anon_sym_DQUOTE] = {\n    .visible = true,\n    .named = false,\n  },\n  [anon_sym_BQUOTE] = {\n    .visible = true,\n    .named = false,\n  },\n  [anon_sym_LT] = {\n    .visible = true,\n    .named = false,\n  },\n  [anon_sym_LBRACK] = {\n    .visible = true,\n    .named = false,\n  },\n  [anon_sym_LBRACE] = {\n    .visible = true,\n    .named = false,\n  },\n  [anon_sym_DOT] = {\n    .visible = true,\n    .named = false,\n  },\n  [anon_sym_COMMA] = {\n    .visible = true,\n    .named = false,\n  },\n  [anon_sym_SEMI] = {\n    .visible = true,\n    .named = false,\n  },\n  [anon_sym_BANG] = {\n    .visible = true,\n    .named = false,\n  },\n  [anon_sym_QMARK] = {\n    .visible = true,\n    .named = false,\n  },\n  [anon_sym_BSLASH] = {\n    .visible = true,\n    .named = false,\n  },\n  [anon_sym_RBRACE] = {\n    .visible = true,\n    .named = false,\n  },\n  [anon_sym_RBRACK] = {\n    .visible = true,\n    .named = false,\n  },\n  [anon_sym_GT] = {\n    .visible = true,\n    .named = false,\n  },\n  [anon_sym_DASH] = {\n    .visible = true,\n    .named = false,\n  },\n  [sym_name] = {\n    .visible = true,\n    .named = true,\n  },\n  [sym_invalid_token] = {\n    .visible = true,\n    .named = true,\n  },\n  [sym_source] = {\n    .visible = true,\n    .named = true,\n  },\n  [sym_tag] = {\n    .visible = true,\n    .named = true,\n  },\n  [sym__user] = {\n    .visible = false,\n    .named = true,\n  },\n  [sym__full_uri] = {\n    .visible = false,\n    .named = true,\n  },\n  [sym__text] = {\n    .visible = true,\n    .named = false,\n  },\n  [sym__stop_char] = {\n    .visible = false,\n    .named = true,\n  },\n  [sym__end_char] = {\n    .visible = true,\n    .named = false,\n  },\n  [aux_sym_source_repeat1] = {\n    .visible = false,\n    .named = false,\n  },\n};\n\nstatic const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = {\n  [0] = {0},\n};\n\nstatic const uint16_t ts_non_terminal_alias_map[] = {\n  0,\n};\n\nstatic const TSStateId ts_primary_state_ids[STATE_COUNT] = {\n  [0] = 0,\n  [1] = 1,\n  [2] = 2,\n  [3] = 3,\n  [4] = 4,\n  [5] = 5,\n  [6] = 6,\n  [7] = 7,\n  [8] = 8,\n  [9] = 9,\n  [10] = 10,\n  [11] = 11,\n  [12] = 12,\n  [13] = 13,\n  [14] = 14,\n  [15] = 15,\n};\n\nstatic const TSCharacterRange sym_uri_character_set_1[] = {\n  {0, 0x08}, {0x0e, 0x1f}, {'#', '&'}, {'(', '('}, {'*', '+'}, {'-', '-'}, {'/', '9'}, {'<', '='},\n  {'@', '['}, {'^', '_'}, {'a', '|'}, {'~', 0x10ffff},\n};\n\nstatic const TSCharacterRange aux_sym__text_token1_character_set_1[] = {\n  {0, 0x08}, {0x0e, 0x1f}, {'#', '&'}, {'*', '+'}, {'0', '9'}, {'=', '='}, {'@', 'Z'}, {'^', '_'},\n  {'a', 'z'}, {'|', '|'}, {'~', 0x10ffff},\n};\n\nstatic bool ts_lex(TSLexer *lexer, TSStateId state) {\n  START_LEXER();\n  eof = lexer->eof(lexer);\n  switch (state) {\n    case 0:\n      if (eof) ADVANCE(6);\n      ADVANCE_MAP(\n        '!', 29,\n        '\"', 21,\n        '\\'', 20,\n        '(', 8,\n        ')', 10,\n        ',', 27,\n        '-', 35,\n        '.', 26,\n        '/', 19,\n        ':', 7,\n        ';', 28,\n        '<', 23,\n        '>', 34,\n        '?', 30,\n        '[', 24,\n        '\\\\', 31,\n        ']', 33,\n        '`', 22,\n        'h', 17,\n        '{', 25,\n        '}', 32,\n      );\n      if (('\\t' <= lookahead && lookahead <= '\\r') ||\n          lookahead == ' ') ADVANCE(11);\n      if (lookahead != 0) ADVANCE(18);\n      END_STATE();\n    case 1:\n      if (lookahead == '/') ADVANCE(4);\n      END_STATE();\n    case 2:\n      if (lookahead == '/') ADVANCE(1);\n      END_STATE();\n    case 3:\n      if (('\\t' <= lookahead && lookahead <= '\\r') ||\n          lookahead == ' ') ADVANCE(9);\n      if (lookahead != 0 &&\n          lookahead != '(' &&\n          lookahead != ')') ADVANCE(9);\n      END_STATE();\n    case 4:\n      ADVANCE_MAP(\n        '!', 5,\n        '\"', 5,\n        '\\'', 5,\n        ')', 5,\n        ',', 5,\n        '.', 5,\n        ':', 5,\n        ';', 5,\n        '>', 5,\n        '?', 5,\n        '\\\\', 5,\n        ']', 5,\n        '`', 5,\n        '}', 5,\n      );\n      if (lookahead != 0 &&\n          (lookahead < '\\t' || '\\r' < lookahead) &&\n          (lookahead < ' ' || '\"' < lookahead)) ADVANCE(12);\n      END_STATE();\n    case 5:\n      if ((!eof && set_contains(sym_uri_character_set_1, 12, lookahead))) ADVANCE(12);\n      END_STATE();\n    case 6:\n      ACCEPT_TOKEN(ts_builtin_sym_end);\n      END_STATE();\n    case 7:\n      ACCEPT_TOKEN(anon_sym_COLON);\n      END_STATE();\n    case 8:\n      ACCEPT_TOKEN(anon_sym_LPAREN);\n      END_STATE();\n    case 9:\n      ACCEPT_TOKEN(aux_sym__user_token1);\n      if (lookahead != 0 &&\n          lookahead != '(' &&\n          lookahead != ')') ADVANCE(9);\n      END_STATE();\n    case 10:\n      ACCEPT_TOKEN(anon_sym_RPAREN);\n      END_STATE();\n    case 11:\n      ACCEPT_TOKEN(aux_sym__full_uri_token1);\n      END_STATE();\n    case 12:\n      ACCEPT_TOKEN(sym_uri);\n      ADVANCE_MAP(\n        '!', 5,\n        '\"', 5,\n        '\\'', 5,\n        ')', 5,\n        ',', 5,\n        '.', 5,\n        ':', 5,\n        ';', 5,\n        '>', 5,\n        '?', 5,\n        '\\\\', 5,\n        ']', 5,\n        '`', 5,\n        '}', 5,\n      );\n      if (lookahead != 0 &&\n          (lookahead < '\\t' || '\\r' < lookahead) &&\n          (lookahead < ' ' || '\"' < lookahead)) ADVANCE(12);\n      END_STATE();\n    case 13:\n      ACCEPT_TOKEN(aux_sym__text_token1);\n      if (lookahead == ':') ADVANCE(2);\n      if (lookahead == 's') ADVANCE(14);\n      if ((!eof && set_contains(aux_sym__text_token1_character_set_1, 11, lookahead))) ADVANCE(18);\n      END_STATE();\n    case 14:\n      ACCEPT_TOKEN(aux_sym__text_token1);\n      if (lookahead == ':') ADVANCE(2);\n      if ((!eof && set_contains(aux_sym__text_token1_character_set_1, 11, lookahead))) ADVANCE(18);\n      END_STATE();\n    case 15:\n      ACCEPT_TOKEN(aux_sym__text_token1);\n      if (lookahead == 'p') ADVANCE(13);\n      if ((!eof && set_contains(aux_sym__text_token1_character_set_1, 11, lookahead))) ADVANCE(18);\n      END_STATE();\n    case 16:\n      ACCEPT_TOKEN(aux_sym__text_token1);\n      if (lookahead == 't') ADVANCE(15);\n      if ((!eof && set_contains(aux_sym__text_token1_character_set_1, 11, lookahead))) ADVANCE(18);\n      END_STATE();\n    case 17:\n      ACCEPT_TOKEN(aux_sym__text_token1);\n      if (lookahead == 't') ADVANCE(16);\n      if ((!eof && set_contains(aux_sym__text_token1_character_set_1, 11, lookahead))) ADVANCE(18);\n      END_STATE();\n    case 18:\n      ACCEPT_TOKEN(aux_sym__text_token1);\n      if ((!eof && set_contains(aux_sym__text_token1_character_set_1, 11, lookahead))) ADVANCE(18);\n      END_STATE();\n    case 19:\n      ACCEPT_TOKEN(anon_sym_SLASH);\n      END_STATE();\n    case 20:\n      ACCEPT_TOKEN(anon_sym_SQUOTE);\n      END_STATE();\n    case 21:\n      ACCEPT_TOKEN(anon_sym_DQUOTE);\n      END_STATE();\n    case 22:\n      ACCEPT_TOKEN(anon_sym_BQUOTE);\n      END_STATE();\n    case 23:\n      ACCEPT_TOKEN(anon_sym_LT);\n      END_STATE();\n    case 24:\n      ACCEPT_TOKEN(anon_sym_LBRACK);\n      END_STATE();\n    case 25:\n      ACCEPT_TOKEN(anon_sym_LBRACE);\n      END_STATE();\n    case 26:\n      ACCEPT_TOKEN(anon_sym_DOT);\n      END_STATE();\n    case 27:\n      ACCEPT_TOKEN(anon_sym_COMMA);\n      END_STATE();\n    case 28:\n      ACCEPT_TOKEN(anon_sym_SEMI);\n      END_STATE();\n    case 29:\n      ACCEPT_TOKEN(anon_sym_BANG);\n      END_STATE();\n    case 30:\n      ACCEPT_TOKEN(anon_sym_QMARK);\n      END_STATE();\n    case 31:\n      ACCEPT_TOKEN(anon_sym_BSLASH);\n      END_STATE();\n    case 32:\n      ACCEPT_TOKEN(anon_sym_RBRACE);\n      END_STATE();\n    case 33:\n      ACCEPT_TOKEN(anon_sym_RBRACK);\n      END_STATE();\n    case 34:\n      ACCEPT_TOKEN(anon_sym_GT);\n      END_STATE();\n    case 35:\n      ACCEPT_TOKEN(anon_sym_DASH);\n      END_STATE();\n    default:\n      return false;\n  }\n}\n\nstatic const TSLexerMode ts_lex_modes[STATE_COUNT] = {\n  [0] = {.lex_state = 0, .external_lex_state = 1},\n  [1] = {.lex_state = 0, .external_lex_state = 2},\n  [2] = {.lex_state = 0, .external_lex_state = 2},\n  [3] = {.lex_state = 0, .external_lex_state = 2},\n  [4] = {.lex_state = 0, .external_lex_state = 2},\n  [5] = {.lex_state = 0, .external_lex_state = 2},\n  [6] = {.lex_state = 0, .external_lex_state = 2},\n  [7] = {.lex_state = 0, .external_lex_state = 2},\n  [8] = {.lex_state = 0, .external_lex_state = 2},\n  [9] = {.lex_state = 0},\n  [10] = {.lex_state = 0},\n  [11] = {.lex_state = 0},\n  [12] = {.lex_state = 3},\n  [13] = {.lex_state = 0},\n  [14] = {.lex_state = 0},\n  [15] = {.lex_state = 0},\n};\n\nstatic const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = {\n  [STATE(0)] = {\n    [ts_builtin_sym_end] = ACTIONS(1),\n    [anon_sym_COLON] = ACTIONS(1),\n    [anon_sym_LPAREN] = ACTIONS(1),\n    [anon_sym_RPAREN] = ACTIONS(1),\n    [aux_sym__full_uri_token1] = ACTIONS(3),\n    [sym_uri] = ACTIONS(1),\n    [aux_sym__text_token1] = ACTIONS(1),\n    [anon_sym_SLASH] = ACTIONS(1),\n    [anon_sym_SQUOTE] = ACTIONS(1),\n    [anon_sym_DQUOTE] = ACTIONS(1),\n    [anon_sym_BQUOTE] = ACTIONS(1),\n    [anon_sym_LT] = ACTIONS(1),\n    [anon_sym_LBRACK] = ACTIONS(1),\n    [anon_sym_LBRACE] = ACTIONS(1),\n    [anon_sym_DOT] = ACTIONS(1),\n    [anon_sym_COMMA] = ACTIONS(1),\n    [anon_sym_SEMI] = ACTIONS(1),\n    [anon_sym_BANG] = ACTIONS(1),\n    [anon_sym_QMARK] = ACTIONS(1),\n    [anon_sym_BSLASH] = ACTIONS(1),\n    [anon_sym_RBRACE] = ACTIONS(1),\n    [anon_sym_RBRACK] = ACTIONS(1),\n    [anon_sym_GT] = ACTIONS(1),\n    [anon_sym_DASH] = ACTIONS(1),\n    [sym_name] = ACTIONS(1),\n    [sym_invalid_token] = ACTIONS(1),\n  },\n  [STATE(1)] = {\n    [sym_source] = STATE(11),\n    [sym_tag] = STATE(2),\n    [sym__full_uri] = STATE(2),\n    [sym__text] = STATE(2),\n    [sym__stop_char] = STATE(4),\n    [aux_sym_source_repeat1] = STATE(2),\n    [ts_builtin_sym_end] = ACTIONS(5),\n    [anon_sym_COLON] = ACTIONS(7),\n    [anon_sym_LPAREN] = ACTIONS(7),\n    [anon_sym_RPAREN] = ACTIONS(7),\n    [aux_sym__full_uri_token1] = ACTIONS(3),\n    [sym_uri] = ACTIONS(9),\n    [aux_sym__text_token1] = ACTIONS(11),\n    [anon_sym_SLASH] = ACTIONS(7),\n    [anon_sym_SQUOTE] = ACTIONS(7),\n    [anon_sym_DQUOTE] = ACTIONS(7),\n    [anon_sym_BQUOTE] = ACTIONS(7),\n    [anon_sym_LT] = ACTIONS(7),\n    [anon_sym_LBRACK] = ACTIONS(7),\n    [anon_sym_LBRACE] = ACTIONS(7),\n    [anon_sym_DOT] = ACTIONS(7),\n    [anon_sym_COMMA] = ACTIONS(7),\n    [anon_sym_SEMI] = ACTIONS(7),\n    [anon_sym_BANG] = ACTIONS(7),\n    [anon_sym_QMARK] = ACTIONS(7),\n    [anon_sym_BSLASH] = ACTIONS(7),\n    [anon_sym_RBRACE] = ACTIONS(7),\n    [anon_sym_RBRACK] = ACTIONS(7),\n    [anon_sym_GT] = ACTIONS(7),\n    [anon_sym_DASH] = ACTIONS(7),\n    [sym_name] = ACTIONS(13),\n  },\n  [STATE(2)] = {\n    [sym_tag] = STATE(3),\n    [sym__full_uri] = STATE(3),\n    [sym__text] = STATE(3),\n    [sym__stop_char] = STATE(4),\n    [aux_sym_source_repeat1] = STATE(3),\n    [ts_builtin_sym_end] = ACTIONS(15),\n    [anon_sym_COLON] = ACTIONS(7),\n    [anon_sym_LPAREN] = ACTIONS(7),\n    [anon_sym_RPAREN] = ACTIONS(7),\n    [aux_sym__full_uri_token1] = ACTIONS(3),\n    [sym_uri] = ACTIONS(9),\n    [aux_sym__text_token1] = ACTIONS(11),\n    [anon_sym_SLASH] = ACTIONS(7),\n    [anon_sym_SQUOTE] = ACTIONS(7),\n    [anon_sym_DQUOTE] = ACTIONS(7),\n    [anon_sym_BQUOTE] = ACTIONS(7),\n    [anon_sym_LT] = ACTIONS(7),\n    [anon_sym_LBRACK] = ACTIONS(7),\n    [anon_sym_LBRACE] = ACTIONS(7),\n    [anon_sym_DOT] = ACTIONS(7),\n    [anon_sym_COMMA] = ACTIONS(7),\n    [anon_sym_SEMI] = ACTIONS(7),\n    [anon_sym_BANG] = ACTIONS(7),\n    [anon_sym_QMARK] = ACTIONS(7),\n    [anon_sym_BSLASH] = ACTIONS(7),\n    [anon_sym_RBRACE] = ACTIONS(7),\n    [anon_sym_RBRACK] = ACTIONS(7),\n    [anon_sym_GT] = ACTIONS(7),\n    [anon_sym_DASH] = ACTIONS(7),\n    [sym_name] = ACTIONS(13),\n  },\n  [STATE(3)] = {\n    [sym_tag] = STATE(3),\n    [sym__full_uri] = STATE(3),\n    [sym__text] = STATE(3),\n    [sym__stop_char] = STATE(4),\n    [aux_sym_source_repeat1] = STATE(3),\n    [ts_builtin_sym_end] = ACTIONS(17),\n    [anon_sym_COLON] = ACTIONS(19),\n    [anon_sym_LPAREN] = ACTIONS(19),\n    [anon_sym_RPAREN] = ACTIONS(19),\n    [aux_sym__full_uri_token1] = ACTIONS(3),\n    [sym_uri] = ACTIONS(22),\n    [aux_sym__text_token1] = ACTIONS(25),\n    [anon_sym_SLASH] = ACTIONS(19),\n    [anon_sym_SQUOTE] = ACTIONS(19),\n    [anon_sym_DQUOTE] = ACTIONS(19),\n    [anon_sym_BQUOTE] = ACTIONS(19),\n    [anon_sym_LT] = ACTIONS(19),\n    [anon_sym_LBRACK] = ACTIONS(19),\n    [anon_sym_LBRACE] = ACTIONS(19),\n    [anon_sym_DOT] = ACTIONS(19),\n    [anon_sym_COMMA] = ACTIONS(19),\n    [anon_sym_SEMI] = ACTIONS(19),\n    [anon_sym_BANG] = ACTIONS(19),\n    [anon_sym_QMARK] = ACTIONS(19),\n    [anon_sym_BSLASH] = ACTIONS(19),\n    [anon_sym_RBRACE] = ACTIONS(19),\n    [anon_sym_RBRACK] = ACTIONS(19),\n    [anon_sym_GT] = ACTIONS(19),\n    [anon_sym_DASH] = ACTIONS(19),\n    [sym_name] = ACTIONS(28),\n  },\n  [STATE(4)] = {\n    [ts_builtin_sym_end] = ACTIONS(31),\n    [anon_sym_COLON] = ACTIONS(31),\n    [anon_sym_LPAREN] = ACTIONS(31),\n    [anon_sym_RPAREN] = ACTIONS(31),\n    [aux_sym__full_uri_token1] = ACTIONS(3),\n    [sym_uri] = ACTIONS(31),\n    [aux_sym__text_token1] = ACTIONS(33),\n    [anon_sym_SLASH] = ACTIONS(31),\n    [anon_sym_SQUOTE] = ACTIONS(31),\n    [anon_sym_DQUOTE] = ACTIONS(31),\n    [anon_sym_BQUOTE] = ACTIONS(31),\n    [anon_sym_LT] = ACTIONS(31),\n    [anon_sym_LBRACK] = ACTIONS(31),\n    [anon_sym_LBRACE] = ACTIONS(31),\n    [anon_sym_DOT] = ACTIONS(31),\n    [anon_sym_COMMA] = ACTIONS(31),\n    [anon_sym_SEMI] = ACTIONS(31),\n    [anon_sym_BANG] = ACTIONS(31),\n    [anon_sym_QMARK] = ACTIONS(31),\n    [anon_sym_BSLASH] = ACTIONS(31),\n    [anon_sym_RBRACE] = ACTIONS(31),\n    [anon_sym_RBRACK] = ACTIONS(31),\n    [anon_sym_GT] = ACTIONS(31),\n    [anon_sym_DASH] = ACTIONS(31),\n    [sym_name] = ACTIONS(31),\n  },\n  [STATE(5)] = {\n    [ts_builtin_sym_end] = ACTIONS(35),\n    [anon_sym_COLON] = ACTIONS(35),\n    [anon_sym_LPAREN] = ACTIONS(35),\n    [anon_sym_RPAREN] = ACTIONS(35),\n    [aux_sym__full_uri_token1] = ACTIONS(3),\n    [sym_uri] = ACTIONS(35),\n    [aux_sym__text_token1] = ACTIONS(37),\n    [anon_sym_SLASH] = ACTIONS(35),\n    [anon_sym_SQUOTE] = ACTIONS(35),\n    [anon_sym_DQUOTE] = ACTIONS(35),\n    [anon_sym_BQUOTE] = ACTIONS(35),\n    [anon_sym_LT] = ACTIONS(35),\n    [anon_sym_LBRACK] = ACTIONS(35),\n    [anon_sym_LBRACE] = ACTIONS(35),\n    [anon_sym_DOT] = ACTIONS(35),\n    [anon_sym_COMMA] = ACTIONS(35),\n    [anon_sym_SEMI] = ACTIONS(35),\n    [anon_sym_BANG] = ACTIONS(35),\n    [anon_sym_QMARK] = ACTIONS(35),\n    [anon_sym_BSLASH] = ACTIONS(35),\n    [anon_sym_RBRACE] = ACTIONS(35),\n    [anon_sym_RBRACK] = ACTIONS(35),\n    [anon_sym_GT] = ACTIONS(35),\n    [anon_sym_DASH] = ACTIONS(35),\n    [sym_name] = ACTIONS(35),\n  },\n  [STATE(6)] = {\n    [ts_builtin_sym_end] = ACTIONS(39),\n    [anon_sym_COLON] = ACTIONS(39),\n    [anon_sym_LPAREN] = ACTIONS(39),\n    [anon_sym_RPAREN] = ACTIONS(39),\n    [aux_sym__full_uri_token1] = ACTIONS(3),\n    [sym_uri] = ACTIONS(39),\n    [aux_sym__text_token1] = ACTIONS(41),\n    [anon_sym_SLASH] = ACTIONS(39),\n    [anon_sym_SQUOTE] = ACTIONS(39),\n    [anon_sym_DQUOTE] = ACTIONS(39),\n    [anon_sym_BQUOTE] = ACTIONS(39),\n    [anon_sym_LT] = ACTIONS(39),\n    [anon_sym_LBRACK] = ACTIONS(39),\n    [anon_sym_LBRACE] = ACTIONS(39),\n    [anon_sym_DOT] = ACTIONS(39),\n    [anon_sym_COMMA] = ACTIONS(39),\n    [anon_sym_SEMI] = ACTIONS(39),\n    [anon_sym_BANG] = ACTIONS(39),\n    [anon_sym_QMARK] = ACTIONS(39),\n    [anon_sym_BSLASH] = ACTIONS(39),\n    [anon_sym_RBRACE] = ACTIONS(39),\n    [anon_sym_RBRACK] = ACTIONS(39),\n    [anon_sym_GT] = ACTIONS(39),\n    [anon_sym_DASH] = ACTIONS(39),\n    [sym_name] = ACTIONS(39),\n  },\n  [STATE(7)] = {\n    [ts_builtin_sym_end] = ACTIONS(43),\n    [anon_sym_COLON] = ACTIONS(43),\n    [anon_sym_LPAREN] = ACTIONS(43),\n    [anon_sym_RPAREN] = ACTIONS(43),\n    [aux_sym__full_uri_token1] = ACTIONS(3),\n    [sym_uri] = ACTIONS(43),\n    [aux_sym__text_token1] = ACTIONS(45),\n    [anon_sym_SLASH] = ACTIONS(43),\n    [anon_sym_SQUOTE] = ACTIONS(43),\n    [anon_sym_DQUOTE] = ACTIONS(43),\n    [anon_sym_BQUOTE] = ACTIONS(43),\n    [anon_sym_LT] = ACTIONS(43),\n    [anon_sym_LBRACK] = ACTIONS(43),\n    [anon_sym_LBRACE] = ACTIONS(43),\n    [anon_sym_DOT] = ACTIONS(43),\n    [anon_sym_COMMA] = ACTIONS(43),\n    [anon_sym_SEMI] = ACTIONS(43),\n    [anon_sym_BANG] = ACTIONS(43),\n    [anon_sym_QMARK] = ACTIONS(43),\n    [anon_sym_BSLASH] = ACTIONS(43),\n    [anon_sym_RBRACE] = ACTIONS(43),\n    [anon_sym_RBRACK] = ACTIONS(43),\n    [anon_sym_GT] = ACTIONS(43),\n    [anon_sym_DASH] = ACTIONS(43),\n    [sym_name] = ACTIONS(43),\n  },\n  [STATE(8)] = {\n    [ts_builtin_sym_end] = ACTIONS(47),\n    [anon_sym_COLON] = ACTIONS(47),\n    [anon_sym_LPAREN] = ACTIONS(47),\n    [anon_sym_RPAREN] = ACTIONS(47),\n    [aux_sym__full_uri_token1] = ACTIONS(3),\n    [sym_uri] = ACTIONS(47),\n    [aux_sym__text_token1] = ACTIONS(49),\n    [anon_sym_SLASH] = ACTIONS(47),\n    [anon_sym_SQUOTE] = ACTIONS(47),\n    [anon_sym_DQUOTE] = ACTIONS(47),\n    [anon_sym_BQUOTE] = ACTIONS(47),\n    [anon_sym_LT] = ACTIONS(47),\n    [anon_sym_LBRACK] = ACTIONS(47),\n    [anon_sym_LBRACE] = ACTIONS(47),\n    [anon_sym_DOT] = ACTIONS(47),\n    [anon_sym_COMMA] = ACTIONS(47),\n    [anon_sym_SEMI] = ACTIONS(47),\n    [anon_sym_BANG] = ACTIONS(47),\n    [anon_sym_QMARK] = ACTIONS(47),\n    [anon_sym_BSLASH] = ACTIONS(47),\n    [anon_sym_RBRACE] = ACTIONS(47),\n    [anon_sym_RBRACK] = ACTIONS(47),\n    [anon_sym_GT] = ACTIONS(47),\n    [anon_sym_DASH] = ACTIONS(47),\n    [sym_name] = ACTIONS(47),\n  },\n};\n\nstatic const uint16_t ts_small_parse_table[] = {\n  [0] = 3,\n    ACTIONS(53), 1,\n      aux_sym__full_uri_token1,\n    STATE(7), 1,\n      sym__end_char,\n    ACTIONS(51), 14,\n      anon_sym_COLON,\n      anon_sym_RPAREN,\n      anon_sym_SQUOTE,\n      anon_sym_DQUOTE,\n      anon_sym_BQUOTE,\n      anon_sym_DOT,\n      anon_sym_COMMA,\n      anon_sym_SEMI,\n      anon_sym_BANG,\n      anon_sym_QMARK,\n      anon_sym_BSLASH,\n      anon_sym_RBRACE,\n      anon_sym_RBRACK,\n      anon_sym_GT,\n  [23] = 4,\n    ACTIONS(3), 1,\n      aux_sym__full_uri_token1,\n    ACTIONS(55), 1,\n      anon_sym_COLON,\n    ACTIONS(57), 1,\n      anon_sym_LPAREN,\n    STATE(13), 1,\n      sym__user,\n  [36] = 2,\n    ACTIONS(3), 1,\n      aux_sym__full_uri_token1,\n    ACTIONS(59), 1,\n      ts_builtin_sym_end,\n  [43] = 2,\n    ACTIONS(61), 1,\n      aux_sym__user_token1,\n    ACTIONS(63), 1,\n      aux_sym__full_uri_token1,\n  [50] = 2,\n    ACTIONS(3), 1,\n      aux_sym__full_uri_token1,\n    ACTIONS(65), 1,\n      anon_sym_COLON,\n  [57] = 2,\n    ACTIONS(3), 1,\n      aux_sym__full_uri_token1,\n    ACTIONS(67), 1,\n      anon_sym_RPAREN,\n  [64] = 2,\n    ACTIONS(3), 1,\n      aux_sym__full_uri_token1,\n    ACTIONS(69), 1,\n      anon_sym_COLON,\n};\n\nstatic const uint32_t ts_small_parse_table_map[] = {\n  [SMALL_STATE(9)] = 0,\n  [SMALL_STATE(10)] = 23,\n  [SMALL_STATE(11)] = 36,\n  [SMALL_STATE(12)] = 43,\n  [SMALL_STATE(13)] = 50,\n  [SMALL_STATE(14)] = 57,\n  [SMALL_STATE(15)] = 64,\n};\n\nstatic const TSParseActionEntry ts_parse_actions[] = {\n  [0] = {.entry = {.count = 0, .reusable = false}},\n  [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(),\n  [3] = {.entry = {.count = 1, .reusable = true}}, SHIFT_EXTRA(),\n  [5] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source, 0, 0, 0),\n  [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4),\n  [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9),\n  [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(4),\n  [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10),\n  [15] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source, 1, 0, 0),\n  [17] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2, 0, 0),\n  [19] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2, 0, 0), SHIFT_REPEAT(4),\n  [22] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2, 0, 0), SHIFT_REPEAT(9),\n  [25] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2, 0, 0), SHIFT_REPEAT(4),\n  [28] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2, 0, 0), SHIFT_REPEAT(10),\n  [31] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__text, 1, 0, 0),\n  [33] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__text, 1, 0, 0),\n  [35] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tag, 2, 0, 0),\n  [37] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tag, 2, 0, 0),\n  [39] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__end_char, 1, 0, 0),\n  [41] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__end_char, 1, 0, 0),\n  [43] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__full_uri, 2, 0, 0),\n  [45] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__full_uri, 2, 0, 0),\n  [47] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tag, 3, 0, 0),\n  [49] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tag, 3, 0, 0),\n  [51] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6),\n  [53] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7),\n  [55] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5),\n  [57] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12),\n  [59] = {.entry = {.count = 1, .reusable = true}},  ACCEPT_INPUT(),\n  [61] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14),\n  [63] = {.entry = {.count = 1, .reusable = false}}, SHIFT_EXTRA(),\n  [65] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8),\n  [67] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15),\n  [69] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__user, 3, 0, 0),\n};\n\nenum ts_external_scanner_symbol_identifiers {\n  ts_external_token_name = 0,\n  ts_external_token_invalid_token = 1,\n};\n\nstatic const TSSymbol ts_external_scanner_symbol_map[EXTERNAL_TOKEN_COUNT] = {\n  [ts_external_token_name] = sym_name,\n  [ts_external_token_invalid_token] = sym_invalid_token,\n};\n\nstatic const bool ts_external_scanner_states[3][EXTERNAL_TOKEN_COUNT] = {\n  [1] = {\n    [ts_external_token_name] = true,\n    [ts_external_token_invalid_token] = true,\n  },\n  [2] = {\n    [ts_external_token_name] = true,\n  },\n};\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\nvoid *tree_sitter_comment_external_scanner_create(void);\nvoid tree_sitter_comment_external_scanner_destroy(void *);\nbool tree_sitter_comment_external_scanner_scan(void *, TSLexer *, const bool *);\nunsigned tree_sitter_comment_external_scanner_serialize(void *, char *);\nvoid tree_sitter_comment_external_scanner_deserialize(void *, const char *, unsigned);\n\n#ifdef TREE_SITTER_HIDE_SYMBOLS\n#define TS_PUBLIC\n#elif defined(_WIN32)\n#define TS_PUBLIC __declspec(dllexport)\n#else\n#define TS_PUBLIC __attribute__((visibility(\"default\")))\n#endif\n\nTS_PUBLIC const TSLanguage *tree_sitter_comment(void) {\n  static const TSLanguage language = {\n    .abi_version = LANGUAGE_VERSION,\n    .symbol_count = SYMBOL_COUNT,\n    .alias_count = ALIAS_COUNT,\n    .token_count = TOKEN_COUNT,\n    .external_token_count = EXTERNAL_TOKEN_COUNT,\n    .state_count = STATE_COUNT,\n    .large_state_count = LARGE_STATE_COUNT,\n    .production_id_count = PRODUCTION_ID_COUNT,\n    .supertype_count = SUPERTYPE_COUNT,\n    .field_count = FIELD_COUNT,\n    .max_alias_sequence_length = MAX_ALIAS_SEQUENCE_LENGTH,\n    .parse_table = &ts_parse_table[0][0],\n    .small_parse_table = ts_small_parse_table,\n    .small_parse_table_map = ts_small_parse_table_map,\n    .parse_actions = ts_parse_actions,\n    .symbol_names = ts_symbol_names,\n    .symbol_metadata = ts_symbol_metadata,\n    .public_symbol_map = ts_symbol_map,\n    .alias_map = ts_non_terminal_alias_map,\n    .alias_sequences = &ts_alias_sequences[0][0],\n    .lex_modes = (const void*)ts_lex_modes,\n    .lex_fn = ts_lex,\n    .external_scanner = {\n      &ts_external_scanner_states[0][0],\n      ts_external_scanner_symbol_map,\n      tree_sitter_comment_external_scanner_create,\n      tree_sitter_comment_external_scanner_destroy,\n      tree_sitter_comment_external_scanner_scan,\n      tree_sitter_comment_external_scanner_serialize,\n      tree_sitter_comment_external_scanner_deserialize,\n    },\n    .primary_state_ids = ts_primary_state_ids,\n    .name = \"comment\",\n    .max_reserved_word_set_size = 0,\n    .metadata = {\n      .major_version = 0,\n      .minor_version = 2,\n      .patch_version = 0,\n    },\n  };\n  return &language;\n}\n#ifdef __cplusplus\n}\n#endif\n"
  },
  {
    "path": "src/scanner.c",
    "content": "#include <tree_sitter/parser.h>\n\n#include \"tree_sitter_comment/parser.c\"\n#include \"tree_sitter_comment/tokens.h\"\n\nvoid* tree_sitter_comment_external_scanner_create()\n{\n  return NULL;\n}\n\nvoid tree_sitter_comment_external_scanner_destroy(void* payload)\n{\n}\n\nunsigned tree_sitter_comment_external_scanner_serialize(\n    void* payload,\n    char* buffer)\n{\n  return 0;\n}\n\nvoid tree_sitter_comment_external_scanner_deserialize(\n    void* payload,\n    const char* buffer,\n    unsigned length)\n{\n}\n\nbool tree_sitter_comment_external_scanner_scan(\n    void* payload,\n    TSLexer* lexer,\n    const bool* valid_symbols)\n{\n  return parse(lexer, valid_symbols);\n}\n"
  },
  {
    "path": "src/tree_sitter/alloc.h",
    "content": "#ifndef TREE_SITTER_ALLOC_H_\n#define TREE_SITTER_ALLOC_H_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include <stdbool.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n// Allow clients to override allocation functions\n#ifdef TREE_SITTER_REUSE_ALLOCATOR\n\nextern void *(*ts_current_malloc)(size_t size);\nextern void *(*ts_current_calloc)(size_t count, size_t size);\nextern void *(*ts_current_realloc)(void *ptr, size_t size);\nextern void (*ts_current_free)(void *ptr);\n\n#ifndef ts_malloc\n#define ts_malloc  ts_current_malloc\n#endif\n#ifndef ts_calloc\n#define ts_calloc  ts_current_calloc\n#endif\n#ifndef ts_realloc\n#define ts_realloc ts_current_realloc\n#endif\n#ifndef ts_free\n#define ts_free    ts_current_free\n#endif\n\n#else\n\n#ifndef ts_malloc\n#define ts_malloc  malloc\n#endif\n#ifndef ts_calloc\n#define ts_calloc  calloc\n#endif\n#ifndef ts_realloc\n#define ts_realloc realloc\n#endif\n#ifndef ts_free\n#define ts_free    free\n#endif\n\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif // TREE_SITTER_ALLOC_H_\n"
  },
  {
    "path": "src/tree_sitter/array.h",
    "content": "#ifndef TREE_SITTER_ARRAY_H_\n#define TREE_SITTER_ARRAY_H_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include \"./alloc.h\"\n\n#include <assert.h>\n#include <stdbool.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#elif defined(__GNUC__) || defined(__clang__)\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wunused-variable\"\n#endif\n\n#define Array(T)       \\\n  struct {             \\\n    T *contents;       \\\n    uint32_t size;     \\\n    uint32_t capacity; \\\n  }\n\n/// Initialize an array.\n#define array_init(self) \\\n  ((self)->size = 0, (self)->capacity = 0, (self)->contents = NULL)\n\n/// Create an empty array.\n#define array_new() \\\n  { NULL, 0, 0 }\n\n/// Get a pointer to the element at a given `index` in the array.\n#define array_get(self, _index) \\\n  (assert((uint32_t)(_index) < (self)->size), &(self)->contents[_index])\n\n/// Get a pointer to the first element in the array.\n#define array_front(self) array_get(self, 0)\n\n/// Get a pointer to the last element in the array.\n#define array_back(self) array_get(self, (self)->size - 1)\n\n/// Clear the array, setting its size to zero. Note that this does not free any\n/// memory allocated for the array's contents.\n#define array_clear(self) ((self)->size = 0)\n\n/// Reserve `new_capacity` elements of space in the array. If `new_capacity` is\n/// less than the array's current capacity, this function has no effect.\n#define array_reserve(self, new_capacity) \\\n  _array__reserve((Array *)(self), array_elem_size(self), new_capacity)\n\n/// Free any memory allocated for this array. Note that this does not free any\n/// memory allocated for the array's contents.\n#define array_delete(self) _array__delete((Array *)(self))\n\n/// Push a new `element` onto the end of the array.\n#define array_push(self, element)                            \\\n  (_array__grow((Array *)(self), 1, array_elem_size(self)), \\\n   (self)->contents[(self)->size++] = (element))\n\n/// Increase the array's size by `count` elements.\n/// New elements are zero-initialized.\n#define array_grow_by(self, count) \\\n  do { \\\n    if ((count) == 0) break; \\\n    _array__grow((Array *)(self), count, array_elem_size(self)); \\\n    memset((self)->contents + (self)->size, 0, (count) * array_elem_size(self)); \\\n    (self)->size += (count); \\\n  } while (0)\n\n/// Append all elements from one array to the end of another.\n#define array_push_all(self, other)                                       \\\n  array_extend((self), (other)->size, (other)->contents)\n\n/// Append `count` elements to the end of the array, reading their values from the\n/// `contents` pointer.\n#define array_extend(self, count, contents)                    \\\n  _array__splice(                                               \\\n    (Array *)(self), array_elem_size(self), (self)->size, \\\n    0, count,  contents                                        \\\n  )\n\n/// Remove `old_count` elements from the array starting at the given `index`. At\n/// the same index, insert `new_count` new elements, reading their values from the\n/// `new_contents` pointer.\n#define array_splice(self, _index, old_count, new_count, new_contents)  \\\n  _array__splice(                                                       \\\n    (Array *)(self), array_elem_size(self), _index,                \\\n    old_count, new_count, new_contents                                 \\\n  )\n\n/// Insert one `element` into the array at the given `index`.\n#define array_insert(self, _index, element) \\\n  _array__splice((Array *)(self), array_elem_size(self), _index, 0, 1, &(element))\n\n/// Remove one element from the array at the given `index`.\n#define array_erase(self, _index) \\\n  _array__erase((Array *)(self), array_elem_size(self), _index)\n\n/// Pop the last element off the array, returning the element by value.\n#define array_pop(self) ((self)->contents[--(self)->size])\n\n/// Assign the contents of one array to another, reallocating if necessary.\n#define array_assign(self, other) \\\n  _array__assign((Array *)(self), (const Array *)(other), array_elem_size(self))\n\n/// Swap one array with another\n#define array_swap(self, other) \\\n  _array__swap((Array *)(self), (Array *)(other))\n\n/// Get the size of the array contents\n#define array_elem_size(self) (sizeof *(self)->contents)\n\n/// Search a sorted array for a given `needle` value, using the given `compare`\n/// callback to determine the order.\n///\n/// If an existing element is found to be equal to `needle`, then the `index`\n/// out-parameter is set to the existing value's index, and the `exists`\n/// out-parameter is set to true. Otherwise, `index` is set to an index where\n/// `needle` should be inserted in order to preserve the sorting, and `exists`\n/// is set to false.\n#define array_search_sorted_with(self, compare, needle, _index, _exists) \\\n  _array__search_sorted(self, 0, compare, , needle, _index, _exists)\n\n/// Search a sorted array for a given `needle` value, using integer comparisons\n/// of a given struct field (specified with a leading dot) to determine the order.\n///\n/// See also `array_search_sorted_with`.\n#define array_search_sorted_by(self, field, needle, _index, _exists) \\\n  _array__search_sorted(self, 0, _compare_int, field, needle, _index, _exists)\n\n/// Insert a given `value` into a sorted array, using the given `compare`\n/// callback to determine the order.\n#define array_insert_sorted_with(self, compare, value) \\\n  do { \\\n    unsigned _index, _exists; \\\n    array_search_sorted_with(self, compare, &(value), &_index, &_exists); \\\n    if (!_exists) array_insert(self, _index, value); \\\n  } while (0)\n\n/// Insert a given `value` into a sorted array, using integer comparisons of\n/// a given struct field (specified with a leading dot) to determine the order.\n///\n/// See also `array_search_sorted_by`.\n#define array_insert_sorted_by(self, field, value) \\\n  do { \\\n    unsigned _index, _exists; \\\n    array_search_sorted_by(self, field, (value) field, &_index, &_exists); \\\n    if (!_exists) array_insert(self, _index, value); \\\n  } while (0)\n\n// Private\n\ntypedef Array(void) Array;\n\n/// This is not what you're looking for, see `array_delete`.\nstatic inline void _array__delete(Array *self) {\n  if (self->contents) {\n    ts_free(self->contents);\n    self->contents = NULL;\n    self->size = 0;\n    self->capacity = 0;\n  }\n}\n\n/// This is not what you're looking for, see `array_erase`.\nstatic inline void _array__erase(Array *self, size_t element_size,\n                                uint32_t index) {\n  assert(index < self->size);\n  char *contents = (char *)self->contents;\n  memmove(contents + index * element_size, contents + (index + 1) * element_size,\n          (self->size - index - 1) * element_size);\n  self->size--;\n}\n\n/// This is not what you're looking for, see `array_reserve`.\nstatic inline void _array__reserve(Array *self, size_t element_size, uint32_t new_capacity) {\n  if (new_capacity > self->capacity) {\n    if (self->contents) {\n      self->contents = ts_realloc(self->contents, new_capacity * element_size);\n    } else {\n      self->contents = ts_malloc(new_capacity * element_size);\n    }\n    self->capacity = new_capacity;\n  }\n}\n\n/// This is not what you're looking for, see `array_assign`.\nstatic inline void _array__assign(Array *self, const Array *other, size_t element_size) {\n  _array__reserve(self, element_size, other->size);\n  self->size = other->size;\n  memcpy(self->contents, other->contents, self->size * element_size);\n}\n\n/// This is not what you're looking for, see `array_swap`.\nstatic inline void _array__swap(Array *self, Array *other) {\n  Array swap = *other;\n  *other = *self;\n  *self = swap;\n}\n\n/// This is not what you're looking for, see `array_push` or `array_grow_by`.\nstatic inline void _array__grow(Array *self, uint32_t count, size_t element_size) {\n  uint32_t new_size = self->size + count;\n  if (new_size > self->capacity) {\n    uint32_t new_capacity = self->capacity * 2;\n    if (new_capacity < 8) new_capacity = 8;\n    if (new_capacity < new_size) new_capacity = new_size;\n    _array__reserve(self, element_size, new_capacity);\n  }\n}\n\n/// This is not what you're looking for, see `array_splice`.\nstatic inline void _array__splice(Array *self, size_t element_size,\n                                 uint32_t index, uint32_t old_count,\n                                 uint32_t new_count, const void *elements) {\n  uint32_t new_size = self->size + new_count - old_count;\n  uint32_t old_end = index + old_count;\n  uint32_t new_end = index + new_count;\n  assert(old_end <= self->size);\n\n  _array__reserve(self, element_size, new_size);\n\n  char *contents = (char *)self->contents;\n  if (self->size > old_end) {\n    memmove(\n      contents + new_end * element_size,\n      contents + old_end * element_size,\n      (self->size - old_end) * element_size\n    );\n  }\n  if (new_count > 0) {\n    if (elements) {\n      memcpy(\n        (contents + index * element_size),\n        elements,\n        new_count * element_size\n      );\n    } else {\n      memset(\n        (contents + index * element_size),\n        0,\n        new_count * element_size\n      );\n    }\n  }\n  self->size += new_count - old_count;\n}\n\n/// A binary search routine, based on Rust's `std::slice::binary_search_by`.\n/// This is not what you're looking for, see `array_search_sorted_with` or `array_search_sorted_by`.\n#define _array__search_sorted(self, start, compare, suffix, needle, _index, _exists) \\\n  do { \\\n    *(_index) = start; \\\n    *(_exists) = false; \\\n    uint32_t size = (self)->size - *(_index); \\\n    if (size == 0) break; \\\n    int comparison; \\\n    while (size > 1) { \\\n      uint32_t half_size = size / 2; \\\n      uint32_t mid_index = *(_index) + half_size; \\\n      comparison = compare(&((self)->contents[mid_index] suffix), (needle)); \\\n      if (comparison <= 0) *(_index) = mid_index; \\\n      size -= half_size; \\\n    } \\\n    comparison = compare(&((self)->contents[*(_index)] suffix), (needle)); \\\n    if (comparison == 0) *(_exists) = true; \\\n    else if (comparison < 0) *(_index) += 1; \\\n  } while (0)\n\n/// Helper macro for the `_sorted_by` routines below. This takes the left (existing)\n/// parameter by reference in order to work with the generic sorting function above.\n#define _compare_int(a, b) ((int)*(a) - (int)(b))\n\n#ifdef _MSC_VER\n#pragma warning(pop)\n#elif defined(__GNUC__) || defined(__clang__)\n#pragma GCC diagnostic pop\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif  // TREE_SITTER_ARRAY_H_\n"
  },
  {
    "path": "src/tree_sitter/parser.h",
    "content": "#ifndef TREE_SITTER_PARSER_H_\n#define TREE_SITTER_PARSER_H_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include <stdbool.h>\n#include <stdint.h>\n#include <stdlib.h>\n\n#define ts_builtin_sym_error ((TSSymbol)-1)\n#define ts_builtin_sym_end 0\n#define TREE_SITTER_SERIALIZATION_BUFFER_SIZE 1024\n\n#ifndef TREE_SITTER_API_H_\ntypedef uint16_t TSStateId;\ntypedef uint16_t TSSymbol;\ntypedef uint16_t TSFieldId;\ntypedef struct TSLanguage TSLanguage;\ntypedef struct TSLanguageMetadata TSLanguageMetadata;\ntypedef struct TSLanguageMetadata {\n  uint8_t major_version;\n  uint8_t minor_version;\n  uint8_t patch_version;\n} TSLanguageMetadata;\n#endif\n\ntypedef struct {\n  TSFieldId field_id;\n  uint8_t child_index;\n  bool inherited;\n} TSFieldMapEntry;\n\n// Used to index the field and supertype maps.\ntypedef struct {\n  uint16_t index;\n  uint16_t length;\n} TSMapSlice;\n\ntypedef struct {\n  bool visible;\n  bool named;\n  bool supertype;\n} TSSymbolMetadata;\n\ntypedef struct TSLexer TSLexer;\n\nstruct TSLexer {\n  int32_t lookahead;\n  TSSymbol result_symbol;\n  void (*advance)(TSLexer *, bool);\n  void (*mark_end)(TSLexer *);\n  uint32_t (*get_column)(TSLexer *);\n  bool (*is_at_included_range_start)(const TSLexer *);\n  bool (*eof)(const TSLexer *);\n  void (*log)(const TSLexer *, const char *, ...);\n};\n\ntypedef enum {\n  TSParseActionTypeShift,\n  TSParseActionTypeReduce,\n  TSParseActionTypeAccept,\n  TSParseActionTypeRecover,\n} TSParseActionType;\n\ntypedef union {\n  struct {\n    uint8_t type;\n    TSStateId state;\n    bool extra;\n    bool repetition;\n  } shift;\n  struct {\n    uint8_t type;\n    uint8_t child_count;\n    TSSymbol symbol;\n    int16_t dynamic_precedence;\n    uint16_t production_id;\n  } reduce;\n  uint8_t type;\n} TSParseAction;\n\ntypedef struct {\n  uint16_t lex_state;\n  uint16_t external_lex_state;\n} TSLexMode;\n\ntypedef struct {\n  uint16_t lex_state;\n  uint16_t external_lex_state;\n  uint16_t reserved_word_set_id;\n} TSLexerMode;\n\ntypedef union {\n  TSParseAction action;\n  struct {\n    uint8_t count;\n    bool reusable;\n  } entry;\n} TSParseActionEntry;\n\ntypedef struct {\n  int32_t start;\n  int32_t end;\n} TSCharacterRange;\n\nstruct TSLanguage {\n  uint32_t abi_version;\n  uint32_t symbol_count;\n  uint32_t alias_count;\n  uint32_t token_count;\n  uint32_t external_token_count;\n  uint32_t state_count;\n  uint32_t large_state_count;\n  uint32_t production_id_count;\n  uint32_t field_count;\n  uint16_t max_alias_sequence_length;\n  const uint16_t *parse_table;\n  const uint16_t *small_parse_table;\n  const uint32_t *small_parse_table_map;\n  const TSParseActionEntry *parse_actions;\n  const char * const *symbol_names;\n  const char * const *field_names;\n  const TSMapSlice *field_map_slices;\n  const TSFieldMapEntry *field_map_entries;\n  const TSSymbolMetadata *symbol_metadata;\n  const TSSymbol *public_symbol_map;\n  const uint16_t *alias_map;\n  const TSSymbol *alias_sequences;\n  const TSLexerMode *lex_modes;\n  bool (*lex_fn)(TSLexer *, TSStateId);\n  bool (*keyword_lex_fn)(TSLexer *, TSStateId);\n  TSSymbol keyword_capture_token;\n  struct {\n    const bool *states;\n    const TSSymbol *symbol_map;\n    void *(*create)(void);\n    void (*destroy)(void *);\n    bool (*scan)(void *, TSLexer *, const bool *symbol_whitelist);\n    unsigned (*serialize)(void *, char *);\n    void (*deserialize)(void *, const char *, unsigned);\n  } external_scanner;\n  const TSStateId *primary_state_ids;\n  const char *name;\n  const TSSymbol *reserved_words;\n  uint16_t max_reserved_word_set_size;\n  uint32_t supertype_count;\n  const TSSymbol *supertype_symbols;\n  const TSMapSlice *supertype_map_slices;\n  const TSSymbol *supertype_map_entries;\n  TSLanguageMetadata metadata;\n};\n\nstatic inline bool set_contains(const TSCharacterRange *ranges, uint32_t len, int32_t lookahead) {\n  uint32_t index = 0;\n  uint32_t size = len - index;\n  while (size > 1) {\n    uint32_t half_size = size / 2;\n    uint32_t mid_index = index + half_size;\n    const TSCharacterRange *range = &ranges[mid_index];\n    if (lookahead >= range->start && lookahead <= range->end) {\n      return true;\n    } else if (lookahead > range->end) {\n      index = mid_index;\n    }\n    size -= half_size;\n  }\n  const TSCharacterRange *range = &ranges[index];\n  return (lookahead >= range->start && lookahead <= range->end);\n}\n\n/*\n *  Lexer Macros\n */\n\n#ifdef _MSC_VER\n#define UNUSED __pragma(warning(suppress : 4101))\n#else\n#define UNUSED __attribute__((unused))\n#endif\n\n#define START_LEXER()           \\\n  bool result = false;          \\\n  bool skip = false;            \\\n  UNUSED                        \\\n  bool eof = false;             \\\n  int32_t lookahead;            \\\n  goto start;                   \\\n  next_state:                   \\\n  lexer->advance(lexer, skip);  \\\n  start:                        \\\n  skip = false;                 \\\n  lookahead = lexer->lookahead;\n\n#define ADVANCE(state_value) \\\n  {                          \\\n    state = state_value;     \\\n    goto next_state;         \\\n  }\n\n#define ADVANCE_MAP(...)                                              \\\n  {                                                                   \\\n    static const uint16_t map[] = { __VA_ARGS__ };                    \\\n    for (uint32_t i = 0; i < sizeof(map) / sizeof(map[0]); i += 2) {  \\\n      if (map[i] == lookahead) {                                      \\\n        state = map[i + 1];                                           \\\n        goto next_state;                                              \\\n      }                                                               \\\n    }                                                                 \\\n  }\n\n#define SKIP(state_value) \\\n  {                       \\\n    skip = true;          \\\n    state = state_value;  \\\n    goto next_state;      \\\n  }\n\n#define ACCEPT_TOKEN(symbol_value)     \\\n  result = true;                       \\\n  lexer->result_symbol = symbol_value; \\\n  lexer->mark_end(lexer);\n\n#define END_STATE() return result;\n\n/*\n *  Parse Table Macros\n */\n\n#define SMALL_STATE(id) ((id) - LARGE_STATE_COUNT)\n\n#define STATE(id) id\n\n#define ACTIONS(id) id\n\n#define SHIFT(state_value)            \\\n  {{                                  \\\n    .shift = {                        \\\n      .type = TSParseActionTypeShift, \\\n      .state = (state_value)          \\\n    }                                 \\\n  }}\n\n#define SHIFT_REPEAT(state_value)     \\\n  {{                                  \\\n    .shift = {                        \\\n      .type = TSParseActionTypeShift, \\\n      .state = (state_value),         \\\n      .repetition = true              \\\n    }                                 \\\n  }}\n\n#define SHIFT_EXTRA()                 \\\n  {{                                  \\\n    .shift = {                        \\\n      .type = TSParseActionTypeShift, \\\n      .extra = true                   \\\n    }                                 \\\n  }}\n\n#define REDUCE(symbol_name, children, precedence, prod_id) \\\n  {{                                                       \\\n    .reduce = {                                            \\\n      .type = TSParseActionTypeReduce,                     \\\n      .symbol = symbol_name,                               \\\n      .child_count = children,                             \\\n      .dynamic_precedence = precedence,                    \\\n      .production_id = prod_id                             \\\n    },                                                     \\\n  }}\n\n#define RECOVER()                    \\\n  {{                                 \\\n    .type = TSParseActionTypeRecover \\\n  }}\n\n#define ACCEPT_INPUT()              \\\n  {{                                \\\n    .type = TSParseActionTypeAccept \\\n  }}\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif  // TREE_SITTER_PARSER_H_\n"
  },
  {
    "path": "src/tree_sitter_comment/chars.c",
    "content": "#include \"chars.h\"\n\nstatic bool is_upper(int32_t c)\n{\n  const int32_t upper = 65;\n  const int32_t lower = 90;\n  return c >= upper && c <= lower;\n}\n\nstatic bool is_digit(int32_t c)\n{\n  const int32_t upper = 48;\n  const int32_t lower = 57;\n  return c >= upper && c <= lower;\n}\n\nstatic bool is_newline(int32_t c)\n{\n  const int32_t newline_chars[] = {\n    CHAR_EOF,\n    CHAR_NEWLINE,\n    CHAR_CARRIAGE_RETURN,\n  };\n  const int length = sizeof(newline_chars) / sizeof(int32_t);\n  for (int i = 0; i < length; i++) {\n    if (c == newline_chars[i]) {\n      return true;\n    }\n  }\n  return false;\n}\n\nstatic bool is_space(int32_t c)\n{\n  const int32_t space_chars[] = {\n    CHAR_SPACE,\n    CHAR_FORM_FEED,\n    CHAR_TAB,\n    CHAR_VERTICAL_TAB,\n  };\n  const int length = sizeof(space_chars) / sizeof(int32_t);\n  bool is_space_char = false;\n  for (int i = 0; i < length; i++) {\n    if (c == space_chars[i]) {\n      is_space_char = true;\n      break;\n    }\n  }\n  return is_space_char || is_newline(c);\n}\n\n/// Check if the character is allowed inside the name.\nstatic bool is_internal_char(int32_t c)\n{\n  const int32_t valid_chars[] = {\n    '-',\n    '_',\n  };\n  const int length = sizeof(valid_chars) / sizeof(int32_t);\n  for (int i = 0; i < length; i++) {\n    if (c == valid_chars[i]) {\n      return true;\n    }\n  }\n  return false;\n}\n"
  },
  {
    "path": "src/tree_sitter_comment/chars.h",
    "content": "#ifndef TREE_SITTER_COMMENT_CHARS_H\n#define TREE_SITTER_COMMENT_CHARS_H\n\n#include <stdbool.h>\n#include <stdint.h>\n\n#define CHAR_EOF 0\n#define CHAR_NEWLINE 10\n#define CHAR_CARRIAGE_RETURN 13\n\n#define CHAR_SPACE ' '\n#define CHAR_FORM_FEED '\\f'\n#define CHAR_TAB '\\t'\n#define CHAR_VERTICAL_TAB '\\v'\n\nstatic bool is_internal_char(int32_t c);\nstatic bool is_newline(int32_t c);\nstatic bool is_space(int32_t c);\nstatic bool is_upper(int32_t c);\nstatic bool is_digit(int32_t c);\n\n#endif /* ifndef TREE_SITTER_COMMENT_CHARS_H */\n"
  },
  {
    "path": "src/tree_sitter_comment/parser.c",
    "content": "#include \"parser.h\"\n\n#include \"chars.c\"\n#include \"tokens.h\"\n#include <stdbool.h>\n#include <stdio.h>\n\n/// Parse the name of the tag.\n///\n/// They can be of the form:\n/// - TODO:\n/// - TODO: text\n/// - TODO(stsewd):\n/// - TODO(stsewd): text\n/// - TODO (stsewd): text\nstatic bool parse_tagname(TSLexer* lexer, const bool* valid_symbols)\n{\n  if (!is_upper(lexer->lookahead) || !valid_symbols[T_TAGNAME]) {\n    return false;\n  }\n\n  int32_t previous = lexer->lookahead;\n  lexer->advance(lexer, false);\n\n  while (is_upper(lexer->lookahead)\n      || is_digit(lexer->lookahead)\n      || is_internal_char(lexer->lookahead)) {\n    previous = lexer->lookahead;\n    lexer->advance(lexer, false);\n  }\n  // The tag name ends here.\n  // But we keep parsing to see if it's a valid tag name.\n  lexer->mark_end(lexer);\n\n  // It can't end with an internal char.\n  if (is_internal_char(previous)) {\n    return false;\n  }\n\n  // For the user component this is `\\s*(`.\n  // We don't parse that part, we just need to be sure it ends with `:\\s`.\n  if ((is_space(lexer->lookahead) && !is_newline(lexer->lookahead))\n      || lexer->lookahead == '(') {\n    // Skip white spaces.\n    while (is_space(lexer->lookahead) && !is_newline(lexer->lookahead)) {\n      lexer->advance(lexer, false);\n    }\n    // Checking aperture.\n    if (lexer->lookahead != '(') {\n      return false;\n    }\n    lexer->advance(lexer, false);\n\n    // Checking closure.\n    int user_length = 0;\n    while (lexer->lookahead != ')') {\n      if (is_newline(lexer->lookahead)) {\n        return false;\n      }\n      lexer->advance(lexer, false);\n      user_length++;\n    }\n    if (user_length <= 0) {\n      return false;\n    }\n    lexer->advance(lexer, false);\n  }\n\n  // It should end with `:`...\n  if (lexer->lookahead != ':') {\n    return false;\n  }\n\n  // ... and be followed by one space.\n  lexer->advance(lexer, false);\n  if (!is_space(lexer->lookahead)) {\n    return false;\n  }\n\n  lexer->result_symbol = T_TAGNAME;\n  return true;\n}\n\nstatic bool parse(TSLexer* lexer, const bool* valid_symbols)\n{\n  // If all valid symbols are true, tree-sitter is in correction mode.\n  // We don't want to parse anything in that case.\n  if (valid_symbols[T_INVALID_TOKEN]) {\n    return false;\n  }\n\n  if (is_upper(lexer->lookahead) && valid_symbols[T_TAGNAME]) {\n    return parse_tagname(lexer, valid_symbols);\n  }\n\n  return false;\n}\n"
  },
  {
    "path": "src/tree_sitter_comment/parser.h",
    "content": "#ifndef TREE_SITTER_COMMENT_PARSER_H\n#define TREE_SITTER_COMMENT_PARSER_H\n\n#include <tree_sitter/parser.h>\n\nstatic bool parse_tagname(TSLexer* lexer, const bool* valid_symbols);\nstatic bool parse(TSLexer* lexer, const bool* valid_symbols);\n\n#endif /* ifndef TREE_SITTER_COMMENT_PARSER_H */\n"
  },
  {
    "path": "src/tree_sitter_comment/tokens.h",
    "content": "#ifndef TREE_SITTER_COMMENT_TOKENS_H\n#define TREE_SITTER_COMMENT_TOKENS_H\n\nenum TokenType {\n  T_TAGNAME,\n  T_INVALID_TOKEN,\n};\n\n#endif /* ifndef TREE_SITTER_COMMENT_TOKENS_H */\n"
  },
  {
    "path": "test/corpus/source.txt",
    "content": "================================================================================\nSimple tags\n================================================================================\n\nTODO: something\n\nXXX: fix something else.\n\nTODO:    extra white spaces.\n\nNOTAG:missing space\n\n(TODO: I'm inside parentheses)\n\nNOTE:\n\n\"NOTE: this should work!\"\n\nDEBUG: thís shoúld wórk with $weird$ symbols\n\n--------------------------------------------------------------------------------\n\n(source\n  (tag\n    (name))\n  (tag\n    (name))\n  (tag\n    (name))\n  (tag\n    (name))\n  (tag\n    (name))\n  (tag\n    (name))\n  (tag\n    (name)))\n\n================================================================================\nDecorated tags\n================================================================================\n\nTODO(stsewd): something\n\nXXX (monday): fix something else.\n\nTODO(@todo):    extra white spaces.\n\nNOTAG(tag):missing space\n\n(TODO (someone): I'm inside parentheses)\n\nNOTE(a user):\n\n\"NOTE (a user): this should work!\"\n\nFIXME(): This isn't a valid tag (user is missing)\n\n--------------------------------------------------------------------------------\n\n(source\n  (tag\n    (name)\n    (user))\n  (tag\n    (name)\n    (user))\n  (tag\n    (name)\n    (user))\n  (tag\n    (name)\n    (user))\n  (tag\n    (name)\n    (user))\n  (tag\n    (name)\n    (user)))\n\n================================================================================\nURIS\n================================================================================\n\nTODO: http://example.com\n\nTODO: https://example.com\n\nSomething \"http://example.com\"\n\nURI: https://user:pass@example.com/org/repo/?foo=baz\n\n(https://example.com/foo/bar/)\n\nURI(me): (https://github.com/stsewd/?foo=bar#baz)\n\nURLs containing stop characters (dots, slashes, etc):\n\n- https://github.com/stsewd/tree-sitter-rst#1.1\n- https://doc.rust-lang.org/std/boxed/struct.Box.html#impl-IntoIterator-for-Box%3C%5BI%5D,+A%3E\n- https://web.archive.org/web/20250315035304/https://www.wikipedia.org/\n\nURLs containing parentheses:\n\n- https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters\n- https://en.wikipedia.org/wiki/Naming_convention_(programming)#Multiple-word_identifiers\n\nURLs from popular markup languages:\n\n- [Markdown](https://github.com/stsewd/tree-sitter-comment)\n- `reStructuredText <https://github.com/stsewd/tree-sitter-comment>`_\n\nURLs in prose:\n\nFollow me in https://github.com, https://x.com, https://linkedin.com...\n\n--------------------------------------------------------------------------------\n\n(source\n  (tag\n    (name))\n  (uri)\n  (tag\n    (name))\n  (uri)\n  (uri)\n  (tag\n    (name))\n  (uri)\n  (uri)\n  (tag\n    (name)\n    (user))\n  (uri)\n  (uri)\n  (uri)\n  (uri)\n  (uri)\n  (uri)\n  (uri)\n  (uri)\n  (uri)\n  (uri)\n  (uri))\n"
  },
  {
    "path": "tree-sitter.json",
    "content": "{\n  \"$schema\": \"https://tree-sitter.github.io/tree-sitter/assets/schemas/config.schema.json\",\n  \"grammars\": [\n    {\n      \"name\": \"comment\",\n      \"camelcase\": \"Comment\",\n      \"title\": \"Comment\",\n      \"scope\": \"source.comment\",\n      \"file-types\": [\n        \"comment\"\n      ],\n      \"injection-regex\": \"^comment$\",\n      \"class-name\": \"TreeSitterComment\"\n    }\n  ],\n  \"metadata\": {\n    \"version\": \"0.3.0\",\n    \"license\": \"MIT\",\n    \"description\": \"Grammar for code tags like TODO:, FIXME(user): for the tree-sitter parsing library\",\n    \"authors\": [\n      {\n        \"name\": \"Santos Gallegos\",\n        \"email\": \"stsewd@proton.me\",\n        \"url\": \"https://stsewd.dev/\"\n      }\n    ],\n    \"links\": {\n      \"repository\": \"https://github.com/stsewd/tree-sitter-comment\",\n      \"funding\": \"https://github.com/sponsors/stsewd\"\n    }\n  },\n  \"bindings\": {\n    \"c\": true,\n    \"go\": true,\n    \"node\": true,\n    \"python\": true,\n    \"rust\": true,\n    \"swift\": true,\n    \"zig\": false\n  }\n}\n"
  }
]