From 9a923cded15d6ec3156fd82c4499cdf67955951a Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Sun, 15 Dec 2024 15:35:32 +0200 Subject: [PATCH] Initial commit --- .editorconfig | 43 + .gitattributes | 13 + .gitignore | 40 + CMakeLists.txt | 60 + Cargo.lock | 96 + Cargo.toml | 27 + Makefile | 94 + Package.swift | 37 + binding.gyp | 30 + bindings/c/tree-sitter-bruno.h | 16 + bindings/c/tree-sitter-bruno.pc.in | 11 + bindings/go/binding.go | 13 + bindings/go/binding_test.go | 15 + bindings/node/binding.cc | 20 + bindings/node/binding_test.js | 9 + bindings/node/index.d.ts | 28 + bindings/node/index.js | 7 + bindings/python/tests/test_binding.py | 11 + bindings/python/tree_sitter_bruno/__init__.py | 42 + .../python/tree_sitter_bruno/__init__.pyi | 10 + bindings/python/tree_sitter_bruno/binding.c | 27 + bindings/python/tree_sitter_bruno/py.typed | 0 bindings/rust/build.rs | 19 + bindings/rust/lib.rs | 53 + bindings/swift/TreeSitterBruno/bruno.h | 16 + .../TreeSitterBrunoTests.swift | 12 + deno.lock | 156 + go.mod | 5 + grammar.js | 129 + package.json | 56 + pyproject.toml | 30 + queries/highlights.scm | 18 + queries/injections.scm | 59 + setup.py | 62 + src/grammar.json | 866 ++++ src/node-types.json | 894 ++++ src/parser.c | 4192 +++++++++++++++++ src/scanner.c | 50 + src/tree_sitter/alloc.h | 54 + src/tree_sitter/array.h | 290 ++ src/tree_sitter/parser.h | 266 ++ test/corpus/assert.txt | 47 + test/corpus/auth.txt | 57 + test/corpus/body.txt | 192 + test/corpus/bruno.txt | 31 + test/corpus/methods.txt | 239 + test/corpus/real.txt | 197 + test/corpus/scripts.txt | 60 + tree-sitter.json | 43 + 49 files changed, 8742 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 Makefile create mode 100644 Package.swift create mode 100644 binding.gyp create mode 100644 bindings/c/tree-sitter-bruno.h create mode 100644 bindings/c/tree-sitter-bruno.pc.in create mode 100644 bindings/go/binding.go create mode 100644 bindings/go/binding_test.go create mode 100644 bindings/node/binding.cc create mode 100644 bindings/node/binding_test.js create mode 100644 bindings/node/index.d.ts create mode 100644 bindings/node/index.js create mode 100644 bindings/python/tests/test_binding.py create mode 100644 bindings/python/tree_sitter_bruno/__init__.py create mode 100644 bindings/python/tree_sitter_bruno/__init__.pyi create mode 100644 bindings/python/tree_sitter_bruno/binding.c create mode 100644 bindings/python/tree_sitter_bruno/py.typed create mode 100644 bindings/rust/build.rs create mode 100644 bindings/rust/lib.rs create mode 100644 bindings/swift/TreeSitterBruno/bruno.h create mode 100644 bindings/swift/TreeSitterBrunoTests/TreeSitterBrunoTests.swift create mode 100644 deno.lock create mode 100644 go.mod create mode 100644 grammar.js create mode 100644 package.json create mode 100644 pyproject.toml create mode 100644 queries/highlights.scm create mode 100644 queries/injections.scm create mode 100644 setup.py create mode 100644 src/grammar.json create mode 100644 src/node-types.json create mode 100644 src/parser.c create mode 100644 src/scanner.c create mode 100644 src/tree_sitter/alloc.h create mode 100644 src/tree_sitter/array.h create mode 100644 src/tree_sitter/parser.h create mode 100644 test/corpus/assert.txt create mode 100644 test/corpus/auth.txt create mode 100644 test/corpus/body.txt create mode 100644 test/corpus/bruno.txt create mode 100644 test/corpus/methods.txt create mode 100644 test/corpus/real.txt create mode 100644 test/corpus/scripts.txt create mode 100644 tree-sitter.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..7756ee9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,43 @@ +root = true + +[*] +charset = utf-8 + +[*.{json,toml,yml,gyp}] +indent_style = space +indent_size = 2 + +[*.js] +indent_style = space +indent_size = 2 + +[*.scm] +indent_style = space +indent_size = 2 + +[*.{c,cc,h}] +indent_style = space +indent_size = 4 + +[*.rs] +indent_style = space +indent_size = 4 + +[*.{py,pyi}] +indent_style = space +indent_size = 4 + +[*.swift] +indent_style = space +indent_size = 4 + +[*.go] +indent_style = tab +indent_size = 8 + +[Makefile] +indent_style = tab +indent_size = 8 + +[parser.c] +indent_size = 2 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9d5c5d4 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,13 @@ +* text=auto eol=lf + +src/*.json linguist-generated +src/parser.c linguist-generated +src/tree_sitter/* linguist-generated + +bindings/** linguist-generated +binding.gyp linguist-generated +setup.py linguist-generated +Makefile linguist-generated +CMakeLists.txt linguist-generated +Package.swift linguist-generated +go.mod linguist-generated diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..308fcab --- /dev/null +++ b/.gitignore @@ -0,0 +1,40 @@ +# Rust artifacts +target/ + +# Node artifacts +build/ +prebuilds/ +node_modules/ + +# Swift artifacts +.build/ + +# Go artifacts +_obj/ + +# Python artifacts +.venv/ +dist/ +*.egg-info +*.whl + +# C artifacts +*.a +*.so +*.so.* +*.dylib +*.dll +*.pc + +# Example dirs +/examples/*/ + +# Grammar volatiles +*.wasm +*.obj +*.o + +# Archives +*.tar.gz +*.tgz +*.zip diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..e3efb34 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,60 @@ +cmake_minimum_required(VERSION 3.13) + +project(tree-sitter-bruno + VERSION "0.1.0" + DESCRIPTION " Bruno grammar for tree-sitter" + HOMEPAGE_URL "https://github.com/kristoferssolo/tree-sitter-bruno" + LANGUAGES C) + +option(BUILD_SHARED_LIBS "Build using shared libraries" ON) +option(TREE_SITTER_REUSE_ALLOCATOR "Reuse the library allocator" OFF) + +set(TREE_SITTER_ABI_VERSION 14 CACHE STRING "Tree-sitter ABI version") +if(NOT ${TREE_SITTER_ABI_VERSION} MATCHES "^[0-9]+$") + unset(TREE_SITTER_ABI_VERSION CACHE) + message(FATAL_ERROR "TREE_SITTER_ABI_VERSION must be an integer") +endif() + +find_program(TREE_SITTER_CLI tree-sitter DOC "Tree-sitter CLI") + +add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/src/parser.c" + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/grammar.json" + COMMAND "${TREE_SITTER_CLI}" generate src/grammar.json + --abi=${TREE_SITTER_ABI_VERSION} + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + COMMENT "Generating parser.c") + +add_library(tree-sitter-bruno src/parser.c) +if(EXISTS src/scanner.c) + target_sources(tree-sitter-bruno PRIVATE src/scanner.c) +endif() +target_include_directories(tree-sitter-bruno PRIVATE src) + +target_compile_definitions(tree-sitter-bruno PRIVATE + $<$:TREE_SITTER_REUSE_ALLOCATOR> + $<$:TREE_SITTER_DEBUG>) + +set_target_properties(tree-sitter-bruno + PROPERTIES + C_STANDARD 11 + POSITION_INDEPENDENT_CODE ON + SOVERSION "${TREE_SITTER_ABI_VERSION}.${PROJECT_VERSION_MAJOR}" + DEFINE_SYMBOL "") + +configure_file(bindings/c/tree-sitter-bruno.pc.in + "${CMAKE_CURRENT_BINARY_DIR}/tree-sitter-bruno.pc" @ONLY) + +include(GNUInstallDirs) + +install(FILES bindings/c/tree-sitter-bruno.h + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/tree_sitter") +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tree-sitter-bruno.pc" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig") +install(TARGETS tree-sitter-bruno + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") + +add_custom_target(test "${TREE_SITTER_CLI}" test + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + COMMENT "tree-sitter test") + +# vim:ft=cmake: diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..40f4777 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,96 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "cc" +version = "1.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9157bbaa6b165880c27a4293a474c91cdcf265cc68cc829bf10be0964a391caf" +dependencies = [ + "shlex", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b2231b7c3057d5e4ad0156fb3dc807d900806020c5ffa3ee6ff2c8c76fb8520" + +[[package]] +name = "tree-sitter" +version = "0.24.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ac95b18f0f727aaaa012bd5179a1916706ee3ed071920fdbda738750b0c0bf5" +dependencies = [ + "cc", + "regex", + "regex-syntax", + "streaming-iterator", + "tree-sitter-language", +] + +[[package]] +name = "tree-sitter-bruno" +version = "0.1.0" +dependencies = [ + "cc", + "tree-sitter", + "tree-sitter-language", +] + +[[package]] +name = "tree-sitter-language" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c199356c799a8945965bb5f2c55b2ad9d9aa7c4b4f6e587fe9dea0bc715e5f9c" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..dfe9562 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "tree-sitter-bruno" +description = " Bruno grammar for tree-sitter" +version = "0.1.0" +authors = ["Kristofers Solo "] +license = "MIT" +readme = "README.md" +keywords = ["incremental", "parsing", "tree-sitter", "bruno"] +categories = ["parsing", "text-editors"] +repository = "https://github.com/kristoferssolo/tree-sitter-bruno" +edition = "2021" +autoexamples = false + +build = "bindings/rust/build.rs" +include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*"] + +[lib] +path = "bindings/rust/lib.rs" + +[dependencies] +tree-sitter-language = "0.1" + +[build-dependencies] +cc = "1.1.22" + +[dev-dependencies] +tree-sitter = "0.24.3" diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f748a64 --- /dev/null +++ b/Makefile @@ -0,0 +1,94 @@ +ifeq ($(OS),Windows_NT) +$(error Windows is not supported) +endif + +LANGUAGE_NAME := tree-sitter-bruno +HOMEPAGE_URL := https://github.com/kristoferssolo/tree-sitter-bruno +VERSION := 0.1.0 + +# repository +SRC_DIR := src + +TS ?= tree-sitter + +# install directory layout +PREFIX ?= /usr/local +INCLUDEDIR ?= $(PREFIX)/include +LIBDIR ?= $(PREFIX)/lib +PCLIBDIR ?= $(LIBDIR)/pkgconfig + +# source/object files +PARSER := $(SRC_DIR)/parser.c +EXTRAS := $(filter-out $(PARSER),$(wildcard $(SRC_DIR)/*.c)) +OBJS := $(patsubst %.c,%.o,$(PARSER) $(EXTRAS)) + +# flags +ARFLAGS ?= rcs +override CFLAGS += -I$(SRC_DIR) -std=c11 -fPIC + +# ABI versioning +SONAME_MAJOR = $(shell sed -n 's/\#define LANGUAGE_VERSION //p' $(PARSER)) +SONAME_MINOR = $(word 1,$(subst ., ,$(VERSION))) + +# OS-specific bits +ifeq ($(shell uname),Darwin) + SOEXT = dylib + SOEXTVER_MAJOR = $(SONAME_MAJOR).$(SOEXT) + SOEXTVER = $(SONAME_MAJOR).$(SONAME_MINOR).$(SOEXT) + LINKSHARED = -dynamiclib -Wl,-install_name,$(LIBDIR)/lib$(LANGUAGE_NAME).$(SOEXTVER),-rpath,@executable_path/../Frameworks +else + SOEXT = so + SOEXTVER_MAJOR = $(SOEXT).$(SONAME_MAJOR) + SOEXTVER = $(SOEXT).$(SONAME_MAJOR).$(SONAME_MINOR) + LINKSHARED = -shared -Wl,-soname,lib$(LANGUAGE_NAME).$(SOEXTVER) +endif +ifneq ($(filter $(shell uname),FreeBSD NetBSD DragonFly),) + PCLIBDIR := $(PREFIX)/libdata/pkgconfig +endif + +all: lib$(LANGUAGE_NAME).a lib$(LANGUAGE_NAME).$(SOEXT) $(LANGUAGE_NAME).pc + +lib$(LANGUAGE_NAME).a: $(OBJS) + $(AR) $(ARFLAGS) $@ $^ + +lib$(LANGUAGE_NAME).$(SOEXT): $(OBJS) + $(CC) $(LDFLAGS) $(LINKSHARED) $^ $(LDLIBS) -o $@ +ifneq ($(STRIP),) + $(STRIP) $@ +endif + +$(LANGUAGE_NAME).pc: bindings/c/$(LANGUAGE_NAME).pc.in + sed -e 's|@PROJECT_VERSION@|$(VERSION)|' \ + -e 's|@CMAKE_INSTALL_LIBDIR@|$(LIBDIR:$(PREFIX)/%=%)|' \ + -e 's|@CMAKE_INSTALL_INCLUDEDIR@|$(INCLUDEDIR:$(PREFIX)/%=%)|' \ + -e 's|@PROJECT_DESCRIPTION@|$(DESCRIPTION)|' \ + -e 's|@PROJECT_HOMEPAGE_URL@|$(HOMEPAGE_URL)|' \ + -e 's|@CMAKE_INSTALL_PREFIX@|$(PREFIX)|' $< > $@ + +$(PARSER): $(SRC_DIR)/grammar.json + $(TS) generate $^ + +install: all + install -d '$(DESTDIR)$(INCLUDEDIR)'/tree_sitter '$(DESTDIR)$(PCLIBDIR)' '$(DESTDIR)$(LIBDIR)' + install -m644 bindings/c/$(LANGUAGE_NAME).h '$(DESTDIR)$(INCLUDEDIR)'/tree_sitter/$(LANGUAGE_NAME).h + install -m644 $(LANGUAGE_NAME).pc '$(DESTDIR)$(PCLIBDIR)'/$(LANGUAGE_NAME).pc + install -m644 lib$(LANGUAGE_NAME).a '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).a + install -m755 lib$(LANGUAGE_NAME).$(SOEXT) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER) + ln -sf lib$(LANGUAGE_NAME).$(SOEXTVER) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER_MAJOR) + ln -sf lib$(LANGUAGE_NAME).$(SOEXTVER_MAJOR) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXT) + +uninstall: + $(RM) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).a \ + '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER) \ + '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER_MAJOR) \ + '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXT) \ + '$(DESTDIR)$(INCLUDEDIR)'/tree_sitter/$(LANGUAGE_NAME).h \ + '$(DESTDIR)$(PCLIBDIR)'/$(LANGUAGE_NAME).pc + +clean: + $(RM) $(OBJS) $(LANGUAGE_NAME).pc lib$(LANGUAGE_NAME).a lib$(LANGUAGE_NAME).$(SOEXT) + +test: + $(TS) test + +.PHONY: all install uninstall clean test diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..1d0b725 --- /dev/null +++ b/Package.swift @@ -0,0 +1,37 @@ +// swift-tools-version:5.3 +import PackageDescription + +let package = Package( + name: "TreeSitterBruno", + products: [ + .library(name: "TreeSitterBruno", targets: ["TreeSitterBruno"]), + ], + dependencies: [ + .package(url: "https://github.com/ChimeHQ/SwiftTreeSitter", from: "0.8.0"), + ], + targets: [ + .target( + name: "TreeSitterBruno", + dependencies: [], + path: ".", + sources: [ + "src/parser.c", + "src/scanner.c", + ], + resources: [ + .copy("queries") + ], + publicHeadersPath: "bindings/swift", + cSettings: [.headerSearchPath("src")] + ), + .testTarget( + name: "TreeSitterBrunoTests", + dependencies: [ + "SwiftTreeSitter", + "TreeSitterBruno", + ], + path: "bindings/swift/TreeSitterBrunoTests" + ) + ], + cLanguageStandard: .c11 +) diff --git a/binding.gyp b/binding.gyp new file mode 100644 index 0000000..c636173 --- /dev/null +++ b/binding.gyp @@ -0,0 +1,30 @@ +{ + "targets": [ + { + "target_name": "tree_sitter_bruno_binding", + "dependencies": [ + " + +typedef struct TSLanguage TSLanguage; + +extern "C" TSLanguage *tree_sitter_bruno(); + +// "tree-sitter", "language" hashed with BLAKE2 +const napi_type_tag LANGUAGE_TYPE_TAG = { + 0x8AF2E5212AD58ABF, 0xD5006CAD83ABBA16 +}; + +Napi::Object Init(Napi::Env env, Napi::Object exports) { + exports["name"] = Napi::String::New(env, "bruno"); + auto language = Napi::External::New(env, tree_sitter_bruno()); + language.TypeTag(&LANGUAGE_TYPE_TAG); + exports["language"] = language; + return exports; +} + +NODE_API_MODULE(tree_sitter_bruno_binding, Init) diff --git a/bindings/node/binding_test.js b/bindings/node/binding_test.js new file mode 100644 index 0000000..afede30 --- /dev/null +++ b/bindings/node/binding_test.js @@ -0,0 +1,9 @@ +/// + +const assert = require("node:assert"); +const { test } = require("node:test"); + +test("can load grammar", () => { + const parser = new (require("tree-sitter"))(); + assert.doesNotThrow(() => parser.setLanguage(require("."))); +}); diff --git a/bindings/node/index.d.ts b/bindings/node/index.d.ts new file mode 100644 index 0000000..efe259e --- /dev/null +++ b/bindings/node/index.d.ts @@ -0,0 +1,28 @@ +type BaseNode = { + type: string; + named: boolean; +}; + +type ChildNode = { + multiple: boolean; + required: boolean; + types: BaseNode[]; +}; + +type NodeInfo = + | (BaseNode & { + subtypes: BaseNode[]; + }) + | (BaseNode & { + fields: { [name: string]: ChildNode }; + children: ChildNode[]; + }); + +type Language = { + name: string; + language: unknown; + nodeTypeInfo: NodeInfo[]; +}; + +declare const language: Language; +export = language; diff --git a/bindings/node/index.js b/bindings/node/index.js new file mode 100644 index 0000000..6657bcf --- /dev/null +++ b/bindings/node/index.js @@ -0,0 +1,7 @@ +const root = require("path").join(__dirname, "..", ".."); + +module.exports = require("node-gyp-build")(root); + +try { + module.exports.nodeTypeInfo = require("../../src/node-types.json"); +} catch (_) {} diff --git a/bindings/python/tests/test_binding.py b/bindings/python/tests/test_binding.py new file mode 100644 index 0000000..4408ccd --- /dev/null +++ b/bindings/python/tests/test_binding.py @@ -0,0 +1,11 @@ +from unittest import TestCase + +import tree_sitter, tree_sitter_bruno + + +class TestLanguage(TestCase): + def test_can_load_grammar(self): + try: + tree_sitter.Language(tree_sitter_bruno.language()) + except Exception: + self.fail("Error loading Bruno grammar") diff --git a/bindings/python/tree_sitter_bruno/__init__.py b/bindings/python/tree_sitter_bruno/__init__.py new file mode 100644 index 0000000..87bcbc1 --- /dev/null +++ b/bindings/python/tree_sitter_bruno/__init__.py @@ -0,0 +1,42 @@ +""" Bruno grammar for tree-sitter""" + +from importlib.resources import files as _files + +from ._binding import language + + +def _get_query(name, file): + query = _files(f"{__package__}.queries") / file + globals()[name] = query.read_text() + return globals()[name] + + +def __getattr__(name): + # NOTE: uncomment these to include any queries that this grammar contains: + + if name == "HIGHLIGHTS_QUERY": + return _get_query("HIGHLIGHTS_QUERY", "highlights.scm") + if name == "INJECTIONS_QUERY": + return _get_query("INJECTIONS_QUERY", "injections.scm") + # if name == "LOCALS_QUERY": + # return _get_query("LOCALS_QUERY", "locals.scm") + # if name == "TAGS_QUERY": + # return _get_query("TAGS_QUERY", "tags.scm") + + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") + + +__all__ = [ + "language", + # "HIGHLIGHTS_QUERY", + # "INJECTIONS_QUERY", + # "LOCALS_QUERY", + # "TAGS_QUERY", +] + + +def __dir__(): + return sorted(__all__ + [ + "__all__", "__builtins__", "__cached__", "__doc__", "__file__", + "__loader__", "__name__", "__package__", "__path__", "__spec__", + ]) diff --git a/bindings/python/tree_sitter_bruno/__init__.pyi b/bindings/python/tree_sitter_bruno/__init__.pyi new file mode 100644 index 0000000..a1370e9 --- /dev/null +++ b/bindings/python/tree_sitter_bruno/__init__.pyi @@ -0,0 +1,10 @@ +from typing import Final + +# NOTE: uncomment these to include any queries that this grammar contains: + +HIGHLIGHTS_QUERY: Final[str] +INJECTIONS_QUERY: Final[str] +# LOCALS_QUERY: Final[str] +# TAGS_QUERY: Final[str] + +def language() -> object: ... diff --git a/bindings/python/tree_sitter_bruno/binding.c b/bindings/python/tree_sitter_bruno/binding.c new file mode 100644 index 0000000..62be54b --- /dev/null +++ b/bindings/python/tree_sitter_bruno/binding.c @@ -0,0 +1,27 @@ +#include + +typedef struct TSLanguage TSLanguage; + +TSLanguage *tree_sitter_bruno(void); + +static PyObject* _binding_language(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(args)) { + return PyCapsule_New(tree_sitter_bruno(), "tree_sitter.Language", NULL); +} + +static PyMethodDef methods[] = { + {"language", _binding_language, METH_NOARGS, + "Get the tree-sitter language for this grammar."}, + {NULL, NULL, 0, NULL} +}; + +static struct PyModuleDef module = { + .m_base = PyModuleDef_HEAD_INIT, + .m_name = "_binding", + .m_doc = NULL, + .m_size = -1, + .m_methods = methods +}; + +PyMODINIT_FUNC PyInit__binding(void) { + return PyModule_Create(&module); +} diff --git a/bindings/python/tree_sitter_bruno/py.typed b/bindings/python/tree_sitter_bruno/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/bindings/rust/build.rs b/bindings/rust/build.rs new file mode 100644 index 0000000..5c38431 --- /dev/null +++ b/bindings/rust/build.rs @@ -0,0 +1,19 @@ +fn main() { + let src_dir = std::path::Path::new("src"); + + let mut c_config = cc::Build::new(); + c_config.std("c11").include(src_dir); + + #[cfg(target_env = "msvc")] + c_config.flag("-utf-8"); + + let parser_path = src_dir.join("parser.c"); + c_config.file(&parser_path); + println!("cargo:rerun-if-changed={}", parser_path.to_str().unwrap()); + + let scanner_path = src_dir.join("scanner.c"); + c_config.file(&scanner_path); + println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap()); + + c_config.compile("tree-sitter-bruno"); +} diff --git a/bindings/rust/lib.rs b/bindings/rust/lib.rs new file mode 100644 index 0000000..ed708f4 --- /dev/null +++ b/bindings/rust/lib.rs @@ -0,0 +1,53 @@ +//! This crate provides Bruno language support for the [tree-sitter][] parsing library. +//! +//! Typically, you will use the [LANGUAGE][] constant to add this language to a +//! tree-sitter [Parser][], and then use the parser to parse some code: +//! +//! ``` +//! let code = r#" +//! "#; +//! let mut parser = tree_sitter::Parser::new(); +//! let language = tree_sitter_bruno::LANGUAGE; +//! parser +//! .set_language(&language.into()) +//! .expect("Error loading Bruno parser"); +//! let tree = parser.parse(code, None).unwrap(); +//! assert!(!tree.root_node().has_error()); +//! ``` +//! +//! [Parser]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Parser.html +//! [tree-sitter]: https://tree-sitter.github.io/ + +use tree_sitter_language::LanguageFn; + +extern "C" { + fn tree_sitter_bruno() -> *const (); +} + +/// The tree-sitter [`LanguageFn`][LanguageFn] for this grammar. +/// +/// [LanguageFn]: https://docs.rs/tree-sitter-language/*/tree_sitter_language/struct.LanguageFn.html +pub const LANGUAGE: LanguageFn = unsafe { LanguageFn::from_raw(tree_sitter_bruno) }; + +/// The content of the [`node-types.json`][] file for this grammar. +/// +/// [`node-types.json`]: https://tree-sitter.github.io/tree-sitter/using-parsers#static-node-types +pub const NODE_TYPES: &str = include_str!("../../src/node-types.json"); + +// NOTE: uncomment these to include any queries that this grammar contains: + +pub const HIGHLIGHTS_QUERY: &str = include_str!("../../queries/highlights.scm"); +pub const INJECTIONS_QUERY: &str = include_str!("../../queries/injections.scm"); +// pub const LOCALS_QUERY: &str = include_str!("../../queries/locals.scm"); +// pub const TAGS_QUERY: &str = include_str!("../../queries/tags.scm"); + +#[cfg(test)] +mod tests { + #[test] + fn test_can_load_grammar() { + let mut parser = tree_sitter::Parser::new(); + parser + .set_language(&super::LANGUAGE.into()) + .expect("Error loading Bruno parser"); + } +} diff --git a/bindings/swift/TreeSitterBruno/bruno.h b/bindings/swift/TreeSitterBruno/bruno.h new file mode 100644 index 0000000..69c5afd --- /dev/null +++ b/bindings/swift/TreeSitterBruno/bruno.h @@ -0,0 +1,16 @@ +#ifndef TREE_SITTER_BRUNO_H_ +#define TREE_SITTER_BRUNO_H_ + +typedef struct TSLanguage TSLanguage; + +#ifdef __cplusplus +extern "C" { +#endif + +const TSLanguage *tree_sitter_bruno(void); + +#ifdef __cplusplus +} +#endif + +#endif // TREE_SITTER_BRUNO_H_ diff --git a/bindings/swift/TreeSitterBrunoTests/TreeSitterBrunoTests.swift b/bindings/swift/TreeSitterBrunoTests/TreeSitterBrunoTests.swift new file mode 100644 index 0000000..8949b34 --- /dev/null +++ b/bindings/swift/TreeSitterBrunoTests/TreeSitterBrunoTests.swift @@ -0,0 +1,12 @@ +import XCTest +import SwiftTreeSitter +import TreeSitterBruno + +final class TreeSitterBrunoTests: XCTestCase { + func testCanLoadGrammar() throws { + let parser = Parser() + let language = Language(language: tree_sitter_bruno()) + XCTAssertNoThrow(try parser.setLanguage(language), + "Error loading Bruno grammar") + } +} diff --git a/deno.lock b/deno.lock new file mode 100644 index 0000000..5064cdf --- /dev/null +++ b/deno.lock @@ -0,0 +1,156 @@ +{ + "version": "4", + "specifiers": { + "npm:node-addon-api@^8.1.0": "8.3.0", + "npm:node-gyp-build@^4.8.2": "4.8.4", + "npm:prebuildify@^6.0.1": "6.0.1", + "npm:tree-sitter-cli@~0.24.3": "0.24.5" + }, + "npm": { + "base64-js@1.5.1": { + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, + "bl@4.1.0": { + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dependencies": [ + "buffer", + "inherits", + "readable-stream" + ] + }, + "buffer@5.7.1": { + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dependencies": [ + "base64-js", + "ieee754" + ] + }, + "chownr@1.1.4": { + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" + }, + "end-of-stream@1.4.4": { + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dependencies": [ + "once" + ] + }, + "fs-constants@1.0.0": { + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + }, + "ieee754@1.2.1": { + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, + "inherits@2.0.4": { + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "minimist@1.2.8": { + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==" + }, + "mkdirp-classic@0.5.3": { + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" + }, + "node-abi@3.71.0": { + "integrity": "sha512-SZ40vRiy/+wRTf21hxkkEjPJZpARzUMVcJoQse2EF8qkUWbbO2z7vd5oA/H6bVH6SZQ5STGcu0KRDS7biNRfxw==", + "dependencies": [ + "semver" + ] + }, + "node-addon-api@8.3.0": { + "integrity": "sha512-8VOpLHFrOQlAH+qA0ZzuGRlALRA6/LVh8QJldbrC4DY0hXoMP0l4Acq8TzFC018HztWiRqyCEj2aTWY2UvnJUg==" + }, + "node-gyp-build@4.8.4": { + "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==" + }, + "npm-run-path@3.1.0": { + "integrity": "sha512-Dbl4A/VfiVGLgQv29URL9xshU8XDY1GeLy+fsaZ1AA8JDSfjvr5P5+pzRbWqRSBxk6/DW7MIh8lTM/PaGnP2kg==", + "dependencies": [ + "path-key" + ] + }, + "once@1.4.0": { + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": [ + "wrappy" + ] + }, + "path-key@3.1.1": { + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + }, + "prebuildify@6.0.1": { + "integrity": "sha512-8Y2oOOateom/s8dNBsGIcnm6AxPmLH4/nanQzL5lQMU+sC0CMhzARZHizwr36pUPLdvBnOkCNQzxg4djuFSgIw==", + "dependencies": [ + "minimist", + "mkdirp-classic", + "node-abi", + "npm-run-path", + "pump", + "tar-fs" + ] + }, + "pump@3.0.2": { + "integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==", + "dependencies": [ + "end-of-stream", + "once" + ] + }, + "readable-stream@3.6.2": { + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dependencies": [ + "inherits", + "string_decoder", + "util-deprecate" + ] + }, + "safe-buffer@5.2.1": { + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "semver@7.6.3": { + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==" + }, + "string_decoder@1.3.0": { + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": [ + "safe-buffer" + ] + }, + "tar-fs@2.1.1": { + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "dependencies": [ + "chownr", + "mkdirp-classic", + "pump", + "tar-stream" + ] + }, + "tar-stream@2.2.0": { + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dependencies": [ + "bl", + "end-of-stream", + "fs-constants", + "inherits", + "readable-stream" + ] + }, + "tree-sitter-cli@0.24.5": { + "integrity": "sha512-8EIgV/ERQlpvk1rPSCCjxveAb6Sba8tMiBpeeL68Mueuuqr0wNfhps/I1nFm2OTnpPCUV2PS9nbzzAMoyxSQUg==" + }, + "util-deprecate@1.0.2": { + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "wrappy@1.0.2": { + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + } + }, + "workspace": { + "packageJson": { + "dependencies": [ + "npm:node-addon-api@^8.1.0", + "npm:node-gyp-build@^4.8.2", + "npm:prebuildify@^6.0.1", + "npm:tree-sitter-cli@~0.24.3" + ] + } + } +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..bbb1f60 --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module github.com/kristoferssolo/tree-sitter-bruno + +go 1.22 + +require github.com/tree-sitter/go-tree-sitter v0.23.1 diff --git a/grammar.js b/grammar.js new file mode 100644 index 0000000..61dd8ad --- /dev/null +++ b/grammar.js @@ -0,0 +1,129 @@ +/** + * @file Bruno grammar for tree-sitter + * @author Kristofers Solo + * @license MIT + */ + +/// +// @ts-check + +module.exports = grammar({ + name: "bruno", + + extras: (_) => [/\s+|(\r?\n)/], + + externals: ($) => [$.rawtext], + + rules: { + source_file: ($) => + repeat( + field( + "tag", + choice( + $.meta, + $.http, + $.query, + $.headers, + $.auths, + $.bodies, + $.varsandassert, + $.script, + $.tests, + $.docs, + ), + ), + ), + + meta: ($) => seq(alias("meta", $.keyword), $.dictionary), + + http: ($) => seq(alias($.http_verb, $.keyword), $.dictionary), + http_verb: (_) => + choice( + "get", + "post", + "put", + "delete", + "patch", + "options", + "head", + "connect", + "trace", + ), + + query: ($) => seq(alias("query", $.keyword), $.dictionary), + + headers: ($) => seq(alias("headers", $.keyword), $.dictionary), + + auths: ($) => + choice( + $.authawsv4, + $.authbasic, + $.authbearer, + $.authdigest, + $.authoauth2, + ), + authawsv4: ($) => seq(alias("auth:awsv4", $.keyword), $.dictionary), + authbasic: ($) => seq(alias("auth:basic", $.keyword), $.dictionary), + authbearer: ($) => seq(alias("auth:bearer", $.keyword), $.dictionary), + authdigest: ($) => seq(alias("auth:digest", $.keyword), $.dictionary), + authoauth2: ($) => seq(alias("auth:oauth2", $.keyword), $.dictionary), + + bodies: ($) => + choice( + $.bodyjson, + $.bodytext, + $.bodyxml, + $.bodysparql, + $.bodygraphql, + $.bodygraphqlvars, + $.bodyforms, + $.body, + ), + bodyforms: ($) => choice($.bodyformurlencoded, $.bodyformmultipart), + body: ($) => seq(alias("body", $.keyword), $.textblock), + bodyjson: ($) => seq(alias("body:json", $.keyword), $.textblock), + bodytext: ($) => seq(alias("body:text", $.keyword), $.textblock), + bodyxml: ($) => seq(alias("body:xml", $.keyword), $.textblock), + bodysparql: ($) => seq(alias("body:sparql", $.keyword), $.textblock), + bodygraphql: ($) => seq(alias("body:graphql", $.keyword), $.textblock), + bodygraphqlvars: ($) => + seq(alias("body:graphql:vars", $.keyword), $.textblock), + bodyformurlencoded: ($) => + seq(alias("body:form-urlencoded", $.keyword), $.dictionary), + bodyformmultipart: ($) => + seq(alias("body:multipart-form", $.keyword), $.dictionary), + + varsandassert: ($) => + choice($.vars, $.vars_secret, $.varsreq, $.varsres, $.assert), + vars: ($) => seq(alias("vars", $.keyword), $.dictionary), + vars_secret: ($) => seq(alias("vars:secret", $.keyword), $.array), + varsreq: ($) => seq(alias("vars:pre-request", $.keyword), $.dictionary), + varsres: ($) => seq(alias("vars:post-response", $.keyword), $.dictionary), + + assert: ($) => seq(alias("assert", $.keyword), $.assert_dictionary), + + script: ($) => choice($.scriptreq, $.scriptres), + scriptreq: ($) => seq(alias("script:pre-request", $.keyword), $.textblock), + scriptres: ($) => + seq(alias("script:post-response", $.keyword), $.textblock), + + tests: ($) => seq(alias("tests", $.keyword), $.textblock), + + docs: ($) => seq(alias("docs", $.keyword), $.textblock), + + textblock: ($) => seq("{", optional($.rawtext), "}"), + + array: ($) => seq("[", repeat(seq($.array_value, optional(","))), "]"), + array_value: (_) => /[^\r\n\s\t\[\],]+/, + + dictionary: ($) => seq("{", repeat($.dictionary_pair), "}"), + dictionary_pair: ($) => seq($.key, ":", $.value), + + assert_dictionary: ($) => seq("{", repeat($.assert_dictionary_pair), "}"), + assert_dictionary_pair: ($) => seq($.assert_key, ":", $.value), + assert_key: (_) => /[^\r\n:]+/, + + key: (_) => /[^\s\r\n:]+/, + value: (_) => /[^\r\n]*/, + }, +}); diff --git a/package.json b/package.json new file mode 100644 index 0000000..c7eaebd --- /dev/null +++ b/package.json @@ -0,0 +1,56 @@ +{ + "name": "tree-sitter-bruno", + "version": "0.1.0", + "description": " Bruno grammar for tree-sitter", + "repository": "github:tree-sitter/tree-sitter-bruno", + "license": "MIT", + "author": { + "name": "Kristofers Solo", + "email": "dev@kristofers.xyz" + }, + "main": "bindings/node", + "types": "bindings/node", + "keywords": [ + "incremental", + "parsing", + "tree-sitter", + "bruno" + ], + "files": [ + "grammar.js", + "binding.gyp", + "prebuilds/**", + "bindings/node/*", + "queries/*", + "src/**", + "*.wasm" + ], + "dependencies": { + "node-addon-api": "^8.1.0", + "node-gyp-build": "^4.8.2" + }, + "devDependencies": { + "prebuildify": "^6.0.1", + "tree-sitter-cli": "^0.24.3" + }, + "peerDependencies": { + "tree-sitter": "^0.21.1" + }, + "peerDependenciesMeta": { + "tree-sitter": { + "optional": true + } + }, + "scripts": { + "install": "node-gyp-build", + "prestart": "tree-sitter build --wasm", + "start": "tree-sitter playground", + "test": "node --test bindings/node/*_test.js" + }, + "tree-sitter": [ + { + "scope": "source.bruno", + "injection-regex": "^bruno$" + } + ] +} diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..d8df926 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,30 @@ +[build-system] +requires = ["setuptools>=42", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "tree-sitter-bruno" +description = " Bruno grammar for tree-sitter" +version = "0.1.0" +keywords = ["incremental", "parsing", "tree-sitter", "bruno"] +classifiers = [ + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Topic :: Software Development :: Compilers", + "Topic :: Text Processing :: Linguistic", + "Typing :: Typed", +] +authors = [{ name = "Kristofers Solo", email = "dev@kristofers.xyz" }] +requires-python = ">=3.9" +license.text = "MIT" +readme = "README.md" + +[project.urls] +Homepage = "https://github.com/kristoferssolo/tree-sitter-bruno" + +[project.optional-dependencies] +core = ["tree-sitter~=0.22"] + +[tool.cibuildwheel] +build = "cp39-*" +build-frontend = "build" diff --git a/queries/highlights.scm b/queries/highlights.scm new file mode 100644 index 0000000..daef973 --- /dev/null +++ b/queries/highlights.scm @@ -0,0 +1,18 @@ +(keyword) @keyword + +[ + "{" + "}" + "[" + "]" +] @punctuation.bracket +":" @punctuation.delimiter + + +(key) @type +[ + (value) + (array_value) +] @string + +(ERROR) @error diff --git a/queries/injections.scm b/queries/injections.scm new file mode 100644 index 0000000..6f5d8f7 --- /dev/null +++ b/queries/injections.scm @@ -0,0 +1,59 @@ +((body + (keyword) + (textblock + (rawtext) @injection.content)) + (#set! injection.language "json")) + +((bodyjson + (keyword) + (textblock + (rawtext) @injection.content)) + (#set! injection.language "json")) + +((bodyxml + (keyword) + (textblock + (rawtext) @injection.content)) + (#set! injection.language "xml")) + +((bodysparql + (keyword) + (textblock + (rawtext) @injection.content)) + (#set! injection.language "sparql")) + +((bodygraphql + (keyword) + (textblock + (rawtext) @injection.content)) + (#set! injection.language "graphql")) + +((bodygraphqlvars + (keyword) + (textblock + (rawtext) @injection.content)) + (#set! injection.language "json")) + +((scriptres + (keyword) + (textblock + (rawtext) @injection.content)) + (#set! injection.language "javascript")) + +((scriptreq + (keyword) + (textblock + (rawtext) @injection.content)) + (#set! injection.language "javascript")) + +((tests + (keyword) + (textblock + (rawtext) @injection.content)) + (#set! injection.language "javascript")) + +((docs + (keyword) + (textblock + (rawtext) @injection.content)) + (#set! injection.language "markdown")) diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..0fcb60c --- /dev/null +++ b/setup.py @@ -0,0 +1,62 @@ +from os.path import isdir, join +from platform import system + +from setuptools import Extension, find_packages, setup +from setuptools.command.build import build +from wheel.bdist_wheel import bdist_wheel + + +class Build(build): + def run(self): + if isdir("queries"): + dest = join(self.build_lib, "tree_sitter_bruno", "queries") + self.copy_tree("queries", dest) + super().run() + + +class BdistWheel(bdist_wheel): + def get_tag(self): + python, abi, platform = super().get_tag() + if python.startswith("cp"): + python, abi = "cp39", "abi3" + return python, abi, platform + + +setup( + packages=find_packages("bindings/python"), + package_dir={"": "bindings/python"}, + package_data={ + "tree_sitter_bruno": ["*.pyi", "py.typed"], + "tree_sitter_bruno.queries": ["*.scm"], + }, + ext_package="tree_sitter_bruno", + ext_modules=[ + Extension( + name="_binding", + sources=[ + "bindings/python/tree_sitter_bruno/binding.c", + "src/parser.c", + "src/scanner.c", + ], + extra_compile_args=[ + "-std=c11", + "-fvisibility=hidden", + ] if system() != "Windows" else [ + "/std:c11", + "/utf-8", + ], + define_macros=[ + ("Py_LIMITED_API", "0x03090000"), + ("PY_SSIZE_T_CLEAN", None), + ("TREE_SITTER_HIDE_SYMBOLS", None), + ], + include_dirs=["src"], + py_limited_api=True, + ) + ], + cmdclass={ + "build": Build, + "bdist_wheel": BdistWheel + }, + zip_safe=False +) diff --git a/src/grammar.json b/src/grammar.json new file mode 100644 index 0000000..20986da --- /dev/null +++ b/src/grammar.json @@ -0,0 +1,866 @@ +{ + "$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json", + "name": "bruno", + "rules": { + "source_file": { + "type": "REPEAT", + "content": { + "type": "FIELD", + "name": "tag", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "meta" + }, + { + "type": "SYMBOL", + "name": "http" + }, + { + "type": "SYMBOL", + "name": "query" + }, + { + "type": "SYMBOL", + "name": "headers" + }, + { + "type": "SYMBOL", + "name": "auths" + }, + { + "type": "SYMBOL", + "name": "bodies" + }, + { + "type": "SYMBOL", + "name": "varsandassert" + }, + { + "type": "SYMBOL", + "name": "script" + }, + { + "type": "SYMBOL", + "name": "tests" + }, + { + "type": "SYMBOL", + "name": "docs" + } + ] + } + } + }, + "meta": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "meta" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "dictionary" + } + ] + }, + "http": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "SYMBOL", + "name": "http_verb" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "dictionary" + } + ] + }, + "http_verb": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "get" + }, + { + "type": "STRING", + "value": "post" + }, + { + "type": "STRING", + "value": "put" + }, + { + "type": "STRING", + "value": "delete" + }, + { + "type": "STRING", + "value": "patch" + }, + { + "type": "STRING", + "value": "options" + }, + { + "type": "STRING", + "value": "head" + }, + { + "type": "STRING", + "value": "connect" + }, + { + "type": "STRING", + "value": "trace" + } + ] + }, + "query": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "query" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "dictionary" + } + ] + }, + "headers": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "headers" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "dictionary" + } + ] + }, + "auths": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "authawsv4" + }, + { + "type": "SYMBOL", + "name": "authbasic" + }, + { + "type": "SYMBOL", + "name": "authbearer" + }, + { + "type": "SYMBOL", + "name": "authdigest" + }, + { + "type": "SYMBOL", + "name": "authoauth2" + } + ] + }, + "authawsv4": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "auth:awsv4" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "dictionary" + } + ] + }, + "authbasic": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "auth:basic" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "dictionary" + } + ] + }, + "authbearer": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "auth:bearer" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "dictionary" + } + ] + }, + "authdigest": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "auth:digest" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "dictionary" + } + ] + }, + "authoauth2": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "auth:oauth2" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "dictionary" + } + ] + }, + "bodies": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "bodyjson" + }, + { + "type": "SYMBOL", + "name": "bodytext" + }, + { + "type": "SYMBOL", + "name": "bodyxml" + }, + { + "type": "SYMBOL", + "name": "bodysparql" + }, + { + "type": "SYMBOL", + "name": "bodygraphql" + }, + { + "type": "SYMBOL", + "name": "bodygraphqlvars" + }, + { + "type": "SYMBOL", + "name": "bodyforms" + }, + { + "type": "SYMBOL", + "name": "body" + } + ] + }, + "bodyforms": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "bodyformurlencoded" + }, + { + "type": "SYMBOL", + "name": "bodyformmultipart" + } + ] + }, + "body": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "body" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "textblock" + } + ] + }, + "bodyjson": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "body:json" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "textblock" + } + ] + }, + "bodytext": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "body:text" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "textblock" + } + ] + }, + "bodyxml": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "body:xml" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "textblock" + } + ] + }, + "bodysparql": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "body:sparql" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "textblock" + } + ] + }, + "bodygraphql": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "body:graphql" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "textblock" + } + ] + }, + "bodygraphqlvars": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "body:graphql:vars" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "textblock" + } + ] + }, + "bodyformurlencoded": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "body:form-urlencoded" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "dictionary" + } + ] + }, + "bodyformmultipart": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "body:multipart-form" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "dictionary" + } + ] + }, + "varsandassert": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "vars" + }, + { + "type": "SYMBOL", + "name": "vars_secret" + }, + { + "type": "SYMBOL", + "name": "varsreq" + }, + { + "type": "SYMBOL", + "name": "varsres" + }, + { + "type": "SYMBOL", + "name": "assert" + } + ] + }, + "vars": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "vars" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "dictionary" + } + ] + }, + "vars_secret": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "vars:secret" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "array" + } + ] + }, + "varsreq": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "vars:pre-request" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "dictionary" + } + ] + }, + "varsres": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "vars:post-response" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "dictionary" + } + ] + }, + "assert": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "assert" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "assert_dictionary" + } + ] + }, + "script": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "scriptreq" + }, + { + "type": "SYMBOL", + "name": "scriptres" + } + ] + }, + "scriptreq": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "script:pre-request" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "textblock" + } + ] + }, + "scriptres": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "script:post-response" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "textblock" + } + ] + }, + "tests": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "tests" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "textblock" + } + ] + }, + "docs": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "STRING", + "value": "docs" + }, + "named": true, + "value": "keyword" + }, + { + "type": "SYMBOL", + "name": "textblock" + } + ] + }, + "textblock": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "{" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "rawtext" + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "array": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "[" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "array_value" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "BLANK" + } + ] + } + ] + } + }, + { + "type": "STRING", + "value": "]" + } + ] + }, + "array_value": { + "type": "PATTERN", + "value": "[^\\r\\n\\s\\t\\[\\],]+" + }, + "dictionary": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "{" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "dictionary_pair" + } + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "dictionary_pair": { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "key" + }, + { + "type": "STRING", + "value": ":" + }, + { + "type": "SYMBOL", + "name": "value" + } + ] + }, + "assert_dictionary": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "{" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "assert_dictionary_pair" + } + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "assert_dictionary_pair": { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "assert_key" + }, + { + "type": "STRING", + "value": ":" + }, + { + "type": "SYMBOL", + "name": "value" + } + ] + }, + "assert_key": { + "type": "PATTERN", + "value": "[^\\r\\n:]+" + }, + "key": { + "type": "PATTERN", + "value": "[^\\s\\r\\n:]+" + }, + "value": { + "type": "PATTERN", + "value": "[^\\r\\n]*" + } + }, + "extras": [ + { + "type": "PATTERN", + "value": "\\s+|(\\r?\\n)" + } + ], + "conflicts": [], + "precedences": [], + "externals": [ + { + "type": "SYMBOL", + "name": "rawtext" + } + ], + "inline": [], + "supertypes": [] +} diff --git a/src/node-types.json b/src/node-types.json new file mode 100644 index 0000000..c7e513b --- /dev/null +++ b/src/node-types.json @@ -0,0 +1,894 @@ +[ + { + "type": "array", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "array_value", + "named": true + } + ] + } + }, + { + "type": "assert", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "assert_dictionary", + "named": true + }, + { + "type": "keyword", + "named": true + } + ] + } + }, + { + "type": "assert_dictionary", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "assert_dictionary_pair", + "named": true + } + ] + } + }, + { + "type": "assert_dictionary_pair", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "assert_key", + "named": true + }, + { + "type": "value", + "named": true + } + ] + } + }, + { + "type": "authawsv4", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "dictionary", + "named": true + }, + { + "type": "keyword", + "named": true + } + ] + } + }, + { + "type": "authbasic", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "dictionary", + "named": true + }, + { + "type": "keyword", + "named": true + } + ] + } + }, + { + "type": "authbearer", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "dictionary", + "named": true + }, + { + "type": "keyword", + "named": true + } + ] + } + }, + { + "type": "authdigest", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "dictionary", + "named": true + }, + { + "type": "keyword", + "named": true + } + ] + } + }, + { + "type": "authoauth2", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "dictionary", + "named": true + }, + { + "type": "keyword", + "named": true + } + ] + } + }, + { + "type": "auths", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "authawsv4", + "named": true + }, + { + "type": "authbasic", + "named": true + }, + { + "type": "authbearer", + "named": true + }, + { + "type": "authdigest", + "named": true + }, + { + "type": "authoauth2", + "named": true + } + ] + } + }, + { + "type": "bodies", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "body", + "named": true + }, + { + "type": "bodyforms", + "named": true + }, + { + "type": "bodygraphql", + "named": true + }, + { + "type": "bodygraphqlvars", + "named": true + }, + { + "type": "bodyjson", + "named": true + }, + { + "type": "bodysparql", + "named": true + }, + { + "type": "bodytext", + "named": true + }, + { + "type": "bodyxml", + "named": true + } + ] + } + }, + { + "type": "body", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "keyword", + "named": true + }, + { + "type": "textblock", + "named": true + } + ] + } + }, + { + "type": "bodyformmultipart", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "dictionary", + "named": true + }, + { + "type": "keyword", + "named": true + } + ] + } + }, + { + "type": "bodyforms", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "bodyformmultipart", + "named": true + }, + { + "type": "bodyformurlencoded", + "named": true + } + ] + } + }, + { + "type": "bodyformurlencoded", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "dictionary", + "named": true + }, + { + "type": "keyword", + "named": true + } + ] + } + }, + { + "type": "bodygraphql", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "keyword", + "named": true + }, + { + "type": "textblock", + "named": true + } + ] + } + }, + { + "type": "bodygraphqlvars", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "keyword", + "named": true + }, + { + "type": "textblock", + "named": true + } + ] + } + }, + { + "type": "bodyjson", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "keyword", + "named": true + }, + { + "type": "textblock", + "named": true + } + ] + } + }, + { + "type": "bodysparql", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "keyword", + "named": true + }, + { + "type": "textblock", + "named": true + } + ] + } + }, + { + "type": "bodytext", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "keyword", + "named": true + }, + { + "type": "textblock", + "named": true + } + ] + } + }, + { + "type": "bodyxml", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "keyword", + "named": true + }, + { + "type": "textblock", + "named": true + } + ] + } + }, + { + "type": "dictionary", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "dictionary_pair", + "named": true + } + ] + } + }, + { + "type": "dictionary_pair", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "key", + "named": true + }, + { + "type": "value", + "named": true + } + ] + } + }, + { + "type": "docs", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "keyword", + "named": true + }, + { + "type": "textblock", + "named": true + } + ] + } + }, + { + "type": "headers", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "dictionary", + "named": true + }, + { + "type": "keyword", + "named": true + } + ] + } + }, + { + "type": "http", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "dictionary", + "named": true + }, + { + "type": "keyword", + "named": true + } + ] + } + }, + { + "type": "keyword", + "named": true, + "fields": {} + }, + { + "type": "meta", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "dictionary", + "named": true + }, + { + "type": "keyword", + "named": true + } + ] + } + }, + { + "type": "query", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "dictionary", + "named": true + }, + { + "type": "keyword", + "named": true + } + ] + } + }, + { + "type": "script", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "scriptreq", + "named": true + }, + { + "type": "scriptres", + "named": true + } + ] + } + }, + { + "type": "scriptreq", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "keyword", + "named": true + }, + { + "type": "textblock", + "named": true + } + ] + } + }, + { + "type": "scriptres", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "keyword", + "named": true + }, + { + "type": "textblock", + "named": true + } + ] + } + }, + { + "type": "source_file", + "named": true, + "root": true, + "fields": { + "tag": { + "multiple": true, + "required": false, + "types": [ + { + "type": "auths", + "named": true + }, + { + "type": "bodies", + "named": true + }, + { + "type": "docs", + "named": true + }, + { + "type": "headers", + "named": true + }, + { + "type": "http", + "named": true + }, + { + "type": "meta", + "named": true + }, + { + "type": "query", + "named": true + }, + { + "type": "script", + "named": true + }, + { + "type": "tests", + "named": true + }, + { + "type": "varsandassert", + "named": true + } + ] + } + } + }, + { + "type": "tests", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "keyword", + "named": true + }, + { + "type": "textblock", + "named": true + } + ] + } + }, + { + "type": "textblock", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": false, + "types": [ + { + "type": "rawtext", + "named": true + } + ] + } + }, + { + "type": "vars", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "dictionary", + "named": true + }, + { + "type": "keyword", + "named": true + } + ] + } + }, + { + "type": "vars_secret", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "array", + "named": true + }, + { + "type": "keyword", + "named": true + } + ] + } + }, + { + "type": "varsandassert", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "assert", + "named": true + }, + { + "type": "vars", + "named": true + }, + { + "type": "vars_secret", + "named": true + }, + { + "type": "varsreq", + "named": true + }, + { + "type": "varsres", + "named": true + } + ] + } + }, + { + "type": "varsreq", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "dictionary", + "named": true + }, + { + "type": "keyword", + "named": true + } + ] + } + }, + { + "type": "varsres", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "dictionary", + "named": true + }, + { + "type": "keyword", + "named": true + } + ] + } + }, + { + "type": ",", + "named": false + }, + { + "type": ":", + "named": false + }, + { + "type": "[", + "named": false + }, + { + "type": "]", + "named": false + }, + { + "type": "array_value", + "named": true + }, + { + "type": "assert_key", + "named": true + }, + { + "type": "connect", + "named": false + }, + { + "type": "delete", + "named": false + }, + { + "type": "get", + "named": false + }, + { + "type": "head", + "named": false + }, + { + "type": "key", + "named": true + }, + { + "type": "options", + "named": false + }, + { + "type": "patch", + "named": false + }, + { + "type": "post", + "named": false + }, + { + "type": "put", + "named": false + }, + { + "type": "rawtext", + "named": true + }, + { + "type": "trace", + "named": false + }, + { + "type": "value", + "named": true + }, + { + "type": "{", + "named": false + }, + { + "type": "}", + "named": false + } +] \ No newline at end of file diff --git a/src/parser.c b/src/parser.c new file mode 100644 index 0000000..8bbf6cc --- /dev/null +++ b/src/parser.c @@ -0,0 +1,4192 @@ +#include "tree_sitter/parser.h" + +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#endif + +#define LANGUAGE_VERSION 14 +#define STATE_COUNT 93 +#define LARGE_STATE_COUNT 4 +#define SYMBOL_COUNT 91 +#define ALIAS_COUNT 0 +#define TOKEN_COUNT 47 +#define EXTERNAL_TOKEN_COUNT 1 +#define FIELD_COUNT 1 +#define MAX_ALIAS_SEQUENCE_LENGTH 3 +#define PRODUCTION_ID_COUNT 4 + +enum ts_symbol_identifiers { + anon_sym_meta = 1, + anon_sym_get = 2, + anon_sym_post = 3, + anon_sym_put = 4, + anon_sym_delete = 5, + anon_sym_patch = 6, + anon_sym_options = 7, + anon_sym_head = 8, + anon_sym_connect = 9, + anon_sym_trace = 10, + anon_sym_query = 11, + anon_sym_headers = 12, + anon_sym_auth_COLONawsv4 = 13, + anon_sym_auth_COLONbasic = 14, + anon_sym_auth_COLONbearer = 15, + anon_sym_auth_COLONdigest = 16, + anon_sym_auth_COLONoauth2 = 17, + anon_sym_body = 18, + anon_sym_body_COLONjson = 19, + anon_sym_body_COLONtext = 20, + anon_sym_body_COLONxml = 21, + anon_sym_body_COLONsparql = 22, + anon_sym_body_COLONgraphql = 23, + anon_sym_body_COLONgraphql_COLONvars = 24, + anon_sym_body_COLONform_DASHurlencoded = 25, + anon_sym_body_COLONmultipart_DASHform = 26, + anon_sym_vars = 27, + anon_sym_vars_COLONsecret = 28, + anon_sym_vars_COLONpre_DASHrequest = 29, + anon_sym_vars_COLONpost_DASHresponse = 30, + anon_sym_assert = 31, + anon_sym_script_COLONpre_DASHrequest = 32, + anon_sym_script_COLONpost_DASHresponse = 33, + anon_sym_tests = 34, + anon_sym_docs = 35, + anon_sym_LBRACE = 36, + anon_sym_RBRACE = 37, + anon_sym_LBRACK = 38, + anon_sym_COMMA = 39, + anon_sym_RBRACK = 40, + sym_array_value = 41, + anon_sym_COLON = 42, + sym_assert_key = 43, + sym_key = 44, + sym_value = 45, + sym_rawtext = 46, + sym_source_file = 47, + sym_meta = 48, + sym_http = 49, + sym_http_verb = 50, + sym_query = 51, + sym_headers = 52, + sym_auths = 53, + sym_authawsv4 = 54, + sym_authbasic = 55, + sym_authbearer = 56, + sym_authdigest = 57, + sym_authoauth2 = 58, + sym_bodies = 59, + sym_bodyforms = 60, + sym_body = 61, + sym_bodyjson = 62, + sym_bodytext = 63, + sym_bodyxml = 64, + sym_bodysparql = 65, + sym_bodygraphql = 66, + sym_bodygraphqlvars = 67, + sym_bodyformurlencoded = 68, + sym_bodyformmultipart = 69, + sym_varsandassert = 70, + sym_vars = 71, + sym_vars_secret = 72, + sym_varsreq = 73, + sym_varsres = 74, + sym_assert = 75, + sym_script = 76, + sym_scriptreq = 77, + sym_scriptres = 78, + sym_tests = 79, + sym_docs = 80, + sym_textblock = 81, + sym_array = 82, + sym_dictionary = 83, + sym_dictionary_pair = 84, + sym_assert_dictionary = 85, + sym_assert_dictionary_pair = 86, + aux_sym_source_file_repeat1 = 87, + aux_sym_array_repeat1 = 88, + aux_sym_dictionary_repeat1 = 89, + aux_sym_assert_dictionary_repeat1 = 90, +}; + +static const char * const ts_symbol_names[] = { + [ts_builtin_sym_end] = "end", + [anon_sym_meta] = "keyword", + [anon_sym_get] = "get", + [anon_sym_post] = "post", + [anon_sym_put] = "put", + [anon_sym_delete] = "delete", + [anon_sym_patch] = "patch", + [anon_sym_options] = "options", + [anon_sym_head] = "head", + [anon_sym_connect] = "connect", + [anon_sym_trace] = "trace", + [anon_sym_query] = "keyword", + [anon_sym_headers] = "keyword", + [anon_sym_auth_COLONawsv4] = "keyword", + [anon_sym_auth_COLONbasic] = "keyword", + [anon_sym_auth_COLONbearer] = "keyword", + [anon_sym_auth_COLONdigest] = "keyword", + [anon_sym_auth_COLONoauth2] = "keyword", + [anon_sym_body] = "keyword", + [anon_sym_body_COLONjson] = "keyword", + [anon_sym_body_COLONtext] = "keyword", + [anon_sym_body_COLONxml] = "keyword", + [anon_sym_body_COLONsparql] = "keyword", + [anon_sym_body_COLONgraphql] = "keyword", + [anon_sym_body_COLONgraphql_COLONvars] = "keyword", + [anon_sym_body_COLONform_DASHurlencoded] = "keyword", + [anon_sym_body_COLONmultipart_DASHform] = "keyword", + [anon_sym_vars] = "keyword", + [anon_sym_vars_COLONsecret] = "keyword", + [anon_sym_vars_COLONpre_DASHrequest] = "keyword", + [anon_sym_vars_COLONpost_DASHresponse] = "keyword", + [anon_sym_assert] = "keyword", + [anon_sym_script_COLONpre_DASHrequest] = "keyword", + [anon_sym_script_COLONpost_DASHresponse] = "keyword", + [anon_sym_tests] = "keyword", + [anon_sym_docs] = "keyword", + [anon_sym_LBRACE] = "{", + [anon_sym_RBRACE] = "}", + [anon_sym_LBRACK] = "[", + [anon_sym_COMMA] = ",", + [anon_sym_RBRACK] = "]", + [sym_array_value] = "array_value", + [anon_sym_COLON] = ":", + [sym_assert_key] = "assert_key", + [sym_key] = "key", + [sym_value] = "value", + [sym_rawtext] = "rawtext", + [sym_source_file] = "source_file", + [sym_meta] = "meta", + [sym_http] = "http", + [sym_http_verb] = "keyword", + [sym_query] = "query", + [sym_headers] = "headers", + [sym_auths] = "auths", + [sym_authawsv4] = "authawsv4", + [sym_authbasic] = "authbasic", + [sym_authbearer] = "authbearer", + [sym_authdigest] = "authdigest", + [sym_authoauth2] = "authoauth2", + [sym_bodies] = "bodies", + [sym_bodyforms] = "bodyforms", + [sym_body] = "body", + [sym_bodyjson] = "bodyjson", + [sym_bodytext] = "bodytext", + [sym_bodyxml] = "bodyxml", + [sym_bodysparql] = "bodysparql", + [sym_bodygraphql] = "bodygraphql", + [sym_bodygraphqlvars] = "bodygraphqlvars", + [sym_bodyformurlencoded] = "bodyformurlencoded", + [sym_bodyformmultipart] = "bodyformmultipart", + [sym_varsandassert] = "varsandassert", + [sym_vars] = "vars", + [sym_vars_secret] = "vars_secret", + [sym_varsreq] = "varsreq", + [sym_varsres] = "varsres", + [sym_assert] = "assert", + [sym_script] = "script", + [sym_scriptreq] = "scriptreq", + [sym_scriptres] = "scriptres", + [sym_tests] = "tests", + [sym_docs] = "docs", + [sym_textblock] = "textblock", + [sym_array] = "array", + [sym_dictionary] = "dictionary", + [sym_dictionary_pair] = "dictionary_pair", + [sym_assert_dictionary] = "assert_dictionary", + [sym_assert_dictionary_pair] = "assert_dictionary_pair", + [aux_sym_source_file_repeat1] = "source_file_repeat1", + [aux_sym_array_repeat1] = "array_repeat1", + [aux_sym_dictionary_repeat1] = "dictionary_repeat1", + [aux_sym_assert_dictionary_repeat1] = "assert_dictionary_repeat1", +}; + +static const TSSymbol ts_symbol_map[] = { + [ts_builtin_sym_end] = ts_builtin_sym_end, + [anon_sym_meta] = anon_sym_meta, + [anon_sym_get] = anon_sym_get, + [anon_sym_post] = anon_sym_post, + [anon_sym_put] = anon_sym_put, + [anon_sym_delete] = anon_sym_delete, + [anon_sym_patch] = anon_sym_patch, + [anon_sym_options] = anon_sym_options, + [anon_sym_head] = anon_sym_head, + [anon_sym_connect] = anon_sym_connect, + [anon_sym_trace] = anon_sym_trace, + [anon_sym_query] = anon_sym_meta, + [anon_sym_headers] = anon_sym_meta, + [anon_sym_auth_COLONawsv4] = anon_sym_meta, + [anon_sym_auth_COLONbasic] = anon_sym_meta, + [anon_sym_auth_COLONbearer] = anon_sym_meta, + [anon_sym_auth_COLONdigest] = anon_sym_meta, + [anon_sym_auth_COLONoauth2] = anon_sym_meta, + [anon_sym_body] = anon_sym_meta, + [anon_sym_body_COLONjson] = anon_sym_meta, + [anon_sym_body_COLONtext] = anon_sym_meta, + [anon_sym_body_COLONxml] = anon_sym_meta, + [anon_sym_body_COLONsparql] = anon_sym_meta, + [anon_sym_body_COLONgraphql] = anon_sym_meta, + [anon_sym_body_COLONgraphql_COLONvars] = anon_sym_meta, + [anon_sym_body_COLONform_DASHurlencoded] = anon_sym_meta, + [anon_sym_body_COLONmultipart_DASHform] = anon_sym_meta, + [anon_sym_vars] = anon_sym_meta, + [anon_sym_vars_COLONsecret] = anon_sym_meta, + [anon_sym_vars_COLONpre_DASHrequest] = anon_sym_meta, + [anon_sym_vars_COLONpost_DASHresponse] = anon_sym_meta, + [anon_sym_assert] = anon_sym_meta, + [anon_sym_script_COLONpre_DASHrequest] = anon_sym_meta, + [anon_sym_script_COLONpost_DASHresponse] = anon_sym_meta, + [anon_sym_tests] = anon_sym_meta, + [anon_sym_docs] = anon_sym_meta, + [anon_sym_LBRACE] = anon_sym_LBRACE, + [anon_sym_RBRACE] = anon_sym_RBRACE, + [anon_sym_LBRACK] = anon_sym_LBRACK, + [anon_sym_COMMA] = anon_sym_COMMA, + [anon_sym_RBRACK] = anon_sym_RBRACK, + [sym_array_value] = sym_array_value, + [anon_sym_COLON] = anon_sym_COLON, + [sym_assert_key] = sym_assert_key, + [sym_key] = sym_key, + [sym_value] = sym_value, + [sym_rawtext] = sym_rawtext, + [sym_source_file] = sym_source_file, + [sym_meta] = sym_meta, + [sym_http] = sym_http, + [sym_http_verb] = anon_sym_meta, + [sym_query] = sym_query, + [sym_headers] = sym_headers, + [sym_auths] = sym_auths, + [sym_authawsv4] = sym_authawsv4, + [sym_authbasic] = sym_authbasic, + [sym_authbearer] = sym_authbearer, + [sym_authdigest] = sym_authdigest, + [sym_authoauth2] = sym_authoauth2, + [sym_bodies] = sym_bodies, + [sym_bodyforms] = sym_bodyforms, + [sym_body] = sym_body, + [sym_bodyjson] = sym_bodyjson, + [sym_bodytext] = sym_bodytext, + [sym_bodyxml] = sym_bodyxml, + [sym_bodysparql] = sym_bodysparql, + [sym_bodygraphql] = sym_bodygraphql, + [sym_bodygraphqlvars] = sym_bodygraphqlvars, + [sym_bodyformurlencoded] = sym_bodyformurlencoded, + [sym_bodyformmultipart] = sym_bodyformmultipart, + [sym_varsandassert] = sym_varsandassert, + [sym_vars] = sym_vars, + [sym_vars_secret] = sym_vars_secret, + [sym_varsreq] = sym_varsreq, + [sym_varsres] = sym_varsres, + [sym_assert] = sym_assert, + [sym_script] = sym_script, + [sym_scriptreq] = sym_scriptreq, + [sym_scriptres] = sym_scriptres, + [sym_tests] = sym_tests, + [sym_docs] = sym_docs, + [sym_textblock] = sym_textblock, + [sym_array] = sym_array, + [sym_dictionary] = sym_dictionary, + [sym_dictionary_pair] = sym_dictionary_pair, + [sym_assert_dictionary] = sym_assert_dictionary, + [sym_assert_dictionary_pair] = sym_assert_dictionary_pair, + [aux_sym_source_file_repeat1] = aux_sym_source_file_repeat1, + [aux_sym_array_repeat1] = aux_sym_array_repeat1, + [aux_sym_dictionary_repeat1] = aux_sym_dictionary_repeat1, + [aux_sym_assert_dictionary_repeat1] = aux_sym_assert_dictionary_repeat1, +}; + +static const TSSymbolMetadata ts_symbol_metadata[] = { + [ts_builtin_sym_end] = { + .visible = false, + .named = true, + }, + [anon_sym_meta] = { + .visible = true, + .named = true, + }, + [anon_sym_get] = { + .visible = true, + .named = false, + }, + [anon_sym_post] = { + .visible = true, + .named = false, + }, + [anon_sym_put] = { + .visible = true, + .named = false, + }, + [anon_sym_delete] = { + .visible = true, + .named = false, + }, + [anon_sym_patch] = { + .visible = true, + .named = false, + }, + [anon_sym_options] = { + .visible = true, + .named = false, + }, + [anon_sym_head] = { + .visible = true, + .named = false, + }, + [anon_sym_connect] = { + .visible = true, + .named = false, + }, + [anon_sym_trace] = { + .visible = true, + .named = false, + }, + [anon_sym_query] = { + .visible = true, + .named = true, + }, + [anon_sym_headers] = { + .visible = true, + .named = true, + }, + [anon_sym_auth_COLONawsv4] = { + .visible = true, + .named = true, + }, + [anon_sym_auth_COLONbasic] = { + .visible = true, + .named = true, + }, + [anon_sym_auth_COLONbearer] = { + .visible = true, + .named = true, + }, + [anon_sym_auth_COLONdigest] = { + .visible = true, + .named = true, + }, + [anon_sym_auth_COLONoauth2] = { + .visible = true, + .named = true, + }, + [anon_sym_body] = { + .visible = true, + .named = true, + }, + [anon_sym_body_COLONjson] = { + .visible = true, + .named = true, + }, + [anon_sym_body_COLONtext] = { + .visible = true, + .named = true, + }, + [anon_sym_body_COLONxml] = { + .visible = true, + .named = true, + }, + [anon_sym_body_COLONsparql] = { + .visible = true, + .named = true, + }, + [anon_sym_body_COLONgraphql] = { + .visible = true, + .named = true, + }, + [anon_sym_body_COLONgraphql_COLONvars] = { + .visible = true, + .named = true, + }, + [anon_sym_body_COLONform_DASHurlencoded] = { + .visible = true, + .named = true, + }, + [anon_sym_body_COLONmultipart_DASHform] = { + .visible = true, + .named = true, + }, + [anon_sym_vars] = { + .visible = true, + .named = true, + }, + [anon_sym_vars_COLONsecret] = { + .visible = true, + .named = true, + }, + [anon_sym_vars_COLONpre_DASHrequest] = { + .visible = true, + .named = true, + }, + [anon_sym_vars_COLONpost_DASHresponse] = { + .visible = true, + .named = true, + }, + [anon_sym_assert] = { + .visible = true, + .named = true, + }, + [anon_sym_script_COLONpre_DASHrequest] = { + .visible = true, + .named = true, + }, + [anon_sym_script_COLONpost_DASHresponse] = { + .visible = true, + .named = true, + }, + [anon_sym_tests] = { + .visible = true, + .named = true, + }, + [anon_sym_docs] = { + .visible = true, + .named = true, + }, + [anon_sym_LBRACE] = { + .visible = true, + .named = false, + }, + [anon_sym_RBRACE] = { + .visible = true, + .named = false, + }, + [anon_sym_LBRACK] = { + .visible = true, + .named = false, + }, + [anon_sym_COMMA] = { + .visible = true, + .named = false, + }, + [anon_sym_RBRACK] = { + .visible = true, + .named = false, + }, + [sym_array_value] = { + .visible = true, + .named = true, + }, + [anon_sym_COLON] = { + .visible = true, + .named = false, + }, + [sym_assert_key] = { + .visible = true, + .named = true, + }, + [sym_key] = { + .visible = true, + .named = true, + }, + [sym_value] = { + .visible = true, + .named = true, + }, + [sym_rawtext] = { + .visible = true, + .named = true, + }, + [sym_source_file] = { + .visible = true, + .named = true, + }, + [sym_meta] = { + .visible = true, + .named = true, + }, + [sym_http] = { + .visible = true, + .named = true, + }, + [sym_http_verb] = { + .visible = true, + .named = true, + }, + [sym_query] = { + .visible = true, + .named = true, + }, + [sym_headers] = { + .visible = true, + .named = true, + }, + [sym_auths] = { + .visible = true, + .named = true, + }, + [sym_authawsv4] = { + .visible = true, + .named = true, + }, + [sym_authbasic] = { + .visible = true, + .named = true, + }, + [sym_authbearer] = { + .visible = true, + .named = true, + }, + [sym_authdigest] = { + .visible = true, + .named = true, + }, + [sym_authoauth2] = { + .visible = true, + .named = true, + }, + [sym_bodies] = { + .visible = true, + .named = true, + }, + [sym_bodyforms] = { + .visible = true, + .named = true, + }, + [sym_body] = { + .visible = true, + .named = true, + }, + [sym_bodyjson] = { + .visible = true, + .named = true, + }, + [sym_bodytext] = { + .visible = true, + .named = true, + }, + [sym_bodyxml] = { + .visible = true, + .named = true, + }, + [sym_bodysparql] = { + .visible = true, + .named = true, + }, + [sym_bodygraphql] = { + .visible = true, + .named = true, + }, + [sym_bodygraphqlvars] = { + .visible = true, + .named = true, + }, + [sym_bodyformurlencoded] = { + .visible = true, + .named = true, + }, + [sym_bodyformmultipart] = { + .visible = true, + .named = true, + }, + [sym_varsandassert] = { + .visible = true, + .named = true, + }, + [sym_vars] = { + .visible = true, + .named = true, + }, + [sym_vars_secret] = { + .visible = true, + .named = true, + }, + [sym_varsreq] = { + .visible = true, + .named = true, + }, + [sym_varsres] = { + .visible = true, + .named = true, + }, + [sym_assert] = { + .visible = true, + .named = true, + }, + [sym_script] = { + .visible = true, + .named = true, + }, + [sym_scriptreq] = { + .visible = true, + .named = true, + }, + [sym_scriptres] = { + .visible = true, + .named = true, + }, + [sym_tests] = { + .visible = true, + .named = true, + }, + [sym_docs] = { + .visible = true, + .named = true, + }, + [sym_textblock] = { + .visible = true, + .named = true, + }, + [sym_array] = { + .visible = true, + .named = true, + }, + [sym_dictionary] = { + .visible = true, + .named = true, + }, + [sym_dictionary_pair] = { + .visible = true, + .named = true, + }, + [sym_assert_dictionary] = { + .visible = true, + .named = true, + }, + [sym_assert_dictionary_pair] = { + .visible = true, + .named = true, + }, + [aux_sym_source_file_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_array_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_dictionary_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_assert_dictionary_repeat1] = { + .visible = false, + .named = false, + }, +}; + +enum ts_field_identifiers { + field_tag = 1, +}; + +static const char * const ts_field_names[] = { + [0] = NULL, + [field_tag] = "tag", +}; + +static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = { + [1] = {.index = 0, .length = 1}, + [2] = {.index = 1, .length = 1}, + [3] = {.index = 2, .length = 2}, +}; + +static const TSFieldMapEntry ts_field_map_entries[] = { + [0] = + {field_tag, 0}, + [1] = + {field_tag, 0, .inherited = true}, + [2] = + {field_tag, 0, .inherited = true}, + {field_tag, 1, .inherited = true}, +}; + +static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = { + [0] = {0}, +}; + +static const uint16_t ts_non_terminal_alias_map[] = { + 0, +}; + +static const TSStateId ts_primary_state_ids[STATE_COUNT] = { + [0] = 0, + [1] = 1, + [2] = 2, + [3] = 3, + [4] = 4, + [5] = 5, + [6] = 6, + [7] = 7, + [8] = 8, + [9] = 9, + [10] = 10, + [11] = 11, + [12] = 12, + [13] = 13, + [14] = 14, + [15] = 15, + [16] = 16, + [17] = 17, + [18] = 18, + [19] = 19, + [20] = 20, + [21] = 21, + [22] = 22, + [23] = 23, + [24] = 24, + [25] = 25, + [26] = 26, + [27] = 27, + [28] = 28, + [29] = 29, + [30] = 30, + [31] = 31, + [32] = 32, + [33] = 33, + [34] = 34, + [35] = 35, + [36] = 36, + [37] = 37, + [38] = 38, + [39] = 39, + [40] = 40, + [41] = 41, + [42] = 42, + [43] = 43, + [44] = 44, + [45] = 45, + [46] = 46, + [47] = 47, + [48] = 48, + [49] = 49, + [50] = 50, + [51] = 51, + [52] = 52, + [53] = 53, + [54] = 54, + [55] = 55, + [56] = 56, + [57] = 57, + [58] = 58, + [59] = 59, + [60] = 60, + [61] = 61, + [62] = 62, + [63] = 63, + [64] = 64, + [65] = 65, + [66] = 66, + [67] = 67, + [68] = 68, + [69] = 69, + [70] = 70, + [71] = 71, + [72] = 72, + [73] = 73, + [74] = 74, + [75] = 75, + [76] = 76, + [77] = 77, + [78] = 78, + [79] = 79, + [80] = 80, + [81] = 81, + [82] = 82, + [83] = 83, + [84] = 84, + [85] = 85, + [86] = 86, + [87] = 87, + [88] = 88, + [89] = 89, + [90] = 90, + [91] = 91, + [92] = 92, +}; + +static bool ts_lex(TSLexer *lexer, TSStateId state) { + START_LEXER(); + eof = lexer->eof(lexer); + switch (state) { + case 0: + if (eof) ADVANCE(194); + if (lookahead == '\n') SKIP(0); + if (lookahead == '\r') SKIP(0); + if (lookahead == ',') ADVANCE(235); + if (lookahead == ':') ADVANCE(238); + if (lookahead == '[') ADVANCE(234); + if (lookahead == ']') ADVANCE(236); + if (lookahead == 'a') ADVANCE(138); + if (lookahead == 'b') ADVANCE(95); + if (lookahead == 'c') ADVANCE(96); + if (lookahead == 'd') ADVANCE(39); + if (lookahead == 'g') ADVANCE(47); + if (lookahead == 'h') ADVANCE(46); + if (lookahead == 'm') ADVANCE(49); + if (lookahead == 'o') ADVANCE(107); + if (lookahead == 'p') ADVANCE(21); + if (lookahead == 'q') ADVANCE(183); + if (lookahead == 's') ADVANCE(27); + if (lookahead == 't') ADVANCE(60); + if (lookahead == 'v') ADVANCE(17); + if (lookahead == '{') ADVANCE(230); + if (lookahead == '}') ADVANCE(231); + if (('\t' <= lookahead && lookahead <= '\f') || + lookahead == ' ') SKIP(0); + END_STATE(); + case 1: + if (lookahead == '\n') SKIP(1); + if (lookahead == '\r') SKIP(1); + if (lookahead == '}') ADVANCE(233); + if (('\t' <= lookahead && lookahead <= '\f') || + lookahead == ' ') ADVANCE(239); + if (lookahead != 0 && + lookahead != ':') ADVANCE(240); + END_STATE(); + case 2: + if (lookahead == '\n') SKIP(2); + if (lookahead == '\r') SKIP(2); + if (lookahead == '}') ADVANCE(232); + if (('\t' <= lookahead && lookahead <= '\f') || + lookahead == ' ') SKIP(2); + if (lookahead != 0 && + lookahead != ':') ADVANCE(241); + END_STATE(); + case 3: + if (lookahead == '\n') SKIP(3); + if (lookahead == '\r') SKIP(3); + if (lookahead == ',') ADVANCE(235); + if (lookahead == ']') ADVANCE(236); + if (('\t' <= lookahead && lookahead <= '\f') || + lookahead == ' ') SKIP(3); + if (lookahead != 0 && + lookahead != '[') ADVANCE(237); + END_STATE(); + case 4: + if (lookahead == '-') ADVANCE(68); + END_STATE(); + case 5: + if (lookahead == '-') ADVANCE(184); + END_STATE(); + case 6: + if (lookahead == '-') ADVANCE(130); + END_STATE(); + case 7: + if (lookahead == '-') ADVANCE(131); + END_STATE(); + case 8: + if (lookahead == '-') ADVANCE(136); + END_STATE(); + case 9: + if (lookahead == '-') ADVANCE(137); + END_STATE(); + case 10: + if (lookahead == '2') ADVANCE(211); + END_STATE(); + case 11: + if (lookahead == '4') ADVANCE(207); + END_STATE(); + case 12: + if (lookahead == ':') ADVANCE(15); + END_STATE(); + case 13: + if (lookahead == ':') ADVANCE(114); + END_STATE(); + case 14: + if (lookahead == 'a') ADVANCE(195); + END_STATE(); + case 15: + if (lookahead == 'a') ADVANCE(190); + if (lookahead == 'b') ADVANCE(24); + if (lookahead == 'd') ADVANCE(74); + if (lookahead == 'o') ADVANCE(18); + END_STATE(); + case 16: + if (lookahead == 'a') ADVANCE(36); + END_STATE(); + case 17: + if (lookahead == 'a') ADVANCE(125); + END_STATE(); + case 18: + if (lookahead == 'a') ADVANCE(185); + END_STATE(); + case 19: + if (lookahead == 'a') ADVANCE(108); + END_STATE(); + case 20: + if (lookahead == 'a') ADVANCE(31); + END_STATE(); + case 21: + if (lookahead == 'a') ADVANCE(173); + if (lookahead == 'o') ADVANCE(148); + if (lookahead == 'u') ADVANCE(163); + END_STATE(); + case 22: + if (lookahead == 'a') ADVANCE(134); + END_STATE(); + case 23: + if (lookahead == 'a') ADVANCE(119); + END_STATE(); + case 24: + if (lookahead == 'a') ADVANCE(146); + if (lookahead == 'e') ADVANCE(22); + END_STATE(); + case 25: + if (lookahead == 'a') ADVANCE(133); + END_STATE(); + case 26: + if (lookahead == 'a') ADVANCE(132); + END_STATE(); + case 27: + if (lookahead == 'c') ADVANCE(122); + END_STATE(); + case 28: + if (lookahead == 'c') ADVANCE(208); + END_STATE(); + case 29: + if (lookahead == 'c') ADVANCE(71); + END_STATE(); + case 30: + if (lookahead == 'c') ADVANCE(139); + END_STATE(); + case 31: + if (lookahead == 'c') ADVANCE(40); + END_STATE(); + case 32: + if (lookahead == 'c') ADVANCE(135); + END_STATE(); + case 33: + if (lookahead == 'c') ADVANCE(166); + END_STATE(); + case 34: + if (lookahead == 'c') ADVANCE(97); + END_STATE(); + case 35: + if (lookahead == 'd') ADVANCE(192); + END_STATE(); + case 36: + if (lookahead == 'd') ADVANCE(202); + END_STATE(); + case 37: + if (lookahead == 'd') ADVANCE(219); + END_STATE(); + case 38: + if (lookahead == 'd') ADVANCE(51); + END_STATE(); + case 39: + if (lookahead == 'e') ADVANCE(84); + if (lookahead == 'o') ADVANCE(30); + END_STATE(); + case 40: + if (lookahead == 'e') ADVANCE(204); + END_STATE(); + case 41: + if (lookahead == 'e') ADVANCE(199); + END_STATE(); + case 42: + if (lookahead == 'e') ADVANCE(191); + END_STATE(); + case 43: + if (lookahead == 'e') ADVANCE(6); + END_STATE(); + case 44: + if (lookahead == 'e') ADVANCE(224); + END_STATE(); + case 45: + if (lookahead == 'e') ADVANCE(227); + END_STATE(); + case 46: + if (lookahead == 'e') ADVANCE(16); + END_STATE(); + case 47: + if (lookahead == 'e') ADVANCE(161); + END_STATE(); + case 48: + if (lookahead == 'e') ADVANCE(117); + END_STATE(); + case 49: + if (lookahead == 'e') ADVANCE(176); + END_STATE(); + case 50: + if (lookahead == 'e') ADVANCE(121); + END_STATE(); + case 51: + if (lookahead == 'e') ADVANCE(37); + END_STATE(); + case 52: + if (lookahead == 'e') ADVANCE(129); + END_STATE(); + case 53: + if (lookahead == 'e') ADVANCE(33); + END_STATE(); + case 54: + if (lookahead == 'e') ADVANCE(91); + END_STATE(); + case 55: + if (lookahead == 'e') ADVANCE(179); + END_STATE(); + case 56: + if (lookahead == 'e') ADVANCE(147); + END_STATE(); + case 57: + if (lookahead == 'e') ADVANCE(120); + END_STATE(); + case 58: + if (lookahead == 'e') ADVANCE(169); + END_STATE(); + case 59: + if (lookahead == 'e') ADVANCE(32); + END_STATE(); + case 60: + if (lookahead == 'e') ADVANCE(149); + if (lookahead == 'r') ADVANCE(20); + END_STATE(); + case 61: + if (lookahead == 'e') ADVANCE(153); + END_STATE(); + case 62: + if (lookahead == 'e') ADVANCE(154); + END_STATE(); + case 63: + if (lookahead == 'e') ADVANCE(155); + END_STATE(); + case 64: + if (lookahead == 'e') ADVANCE(158); + END_STATE(); + case 65: + if (lookahead == 'e') ADVANCE(118); + END_STATE(); + case 66: + if (lookahead == 'e') ADVANCE(9); + END_STATE(); + case 67: + if (lookahead == 'f') ADVANCE(101); + if (lookahead == 'g') ADVANCE(126); + if (lookahead == 'j') ADVANCE(156); + if (lookahead == 'm') ADVANCE(182); + if (lookahead == 's') ADVANCE(110); + if (lookahead == 't') ADVANCE(42); + if (lookahead == 'x') ADVANCE(87); + END_STATE(); + case 68: + if (lookahead == 'f') ADVANCE(102); + END_STATE(); + case 69: + if (lookahead == 'g') ADVANCE(61); + END_STATE(); + case 70: + if (lookahead == 'h') ADVANCE(12); + END_STATE(); + case 71: + if (lookahead == 'h') ADVANCE(200); + END_STATE(); + case 72: + if (lookahead == 'h') ADVANCE(10); + END_STATE(); + case 73: + if (lookahead == 'h') ADVANCE(116); + END_STATE(); + case 74: + if (lookahead == 'i') ADVANCE(69); + END_STATE(); + case 75: + if (lookahead == 'i') ADVANCE(98); + END_STATE(); + case 76: + if (lookahead == 'i') ADVANCE(28); + END_STATE(); + case 77: + if (lookahead == 'i') ADVANCE(109); + END_STATE(); + case 78: + if (lookahead == 'i') ADVANCE(112); + END_STATE(); + case 79: + if (lookahead == 'l') ADVANCE(215); + END_STATE(); + case 80: + if (lookahead == 'l') ADVANCE(216); + END_STATE(); + case 81: + if (lookahead == 'l') ADVANCE(217); + END_STATE(); + case 82: + if (lookahead == 'l') ADVANCE(54); + END_STATE(); + case 83: + if (lookahead == 'l') ADVANCE(178); + END_STATE(); + case 84: + if (lookahead == 'l') ADVANCE(55); + END_STATE(); + case 85: + if (lookahead == 'm') ADVANCE(220); + END_STATE(); + case 86: + if (lookahead == 'm') ADVANCE(5); + END_STATE(); + case 87: + if (lookahead == 'm') ADVANCE(79); + END_STATE(); + case 88: + if (lookahead == 'n') ADVANCE(213); + END_STATE(); + case 89: + if (lookahead == 'n') ADVANCE(90); + END_STATE(); + case 90: + if (lookahead == 'n') ADVANCE(53); + END_STATE(); + case 91: + if (lookahead == 'n') ADVANCE(34); + END_STATE(); + case 92: + if (lookahead == 'n') ADVANCE(143); + END_STATE(); + case 93: + if (lookahead == 'n') ADVANCE(150); + END_STATE(); + case 94: + if (lookahead == 'n') ADVANCE(152); + END_STATE(); + case 95: + if (lookahead == 'o') ADVANCE(35); + END_STATE(); + case 96: + if (lookahead == 'o') ADVANCE(89); + END_STATE(); + case 97: + if (lookahead == 'o') ADVANCE(38); + END_STATE(); + case 98: + if (lookahead == 'o') ADVANCE(92); + END_STATE(); + case 99: + if (lookahead == 'o') ADVANCE(88); + END_STATE(); + case 100: + if (lookahead == 'o') ADVANCE(93); + END_STATE(); + case 101: + if (lookahead == 'o') ADVANCE(123); + END_STATE(); + case 102: + if (lookahead == 'o') ADVANCE(124); + END_STATE(); + case 103: + if (lookahead == 'o') ADVANCE(151); + if (lookahead == 'r') ADVANCE(43); + END_STATE(); + case 104: + if (lookahead == 'o') ADVANCE(94); + END_STATE(); + case 105: + if (lookahead == 'o') ADVANCE(159); + if (lookahead == 'r') ADVANCE(66); + END_STATE(); + case 106: + if (lookahead == 'p') ADVANCE(103); + if (lookahead == 's') ADVANCE(59); + END_STATE(); + case 107: + if (lookahead == 'p') ADVANCE(162); + END_STATE(); + case 108: + if (lookahead == 'p') ADVANCE(73); + END_STATE(); + case 109: + if (lookahead == 'p') ADVANCE(172); + END_STATE(); + case 110: + if (lookahead == 'p') ADVANCE(23); + END_STATE(); + case 111: + if (lookahead == 'p') ADVANCE(100); + END_STATE(); + case 112: + if (lookahead == 'p') ADVANCE(25); + END_STATE(); + case 113: + if (lookahead == 'p') ADVANCE(104); + END_STATE(); + case 114: + if (lookahead == 'p') ADVANCE(105); + END_STATE(); + case 115: + if (lookahead == 'q') ADVANCE(80); + END_STATE(); + case 116: + if (lookahead == 'q') ADVANCE(81); + END_STATE(); + case 117: + if (lookahead == 'q') ADVANCE(186); + END_STATE(); + case 118: + if (lookahead == 'q') ADVANCE(187); + END_STATE(); + case 119: + if (lookahead == 'r') ADVANCE(115); + END_STATE(); + case 120: + if (lookahead == 'r') ADVANCE(209); + END_STATE(); + case 121: + if (lookahead == 'r') ADVANCE(193); + END_STATE(); + case 122: + if (lookahead == 'r') ADVANCE(77); + END_STATE(); + case 123: + if (lookahead == 'r') ADVANCE(86); + END_STATE(); + case 124: + if (lookahead == 'r') ADVANCE(85); + END_STATE(); + case 125: + if (lookahead == 'r') ADVANCE(140); + END_STATE(); + case 126: + if (lookahead == 'r') ADVANCE(19); + END_STATE(); + case 127: + if (lookahead == 'r') ADVANCE(82); + END_STATE(); + case 128: + if (lookahead == 'r') ADVANCE(142); + END_STATE(); + case 129: + if (lookahead == 'r') ADVANCE(165); + END_STATE(); + case 130: + if (lookahead == 'r') ADVANCE(48); + END_STATE(); + case 131: + if (lookahead == 'r') ADVANCE(56); + END_STATE(); + case 132: + if (lookahead == 'r') ADVANCE(145); + END_STATE(); + case 133: + if (lookahead == 'r') ADVANCE(175); + END_STATE(); + case 134: + if (lookahead == 'r') ADVANCE(57); + END_STATE(); + case 135: + if (lookahead == 'r') ADVANCE(58); + END_STATE(); + case 136: + if (lookahead == 'r') ADVANCE(64); + END_STATE(); + case 137: + if (lookahead == 'r') ADVANCE(65); + END_STATE(); + case 138: + if (lookahead == 's') ADVANCE(157); + if (lookahead == 'u') ADVANCE(160); + END_STATE(); + case 139: + if (lookahead == 's') ADVANCE(229); + END_STATE(); + case 140: + if (lookahead == 's') ADVANCE(221); + END_STATE(); + case 141: + if (lookahead == 's') ADVANCE(228); + END_STATE(); + case 142: + if (lookahead == 's') ADVANCE(206); + END_STATE(); + case 143: + if (lookahead == 's') ADVANCE(201); + END_STATE(); + case 144: + if (lookahead == 's') ADVANCE(188); + END_STATE(); + case 145: + if (lookahead == 's') ADVANCE(218); + END_STATE(); + case 146: + if (lookahead == 's') ADVANCE(76); + END_STATE(); + case 147: + if (lookahead == 's') ADVANCE(111); + END_STATE(); + case 148: + if (lookahead == 's') ADVANCE(164); + END_STATE(); + case 149: + if (lookahead == 's') ADVANCE(177); + END_STATE(); + case 150: + if (lookahead == 's') ADVANCE(44); + END_STATE(); + case 151: + if (lookahead == 's') ADVANCE(180); + END_STATE(); + case 152: + if (lookahead == 's') ADVANCE(45); + END_STATE(); + case 153: + if (lookahead == 's') ADVANCE(168); + END_STATE(); + case 154: + if (lookahead == 's') ADVANCE(170); + END_STATE(); + case 155: + if (lookahead == 's') ADVANCE(171); + END_STATE(); + case 156: + if (lookahead == 's') ADVANCE(99); + END_STATE(); + case 157: + if (lookahead == 's') ADVANCE(52); + END_STATE(); + case 158: + if (lookahead == 's') ADVANCE(113); + END_STATE(); + case 159: + if (lookahead == 's') ADVANCE(181); + END_STATE(); + case 160: + if (lookahead == 't') ADVANCE(70); + END_STATE(); + case 161: + if (lookahead == 't') ADVANCE(196); + END_STATE(); + case 162: + if (lookahead == 't') ADVANCE(75); + END_STATE(); + case 163: + if (lookahead == 't') ADVANCE(198); + END_STATE(); + case 164: + if (lookahead == 't') ADVANCE(197); + END_STATE(); + case 165: + if (lookahead == 't') ADVANCE(225); + END_STATE(); + case 166: + if (lookahead == 't') ADVANCE(203); + END_STATE(); + case 167: + if (lookahead == 't') ADVANCE(214); + END_STATE(); + case 168: + if (lookahead == 't') ADVANCE(210); + END_STATE(); + case 169: + if (lookahead == 't') ADVANCE(222); + END_STATE(); + case 170: + if (lookahead == 't') ADVANCE(223); + END_STATE(); + case 171: + if (lookahead == 't') ADVANCE(226); + END_STATE(); + case 172: + if (lookahead == 't') ADVANCE(13); + END_STATE(); + case 173: + if (lookahead == 't') ADVANCE(29); + END_STATE(); + case 174: + if (lookahead == 't') ADVANCE(72); + END_STATE(); + case 175: + if (lookahead == 't') ADVANCE(4); + END_STATE(); + case 176: + if (lookahead == 't') ADVANCE(14); + END_STATE(); + case 177: + if (lookahead == 't') ADVANCE(141); + END_STATE(); + case 178: + if (lookahead == 't') ADVANCE(78); + END_STATE(); + case 179: + if (lookahead == 't') ADVANCE(41); + END_STATE(); + case 180: + if (lookahead == 't') ADVANCE(7); + END_STATE(); + case 181: + if (lookahead == 't') ADVANCE(8); + END_STATE(); + case 182: + if (lookahead == 'u') ADVANCE(83); + END_STATE(); + case 183: + if (lookahead == 'u') ADVANCE(50); + END_STATE(); + case 184: + if (lookahead == 'u') ADVANCE(127); + END_STATE(); + case 185: + if (lookahead == 'u') ADVANCE(174); + END_STATE(); + case 186: + if (lookahead == 'u') ADVANCE(62); + END_STATE(); + case 187: + if (lookahead == 'u') ADVANCE(63); + END_STATE(); + case 188: + if (lookahead == 'v') ADVANCE(11); + END_STATE(); + case 189: + if (lookahead == 'v') ADVANCE(26); + END_STATE(); + case 190: + if (lookahead == 'w') ADVANCE(144); + END_STATE(); + case 191: + if (lookahead == 'x') ADVANCE(167); + END_STATE(); + case 192: + if (lookahead == 'y') ADVANCE(212); + END_STATE(); + case 193: + if (lookahead == 'y') ADVANCE(205); + END_STATE(); + case 194: + ACCEPT_TOKEN(ts_builtin_sym_end); + END_STATE(); + case 195: + ACCEPT_TOKEN(anon_sym_meta); + END_STATE(); + case 196: + ACCEPT_TOKEN(anon_sym_get); + END_STATE(); + case 197: + ACCEPT_TOKEN(anon_sym_post); + END_STATE(); + case 198: + ACCEPT_TOKEN(anon_sym_put); + END_STATE(); + case 199: + ACCEPT_TOKEN(anon_sym_delete); + END_STATE(); + case 200: + ACCEPT_TOKEN(anon_sym_patch); + END_STATE(); + case 201: + ACCEPT_TOKEN(anon_sym_options); + END_STATE(); + case 202: + ACCEPT_TOKEN(anon_sym_head); + if (lookahead == 'e') ADVANCE(128); + END_STATE(); + case 203: + ACCEPT_TOKEN(anon_sym_connect); + END_STATE(); + case 204: + ACCEPT_TOKEN(anon_sym_trace); + END_STATE(); + case 205: + ACCEPT_TOKEN(anon_sym_query); + END_STATE(); + case 206: + ACCEPT_TOKEN(anon_sym_headers); + END_STATE(); + case 207: + ACCEPT_TOKEN(anon_sym_auth_COLONawsv4); + END_STATE(); + case 208: + ACCEPT_TOKEN(anon_sym_auth_COLONbasic); + END_STATE(); + case 209: + ACCEPT_TOKEN(anon_sym_auth_COLONbearer); + END_STATE(); + case 210: + ACCEPT_TOKEN(anon_sym_auth_COLONdigest); + END_STATE(); + case 211: + ACCEPT_TOKEN(anon_sym_auth_COLONoauth2); + END_STATE(); + case 212: + ACCEPT_TOKEN(anon_sym_body); + if (lookahead == ':') ADVANCE(67); + END_STATE(); + case 213: + ACCEPT_TOKEN(anon_sym_body_COLONjson); + END_STATE(); + case 214: + ACCEPT_TOKEN(anon_sym_body_COLONtext); + END_STATE(); + case 215: + ACCEPT_TOKEN(anon_sym_body_COLONxml); + END_STATE(); + case 216: + ACCEPT_TOKEN(anon_sym_body_COLONsparql); + END_STATE(); + case 217: + ACCEPT_TOKEN(anon_sym_body_COLONgraphql); + if (lookahead == ':') ADVANCE(189); + END_STATE(); + case 218: + ACCEPT_TOKEN(anon_sym_body_COLONgraphql_COLONvars); + END_STATE(); + case 219: + ACCEPT_TOKEN(anon_sym_body_COLONform_DASHurlencoded); + END_STATE(); + case 220: + ACCEPT_TOKEN(anon_sym_body_COLONmultipart_DASHform); + END_STATE(); + case 221: + ACCEPT_TOKEN(anon_sym_vars); + if (lookahead == ':') ADVANCE(106); + END_STATE(); + case 222: + ACCEPT_TOKEN(anon_sym_vars_COLONsecret); + END_STATE(); + case 223: + ACCEPT_TOKEN(anon_sym_vars_COLONpre_DASHrequest); + END_STATE(); + case 224: + ACCEPT_TOKEN(anon_sym_vars_COLONpost_DASHresponse); + END_STATE(); + case 225: + ACCEPT_TOKEN(anon_sym_assert); + END_STATE(); + case 226: + ACCEPT_TOKEN(anon_sym_script_COLONpre_DASHrequest); + END_STATE(); + case 227: + ACCEPT_TOKEN(anon_sym_script_COLONpost_DASHresponse); + END_STATE(); + case 228: + ACCEPT_TOKEN(anon_sym_tests); + END_STATE(); + case 229: + ACCEPT_TOKEN(anon_sym_docs); + END_STATE(); + case 230: + ACCEPT_TOKEN(anon_sym_LBRACE); + END_STATE(); + case 231: + ACCEPT_TOKEN(anon_sym_RBRACE); + END_STATE(); + case 232: + ACCEPT_TOKEN(anon_sym_RBRACE); + if (lookahead != 0 && + (lookahead < '\t' || '\r' < lookahead) && + lookahead != ' ' && + lookahead != ':') ADVANCE(241); + END_STATE(); + case 233: + ACCEPT_TOKEN(anon_sym_RBRACE); + if (lookahead != 0 && + lookahead != '\n' && + lookahead != '\r' && + lookahead != ':') ADVANCE(240); + END_STATE(); + case 234: + ACCEPT_TOKEN(anon_sym_LBRACK); + END_STATE(); + case 235: + ACCEPT_TOKEN(anon_sym_COMMA); + END_STATE(); + case 236: + ACCEPT_TOKEN(anon_sym_RBRACK); + END_STATE(); + case 237: + ACCEPT_TOKEN(sym_array_value); + if (lookahead != 0 && + (lookahead < '\t' || '\r' < lookahead) && + lookahead != ' ' && + lookahead != ',' && + lookahead != '[' && + lookahead != ']') ADVANCE(237); + END_STATE(); + case 238: + ACCEPT_TOKEN(anon_sym_COLON); + END_STATE(); + case 239: + ACCEPT_TOKEN(sym_assert_key); + if (lookahead == '}') ADVANCE(233); + if (lookahead == '\t' || + lookahead == 0x0b || + lookahead == '\f' || + lookahead == ' ') ADVANCE(239); + if (lookahead != 0 && + (lookahead < '\t' || '\r' < lookahead) && + lookahead != ':') ADVANCE(240); + END_STATE(); + case 240: + ACCEPT_TOKEN(sym_assert_key); + if (lookahead != 0 && + lookahead != '\n' && + lookahead != '\r' && + lookahead != ':') ADVANCE(240); + END_STATE(); + case 241: + ACCEPT_TOKEN(sym_key); + if (lookahead != 0 && + (lookahead < '\t' || '\r' < lookahead) && + lookahead != ' ' && + lookahead != ':') ADVANCE(241); + END_STATE(); + case 242: + ACCEPT_TOKEN(sym_value); + if (lookahead == '\t' || + lookahead == 0x0b || + lookahead == '\f' || + lookahead == ' ') ADVANCE(242); + if (lookahead != 0 && + (lookahead < '\t' || '\r' < lookahead)) ADVANCE(243); + END_STATE(); + case 243: + ACCEPT_TOKEN(sym_value); + if (lookahead != 0 && + lookahead != '\n' && + lookahead != '\r') ADVANCE(243); + END_STATE(); + default: + return false; + } +} + +static const TSLexMode ts_lex_modes[STATE_COUNT] = { + [0] = {.lex_state = 0, .external_lex_state = 1}, + [1] = {.lex_state = 0}, + [2] = {.lex_state = 0}, + [3] = {.lex_state = 0}, + [4] = {.lex_state = 0}, + [5] = {.lex_state = 0}, + [6] = {.lex_state = 0}, + [7] = {.lex_state = 0}, + [8] = {.lex_state = 0}, + [9] = {.lex_state = 0}, + [10] = {.lex_state = 0}, + [11] = {.lex_state = 0}, + [12] = {.lex_state = 0}, + [13] = {.lex_state = 0}, + [14] = {.lex_state = 0}, + [15] = {.lex_state = 0}, + [16] = {.lex_state = 0}, + [17] = {.lex_state = 0}, + [18] = {.lex_state = 0}, + [19] = {.lex_state = 0}, + [20] = {.lex_state = 0}, + [21] = {.lex_state = 0}, + [22] = {.lex_state = 0}, + [23] = {.lex_state = 0}, + [24] = {.lex_state = 0}, + [25] = {.lex_state = 0}, + [26] = {.lex_state = 0}, + [27] = {.lex_state = 0}, + [28] = {.lex_state = 0}, + [29] = {.lex_state = 0}, + [30] = {.lex_state = 0}, + [31] = {.lex_state = 0}, + [32] = {.lex_state = 0}, + [33] = {.lex_state = 0}, + [34] = {.lex_state = 0}, + [35] = {.lex_state = 0}, + [36] = {.lex_state = 0}, + [37] = {.lex_state = 0}, + [38] = {.lex_state = 0}, + [39] = {.lex_state = 0}, + [40] = {.lex_state = 0}, + [41] = {.lex_state = 0}, + [42] = {.lex_state = 0}, + [43] = {.lex_state = 0}, + [44] = {.lex_state = 0}, + [45] = {.lex_state = 1}, + [46] = {.lex_state = 2}, + [47] = {.lex_state = 2}, + [48] = {.lex_state = 2}, + [49] = {.lex_state = 1}, + [50] = {.lex_state = 1}, + [51] = {.lex_state = 3}, + [52] = {.lex_state = 3}, + [53] = {.lex_state = 3}, + [54] = {.lex_state = 3}, + [55] = {.lex_state = 0}, + [56] = {.lex_state = 0}, + [57] = {.lex_state = 0}, + [58] = {.lex_state = 0}, + [59] = {.lex_state = 0}, + [60] = {.lex_state = 0}, + [61] = {.lex_state = 0}, + [62] = {.lex_state = 0}, + [63] = {.lex_state = 0}, + [64] = {.lex_state = 0}, + [65] = {.lex_state = 0}, + [66] = {.lex_state = 0}, + [67] = {.lex_state = 0}, + [68] = {.lex_state = 0}, + [69] = {.lex_state = 0}, + [70] = {.lex_state = 0}, + [71] = {.lex_state = 0}, + [72] = {.lex_state = 0}, + [73] = {.lex_state = 0}, + [74] = {.lex_state = 0}, + [75] = {.lex_state = 0}, + [76] = {.lex_state = 0, .external_lex_state = 1}, + [77] = {.lex_state = 0}, + [78] = {.lex_state = 3}, + [79] = {.lex_state = 0}, + [80] = {.lex_state = 0}, + [81] = {.lex_state = 0}, + [82] = {.lex_state = 0}, + [83] = {.lex_state = 2}, + [84] = {.lex_state = 1}, + [85] = {.lex_state = 0}, + [86] = {.lex_state = 0}, + [87] = {.lex_state = 242}, + [88] = {.lex_state = 242}, + [89] = {.lex_state = 0}, + [90] = {.lex_state = 0}, + [91] = {.lex_state = 0}, + [92] = {.lex_state = 0}, +}; + +static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { + [0] = { + [ts_builtin_sym_end] = ACTIONS(1), + [anon_sym_meta] = ACTIONS(1), + [anon_sym_get] = ACTIONS(1), + [anon_sym_post] = ACTIONS(1), + [anon_sym_put] = ACTIONS(1), + [anon_sym_delete] = ACTIONS(1), + [anon_sym_patch] = ACTIONS(1), + [anon_sym_options] = ACTIONS(1), + [anon_sym_head] = ACTIONS(1), + [anon_sym_connect] = ACTIONS(1), + [anon_sym_trace] = ACTIONS(1), + [anon_sym_query] = ACTIONS(1), + [anon_sym_headers] = ACTIONS(1), + [anon_sym_auth_COLONawsv4] = ACTIONS(1), + [anon_sym_auth_COLONbasic] = ACTIONS(1), + [anon_sym_auth_COLONbearer] = ACTIONS(1), + [anon_sym_auth_COLONdigest] = ACTIONS(1), + [anon_sym_auth_COLONoauth2] = ACTIONS(1), + [anon_sym_body] = ACTIONS(1), + [anon_sym_body_COLONjson] = ACTIONS(1), + [anon_sym_body_COLONtext] = ACTIONS(1), + [anon_sym_body_COLONxml] = ACTIONS(1), + [anon_sym_body_COLONsparql] = ACTIONS(1), + [anon_sym_body_COLONgraphql] = ACTIONS(1), + [anon_sym_body_COLONgraphql_COLONvars] = ACTIONS(1), + [anon_sym_body_COLONform_DASHurlencoded] = ACTIONS(1), + [anon_sym_body_COLONmultipart_DASHform] = ACTIONS(1), + [anon_sym_vars] = ACTIONS(1), + [anon_sym_vars_COLONsecret] = ACTIONS(1), + [anon_sym_vars_COLONpre_DASHrequest] = ACTIONS(1), + [anon_sym_vars_COLONpost_DASHresponse] = ACTIONS(1), + [anon_sym_assert] = ACTIONS(1), + [anon_sym_script_COLONpre_DASHrequest] = ACTIONS(1), + [anon_sym_script_COLONpost_DASHresponse] = ACTIONS(1), + [anon_sym_tests] = ACTIONS(1), + [anon_sym_docs] = ACTIONS(1), + [anon_sym_LBRACE] = ACTIONS(1), + [anon_sym_RBRACE] = ACTIONS(1), + [anon_sym_LBRACK] = ACTIONS(1), + [anon_sym_COMMA] = ACTIONS(1), + [anon_sym_RBRACK] = ACTIONS(1), + [anon_sym_COLON] = ACTIONS(1), + [sym_rawtext] = ACTIONS(1), + }, + [1] = { + [sym_source_file] = STATE(91), + [sym_meta] = STATE(4), + [sym_http] = STATE(4), + [sym_http_verb] = STATE(60), + [sym_query] = STATE(4), + [sym_headers] = STATE(4), + [sym_auths] = STATE(4), + [sym_authawsv4] = STATE(38), + [sym_authbasic] = STATE(38), + [sym_authbearer] = STATE(38), + [sym_authdigest] = STATE(38), + [sym_authoauth2] = STATE(38), + [sym_bodies] = STATE(4), + [sym_bodyforms] = STATE(23), + [sym_body] = STATE(23), + [sym_bodyjson] = STATE(23), + [sym_bodytext] = STATE(23), + [sym_bodyxml] = STATE(23), + [sym_bodysparql] = STATE(23), + [sym_bodygraphql] = STATE(23), + [sym_bodygraphqlvars] = STATE(23), + [sym_bodyformurlencoded] = STATE(6), + [sym_bodyformmultipart] = STATE(6), + [sym_varsandassert] = STATE(4), + [sym_vars] = STATE(34), + [sym_vars_secret] = STATE(34), + [sym_varsreq] = STATE(34), + [sym_varsres] = STATE(34), + [sym_assert] = STATE(34), + [sym_script] = STATE(4), + [sym_scriptreq] = STATE(5), + [sym_scriptres] = STATE(5), + [sym_tests] = STATE(4), + [sym_docs] = STATE(4), + [aux_sym_source_file_repeat1] = STATE(3), + [ts_builtin_sym_end] = ACTIONS(3), + [anon_sym_meta] = ACTIONS(5), + [anon_sym_get] = ACTIONS(7), + [anon_sym_post] = ACTIONS(7), + [anon_sym_put] = ACTIONS(7), + [anon_sym_delete] = ACTIONS(7), + [anon_sym_patch] = ACTIONS(7), + [anon_sym_options] = ACTIONS(7), + [anon_sym_head] = ACTIONS(9), + [anon_sym_connect] = ACTIONS(7), + [anon_sym_trace] = ACTIONS(7), + [anon_sym_query] = ACTIONS(11), + [anon_sym_headers] = ACTIONS(13), + [anon_sym_auth_COLONawsv4] = ACTIONS(15), + [anon_sym_auth_COLONbasic] = ACTIONS(17), + [anon_sym_auth_COLONbearer] = ACTIONS(19), + [anon_sym_auth_COLONdigest] = ACTIONS(21), + [anon_sym_auth_COLONoauth2] = ACTIONS(23), + [anon_sym_body] = ACTIONS(25), + [anon_sym_body_COLONjson] = ACTIONS(27), + [anon_sym_body_COLONtext] = ACTIONS(29), + [anon_sym_body_COLONxml] = ACTIONS(31), + [anon_sym_body_COLONsparql] = ACTIONS(33), + [anon_sym_body_COLONgraphql] = ACTIONS(35), + [anon_sym_body_COLONgraphql_COLONvars] = ACTIONS(37), + [anon_sym_body_COLONform_DASHurlencoded] = ACTIONS(39), + [anon_sym_body_COLONmultipart_DASHform] = ACTIONS(41), + [anon_sym_vars] = ACTIONS(43), + [anon_sym_vars_COLONsecret] = ACTIONS(45), + [anon_sym_vars_COLONpre_DASHrequest] = ACTIONS(47), + [anon_sym_vars_COLONpost_DASHresponse] = ACTIONS(49), + [anon_sym_assert] = ACTIONS(51), + [anon_sym_script_COLONpre_DASHrequest] = ACTIONS(53), + [anon_sym_script_COLONpost_DASHresponse] = ACTIONS(55), + [anon_sym_tests] = ACTIONS(57), + [anon_sym_docs] = ACTIONS(59), + }, + [2] = { + [sym_meta] = STATE(4), + [sym_http] = STATE(4), + [sym_http_verb] = STATE(60), + [sym_query] = STATE(4), + [sym_headers] = STATE(4), + [sym_auths] = STATE(4), + [sym_authawsv4] = STATE(38), + [sym_authbasic] = STATE(38), + [sym_authbearer] = STATE(38), + [sym_authdigest] = STATE(38), + [sym_authoauth2] = STATE(38), + [sym_bodies] = STATE(4), + [sym_bodyforms] = STATE(23), + [sym_body] = STATE(23), + [sym_bodyjson] = STATE(23), + [sym_bodytext] = STATE(23), + [sym_bodyxml] = STATE(23), + [sym_bodysparql] = STATE(23), + [sym_bodygraphql] = STATE(23), + [sym_bodygraphqlvars] = STATE(23), + [sym_bodyformurlencoded] = STATE(6), + [sym_bodyformmultipart] = STATE(6), + [sym_varsandassert] = STATE(4), + [sym_vars] = STATE(34), + [sym_vars_secret] = STATE(34), + [sym_varsreq] = STATE(34), + [sym_varsres] = STATE(34), + [sym_assert] = STATE(34), + [sym_script] = STATE(4), + [sym_scriptreq] = STATE(5), + [sym_scriptres] = STATE(5), + [sym_tests] = STATE(4), + [sym_docs] = STATE(4), + [aux_sym_source_file_repeat1] = STATE(2), + [ts_builtin_sym_end] = ACTIONS(61), + [anon_sym_meta] = ACTIONS(63), + [anon_sym_get] = ACTIONS(66), + [anon_sym_post] = ACTIONS(66), + [anon_sym_put] = ACTIONS(66), + [anon_sym_delete] = ACTIONS(66), + [anon_sym_patch] = ACTIONS(66), + [anon_sym_options] = ACTIONS(66), + [anon_sym_head] = ACTIONS(69), + [anon_sym_connect] = ACTIONS(66), + [anon_sym_trace] = ACTIONS(66), + [anon_sym_query] = ACTIONS(72), + [anon_sym_headers] = ACTIONS(75), + [anon_sym_auth_COLONawsv4] = ACTIONS(78), + [anon_sym_auth_COLONbasic] = ACTIONS(81), + [anon_sym_auth_COLONbearer] = ACTIONS(84), + [anon_sym_auth_COLONdigest] = ACTIONS(87), + [anon_sym_auth_COLONoauth2] = ACTIONS(90), + [anon_sym_body] = ACTIONS(93), + [anon_sym_body_COLONjson] = ACTIONS(96), + [anon_sym_body_COLONtext] = ACTIONS(99), + [anon_sym_body_COLONxml] = ACTIONS(102), + [anon_sym_body_COLONsparql] = ACTIONS(105), + [anon_sym_body_COLONgraphql] = ACTIONS(108), + [anon_sym_body_COLONgraphql_COLONvars] = ACTIONS(111), + [anon_sym_body_COLONform_DASHurlencoded] = ACTIONS(114), + [anon_sym_body_COLONmultipart_DASHform] = ACTIONS(117), + [anon_sym_vars] = ACTIONS(120), + [anon_sym_vars_COLONsecret] = ACTIONS(123), + [anon_sym_vars_COLONpre_DASHrequest] = ACTIONS(126), + [anon_sym_vars_COLONpost_DASHresponse] = ACTIONS(129), + [anon_sym_assert] = ACTIONS(132), + [anon_sym_script_COLONpre_DASHrequest] = ACTIONS(135), + [anon_sym_script_COLONpost_DASHresponse] = ACTIONS(138), + [anon_sym_tests] = ACTIONS(141), + [anon_sym_docs] = ACTIONS(144), + }, + [3] = { + [sym_meta] = STATE(4), + [sym_http] = STATE(4), + [sym_http_verb] = STATE(60), + [sym_query] = STATE(4), + [sym_headers] = STATE(4), + [sym_auths] = STATE(4), + [sym_authawsv4] = STATE(38), + [sym_authbasic] = STATE(38), + [sym_authbearer] = STATE(38), + [sym_authdigest] = STATE(38), + [sym_authoauth2] = STATE(38), + [sym_bodies] = STATE(4), + [sym_bodyforms] = STATE(23), + [sym_body] = STATE(23), + [sym_bodyjson] = STATE(23), + [sym_bodytext] = STATE(23), + [sym_bodyxml] = STATE(23), + [sym_bodysparql] = STATE(23), + [sym_bodygraphql] = STATE(23), + [sym_bodygraphqlvars] = STATE(23), + [sym_bodyformurlencoded] = STATE(6), + [sym_bodyformmultipart] = STATE(6), + [sym_varsandassert] = STATE(4), + [sym_vars] = STATE(34), + [sym_vars_secret] = STATE(34), + [sym_varsreq] = STATE(34), + [sym_varsres] = STATE(34), + [sym_assert] = STATE(34), + [sym_script] = STATE(4), + [sym_scriptreq] = STATE(5), + [sym_scriptres] = STATE(5), + [sym_tests] = STATE(4), + [sym_docs] = STATE(4), + [aux_sym_source_file_repeat1] = STATE(2), + [ts_builtin_sym_end] = ACTIONS(147), + [anon_sym_meta] = ACTIONS(5), + [anon_sym_get] = ACTIONS(7), + [anon_sym_post] = ACTIONS(7), + [anon_sym_put] = ACTIONS(7), + [anon_sym_delete] = ACTIONS(7), + [anon_sym_patch] = ACTIONS(7), + [anon_sym_options] = ACTIONS(7), + [anon_sym_head] = ACTIONS(9), + [anon_sym_connect] = ACTIONS(7), + [anon_sym_trace] = ACTIONS(7), + [anon_sym_query] = ACTIONS(11), + [anon_sym_headers] = ACTIONS(13), + [anon_sym_auth_COLONawsv4] = ACTIONS(15), + [anon_sym_auth_COLONbasic] = ACTIONS(17), + [anon_sym_auth_COLONbearer] = ACTIONS(19), + [anon_sym_auth_COLONdigest] = ACTIONS(21), + [anon_sym_auth_COLONoauth2] = ACTIONS(23), + [anon_sym_body] = ACTIONS(25), + [anon_sym_body_COLONjson] = ACTIONS(27), + [anon_sym_body_COLONtext] = ACTIONS(29), + [anon_sym_body_COLONxml] = ACTIONS(31), + [anon_sym_body_COLONsparql] = ACTIONS(33), + [anon_sym_body_COLONgraphql] = ACTIONS(35), + [anon_sym_body_COLONgraphql_COLONvars] = ACTIONS(37), + [anon_sym_body_COLONform_DASHurlencoded] = ACTIONS(39), + [anon_sym_body_COLONmultipart_DASHform] = ACTIONS(41), + [anon_sym_vars] = ACTIONS(43), + [anon_sym_vars_COLONsecret] = ACTIONS(45), + [anon_sym_vars_COLONpre_DASHrequest] = ACTIONS(47), + [anon_sym_vars_COLONpost_DASHresponse] = ACTIONS(49), + [anon_sym_assert] = ACTIONS(51), + [anon_sym_script_COLONpre_DASHrequest] = ACTIONS(53), + [anon_sym_script_COLONpost_DASHresponse] = ACTIONS(55), + [anon_sym_tests] = ACTIONS(57), + [anon_sym_docs] = ACTIONS(59), + }, +}; + +static const uint16_t ts_small_parse_table[] = { + [0] = 2, + ACTIONS(151), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(149), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [41] = 2, + ACTIONS(155), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(153), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [82] = 2, + ACTIONS(159), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(157), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [123] = 2, + ACTIONS(163), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(161), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [164] = 2, + ACTIONS(167), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(165), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [205] = 2, + ACTIONS(171), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(169), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [246] = 2, + ACTIONS(175), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(173), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [287] = 2, + ACTIONS(179), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(177), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [328] = 2, + ACTIONS(183), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(181), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [369] = 2, + ACTIONS(187), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(185), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [410] = 2, + ACTIONS(191), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(189), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [451] = 2, + ACTIONS(195), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(193), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [492] = 2, + ACTIONS(199), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(197), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [533] = 2, + ACTIONS(203), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(201), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [574] = 2, + ACTIONS(207), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(205), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [615] = 2, + ACTIONS(211), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(209), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [656] = 2, + ACTIONS(215), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(213), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [697] = 2, + ACTIONS(219), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(217), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [738] = 2, + ACTIONS(223), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(221), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [779] = 2, + ACTIONS(227), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(225), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [820] = 2, + ACTIONS(231), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(229), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [861] = 2, + ACTIONS(235), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(233), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [902] = 2, + ACTIONS(239), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(237), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [943] = 2, + ACTIONS(243), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(241), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [984] = 2, + ACTIONS(247), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(245), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [1025] = 2, + ACTIONS(251), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(249), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [1066] = 2, + ACTIONS(255), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(253), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [1107] = 2, + ACTIONS(259), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(257), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [1148] = 2, + ACTIONS(263), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(261), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [1189] = 2, + ACTIONS(267), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(265), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [1230] = 2, + ACTIONS(271), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(269), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [1271] = 2, + ACTIONS(275), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(273), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [1312] = 2, + ACTIONS(279), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(277), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [1353] = 2, + ACTIONS(283), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(281), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [1394] = 2, + ACTIONS(287), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(285), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [1435] = 2, + ACTIONS(291), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(289), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [1476] = 2, + ACTIONS(295), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(293), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [1517] = 2, + ACTIONS(299), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(297), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [1558] = 2, + ACTIONS(303), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(301), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [1599] = 2, + ACTIONS(307), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(305), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [1640] = 2, + ACTIONS(311), 4, + anon_sym_head, + anon_sym_body, + anon_sym_body_COLONgraphql, + anon_sym_vars, + ACTIONS(309), 32, + ts_builtin_sym_end, + anon_sym_meta, + anon_sym_get, + anon_sym_post, + anon_sym_put, + anon_sym_delete, + anon_sym_patch, + anon_sym_options, + anon_sym_connect, + anon_sym_trace, + anon_sym_query, + anon_sym_headers, + anon_sym_auth_COLONawsv4, + anon_sym_auth_COLONbasic, + anon_sym_auth_COLONbearer, + anon_sym_auth_COLONdigest, + anon_sym_auth_COLONoauth2, + anon_sym_body_COLONjson, + anon_sym_body_COLONtext, + anon_sym_body_COLONxml, + anon_sym_body_COLONsparql, + anon_sym_body_COLONgraphql_COLONvars, + anon_sym_body_COLONform_DASHurlencoded, + anon_sym_body_COLONmultipart_DASHform, + anon_sym_vars_COLONsecret, + anon_sym_vars_COLONpre_DASHrequest, + anon_sym_vars_COLONpost_DASHresponse, + anon_sym_assert, + anon_sym_script_COLONpre_DASHrequest, + anon_sym_script_COLONpost_DASHresponse, + anon_sym_tests, + anon_sym_docs, + [1681] = 3, + ACTIONS(313), 1, + anon_sym_RBRACE, + ACTIONS(315), 1, + sym_assert_key, + STATE(49), 2, + sym_assert_dictionary_pair, + aux_sym_assert_dictionary_repeat1, + [1692] = 3, + ACTIONS(317), 1, + anon_sym_RBRACE, + ACTIONS(319), 1, + sym_key, + STATE(46), 2, + sym_dictionary_pair, + aux_sym_dictionary_repeat1, + [1703] = 3, + ACTIONS(322), 1, + anon_sym_RBRACE, + ACTIONS(324), 1, + sym_key, + STATE(46), 2, + sym_dictionary_pair, + aux_sym_dictionary_repeat1, + [1714] = 3, + ACTIONS(324), 1, + sym_key, + ACTIONS(326), 1, + anon_sym_RBRACE, + STATE(47), 2, + sym_dictionary_pair, + aux_sym_dictionary_repeat1, + [1725] = 3, + ACTIONS(315), 1, + sym_assert_key, + ACTIONS(328), 1, + anon_sym_RBRACE, + STATE(50), 2, + sym_assert_dictionary_pair, + aux_sym_assert_dictionary_repeat1, + [1736] = 3, + ACTIONS(330), 1, + anon_sym_RBRACE, + ACTIONS(332), 1, + sym_assert_key, + STATE(50), 2, + sym_assert_dictionary_pair, + aux_sym_assert_dictionary_repeat1, + [1747] = 3, + ACTIONS(335), 1, + anon_sym_RBRACK, + ACTIONS(337), 1, + sym_array_value, + STATE(52), 1, + aux_sym_array_repeat1, + [1757] = 3, + ACTIONS(339), 1, + anon_sym_RBRACK, + ACTIONS(341), 1, + sym_array_value, + STATE(52), 1, + aux_sym_array_repeat1, + [1767] = 3, + ACTIONS(337), 1, + sym_array_value, + ACTIONS(344), 1, + anon_sym_RBRACK, + STATE(51), 1, + aux_sym_array_repeat1, + [1777] = 2, + ACTIONS(346), 1, + anon_sym_COMMA, + ACTIONS(348), 2, + anon_sym_RBRACK, + sym_array_value, + [1785] = 2, + ACTIONS(350), 1, + anon_sym_LBRACE, + STATE(15), 1, + sym_textblock, + [1792] = 2, + ACTIONS(350), 1, + anon_sym_LBRACE, + STATE(31), 1, + sym_textblock, + [1799] = 2, + ACTIONS(352), 1, + anon_sym_LBRACE, + STATE(28), 1, + sym_assert_dictionary, + [1806] = 2, + ACTIONS(350), 1, + anon_sym_LBRACE, + STATE(32), 1, + sym_textblock, + [1813] = 2, + ACTIONS(354), 1, + anon_sym_LBRACE, + STATE(7), 1, + sym_dictionary, + [1820] = 2, + ACTIONS(354), 1, + anon_sym_LBRACE, + STATE(33), 1, + sym_dictionary, + [1827] = 2, + ACTIONS(354), 1, + anon_sym_LBRACE, + STATE(8), 1, + sym_dictionary, + [1834] = 2, + ACTIONS(354), 1, + anon_sym_LBRACE, + STATE(9), 1, + sym_dictionary, + [1841] = 2, + ACTIONS(354), 1, + anon_sym_LBRACE, + STATE(10), 1, + sym_dictionary, + [1848] = 2, + ACTIONS(354), 1, + anon_sym_LBRACE, + STATE(11), 1, + sym_dictionary, + [1855] = 2, + ACTIONS(354), 1, + anon_sym_LBRACE, + STATE(12), 1, + sym_dictionary, + [1862] = 2, + ACTIONS(354), 1, + anon_sym_LBRACE, + STATE(13), 1, + sym_dictionary, + [1869] = 2, + ACTIONS(354), 1, + anon_sym_LBRACE, + STATE(14), 1, + sym_dictionary, + [1876] = 2, + ACTIONS(354), 1, + anon_sym_LBRACE, + STATE(27), 1, + sym_dictionary, + [1883] = 2, + ACTIONS(350), 1, + anon_sym_LBRACE, + STATE(16), 1, + sym_textblock, + [1890] = 2, + ACTIONS(350), 1, + anon_sym_LBRACE, + STATE(17), 1, + sym_textblock, + [1897] = 2, + ACTIONS(350), 1, + anon_sym_LBRACE, + STATE(29), 1, + sym_textblock, + [1904] = 2, + ACTIONS(350), 1, + anon_sym_LBRACE, + STATE(18), 1, + sym_textblock, + [1911] = 2, + ACTIONS(350), 1, + anon_sym_LBRACE, + STATE(19), 1, + sym_textblock, + [1918] = 2, + ACTIONS(350), 1, + anon_sym_LBRACE, + STATE(20), 1, + sym_textblock, + [1925] = 2, + ACTIONS(350), 1, + anon_sym_LBRACE, + STATE(21), 1, + sym_textblock, + [1932] = 2, + ACTIONS(356), 1, + anon_sym_RBRACE, + ACTIONS(358), 1, + sym_rawtext, + [1939] = 2, + ACTIONS(354), 1, + anon_sym_LBRACE, + STATE(22), 1, + sym_dictionary, + [1946] = 1, + ACTIONS(339), 2, + anon_sym_RBRACK, + sym_array_value, + [1951] = 2, + ACTIONS(354), 1, + anon_sym_LBRACE, + STATE(44), 1, + sym_dictionary, + [1958] = 2, + ACTIONS(350), 1, + anon_sym_LBRACE, + STATE(30), 1, + sym_textblock, + [1965] = 2, + ACTIONS(354), 1, + anon_sym_LBRACE, + STATE(24), 1, + sym_dictionary, + [1972] = 2, + ACTIONS(360), 1, + anon_sym_LBRACK, + STATE(25), 1, + sym_array, + [1979] = 1, + ACTIONS(362), 2, + anon_sym_RBRACE, + sym_key, + [1984] = 1, + ACTIONS(364), 2, + anon_sym_RBRACE, + sym_assert_key, + [1989] = 2, + ACTIONS(354), 1, + anon_sym_LBRACE, + STATE(26), 1, + sym_dictionary, + [1996] = 1, + ACTIONS(366), 1, + anon_sym_COLON, + [2000] = 1, + ACTIONS(368), 1, + sym_value, + [2004] = 1, + ACTIONS(370), 1, + sym_value, + [2008] = 1, + ACTIONS(372), 1, + anon_sym_LBRACE, + [2012] = 1, + ACTIONS(374), 1, + anon_sym_RBRACE, + [2016] = 1, + ACTIONS(376), 1, + ts_builtin_sym_end, + [2020] = 1, + ACTIONS(378), 1, + anon_sym_COLON, +}; + +static const uint32_t ts_small_parse_table_map[] = { + [SMALL_STATE(4)] = 0, + [SMALL_STATE(5)] = 41, + [SMALL_STATE(6)] = 82, + [SMALL_STATE(7)] = 123, + [SMALL_STATE(8)] = 164, + [SMALL_STATE(9)] = 205, + [SMALL_STATE(10)] = 246, + [SMALL_STATE(11)] = 287, + [SMALL_STATE(12)] = 328, + [SMALL_STATE(13)] = 369, + [SMALL_STATE(14)] = 410, + [SMALL_STATE(15)] = 451, + [SMALL_STATE(16)] = 492, + [SMALL_STATE(17)] = 533, + [SMALL_STATE(18)] = 574, + [SMALL_STATE(19)] = 615, + [SMALL_STATE(20)] = 656, + [SMALL_STATE(21)] = 697, + [SMALL_STATE(22)] = 738, + [SMALL_STATE(23)] = 779, + [SMALL_STATE(24)] = 820, + [SMALL_STATE(25)] = 861, + [SMALL_STATE(26)] = 902, + [SMALL_STATE(27)] = 943, + [SMALL_STATE(28)] = 984, + [SMALL_STATE(29)] = 1025, + [SMALL_STATE(30)] = 1066, + [SMALL_STATE(31)] = 1107, + [SMALL_STATE(32)] = 1148, + [SMALL_STATE(33)] = 1189, + [SMALL_STATE(34)] = 1230, + [SMALL_STATE(35)] = 1271, + [SMALL_STATE(36)] = 1312, + [SMALL_STATE(37)] = 1353, + [SMALL_STATE(38)] = 1394, + [SMALL_STATE(39)] = 1435, + [SMALL_STATE(40)] = 1476, + [SMALL_STATE(41)] = 1517, + [SMALL_STATE(42)] = 1558, + [SMALL_STATE(43)] = 1599, + [SMALL_STATE(44)] = 1640, + [SMALL_STATE(45)] = 1681, + [SMALL_STATE(46)] = 1692, + [SMALL_STATE(47)] = 1703, + [SMALL_STATE(48)] = 1714, + [SMALL_STATE(49)] = 1725, + [SMALL_STATE(50)] = 1736, + [SMALL_STATE(51)] = 1747, + [SMALL_STATE(52)] = 1757, + [SMALL_STATE(53)] = 1767, + [SMALL_STATE(54)] = 1777, + [SMALL_STATE(55)] = 1785, + [SMALL_STATE(56)] = 1792, + [SMALL_STATE(57)] = 1799, + [SMALL_STATE(58)] = 1806, + [SMALL_STATE(59)] = 1813, + [SMALL_STATE(60)] = 1820, + [SMALL_STATE(61)] = 1827, + [SMALL_STATE(62)] = 1834, + [SMALL_STATE(63)] = 1841, + [SMALL_STATE(64)] = 1848, + [SMALL_STATE(65)] = 1855, + [SMALL_STATE(66)] = 1862, + [SMALL_STATE(67)] = 1869, + [SMALL_STATE(68)] = 1876, + [SMALL_STATE(69)] = 1883, + [SMALL_STATE(70)] = 1890, + [SMALL_STATE(71)] = 1897, + [SMALL_STATE(72)] = 1904, + [SMALL_STATE(73)] = 1911, + [SMALL_STATE(74)] = 1918, + [SMALL_STATE(75)] = 1925, + [SMALL_STATE(76)] = 1932, + [SMALL_STATE(77)] = 1939, + [SMALL_STATE(78)] = 1946, + [SMALL_STATE(79)] = 1951, + [SMALL_STATE(80)] = 1958, + [SMALL_STATE(81)] = 1965, + [SMALL_STATE(82)] = 1972, + [SMALL_STATE(83)] = 1979, + [SMALL_STATE(84)] = 1984, + [SMALL_STATE(85)] = 1989, + [SMALL_STATE(86)] = 1996, + [SMALL_STATE(87)] = 2000, + [SMALL_STATE(88)] = 2004, + [SMALL_STATE(89)] = 2008, + [SMALL_STATE(90)] = 2012, + [SMALL_STATE(91)] = 2016, + [SMALL_STATE(92)] = 2020, +}; + +static const TSParseActionEntry ts_parse_actions[] = { + [0] = {.entry = {.count = 0, .reusable = false}}, + [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(), + [3] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 0, 0, 0), + [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(59), + [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(89), + [9] = {.entry = {.count = 1, .reusable = false}}, SHIFT(89), + [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(61), + [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(62), + [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(63), + [17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(64), + [19] = {.entry = {.count = 1, .reusable = true}}, SHIFT(65), + [21] = {.entry = {.count = 1, .reusable = true}}, SHIFT(66), + [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(67), + [25] = {.entry = {.count = 1, .reusable = false}}, SHIFT(55), + [27] = {.entry = {.count = 1, .reusable = true}}, SHIFT(69), + [29] = {.entry = {.count = 1, .reusable = true}}, SHIFT(70), + [31] = {.entry = {.count = 1, .reusable = true}}, SHIFT(72), + [33] = {.entry = {.count = 1, .reusable = true}}, SHIFT(73), + [35] = {.entry = {.count = 1, .reusable = false}}, SHIFT(74), + [37] = {.entry = {.count = 1, .reusable = true}}, SHIFT(75), + [39] = {.entry = {.count = 1, .reusable = true}}, SHIFT(77), + [41] = {.entry = {.count = 1, .reusable = true}}, SHIFT(79), + [43] = {.entry = {.count = 1, .reusable = false}}, SHIFT(81), + [45] = {.entry = {.count = 1, .reusable = true}}, SHIFT(82), + [47] = {.entry = {.count = 1, .reusable = true}}, SHIFT(85), + [49] = {.entry = {.count = 1, .reusable = true}}, SHIFT(68), + [51] = {.entry = {.count = 1, .reusable = true}}, SHIFT(57), + [53] = {.entry = {.count = 1, .reusable = true}}, SHIFT(71), + [55] = {.entry = {.count = 1, .reusable = true}}, SHIFT(80), + [57] = {.entry = {.count = 1, .reusable = true}}, SHIFT(56), + [59] = {.entry = {.count = 1, .reusable = true}}, SHIFT(58), + [61] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), + [63] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(59), + [66] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(89), + [69] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(89), + [72] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(61), + [75] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(62), + [78] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(63), + [81] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(64), + [84] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(65), + [87] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(66), + [90] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(67), + [93] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(55), + [96] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(69), + [99] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(70), + [102] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(72), + [105] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(73), + [108] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(74), + [111] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(75), + [114] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(77), + [117] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(79), + [120] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(81), + [123] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(82), + [126] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(85), + [129] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(68), + [132] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(57), + [135] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(71), + [138] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(80), + [141] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(56), + [144] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 3), SHIFT_REPEAT(58), + [147] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1, 0, 2), + [149] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 1, 0, 1), + [151] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 1, 0, 1), + [153] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_script, 1, 0, 0), + [155] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_script, 1, 0, 0), + [157] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_bodyforms, 1, 0, 0), + [159] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_bodyforms, 1, 0, 0), + [161] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_meta, 2, 0, 0), + [163] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_meta, 2, 0, 0), + [165] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_query, 2, 0, 0), + [167] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_query, 2, 0, 0), + [169] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_headers, 2, 0, 0), + [171] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_headers, 2, 0, 0), + [173] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_authawsv4, 2, 0, 0), + [175] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_authawsv4, 2, 0, 0), + [177] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_authbasic, 2, 0, 0), + [179] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_authbasic, 2, 0, 0), + [181] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_authbearer, 2, 0, 0), + [183] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_authbearer, 2, 0, 0), + [185] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_authdigest, 2, 0, 0), + [187] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_authdigest, 2, 0, 0), + [189] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_authoauth2, 2, 0, 0), + [191] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_authoauth2, 2, 0, 0), + [193] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_body, 2, 0, 0), + [195] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_body, 2, 0, 0), + [197] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_bodyjson, 2, 0, 0), + [199] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_bodyjson, 2, 0, 0), + [201] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_bodytext, 2, 0, 0), + [203] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_bodytext, 2, 0, 0), + [205] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_bodyxml, 2, 0, 0), + [207] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_bodyxml, 2, 0, 0), + [209] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_bodysparql, 2, 0, 0), + [211] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_bodysparql, 2, 0, 0), + [213] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_bodygraphql, 2, 0, 0), + [215] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_bodygraphql, 2, 0, 0), + [217] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_bodygraphqlvars, 2, 0, 0), + [219] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_bodygraphqlvars, 2, 0, 0), + [221] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_bodyformurlencoded, 2, 0, 0), + [223] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_bodyformurlencoded, 2, 0, 0), + [225] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_bodies, 1, 0, 0), + [227] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_bodies, 1, 0, 0), + [229] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_vars, 2, 0, 0), + [231] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_vars, 2, 0, 0), + [233] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_vars_secret, 2, 0, 0), + [235] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_vars_secret, 2, 0, 0), + [237] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_varsreq, 2, 0, 0), + [239] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_varsreq, 2, 0, 0), + [241] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_varsres, 2, 0, 0), + [243] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_varsres, 2, 0, 0), + [245] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assert, 2, 0, 0), + [247] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_assert, 2, 0, 0), + [249] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_scriptreq, 2, 0, 0), + [251] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_scriptreq, 2, 0, 0), + [253] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_scriptres, 2, 0, 0), + [255] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_scriptres, 2, 0, 0), + [257] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tests, 2, 0, 0), + [259] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tests, 2, 0, 0), + [261] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_docs, 2, 0, 0), + [263] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_docs, 2, 0, 0), + [265] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_http, 2, 0, 0), + [267] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_http, 2, 0, 0), + [269] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_varsandassert, 1, 0, 0), + [271] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_varsandassert, 1, 0, 0), + [273] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_dictionary, 2, 0, 0), + [275] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_dictionary, 2, 0, 0), + [277] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_textblock, 2, 0, 0), + [279] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_textblock, 2, 0, 0), + [281] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_array, 2, 0, 0), + [283] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_array, 2, 0, 0), + [285] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_auths, 1, 0, 0), + [287] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_auths, 1, 0, 0), + [289] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assert_dictionary, 2, 0, 0), + [291] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_assert_dictionary, 2, 0, 0), + [293] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_dictionary, 3, 0, 0), + [295] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_dictionary, 3, 0, 0), + [297] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_textblock, 3, 0, 0), + [299] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_textblock, 3, 0, 0), + [301] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_array, 3, 0, 0), + [303] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_array, 3, 0, 0), + [305] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assert_dictionary, 3, 0, 0), + [307] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_assert_dictionary, 3, 0, 0), + [309] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_bodyformmultipart, 2, 0, 0), + [311] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_bodyformmultipart, 2, 0, 0), + [313] = {.entry = {.count = 1, .reusable = false}}, SHIFT(39), + [315] = {.entry = {.count = 1, .reusable = false}}, SHIFT(92), + [317] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_dictionary_repeat1, 2, 0, 0), + [319] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_dictionary_repeat1, 2, 0, 0), SHIFT_REPEAT(86), + [322] = {.entry = {.count = 1, .reusable = false}}, SHIFT(40), + [324] = {.entry = {.count = 1, .reusable = false}}, SHIFT(86), + [326] = {.entry = {.count = 1, .reusable = false}}, SHIFT(35), + [328] = {.entry = {.count = 1, .reusable = false}}, SHIFT(43), + [330] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_assert_dictionary_repeat1, 2, 0, 0), + [332] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_assert_dictionary_repeat1, 2, 0, 0), SHIFT_REPEAT(92), + [335] = {.entry = {.count = 1, .reusable = true}}, SHIFT(42), + [337] = {.entry = {.count = 1, .reusable = true}}, SHIFT(54), + [339] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_array_repeat1, 2, 0, 0), + [341] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_array_repeat1, 2, 0, 0), SHIFT_REPEAT(54), + [344] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37), + [346] = {.entry = {.count = 1, .reusable = true}}, SHIFT(78), + [348] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_array_repeat1, 1, 0, 0), + [350] = {.entry = {.count = 1, .reusable = true}}, SHIFT(76), + [352] = {.entry = {.count = 1, .reusable = true}}, SHIFT(45), + [354] = {.entry = {.count = 1, .reusable = true}}, SHIFT(48), + [356] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36), + [358] = {.entry = {.count = 1, .reusable = true}}, SHIFT(90), + [360] = {.entry = {.count = 1, .reusable = true}}, SHIFT(53), + [362] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_dictionary_pair, 3, 0, 0), + [364] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_assert_dictionary_pair, 3, 0, 0), + [366] = {.entry = {.count = 1, .reusable = true}}, SHIFT(87), + [368] = {.entry = {.count = 1, .reusable = true}}, SHIFT(83), + [370] = {.entry = {.count = 1, .reusable = true}}, SHIFT(84), + [372] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_http_verb, 1, 0, 0), + [374] = {.entry = {.count = 1, .reusable = true}}, SHIFT(41), + [376] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [378] = {.entry = {.count = 1, .reusable = true}}, SHIFT(88), +}; + +enum ts_external_scanner_symbol_identifiers { + ts_external_token_rawtext = 0, +}; + +static const TSSymbol ts_external_scanner_symbol_map[EXTERNAL_TOKEN_COUNT] = { + [ts_external_token_rawtext] = sym_rawtext, +}; + +static const bool ts_external_scanner_states[2][EXTERNAL_TOKEN_COUNT] = { + [1] = { + [ts_external_token_rawtext] = true, + }, +}; + +#ifdef __cplusplus +extern "C" { +#endif +void *tree_sitter_bruno_external_scanner_create(void); +void tree_sitter_bruno_external_scanner_destroy(void *); +bool tree_sitter_bruno_external_scanner_scan(void *, TSLexer *, const bool *); +unsigned tree_sitter_bruno_external_scanner_serialize(void *, char *); +void tree_sitter_bruno_external_scanner_deserialize(void *, const char *, unsigned); + +#ifdef TREE_SITTER_HIDE_SYMBOLS +#define TS_PUBLIC +#elif defined(_WIN32) +#define TS_PUBLIC __declspec(dllexport) +#else +#define TS_PUBLIC __attribute__((visibility("default"))) +#endif + +TS_PUBLIC const TSLanguage *tree_sitter_bruno(void) { + static const TSLanguage language = { + .version = LANGUAGE_VERSION, + .symbol_count = SYMBOL_COUNT, + .alias_count = ALIAS_COUNT, + .token_count = TOKEN_COUNT, + .external_token_count = EXTERNAL_TOKEN_COUNT, + .state_count = STATE_COUNT, + .large_state_count = LARGE_STATE_COUNT, + .production_id_count = PRODUCTION_ID_COUNT, + .field_count = FIELD_COUNT, + .max_alias_sequence_length = MAX_ALIAS_SEQUENCE_LENGTH, + .parse_table = &ts_parse_table[0][0], + .small_parse_table = ts_small_parse_table, + .small_parse_table_map = ts_small_parse_table_map, + .parse_actions = ts_parse_actions, + .symbol_names = ts_symbol_names, + .field_names = ts_field_names, + .field_map_slices = ts_field_map_slices, + .field_map_entries = ts_field_map_entries, + .symbol_metadata = ts_symbol_metadata, + .public_symbol_map = ts_symbol_map, + .alias_map = ts_non_terminal_alias_map, + .alias_sequences = &ts_alias_sequences[0][0], + .lex_modes = ts_lex_modes, + .lex_fn = ts_lex, + .external_scanner = { + &ts_external_scanner_states[0][0], + ts_external_scanner_symbol_map, + tree_sitter_bruno_external_scanner_create, + tree_sitter_bruno_external_scanner_destroy, + tree_sitter_bruno_external_scanner_scan, + tree_sitter_bruno_external_scanner_serialize, + tree_sitter_bruno_external_scanner_deserialize, + }, + .primary_state_ids = ts_primary_state_ids, + }; + return &language; +} +#ifdef __cplusplus +} +#endif diff --git a/src/scanner.c b/src/scanner.c new file mode 100644 index 0000000..0953495 --- /dev/null +++ b/src/scanner.c @@ -0,0 +1,50 @@ +#include "tree_sitter/parser.h" + +enum TokenType { + RAW_TEXT, +}; + +void *tree_sitter_bruno_external_scanner_create() { + return NULL; +} + +void tree_sitter_bruno_external_scanner_destroy(void *p) { +} + +void tree_sitter_bruno_external_scanner_reset(void *p) { +} + +unsigned tree_sitter_bruno_external_scanner_serialize(void *p, char *buffer) { + return 0; +} + +void tree_sitter_bruno_external_scanner_deserialize(void *p, const char *b, unsigned n) { +} + +static void advance(TSLexer *lexer) { + lexer->advance(lexer, false); +} + +bool tree_sitter_bruno_external_scanner_scan(void *payload, TSLexer *lexer, const bool *valid_symbols) { + if (valid_symbols[RAW_TEXT]) { + // Scanning raw text follows the rules of the official Bruno language grammar + // (refer to https://github.com/usebruno/bruno/blob/main/packages/bruno-lang/v2/src/bruToJson.js). + // A raw text block ends if a closing angle bracket is found right after a newline. + + lexer->result_symbol = RAW_TEXT; + for (bool has_content = false;; has_content = true) { + lexer->mark_end(lexer); + + switch (lexer->lookahead) { + case '\n': + advance(lexer); + if (lexer->lookahead == '}') return has_content; + break; + case '\0': return false; + default: advance(lexer); + } + } + } + + return false; +} diff --git a/src/tree_sitter/alloc.h b/src/tree_sitter/alloc.h new file mode 100644 index 0000000..1abdd12 --- /dev/null +++ b/src/tree_sitter/alloc.h @@ -0,0 +1,54 @@ +#ifndef TREE_SITTER_ALLOC_H_ +#define TREE_SITTER_ALLOC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +// Allow clients to override allocation functions +#ifdef TREE_SITTER_REUSE_ALLOCATOR + +extern void *(*ts_current_malloc)(size_t size); +extern void *(*ts_current_calloc)(size_t count, size_t size); +extern void *(*ts_current_realloc)(void *ptr, size_t size); +extern void (*ts_current_free)(void *ptr); + +#ifndef ts_malloc +#define ts_malloc ts_current_malloc +#endif +#ifndef ts_calloc +#define ts_calloc ts_current_calloc +#endif +#ifndef ts_realloc +#define ts_realloc ts_current_realloc +#endif +#ifndef ts_free +#define ts_free ts_current_free +#endif + +#else + +#ifndef ts_malloc +#define ts_malloc malloc +#endif +#ifndef ts_calloc +#define ts_calloc calloc +#endif +#ifndef ts_realloc +#define ts_realloc realloc +#endif +#ifndef ts_free +#define ts_free free +#endif + +#endif + +#ifdef __cplusplus +} +#endif + +#endif // TREE_SITTER_ALLOC_H_ diff --git a/src/tree_sitter/array.h b/src/tree_sitter/array.h new file mode 100644 index 0000000..15a3b23 --- /dev/null +++ b/src/tree_sitter/array.h @@ -0,0 +1,290 @@ +#ifndef TREE_SITTER_ARRAY_H_ +#define TREE_SITTER_ARRAY_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "./alloc.h" + +#include +#include +#include +#include +#include + +#ifdef _MSC_VER +#pragma warning(disable : 4101) +#elif defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#endif + +#define Array(T) \ + struct { \ + T *contents; \ + uint32_t size; \ + uint32_t capacity; \ + } + +/// Initialize an array. +#define array_init(self) \ + ((self)->size = 0, (self)->capacity = 0, (self)->contents = NULL) + +/// Create an empty array. +#define array_new() \ + { NULL, 0, 0 } + +/// Get a pointer to the element at a given `index` in the array. +#define array_get(self, _index) \ + (assert((uint32_t)(_index) < (self)->size), &(self)->contents[_index]) + +/// Get a pointer to the first element in the array. +#define array_front(self) array_get(self, 0) + +/// Get a pointer to the last element in the array. +#define array_back(self) array_get(self, (self)->size - 1) + +/// Clear the array, setting its size to zero. Note that this does not free any +/// memory allocated for the array's contents. +#define array_clear(self) ((self)->size = 0) + +/// Reserve `new_capacity` elements of space in the array. If `new_capacity` is +/// less than the array's current capacity, this function has no effect. +#define array_reserve(self, new_capacity) \ + _array__reserve((Array *)(self), array_elem_size(self), new_capacity) + +/// Free any memory allocated for this array. Note that this does not free any +/// memory allocated for the array's contents. +#define array_delete(self) _array__delete((Array *)(self)) + +/// Push a new `element` onto the end of the array. +#define array_push(self, element) \ + (_array__grow((Array *)(self), 1, array_elem_size(self)), \ + (self)->contents[(self)->size++] = (element)) + +/// Increase the array's size by `count` elements. +/// New elements are zero-initialized. +#define array_grow_by(self, count) \ + do { \ + if ((count) == 0) break; \ + _array__grow((Array *)(self), count, array_elem_size(self)); \ + memset((self)->contents + (self)->size, 0, (count) * array_elem_size(self)); \ + (self)->size += (count); \ + } while (0) + +/// Append all elements from one array to the end of another. +#define array_push_all(self, other) \ + array_extend((self), (other)->size, (other)->contents) + +/// Append `count` elements to the end of the array, reading their values from the +/// `contents` pointer. +#define array_extend(self, count, contents) \ + _array__splice( \ + (Array *)(self), array_elem_size(self), (self)->size, \ + 0, count, contents \ + ) + +/// Remove `old_count` elements from the array starting at the given `index`. At +/// the same index, insert `new_count` new elements, reading their values from the +/// `new_contents` pointer. +#define array_splice(self, _index, old_count, new_count, new_contents) \ + _array__splice( \ + (Array *)(self), array_elem_size(self), _index, \ + old_count, new_count, new_contents \ + ) + +/// Insert one `element` into the array at the given `index`. +#define array_insert(self, _index, element) \ + _array__splice((Array *)(self), array_elem_size(self), _index, 0, 1, &(element)) + +/// Remove one element from the array at the given `index`. +#define array_erase(self, _index) \ + _array__erase((Array *)(self), array_elem_size(self), _index) + +/// Pop the last element off the array, returning the element by value. +#define array_pop(self) ((self)->contents[--(self)->size]) + +/// Assign the contents of one array to another, reallocating if necessary. +#define array_assign(self, other) \ + _array__assign((Array *)(self), (const Array *)(other), array_elem_size(self)) + +/// Swap one array with another +#define array_swap(self, other) \ + _array__swap((Array *)(self), (Array *)(other)) + +/// Get the size of the array contents +#define array_elem_size(self) (sizeof *(self)->contents) + +/// Search a sorted array for a given `needle` value, using the given `compare` +/// callback to determine the order. +/// +/// If an existing element is found to be equal to `needle`, then the `index` +/// out-parameter is set to the existing value's index, and the `exists` +/// out-parameter is set to true. Otherwise, `index` is set to an index where +/// `needle` should be inserted in order to preserve the sorting, and `exists` +/// is set to false. +#define array_search_sorted_with(self, compare, needle, _index, _exists) \ + _array__search_sorted(self, 0, compare, , needle, _index, _exists) + +/// Search a sorted array for a given `needle` value, using integer comparisons +/// of a given struct field (specified with a leading dot) to determine the order. +/// +/// See also `array_search_sorted_with`. +#define array_search_sorted_by(self, field, needle, _index, _exists) \ + _array__search_sorted(self, 0, _compare_int, field, needle, _index, _exists) + +/// Insert a given `value` into a sorted array, using the given `compare` +/// callback to determine the order. +#define array_insert_sorted_with(self, compare, value) \ + do { \ + unsigned _index, _exists; \ + array_search_sorted_with(self, compare, &(value), &_index, &_exists); \ + if (!_exists) array_insert(self, _index, value); \ + } while (0) + +/// Insert a given `value` into a sorted array, using integer comparisons of +/// a given struct field (specified with a leading dot) to determine the order. +/// +/// See also `array_search_sorted_by`. +#define array_insert_sorted_by(self, field, value) \ + do { \ + unsigned _index, _exists; \ + array_search_sorted_by(self, field, (value) field, &_index, &_exists); \ + if (!_exists) array_insert(self, _index, value); \ + } while (0) + +// Private + +typedef Array(void) Array; + +/// This is not what you're looking for, see `array_delete`. +static inline void _array__delete(Array *self) { + if (self->contents) { + ts_free(self->contents); + self->contents = NULL; + self->size = 0; + self->capacity = 0; + } +} + +/// This is not what you're looking for, see `array_erase`. +static inline void _array__erase(Array *self, size_t element_size, + uint32_t index) { + assert(index < self->size); + char *contents = (char *)self->contents; + memmove(contents + index * element_size, contents + (index + 1) * element_size, + (self->size - index - 1) * element_size); + self->size--; +} + +/// This is not what you're looking for, see `array_reserve`. +static inline void _array__reserve(Array *self, size_t element_size, uint32_t new_capacity) { + if (new_capacity > self->capacity) { + if (self->contents) { + self->contents = ts_realloc(self->contents, new_capacity * element_size); + } else { + self->contents = ts_malloc(new_capacity * element_size); + } + self->capacity = new_capacity; + } +} + +/// This is not what you're looking for, see `array_assign`. +static inline void _array__assign(Array *self, const Array *other, size_t element_size) { + _array__reserve(self, element_size, other->size); + self->size = other->size; + memcpy(self->contents, other->contents, self->size * element_size); +} + +/// This is not what you're looking for, see `array_swap`. +static inline void _array__swap(Array *self, Array *other) { + Array swap = *other; + *other = *self; + *self = swap; +} + +/// This is not what you're looking for, see `array_push` or `array_grow_by`. +static inline void _array__grow(Array *self, uint32_t count, size_t element_size) { + uint32_t new_size = self->size + count; + if (new_size > self->capacity) { + uint32_t new_capacity = self->capacity * 2; + if (new_capacity < 8) new_capacity = 8; + if (new_capacity < new_size) new_capacity = new_size; + _array__reserve(self, element_size, new_capacity); + } +} + +/// This is not what you're looking for, see `array_splice`. +static inline void _array__splice(Array *self, size_t element_size, + uint32_t index, uint32_t old_count, + uint32_t new_count, const void *elements) { + uint32_t new_size = self->size + new_count - old_count; + uint32_t old_end = index + old_count; + uint32_t new_end = index + new_count; + assert(old_end <= self->size); + + _array__reserve(self, element_size, new_size); + + char *contents = (char *)self->contents; + if (self->size > old_end) { + memmove( + contents + new_end * element_size, + contents + old_end * element_size, + (self->size - old_end) * element_size + ); + } + if (new_count > 0) { + if (elements) { + memcpy( + (contents + index * element_size), + elements, + new_count * element_size + ); + } else { + memset( + (contents + index * element_size), + 0, + new_count * element_size + ); + } + } + self->size += new_count - old_count; +} + +/// A binary search routine, based on Rust's `std::slice::binary_search_by`. +/// This is not what you're looking for, see `array_search_sorted_with` or `array_search_sorted_by`. +#define _array__search_sorted(self, start, compare, suffix, needle, _index, _exists) \ + do { \ + *(_index) = start; \ + *(_exists) = false; \ + uint32_t size = (self)->size - *(_index); \ + if (size == 0) break; \ + int comparison; \ + while (size > 1) { \ + uint32_t half_size = size / 2; \ + uint32_t mid_index = *(_index) + half_size; \ + comparison = compare(&((self)->contents[mid_index] suffix), (needle)); \ + if (comparison <= 0) *(_index) = mid_index; \ + size -= half_size; \ + } \ + comparison = compare(&((self)->contents[*(_index)] suffix), (needle)); \ + if (comparison == 0) *(_exists) = true; \ + else if (comparison < 0) *(_index) += 1; \ + } while (0) + +/// Helper macro for the `_sorted_by` routines below. This takes the left (existing) +/// parameter by reference in order to work with the generic sorting function above. +#define _compare_int(a, b) ((int)*(a) - (int)(b)) + +#ifdef _MSC_VER +#pragma warning(default : 4101) +#elif defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic pop +#endif + +#ifdef __cplusplus +} +#endif + +#endif // TREE_SITTER_ARRAY_H_ diff --git a/src/tree_sitter/parser.h b/src/tree_sitter/parser.h new file mode 100644 index 0000000..799f599 --- /dev/null +++ b/src/tree_sitter/parser.h @@ -0,0 +1,266 @@ +#ifndef TREE_SITTER_PARSER_H_ +#define TREE_SITTER_PARSER_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +#define ts_builtin_sym_error ((TSSymbol)-1) +#define ts_builtin_sym_end 0 +#define TREE_SITTER_SERIALIZATION_BUFFER_SIZE 1024 + +#ifndef TREE_SITTER_API_H_ +typedef uint16_t TSStateId; +typedef uint16_t TSSymbol; +typedef uint16_t TSFieldId; +typedef struct TSLanguage TSLanguage; +#endif + +typedef struct { + TSFieldId field_id; + uint8_t child_index; + bool inherited; +} TSFieldMapEntry; + +typedef struct { + uint16_t index; + uint16_t length; +} TSFieldMapSlice; + +typedef struct { + bool visible; + bool named; + bool supertype; +} TSSymbolMetadata; + +typedef struct TSLexer TSLexer; + +struct TSLexer { + int32_t lookahead; + TSSymbol result_symbol; + void (*advance)(TSLexer *, bool); + void (*mark_end)(TSLexer *); + uint32_t (*get_column)(TSLexer *); + bool (*is_at_included_range_start)(const TSLexer *); + bool (*eof)(const TSLexer *); + void (*log)(const TSLexer *, const char *, ...); +}; + +typedef enum { + TSParseActionTypeShift, + TSParseActionTypeReduce, + TSParseActionTypeAccept, + TSParseActionTypeRecover, +} TSParseActionType; + +typedef union { + struct { + uint8_t type; + TSStateId state; + bool extra; + bool repetition; + } shift; + struct { + uint8_t type; + uint8_t child_count; + TSSymbol symbol; + int16_t dynamic_precedence; + uint16_t production_id; + } reduce; + uint8_t type; +} TSParseAction; + +typedef struct { + uint16_t lex_state; + uint16_t external_lex_state; +} TSLexMode; + +typedef union { + TSParseAction action; + struct { + uint8_t count; + bool reusable; + } entry; +} TSParseActionEntry; + +typedef struct { + int32_t start; + int32_t end; +} TSCharacterRange; + +struct TSLanguage { + uint32_t version; + uint32_t symbol_count; + uint32_t alias_count; + uint32_t token_count; + uint32_t external_token_count; + uint32_t state_count; + uint32_t large_state_count; + uint32_t production_id_count; + uint32_t field_count; + uint16_t max_alias_sequence_length; + const uint16_t *parse_table; + const uint16_t *small_parse_table; + const uint32_t *small_parse_table_map; + const TSParseActionEntry *parse_actions; + const char * const *symbol_names; + const char * const *field_names; + const TSFieldMapSlice *field_map_slices; + const TSFieldMapEntry *field_map_entries; + const TSSymbolMetadata *symbol_metadata; + const TSSymbol *public_symbol_map; + const uint16_t *alias_map; + const TSSymbol *alias_sequences; + const TSLexMode *lex_modes; + bool (*lex_fn)(TSLexer *, TSStateId); + bool (*keyword_lex_fn)(TSLexer *, TSStateId); + TSSymbol keyword_capture_token; + struct { + const bool *states; + const TSSymbol *symbol_map; + void *(*create)(void); + void (*destroy)(void *); + bool (*scan)(void *, TSLexer *, const bool *symbol_whitelist); + unsigned (*serialize)(void *, char *); + void (*deserialize)(void *, const char *, unsigned); + } external_scanner; + const TSStateId *primary_state_ids; +}; + +static inline bool set_contains(TSCharacterRange *ranges, uint32_t len, int32_t lookahead) { + uint32_t index = 0; + uint32_t size = len - index; + while (size > 1) { + uint32_t half_size = size / 2; + uint32_t mid_index = index + half_size; + TSCharacterRange *range = &ranges[mid_index]; + if (lookahead >= range->start && lookahead <= range->end) { + return true; + } else if (lookahead > range->end) { + index = mid_index; + } + size -= half_size; + } + TSCharacterRange *range = &ranges[index]; + return (lookahead >= range->start && lookahead <= range->end); +} + +/* + * Lexer Macros + */ + +#ifdef _MSC_VER +#define UNUSED __pragma(warning(suppress : 4101)) +#else +#define UNUSED __attribute__((unused)) +#endif + +#define START_LEXER() \ + bool result = false; \ + bool skip = false; \ + UNUSED \ + bool eof = false; \ + int32_t lookahead; \ + goto start; \ + next_state: \ + lexer->advance(lexer, skip); \ + start: \ + skip = false; \ + lookahead = lexer->lookahead; + +#define ADVANCE(state_value) \ + { \ + state = state_value; \ + goto next_state; \ + } + +#define ADVANCE_MAP(...) \ + { \ + static const uint16_t map[] = { __VA_ARGS__ }; \ + for (uint32_t i = 0; i < sizeof(map) / sizeof(map[0]); i += 2) { \ + if (map[i] == lookahead) { \ + state = map[i + 1]; \ + goto next_state; \ + } \ + } \ + } + +#define SKIP(state_value) \ + { \ + skip = true; \ + state = state_value; \ + goto next_state; \ + } + +#define ACCEPT_TOKEN(symbol_value) \ + result = true; \ + lexer->result_symbol = symbol_value; \ + lexer->mark_end(lexer); + +#define END_STATE() return result; + +/* + * Parse Table Macros + */ + +#define SMALL_STATE(id) ((id) - LARGE_STATE_COUNT) + +#define STATE(id) id + +#define ACTIONS(id) id + +#define SHIFT(state_value) \ + {{ \ + .shift = { \ + .type = TSParseActionTypeShift, \ + .state = (state_value) \ + } \ + }} + +#define SHIFT_REPEAT(state_value) \ + {{ \ + .shift = { \ + .type = TSParseActionTypeShift, \ + .state = (state_value), \ + .repetition = true \ + } \ + }} + +#define SHIFT_EXTRA() \ + {{ \ + .shift = { \ + .type = TSParseActionTypeShift, \ + .extra = true \ + } \ + }} + +#define REDUCE(symbol_name, children, precedence, prod_id) \ + {{ \ + .reduce = { \ + .type = TSParseActionTypeReduce, \ + .symbol = symbol_name, \ + .child_count = children, \ + .dynamic_precedence = precedence, \ + .production_id = prod_id \ + }, \ + }} + +#define RECOVER() \ + {{ \ + .type = TSParseActionTypeRecover \ + }} + +#define ACCEPT_INPUT() \ + {{ \ + .type = TSParseActionTypeAccept \ + }} + +#ifdef __cplusplus +} +#endif + +#endif // TREE_SITTER_PARSER_H_ diff --git a/test/corpus/assert.txt b/test/corpus/assert.txt new file mode 100644 index 0000000..3319422 --- /dev/null +++ b/test/corpus/assert.txt @@ -0,0 +1,47 @@ +======================= +Assert res.status = 200 +======================= + +assert { + res.status: eq 200 +} + +--- + +(source_file + (varsandassert + (assert + (keyword) + (assert_dictionary + (assert_dictionary_pair + (assert_key) + (value) + ) + ) + ) + ) +) + +======================= +Assert with empty value +======================= + +assert { + res.status: +} + +--- + +(source_file + (varsandassert + (assert + (keyword) + (assert_dictionary + (assert_dictionary_pair + (assert_key) + (value) + ) + ) + ) + ) +) diff --git a/test/corpus/auth.txt b/test/corpus/auth.txt new file mode 100644 index 0000000..e5d1a13 --- /dev/null +++ b/test/corpus/auth.txt @@ -0,0 +1,57 @@ +=========== +Auth Oauth2 +=========== + +auth:oauth2 { + grant_type: authorization_code + scope: read write +} + +--- + +(source_file + (auths + (authoauth2 + (keyword) + (dictionary + (dictionary_pair + (key) + (value) + ) + (dictionary_pair + (key) + (value) + ) + ) + ) + ) +) + +=========================================== +Auth Basic with empty username and password +=========================================== + +auth:basic { + username: + password: +} + +--- + +(source_file + (auths + (authbasic + (keyword) + (dictionary + (dictionary_pair + (key) + (value) + ) + (dictionary_pair + (key) + (value) + ) + ) + ) + ) +) diff --git a/test/corpus/body.txt b/test/corpus/body.txt new file mode 100644 index 0000000..854418b --- /dev/null +++ b/test/corpus/body.txt @@ -0,0 +1,192 @@ +========== +JSON Body +========== + +body:json { + { + "apiKey": "secret", + "numbers": "9988776655", + "message": "Woof! lets play with some apis" + } +} + +--- + +(source_file + (bodies + (bodyjson + (keyword) + (textblock + (rawtext) + ) + ) + ) +) + +========== +Text Body +========== + +body:text { + This is a text body +} + +--- + +(source_file + (bodies + (bodytext + (keyword) + (textblock + (rawtext) + ) + ) + ) +) + +========= +XML Body +========= + +body:xml { + + John + 30 + +} + +--- + +(source_file + (bodies + (bodyxml + (keyword) + (textblock + (rawtext) + ) + ) + ) +) + +============= +GraphQL Body +============= + +body:graphql { + { + launchesPast { + launch_site { + site_name + } + launch_success + } + } +} + +--- + +(source_file + (bodies + (bodygraphql + (keyword) + (textblock + (rawtext) + ) + ) + ) +) + +================== +GraphQL Vars Body +================== + +body:graphql:vars { + { + "limit": 5 + } +} + +--- + +(source_file + (bodies + (bodygraphqlvars + (keyword) + (textblock + (rawtext) + ) + ) + ) +) + +===================== +Form URLEncoded Body +===================== + +body:form-urlencoded { + apikey: secret + numbers: +91998877665 + ~message: hello +} + +--- + +(source_file + (bodies + (bodyforms + (bodyformurlencoded + (keyword) + (dictionary + (dictionary_pair + (key) + (value) + ) + (dictionary_pair + (key) + (value) + ) + (dictionary_pair + (key) + (value) + ) + ) + ) + ) + ) +) + +===================== +Form Multipart Body +===================== + +body:multipart-form { + apikey: secret + numbers: +91998877665 + ~message: hello +} + +--- + +(source_file + (bodies + (bodyforms + (bodyformmultipart + (keyword) + (dictionary + (dictionary_pair + (key) + (value) + ) + (dictionary_pair + (key) + (value) + ) + (dictionary_pair + (key) + (value) + ) + ) + ) + ) + ) +) diff --git a/test/corpus/bruno.txt b/test/corpus/bruno.txt new file mode 100644 index 0000000..c3eab3f --- /dev/null +++ b/test/corpus/bruno.txt @@ -0,0 +1,31 @@ +================ +META Tag +================ + +meta { + name: Get users + type: http + seq: 1 +} + +--- + +(source_file + tag: (meta + (keyword) + (dictionary + (dictionary_pair + (key) + (value) + ) + (dictionary_pair + (key) + (value) + ) + (dictionary_pair + (key) + (value) + ) + ) + ) +) diff --git a/test/corpus/methods.txt b/test/corpus/methods.txt new file mode 100644 index 0000000..0949a64 --- /dev/null +++ b/test/corpus/methods.txt @@ -0,0 +1,239 @@ +===================== +Query Parameters Tag +===================== + +query { + apiKey: secret + numbers: 9988776655 + message: hello +} + +--- + +(source_file + tag: (query + (keyword) + (dictionary + (dictionary_pair + (key) + (value) + ) + (dictionary_pair + (key) + (value) + ) + (dictionary_pair + (key) + (value) + ) + ) + ) +) + +============ +Headers Tag +============ + +headers { + content-type: application/json + Authorization: Bearer topsecret +} + +--- + +(source_file + tag: (headers + (keyword) + (dictionary + (dictionary_pair + (key) + (value) + ) + (dictionary_pair + (key) + (value) + ) + ) + ) +) + +=============== +GET Method Tag +=============== + +get { + url: https://github.com/Scalamando/tree-sitter-bruno + body: JSON +} + +--- + +(source_file + tag: (http + (keyword) + (dictionary + (dictionary_pair + (key) + (value) + ) + (dictionary_pair + (key) + (value) + ) + ) + ) +) + +================ +POST Method Tag +================ + +post { + url: https://api.github.com/users/usebruno +} + +--- + +(source_file + tag: (http + (keyword) + (dictionary + (dictionary_pair + (key) + (value) + ) + ) + ) +) + +=============== +PUT Method Tag +=============== + +put { + url: https://api.github.com/users/usebruno +} + +--- + +(source_file + tag: (http + (keyword) + (dictionary + (dictionary_pair + (key) + (value) + ) + ) + ) +) + +================== +DELETE Method Tag +================== + +delete { + url: https://api.github.com/users/usebruno +} + +--- + +(source_file + tag: (http + (keyword) + (dictionary + (dictionary_pair + (key) + (value) + ) + ) + ) +) + +=================== +OPTIONS Method Tag +=================== + +options { + url: https://api.github.com/users/usebruno +} + +--- + +(source_file + tag: (http + (keyword) + (dictionary + (dictionary_pair + (key) + (value) + ) + ) + ) +) + +================= +TRACE Method Tag +================= + +trace { + url: https://api.github.com/users/usebruno +} + +--- + +(source_file + tag: (http + (keyword) + (dictionary + (dictionary_pair + (key) + (value) + ) + ) + ) +) + +=================== +CONNECT Method Tag +=================== + +connect { + url: https://api.github.com/users/usebruno +} + +--- + +(source_file + tag: (http + (keyword) + (dictionary + (dictionary_pair + (key) + (value) + ) + ) + ) +) + +================ +HEAD Method Tag +================ + +head { + url: https://api.github.com/users/usebruno +} + +--- + +(source_file + tag: (http + (keyword) + (dictionary + (dictionary_pair + (key) + (value) + ) + ) + ) +) diff --git a/test/corpus/real.txt b/test/corpus/real.txt new file mode 100644 index 0000000..2ec7a25 --- /dev/null +++ b/test/corpus/real.txt @@ -0,0 +1,197 @@ +================= +GET with headers +================= + +get { + url: https://api.textlocal.in/send?apiKey=secret&numbers=9988776655&message=hello +} + +headers { + content-type: application/json + Authorization: Bearer topsecret +} + +--- + +(source_file + tag: (http + (keyword) + (dictionary + (dictionary_pair + (key) + (value) + ) + ) + ) + tag: (headers + (keyword) + (dictionary + (dictionary_pair + (key) + (value) + ) + (dictionary_pair + (key) + (value) + ) + ) + ) +) + +=============== +POST with body +=============== + +post { + url: https://api.textlocal.in/send +} + +body { + { + "apiKey": "secret", + "numbers": "9988776655", + "message": "Woof! lets play with some apis" + } +} + +headers { + content-type: application/json + Authorization: Bearer topsecret +} + +--- + +(source_file + tag: (http + (keyword) + (dictionary + (dictionary_pair + (key) + (value) + ) + ) + ) + tag: (bodies + (body + (keyword) + (textblock + (rawtext) + ) + ) + ) + tag: (headers + (keyword) + (dictionary + (dictionary_pair + (key) + (value) + ) + (dictionary_pair + (key) + (value) + ) + ) + ) +) + +========== +Scripting +========== + +post { + url: https://api.textlocal.in/login +} + +body { + { + "username": "johnnash", + "password": "governingdynamics" + } +} + +script:post-response { + bru.setVar("token", res.body.token); +} + +--- + +(source_file + tag: (http + (keyword) + (dictionary + (dictionary_pair + (key) + (value) + ) + ) + ) + tag: (bodies + (body + (keyword) + (textblock + (rawtext) + ) + ) + ) + tag: (script + (scriptres + (keyword) + (textblock + (rawtext) + ) + ) + ) +) + +======== +Testing +======== + +post { + url: https://api.textlocal.in/login +} + +body { + { + "username": "johnnash", + "password": "governingdynamics" + } +} + +tests { + test("should be able to login", function() { + expect(res.status).to.equal(201); + }); + + test("should receive the token", function() { + expect(res.body.token).to.be.a('string'); + }); +} + +--- + +(source_file + tag: (http + (keyword) + (dictionary + (dictionary_pair + (key) + (value) + ) + ) + ) + tag: (bodies + (body + (keyword) + (textblock + (rawtext) + ) + ) + ) + tag: (tests + (keyword) + (textblock + (rawtext) + ) + ) +) diff --git a/test/corpus/scripts.txt b/test/corpus/scripts.txt new file mode 100644 index 0000000..49bc8df --- /dev/null +++ b/test/corpus/scripts.txt @@ -0,0 +1,60 @@ +======================== +Script Pre-Request Tags +======================== + +script:pre-request { + req.setHeader("Authorization", "{{token}}"); +} + +--- + +(source_file + tag: (script + (scriptreq + (keyword) + (textblock + (rawtext) + ) + ) + ) +) + +======================== +Script Post-Response Tags +======================== + +script:post-response { + bru.setVar("token", res.body.token); +} + +--- + +(source_file + tag: (script + (scriptres + (keyword) + (textblock + (rawtext) + ) + ) + ) +) + +======================== +Test Tags +======================== + +tests { + expect(res.status).to.equal(200); +} + +--- + +(source_file + tag: (tests + (keyword) + (textblock + (rawtext) + ) + ) +) diff --git a/tree-sitter.json b/tree-sitter.json new file mode 100644 index 0000000..e9d6b1b --- /dev/null +++ b/tree-sitter.json @@ -0,0 +1,43 @@ +{ + "grammars": [ + { + "name": "bruno", + "camelcase": "Bruno", + "scope": "source.bruno", + "path": ".", + "file-types": [ + "bru" + ], + "injection-regex": "^bruno$", + "highlights": [ + "queries/highlights.scm" + ], + "injections": [ + "queries/injections.scm" + ] + } + ], + "metadata": { + "version": "0.1.0", + "license": "MIT", + "description": " Bruno grammar for tree-sitter", + "authors": [ + { + "name": "Kristofers Solo", + "email": "dev@kristofers.xyz" + } + ], + "links": { + "repository": "https://github.com/kristoferssolo/tree-sitter-bruno" + } + }, + "bindings": { + "c": true, + "go": true, + "node": true, + "python": true, + "rust": true, + "swift": true + } +} +