chore: update packages

This commit is contained in:
2026-03-11 14:53:19 +02:00
parent 347e99f256
commit 356820577e
43 changed files with 207 additions and 8649 deletions

View File

@@ -41,3 +41,6 @@ indent_size = 8
[parser.c]
indent_size = 2
[{alloc,array,parser}.h]
indent_size = 2

39
.gitattributes vendored
View File

@@ -1,13 +1,42 @@
* text=auto eol=lf
# Generated source files
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
# C bindings
bindings/c/** linguist-generated
CMakeLists.txt linguist-generated
Package.swift linguist-generated
Makefile linguist-generated
# Rust bindings
bindings/rust/* linguist-generated
Cargo.toml linguist-generated
Cargo.lock linguist-generated
# Node.js bindings
bindings/node/* linguist-generated
binding.gyp linguist-generated
package.json linguist-generated
package-lock.json linguist-generated
# Python bindings
bindings/python/** linguist-generated
setup.py linguist-generated
pyproject.toml linguist-generated
# Go bindings
bindings/go/* linguist-generated
go.mod linguist-generated
go.sum linguist-generated
# Swift bindings
bindings/swift/** linguist-generated
Package.swift linguist-generated
Package.resolved linguist-generated
# Zig bindings
bindings/zig/* linguist-generated
build.zig linguist-generated
build.zig.zon linguist-generated

10
.gitignore vendored
View File

@@ -1,13 +1,16 @@
# Rust artifacts
target/
Cargo.lock
# Node artifacts
build/
prebuilds/
node_modules/
package-lock.json
# Swift artifacts
.build/
Package.resolved
# Go artifacts
_obj/
@@ -25,6 +28,13 @@ dist/
*.dylib
*.dll
*.pc
*.exp
*.lib
# Zig artifacts
.zig-cache/
zig-cache/
zig-out/
# Example dirs
/examples/*/

32
CMakeLists.txt generated
View File

@@ -2,19 +2,21 @@ 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"
DESCRIPTION "Bruno grammar for tree-sitter"
HOMEPAGE_URL "https://codeberg.org/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")
set(TREE_SITTER_ABI_VERSION 15 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()
include(GNUInstallDirs)
find_program(TREE_SITTER_CLI tree-sitter DOC "Tree-sitter CLI")
add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/src/parser.c"
@@ -25,10 +27,13 @@ add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/src/parser.c"
COMMENT "Generating parser.c")
add_library(tree-sitter-bruno src/parser.c)
if(EXISTS src/scanner.c)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/scanner.c)
target_sources(tree-sitter-bruno PRIVATE src/scanner.c)
endif()
target_include_directories(tree-sitter-bruno PRIVATE src)
target_include_directories(tree-sitter-bruno
PRIVATE src
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/bindings/c>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_compile_definitions(tree-sitter-bruno PRIVATE
$<$<BOOL:${TREE_SITTER_REUSE_ALLOCATOR}>:TREE_SITTER_REUSE_ALLOCATOR>
@@ -44,17 +49,18 @@ set_target_properties(tree-sitter-bruno
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(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bindings/c/tree_sitter"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
FILES_MATCHING PATTERN "*.h")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tree-sitter-bruno.pc"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig")
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
install(TARGETS tree-sitter-bruno
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
add_custom_target(test "${TREE_SITTER_CLI}" test
file(GLOB QUERIES queries/*.scm)
install(FILES ${QUERIES}
DESTINATION "${CMAKE_INSTALL_DATADIR}/tree-sitter/queries/bruno")
add_custom_target(ts-test "${TREE_SITTER_CLI}" test
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMENT "tree-sitter test")
# vim:ft=cmake:

96
Cargo.lock generated
View File

@@ -1,96 +0,0 @@
# 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"

19
Cargo.toml generated
View File

@@ -1,18 +1,25 @@
[package]
name = "tree-sitter-bruno"
description = " Bruno grammar for tree-sitter"
description = "Bruno grammar for tree-sitter"
version = "0.1.0"
authors = ["Kristofers Solo <dev@kristofers.xyz>"]
license = "MIT"
readme = "README.md"
keywords = ["incremental", "parsing", "tree-sitter", "bruno"]
categories = ["parsing", "text-editors"]
repository = "https://github.com/kristoferssolo/tree-sitter-bruno"
categories = ["parser-implementations", "parsing", "text-editors"]
repository = "https://codeberg.org/kristoferssolo/tree-sitter-bruno"
edition = "2021"
autoexamples = false
build = "bindings/rust/build.rs"
include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*"]
include = [
"bindings/rust/*",
"grammar.js",
"queries/*",
"src/*",
"tree-sitter.json",
"/LICENSE",
]
[lib]
path = "bindings/rust/lib.rs"
@@ -21,7 +28,7 @@ path = "bindings/rust/lib.rs"
tree-sitter-language = "0.1"
[build-dependencies]
cc = "1.1.22"
cc = "1.2"
[dev-dependencies]
tree-sitter = "0.24.3"
tree-sitter = "0.25.10"

11
Makefile generated
View File

@@ -3,7 +3,7 @@ $(error Windows is not supported)
endif
LANGUAGE_NAME := tree-sitter-bruno
HOMEPAGE_URL := https://github.com/kristoferssolo/tree-sitter-bruno
HOMEPAGE_URL := https://codeberg.org/kristoferssolo/tree-sitter-bruno
VERSION := 0.1.0
# repository
@@ -13,6 +13,7 @@ TS ?= tree-sitter
# install directory layout
PREFIX ?= /usr/local
DATADIR ?= $(PREFIX)/share
INCLUDEDIR ?= $(PREFIX)/include
LIBDIR ?= $(PREFIX)/lib
PCLIBDIR ?= $(LIBDIR)/pkgconfig
@@ -69,13 +70,16 @@ $(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 -d '$(DESTDIR)$(DATADIR)'/tree-sitter/queries/bruno '$(DESTDIR)$(INCLUDEDIR)'/tree_sitter '$(DESTDIR)$(PCLIBDIR)' '$(DESTDIR)$(LIBDIR)'
install -m644 bindings/c/tree_sitter/$(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)
ifneq ($(wildcard queries/*.scm),)
install -m644 queries/*.scm '$(DESTDIR)$(DATADIR)'/tree-sitter/queries/bruno
endif
uninstall:
$(RM) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).a \
@@ -84,6 +88,7 @@ uninstall:
'$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXT) \
'$(DESTDIR)$(INCLUDEDIR)'/tree_sitter/$(LANGUAGE_NAME).h \
'$(DESTDIR)$(PCLIBDIR)'/$(LANGUAGE_NAME).pc
$(RM) -r '$(DESTDIR)$(DATADIR)'/tree-sitter/queries/bruno
clean:
$(RM) $(OBJS) $(LANGUAGE_NAME).pc lib$(LANGUAGE_NAME).a lib$(LANGUAGE_NAME).$(SOEXT)

14
Package.swift generated
View File

@@ -1,23 +1,27 @@
// swift-tools-version:5.3
import Foundation
import PackageDescription
var sources = ["src/parser.c"]
if FileManager.default.fileExists(atPath: "src/scanner.c") {
sources.append("src/scanner.c")
}
let package = Package(
name: "TreeSitterBruno",
products: [
.library(name: "TreeSitterBruno", targets: ["TreeSitterBruno"]),
],
dependencies: [
.package(url: "https://github.com/ChimeHQ/SwiftTreeSitter", from: "0.8.0"),
.package(name: "SwiftTreeSitter", url: "https://github.com/tree-sitter/swift-tree-sitter", from: "0.9.0"),
],
targets: [
.target(
name: "TreeSitterBruno",
dependencies: [],
path: ".",
sources: [
"src/parser.c",
"src/scanner.c",
],
sources: sources,
resources: [
.copy("queries")
],

7
binding.gyp generated
View File

@@ -11,9 +11,14 @@
"sources": [
"bindings/node/binding.cc",
"src/parser.c",
"src/scanner.c",
],
"variables": {
"has_scanner": "<!(node -p \"fs.existsSync('src/scanner.c')\")"
},
"conditions": [
["has_scanner=='true'", {
"sources+": ["src/scanner.c"],
}],
["OS!='win'", {
"cflags_c": [
"-std=c11",

View File

@@ -6,6 +6,5 @@ Name: tree-sitter-bruno
Description: @PROJECT_DESCRIPTION@
URL: @PROJECT_HOMEPAGE_URL@
Version: @PROJECT_VERSION@
Requires: @TS_REQUIRES@
Libs: -L${libdir} -ltree-sitter-bruno
Cflags: -I${includedir}

View File

@@ -2,7 +2,9 @@ package tree_sitter_bruno
// #cgo CFLAGS: -std=c11 -fPIC
// #include "../../src/parser.c"
// #if __has_include("../../src/scanner.c")
// #include "../../src/scanner.c"
// #endif
import "C"
import "unsafe"

View File

@@ -4,7 +4,7 @@ import (
"testing"
tree_sitter "github.com/tree-sitter/go-tree-sitter"
tree_sitter_bruno "github.com/kristoferssolo/tree-sitter-bruno/bindings/go"
tree_sitter_bruno "codeberg.org/kristoferssolo/tree-sitter-bruno/bindings/go"
)
func TestCanLoadGrammar(t *testing.T) {

View File

@@ -10,7 +10,6 @@ const napi_type_tag LANGUAGE_TYPE_TAG = {
};
Napi::Object Init(Napi::Env env, Napi::Object exports) {
exports["name"] = Napi::String::New(env, "bruno");
auto language = Napi::External<TSLanguage>::New(env, tree_sitter_bruno());
language.TypeTag(&LANGUAGE_TYPE_TAG);
exports["language"] = language;

View File

@@ -1,9 +1,9 @@
/// <reference types="node" />
const assert = require("node:assert");
const { test } = require("node:test");
const Parser = require("tree-sitter");
test("can load grammar", () => {
const parser = new (require("tree-sitter"))();
const parser = new Parser();
assert.doesNotThrow(() => parser.setLanguage(require(".")));
});

1
bindings/node/index.d.ts generated vendored
View File

@@ -19,7 +19,6 @@ type NodeInfo =
});
type Language = {
name: string;
language: unknown;
nodeTypeInfo: NodeInfo[];
};

View File

@@ -1,6 +1,10 @@
const root = require("path").join(__dirname, "..", "..");
module.exports = require("node-gyp-build")(root);
module.exports =
typeof process.versions.bun === "string"
// Support `bun build --compile` by being statically analyzable enough to find the .node file at build-time
? require(`../../prebuilds/${process.platform}-${process.arch}/tree-sitter-bruno.node`)
: require("node-gyp-build")(root);
try {
module.exports.nodeTypeInfo = require("../../src/node-types.json");

View File

@@ -1,13 +1,12 @@
from unittest import TestCase
from tree_sitter import Language, Parser
import tree_sitter_bruno
import tree_sitter
class TestLanguage(TestCase):
def test_can_load_grammar(self):
try:
tree_sitter.Language(tree_sitter_bruno.language())
Parser(Language(tree_sitter_bruno.language()))
except Exception:
self.fail("Error loading Bruno grammar")

View File

@@ -6,7 +6,7 @@ from ._binding import language
def _get_query(name, file):
query = _files(f"{__package__}.queries") / "bruno" / file
query = _files(f"{__package__}.queries") / file
globals()[name] = query.read_text()
return globals()[name]
@@ -14,14 +14,14 @@ def _get_query(name, file):
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 == "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")
# if name == "TAGS_QUERY":
# return _get_query("TAGS_QUERY", "tags.scm")
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
@@ -36,18 +36,7 @@ __all__ = [
def __dir__():
return sorted(
__all__
+ [
"__all__",
"__builtins__",
"__cached__",
"__doc__",
"__file__",
"__loader__",
"__name__",
"__package__",
"__path__",
"__spec__",
]
)
return sorted(__all__ + [
"__all__", "__builtins__", "__cached__", "__doc__", "__file__",
"__loader__", "__name__", "__package__", "__path__", "__spec__",
])

View File

@@ -2,9 +2,9 @@ from typing import Final
# NOTE: uncomment these to include any queries that this grammar contains:
HIGHLIGHTS_QUERY: Final[str]
INJECTIONS_QUERY: Final[str]
# HIGHLIGHTS_QUERY: Final[str]
# INJECTIONS_QUERY: Final[str]
# LOCALS_QUERY: Final[str]
TAGS_QUERY: Final[str]
# TAGS_QUERY: Final[str]
def language() -> object: ...

View File

@@ -8,6 +8,13 @@ static PyObject* _binding_language(PyObject *Py_UNUSED(self), PyObject *Py_UNUSE
return PyCapsule_New(tree_sitter_bruno(), "tree_sitter.Language", NULL);
}
static struct PyModuleDef_Slot slots[] = {
#ifdef Py_GIL_DISABLED
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
#endif
{0, NULL}
};
static PyMethodDef methods[] = {
{"language", _binding_language, METH_NOARGS,
"Get the tree-sitter language for this grammar."},
@@ -18,10 +25,11 @@ static struct PyModuleDef module = {
.m_base = PyModuleDef_HEAD_INIT,
.m_name = "_binding",
.m_doc = NULL,
.m_size = -1,
.m_methods = methods
.m_size = 0,
.m_methods = methods,
.m_slots = slots,
};
PyMODINIT_FUNC PyInit__binding(void) {
return PyModule_Create(&module);
return PyModuleDef_Init(&module);
}

View File

@@ -12,8 +12,10 @@ fn main() {
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());
if scanner_path.exists() {
c_config.file(&scanner_path);
println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap());
}
c_config.compile("tree-sitter-bruno");
}

24
bindings/rust/lib.rs generated
View File

@@ -1,7 +1,7 @@
//! This crate provides Bruno language support for the [tree-sitter][] parsing library.
//! 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:
//! 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#"
@@ -15,7 +15,7 @@
//! assert!(!tree.root_node().has_error());
//! ```
//!
//! [Parser]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Parser.html
//! [`Parser`]: https://docs.rs/tree-sitter/0.25.10/tree_sitter/struct.Parser.html
//! [tree-sitter]: https://tree-sitter.github.io/
use tree_sitter_language::LanguageFn;
@@ -24,22 +24,20 @@ 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
/// The tree-sitter [`LanguageFn`] for this grammar.
pub const LANGUAGE: LanguageFn = unsafe { LanguageFn::from_raw(tree_sitter_bruno) };
/// The content of the [`node-types.json`][] file for this grammar.
/// 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
/// [`node-types.json`]: https://tree-sitter.github.io/tree-sitter/using-parsers/6-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/bruno/highlights.scm");
pub const INJECTIONS_QUERY: &str = include_str!("../../queries/bruno/injections.scm");
// pub const LOCALS_QUERY: &str = include_str!("../../queries/bruno/locals.scm");
pub const TAGS_QUERY: &str = include_str!("../../queries/bruno/tags.scm");
// 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 {

4
go.mod generated
View File

@@ -1,5 +1,5 @@
module github.com/kristoferssolo/tree-sitter-bruno
module codeberg.org/kristoferssolo/tree-sitter-bruno
go 1.22
require github.com/tree-sitter/go-tree-sitter v0.23.1
require github.com/tree-sitter/go-tree-sitter v0.24.0

392
package-lock.json generated
View File

@@ -1,392 +0,0 @@
{
"name": "tree-sitter-bruno",
"version": "0.1.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "tree-sitter-bruno",
"version": "0.1.0",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
"node": "^23.4.0",
"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
}
}
},
"node_modules/base64-js": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"license": "MIT"
},
"node_modules/bl": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
"integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",
"dev": true,
"license": "MIT",
"dependencies": {
"buffer": "^5.5.0",
"inherits": "^2.0.4",
"readable-stream": "^3.4.0"
}
},
"node_modules/buffer": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
"integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"license": "MIT",
"dependencies": {
"base64-js": "^1.3.1",
"ieee754": "^1.1.13"
}
},
"node_modules/chownr": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==",
"dev": true,
"license": "ISC"
},
"node_modules/end-of-stream": {
"version": "1.4.4",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
"integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"once": "^1.4.0"
}
},
"node_modules/fs-constants": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
"integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==",
"dev": true,
"license": "MIT"
},
"node_modules/ieee754": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
"integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"license": "BSD-3-Clause"
},
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"dev": true,
"license": "ISC"
},
"node_modules/minimist": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
"dev": true,
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/mkdirp-classic": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
"integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==",
"dev": true,
"license": "MIT"
},
"node_modules/node": {
"version": "23.4.0",
"resolved": "https://registry.npmjs.org/node/-/node-23.4.0.tgz",
"integrity": "sha512-uzDNv0OyY8xC7x1/CuYx2c9G3g33GznkhPFs89Q2trrk7M9JzYFj8nlEbv9E666ihJdop+WaeCQST2Hbm/iKuw==",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {
"node-bin-setup": "^1.0.0"
},
"bin": {
"node": "bin/node"
},
"engines": {
"npm": ">=5.0.0"
}
},
"node_modules/node-abi": {
"version": "3.71.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.71.0.tgz",
"integrity": "sha512-SZ40vRiy/+wRTf21hxkkEjPJZpARzUMVcJoQse2EF8qkUWbbO2z7vd5oA/H6bVH6SZQ5STGcu0KRDS7biNRfxw==",
"dev": true,
"license": "MIT",
"dependencies": {
"semver": "^7.3.5"
},
"engines": {
"node": ">=10"
}
},
"node_modules/node-addon-api": {
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.3.0.tgz",
"integrity": "sha512-8VOpLHFrOQlAH+qA0ZzuGRlALRA6/LVh8QJldbrC4DY0hXoMP0l4Acq8TzFC018HztWiRqyCEj2aTWY2UvnJUg==",
"license": "MIT",
"engines": {
"node": "^18 || ^20 || >= 21"
}
},
"node_modules/node-bin-setup": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/node-bin-setup/-/node-bin-setup-1.1.3.tgz",
"integrity": "sha512-opgw9iSCAzT2+6wJOETCpeRYAQxSopqQ2z+N6BXwIMsQQ7Zj5M8MaafQY8JMlolRR6R1UXg2WmhKp0p9lSOivg==",
"license": "ISC"
},
"node_modules/node-gyp-build": {
"version": "4.8.4",
"resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz",
"integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==",
"license": "MIT",
"bin": {
"node-gyp-build": "bin.js",
"node-gyp-build-optional": "optional.js",
"node-gyp-build-test": "build-test.js"
}
},
"node_modules/npm-run-path": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-3.1.0.tgz",
"integrity": "sha512-Dbl4A/VfiVGLgQv29URL9xshU8XDY1GeLy+fsaZ1AA8JDSfjvr5P5+pzRbWqRSBxk6/DW7MIh8lTM/PaGnP2kg==",
"dev": true,
"license": "MIT",
"dependencies": {
"path-key": "^3.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
"dev": true,
"license": "ISC",
"dependencies": {
"wrappy": "1"
}
},
"node_modules/path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/prebuildify": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/prebuildify/-/prebuildify-6.0.1.tgz",
"integrity": "sha512-8Y2oOOateom/s8dNBsGIcnm6AxPmLH4/nanQzL5lQMU+sC0CMhzARZHizwr36pUPLdvBnOkCNQzxg4djuFSgIw==",
"dev": true,
"license": "MIT",
"dependencies": {
"minimist": "^1.2.5",
"mkdirp-classic": "^0.5.3",
"node-abi": "^3.3.0",
"npm-run-path": "^3.1.0",
"pump": "^3.0.0",
"tar-fs": "^2.1.0"
},
"bin": {
"prebuildify": "bin.js"
}
},
"node_modules/pump": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz",
"integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==",
"dev": true,
"license": "MIT",
"dependencies": {
"end-of-stream": "^1.1.0",
"once": "^1.3.1"
}
},
"node_modules/readable-stream": {
"version": "3.6.2",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
"dev": true,
"license": "MIT",
"dependencies": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"license": "MIT"
},
"node_modules/semver": {
"version": "7.6.3",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz",
"integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==",
"dev": true,
"license": "ISC",
"bin": {
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/string_decoder": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
"dev": true,
"license": "MIT",
"dependencies": {
"safe-buffer": "~5.2.0"
}
},
"node_modules/tar-fs": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz",
"integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==",
"dev": true,
"license": "MIT",
"dependencies": {
"chownr": "^1.1.1",
"mkdirp-classic": "^0.5.2",
"pump": "^3.0.0",
"tar-stream": "^2.1.4"
}
},
"node_modules/tar-stream": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",
"integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"bl": "^4.0.3",
"end-of-stream": "^1.4.1",
"fs-constants": "^1.0.0",
"inherits": "^2.0.3",
"readable-stream": "^3.1.1"
},
"engines": {
"node": ">=6"
}
},
"node_modules/tree-sitter-cli": {
"version": "0.24.5",
"resolved": "https://registry.npmjs.org/tree-sitter-cli/-/tree-sitter-cli-0.24.5.tgz",
"integrity": "sha512-8EIgV/ERQlpvk1rPSCCjxveAb6Sba8tMiBpeeL68Mueuuqr0wNfhps/I1nFm2OTnpPCUV2PS9nbzzAMoyxSQUg==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"bin": {
"tree-sitter": "cli.js"
},
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
"dev": true,
"license": "MIT"
},
"node_modules/wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
"dev": true,
"license": "ISC"
}
}
}

23
package.json generated
View File

@@ -1,8 +1,8 @@
{
"name": "tree-sitter-bruno",
"version": "0.1.0",
"description": " Bruno grammar for tree-sitter",
"repository": "github:tree-sitter/tree-sitter-bruno",
"description": "Bruno grammar for tree-sitter",
"repository": "https://codeberg.org/kristoferssolo/tree-sitter-bruno",
"license": "MIT",
"author": {
"name": "Kristofers Solo",
@@ -18,6 +18,7 @@
],
"files": [
"grammar.js",
"tree-sitter.json",
"binding.gyp",
"prebuilds/**",
"bindings/node/*",
@@ -26,16 +27,16 @@
"*.wasm"
],
"dependencies": {
"node": "^23.4.0",
"node-addon-api": "^8.1.0",
"node-gyp-build": "^4.8.2"
"node-addon-api": "^8.5.0",
"node-gyp-build": "^4.8.4"
},
"devDependencies": {
"prebuildify": "^6.0.1",
"tree-sitter-cli": "^0.24.3"
"tree-sitter": "^0.22.4",
"tree-sitter-cli": "^0.25.10"
},
"peerDependencies": {
"tree-sitter": "^0.21.1"
"tree-sitter": "^0.22.4"
},
"peerDependenciesMeta": {
"tree-sitter": {
@@ -47,11 +48,5 @@
"prestart": "tree-sitter build --wasm",
"start": "tree-sitter playground",
"test": "node --test bindings/node/*_test.js"
},
"tree-sitter": [
{
"scope": "source.bruno",
"injection-regex": "^bruno$"
}
]
}
}

64
pyproject.toml generated
View File

@@ -1,81 +1,29 @@
[build-system]
requires = ["setuptools>=42", "wheel"]
requires = ["setuptools>=62.4.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "tree-sitter-bruno"
description = " Bruno grammar for tree-sitter"
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"
requires-python = ">=3.10"
license.text = "MIT"
readme = "README.md"
[project.urls]
Homepage = "https://github.com/kristoferssolo/tree-sitter-bruno"
Homepage = "https://codeberg.org/kristoferssolo/tree-sitter-bruno"
[project.optional-dependencies]
core = ["tree-sitter~=0.22"]
core = ["tree-sitter~=0.24"]
[tool.cibuildwheel]
build = "cp39-*"
build = "cp310-*"
build-frontend = "build"
[dependency-groups]
dev = ["ruff>=0.8.3"]
[tool.ruff]
show-fixes = true
line-length = 120
indent-width = 4
target-version = "py39"
[tool.ruff.lint]
extend-select = [
"B",
"BLE",
"C",
"C4",
"E",
"ERA",
"F",
"I",
"ICN",
"INP",
"N",
"PL",
"PGH",
"PIE",
"Q",
"RET",
"RSE",
"RUF",
"S",
"SIM",
"T20",
"TCH",
"TID",
"PT",
"UP",
"DJ",
"W",
]
ignore = []
preview = true
fixable = ["ALL"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "lf"
docstring-code-format = true
docstring-code-line-length = 40

54
setup.py generated
View File

@@ -1,27 +1,49 @@
from os.path import isdir, join
from platform import system
from os import path
from sysconfig import get_config_var
from setuptools import Extension, find_packages, setup
from setuptools.command.build import build
from setuptools.command.build_ext import build_ext
from setuptools.command.egg_info import egg_info
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")
if path.isdir("queries"):
dest = path.join(self.build_lib, "tree_sitter_bruno", "queries")
self.copy_tree("queries", dest)
super().run()
class BuildExt(build_ext):
def build_extension(self, ext: Extension):
if self.compiler.compiler_type != "msvc":
ext.extra_compile_args = ["-std=c11", "-fvisibility=hidden"]
else:
ext.extra_compile_args = ["/std:c11", "/utf-8"]
if path.exists("src/scanner.c"):
ext.sources.append("src/scanner.c")
if ext.py_limited_api:
ext.define_macros.append(("Py_LIMITED_API", "0x030A0000"))
super().build_extension(ext)
class BdistWheel(bdist_wheel):
def get_tag(self):
python, abi, platform = super().get_tag()
if python.startswith("cp"):
python, abi = "cp39", "abi3"
python, abi = "cp310", "abi3"
return python, abi, platform
class EggInfo(egg_info):
def find_sources(self):
super().find_sources()
self.filelist.recursive_include("queries", "*.scm")
self.filelist.include("src/tree_sitter/*.h")
setup(
packages=find_packages("bindings/python"),
package_dir={"": "bindings/python"},
@@ -36,26 +58,20 @@ setup(
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,
py_limited_api=not get_config_var("Py_GIL_DISABLED"),
)
],
cmdclass={"build": Build, "bdist_wheel": BdistWheel},
zip_safe=False,
cmdclass={
"build": Build,
"build_ext": BuildExt,
"bdist_wheel": BdistWheel,
"egg_info": EggInfo,
},
zip_safe=False
)

919
src/grammar.json generated
View File

@@ -1,919 +0,0 @@
{
"$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"
},
{
"type": "SYMBOL",
"name": "params"
}
]
},
"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"
}
]
},
"params": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "params_path"
},
{
"type": "SYMBOL",
"name": "params_query"
}
]
},
"params_query": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "STRING",
"value": "params:query"
},
"named": true,
"value": "keyword"
},
{
"type": "SYMBOL",
"name": "dictionary"
}
]
},
"params_path": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "STRING",
"value": "params:path"
},
"named": true,
"value": "keyword"
},
{
"type": "SYMBOL",
"name": "dictionary"
}
]
},
"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": []
}

955
src/node-types.json generated
View File

@@ -1,955 +0,0 @@
[
{
"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": "params",
"named": true,
"fields": {},
"children": {
"multiple": false,
"required": true,
"types": [
{
"type": "params_path",
"named": true
},
{
"type": "params_query",
"named": true
}
]
}
},
{
"type": "params_path",
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "dictionary",
"named": true
},
{
"type": "keyword",
"named": true
}
]
}
},
{
"type": "params_query",
"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": "params",
"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
}
]

4528
src/parser.c generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,50 +0,0 @@
#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;
}

View File

@@ -1,54 +0,0 @@
#ifndef TREE_SITTER_ALLOC_H_
#define TREE_SITTER_ALLOC_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
// 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_

290
src/tree_sitter/array.h generated
View File

@@ -1,290 +0,0 @@
#ifndef TREE_SITTER_ARRAY_H_
#define TREE_SITTER_ARRAY_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "./alloc.h"
#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#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_

266
src/tree_sitter/parser.h generated
View File

@@ -1,266 +0,0 @@
#ifndef TREE_SITTER_PARSER_H_
#define TREE_SITTER_PARSER_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#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_

View File

@@ -1,47 +0,0 @@
=======================
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)
)
)
)
)
)

View File

@@ -1,57 +0,0 @@
===========
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)
)
)
)
)
)

View File

@@ -1,192 +0,0 @@
==========
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 {
<xml>
<name>John</name>
<age>30</age>
</xml>
}
---
(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)
)
)
)
)
)
)

View File

@@ -1,31 +0,0 @@
================
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)
)
)
)
)

View File

@@ -1,239 +0,0 @@
=====================
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)
)
)
)
)

View File

@@ -1,197 +0,0 @@
=================
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)
)
)
)

View File

@@ -1,60 +0,0 @@
========================
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)
)
)
)

96
uv.lock generated
View File

@@ -1,96 +0,0 @@
version = 1
requires-python = ">=3.9"
[[package]]
name = "ruff"
version = "0.8.3"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/bf/5e/683c7ef7a696923223e7d95ca06755d6e2acbc5fd8382b2912a28008137c/ruff-0.8.3.tar.gz", hash = "sha256:5e7558304353b84279042fc584a4f4cb8a07ae79b2bf3da1a7551d960b5626d3", size = 3378522 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/f8/c4/bfdbb8b9c419ff3b52479af8581026eeaac3764946fdb463dec043441b7d/ruff-0.8.3-py3-none-linux_armv6l.whl", hash = "sha256:8d5d273ffffff0acd3db5bf626d4b131aa5a5ada1276126231c4174543ce20d6", size = 10535860 },
{ url = "https://files.pythonhosted.org/packages/ef/c5/0aabdc9314b4b6f051168ac45227e2aa8e1c6d82718a547455e40c9c9faa/ruff-0.8.3-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:e4d66a21de39f15c9757d00c50c8cdd20ac84f55684ca56def7891a025d7e939", size = 10346327 },
{ url = "https://files.pythonhosted.org/packages/1a/78/4843a59e7e7b398d6019cf91ab06502fd95397b99b2b858798fbab9151f5/ruff-0.8.3-py3-none-macosx_11_0_arm64.whl", hash = "sha256:c356e770811858bd20832af696ff6c7e884701115094f427b64b25093d6d932d", size = 9942585 },
{ url = "https://files.pythonhosted.org/packages/91/5a/642ed8f1ba23ffc2dd347697e01eef3c42fad6ac76603be4a8c3a9d6311e/ruff-0.8.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9c0a60a825e3e177116c84009d5ebaa90cf40dfab56e1358d1df4e29a9a14b13", size = 10797597 },
{ url = "https://files.pythonhosted.org/packages/30/25/2e654bc7226da09a49730a1a2ea6e89f843b362db80b4b2a7a4f948ac986/ruff-0.8.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:75fb782f4db39501210ac093c79c3de581d306624575eddd7e4e13747e61ba18", size = 10307244 },
{ url = "https://files.pythonhosted.org/packages/c0/2d/a224d56bcd4383583db53c2b8f410ebf1200866984aa6eb9b5a70f04e71f/ruff-0.8.3-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7f26bc76a133ecb09a38b7868737eded6941b70a6d34ef53a4027e83913b6502", size = 11362439 },
{ url = "https://files.pythonhosted.org/packages/82/01/03e2857f9c371b8767d3e909f06a33bbdac880df17f17f93d6f6951c3381/ruff-0.8.3-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:01b14b2f72a37390c1b13477c1c02d53184f728be2f3ffc3ace5b44e9e87b90d", size = 12078538 },
{ url = "https://files.pythonhosted.org/packages/af/ae/ff7f97b355da16d748ceec50e1604a8215d3659b36b38025a922e0612e9b/ruff-0.8.3-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:53babd6e63e31f4e96ec95ea0d962298f9f0d9cc5990a1bbb023a6baf2503a82", size = 11616172 },
{ url = "https://files.pythonhosted.org/packages/6a/d0/6156d4d1e53ebd17747049afe801c5d7e3014d9b2f398b9236fe36ba4320/ruff-0.8.3-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1ae441ce4cf925b7f363d33cd6570c51435972d697e3e58928973994e56e1452", size = 12919886 },
{ url = "https://files.pythonhosted.org/packages/4e/84/affcb30bacb94f6036a128ad5de0e29f543d3f67ee42b490b17d68e44b8a/ruff-0.8.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d7c65bc0cadce32255e93c57d57ecc2cca23149edd52714c0c5d6fa11ec328cd", size = 11212599 },
{ url = "https://files.pythonhosted.org/packages/60/b9/5694716bdefd8f73df7c0104334156c38fb0f77673d2966a5a1345bab94d/ruff-0.8.3-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:5be450bb18f23f0edc5a4e5585c17a56ba88920d598f04a06bd9fd76d324cb20", size = 10784637 },
{ url = "https://files.pythonhosted.org/packages/24/7e/0e8f835103ac7da81c3663eedf79dec8359e9ae9a3b0d704bae50be59176/ruff-0.8.3-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:8faeae3827eaa77f5721f09b9472a18c749139c891dbc17f45e72d8f2ca1f8fc", size = 10390591 },
{ url = "https://files.pythonhosted.org/packages/27/da/180ec771fc01c004045962ce017ca419a0281f4bfaf867ed0020f555b56e/ruff-0.8.3-py3-none-musllinux_1_2_i686.whl", hash = "sha256:db503486e1cf074b9808403991663e4277f5c664d3fe237ee0d994d1305bb060", size = 10894298 },
{ url = "https://files.pythonhosted.org/packages/6d/f8/29f241742ed3954eb2222314b02db29f531a15cab3238d1295e8657c5f18/ruff-0.8.3-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:6567be9fb62fbd7a099209257fef4ad2c3153b60579818b31a23c886ed4147ea", size = 11275965 },
{ url = "https://files.pythonhosted.org/packages/79/e9/5b81dc9afc8a80884405b230b9429efeef76d04caead904bd213f453b973/ruff-0.8.3-py3-none-win32.whl", hash = "sha256:19048f2f878f3ee4583fc6cb23fb636e48c2635e30fb2022b3a1cd293402f964", size = 8807651 },
{ url = "https://files.pythonhosted.org/packages/ea/67/7291461066007617b59a707887b90e319b6a043c79b4d19979f86b7a20e7/ruff-0.8.3-py3-none-win_amd64.whl", hash = "sha256:f7df94f57d7418fa7c3ffb650757e0c2b96cf2501a0b192c18e4fb5571dfada9", size = 9625289 },
{ url = "https://files.pythonhosted.org/packages/03/8f/e4fa95288b81233356d9a9dcaed057e5b0adc6399aa8fd0f6d784041c9c3/ruff-0.8.3-py3-none-win_arm64.whl", hash = "sha256:fe2756edf68ea79707c8d68b78ca9a58ed9af22e430430491ee03e718b5e4936", size = 9078754 },
]
[[package]]
name = "tree-sitter"
version = "0.23.2"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/0f/50/fd5fafa42b884f741b28d9e6fd366c3f34e15d2ed3aa9633b34e388379e2/tree-sitter-0.23.2.tar.gz", hash = "sha256:66bae8dd47f1fed7bdef816115146d3a41c39b5c482d7bad36d9ba1def088450", size = 166800 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/91/04/2068a7b725265ecfcbf63ecdae038f1d4124ebccd55b8a7ce145b70e2b6a/tree_sitter-0.23.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:3a937f5d8727bc1c74c4bf2a9d1c25ace049e8628273016ad0d45914ae904e10", size = 139289 },
{ url = "https://files.pythonhosted.org/packages/a8/07/a5b943121f674fe1ac77694a698e71ce95353830c1f3f4ce45da7ef3e406/tree_sitter-0.23.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2c7eae7fe2af215645a38660d2d57d257a4c461fe3ec827cca99a79478284e80", size = 132379 },
{ url = "https://files.pythonhosted.org/packages/d4/96/fcc72c33d464a2d722db1e95b74a53ced771a47b3cfde60aced29764a783/tree_sitter-0.23.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3a71d607595270b6870eaf778a1032d146b2aa79bfcfa60f57a82a7b7584a4c7", size = 552884 },
{ url = "https://files.pythonhosted.org/packages/d0/af/b0e787a52767155b4643a55d6de03c1e4ae77abb61e1dc1629ad983e0a40/tree_sitter-0.23.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fe9b9ea7a0aa23b52fd97354da95d1b2580065bc12a4ac868f9164a127211d6", size = 566561 },
{ url = "https://files.pythonhosted.org/packages/65/fd/05e966b5317b1c6679c071c5b0203f28af9d26c9363700cb9682e1bcf343/tree_sitter-0.23.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d74d00a8021719eae14d10d1b1e28649e15d8b958c01c2b2c3dad7a2ebc4dbae", size = 558273 },
{ url = "https://files.pythonhosted.org/packages/60/bc/19145efdf3f47711aa3f1bf06f0b50593f97f1108550d38694841fd97b7c/tree_sitter-0.23.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:6de18d8d8a7f67ab71f472d1fcb01cc506e080cbb5e13d52929e4b6fdce6bbee", size = 569176 },
{ url = "https://files.pythonhosted.org/packages/32/08/3553d8e488ae9284a0762effafb7d2639a306e184963b7f99853923084d6/tree_sitter-0.23.2-cp310-cp310-win_amd64.whl", hash = "sha256:12b60dca70d2282af942b650a6d781be487485454668c7c956338a367b98cdee", size = 117902 },
{ url = "https://files.pythonhosted.org/packages/1d/39/836fa485e985c33e8aa1cc3abbf7a84be1c2c382e69547a765631fdd7ce3/tree_sitter-0.23.2-cp310-cp310-win_arm64.whl", hash = "sha256:3346a4dd0447a42aabb863443b0fd8c92b909baf40ed2344fae4b94b625d5955", size = 102644 },
{ url = "https://files.pythonhosted.org/packages/55/8d/2d4fb04408772be0919441d66f700673ce7cb76b9ab6682e226d740fb88d/tree_sitter-0.23.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:91fda41d4f8824335cc43c64e2c37d8089c8c563bd3900a512d2852d075af719", size = 139142 },
{ url = "https://files.pythonhosted.org/packages/32/52/b8a44bfff7b0203256e5dbc8d3a372ee8896128b8ed7d3a89e1ef17b2065/tree_sitter-0.23.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:92b2b489d5ce54b41f94c6f23fbaf592bd6e84dc2877048fd1cb060480fa53f7", size = 132198 },
{ url = "https://files.pythonhosted.org/packages/5d/54/746f2ee5acf6191a4a0be7f5843329f0d713bfe5196f5fc6fe2ea69cb44c/tree_sitter-0.23.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:64859bd4aa1567d0d6016a811b2b49c59d4a4427d096e3d8c84b2521455f62b7", size = 554303 },
{ url = "https://files.pythonhosted.org/packages/2f/5a/3169d9933be813776a9b4b3f2e671d3d50fa27e589dee5578f6ecef7ff6d/tree_sitter-0.23.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:614590611636044e071d3a0b748046d52676dbda3bc9fa431216231e11dd98f7", size = 567626 },
{ url = "https://files.pythonhosted.org/packages/32/0d/23f363b3b0bc3fa0e7a4a294bf119957ac1ab02737d57815e1e8b7b3e196/tree_sitter-0.23.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:08466953c78ae57be61057188fb88c89791b0a562856010228e0ccf60e2ac453", size = 559803 },
{ url = "https://files.pythonhosted.org/packages/6f/b3/1ffba0f17a7ff2c9114d91a1ecc15e0748f217817797564d31fbb61d7458/tree_sitter-0.23.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:8a33f03a562de91f7fd05eefcedd8994a06cd44c62f7aabace811ad82bc11cbd", size = 570987 },
{ url = "https://files.pythonhosted.org/packages/59/4b/085bcb8a11ea18003aacc4dbc91c301d1536c5e2deedb95393e8ef26f1f7/tree_sitter-0.23.2-cp311-cp311-win_amd64.whl", hash = "sha256:03b70296b569ef64f7b92b42ca5da9bf86d81bee2afd480bea35092687f51dae", size = 117771 },
{ url = "https://files.pythonhosted.org/packages/4b/e5/90adc4081f49ccb6bea89a800dc9b0dcc5b6953b0da423e8eff28f63fddf/tree_sitter-0.23.2-cp311-cp311-win_arm64.whl", hash = "sha256:7cb4bb953ea7c0b50eeafc4454783e030357179d2a93c3dd5ebed2da5588ddd0", size = 102555 },
{ url = "https://files.pythonhosted.org/packages/07/a7/57e0fe87b49a78c670a7b4483f70e44c000c65c29b138001096b22e7dd87/tree_sitter-0.23.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:a014498b6a9e6003fae8c6eb72f5927d62da9dcb72b28b3ce8cd15c6ff6a6572", size = 139259 },
{ url = "https://files.pythonhosted.org/packages/b4/b9/bc8513d818ffb54993a017a36c8739300bc5739a13677acf90b54995e7db/tree_sitter-0.23.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:04f8699b131d4bcbe3805c37e4ef3d159ee9a82a0e700587625623999ba0ea53", size = 131951 },
{ url = "https://files.pythonhosted.org/packages/d7/6a/eab01bb6b1ce3c9acf16d72922ffc29a904af485eb3e60baf3a3e04edd30/tree_sitter-0.23.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4471577df285059c71686ecb208bc50fb472099b38dcc8e849b0e86652891e87", size = 557952 },
{ url = "https://files.pythonhosted.org/packages/bd/95/f2f73332623cf63200d57800f85273170bc5f99d28ea3f234afd5b0048df/tree_sitter-0.23.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f342c925290dd4e20ecd5787ef7ae8749981597ab364783a1eb73173efe65226", size = 571199 },
{ url = "https://files.pythonhosted.org/packages/04/ac/bd6e6cfdd0421156e86f5c93848629af1c7323083077e1a95b27d32d5811/tree_sitter-0.23.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a4e9e53d07dd076bede72e4f7d3a0173d7b9ad6576572dd86da008a740a9bb22", size = 562129 },
{ url = "https://files.pythonhosted.org/packages/7b/bd/8a9edcbcf8a76b0bf58e3b927ed291e3598e063d56667367762833cc8709/tree_sitter-0.23.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:8caebe65bc358759dac2500d8f8feed3aed939c4ade9a684a1783fe07bc7d5db", size = 574307 },
{ url = "https://files.pythonhosted.org/packages/0c/c2/3fb2c6c0ae2f59a7411dc6d3e7945e3cb6f34c8552688708acc8b2b13f83/tree_sitter-0.23.2-cp312-cp312-win_amd64.whl", hash = "sha256:fc5a72eb50d43485000dbbb309acb350467b7467e66dc747c6bb82ce63041582", size = 117858 },
{ url = "https://files.pythonhosted.org/packages/e2/18/4ca2c0f4a0c802ebcb3a92264cc436f1d54b394fa24dfa76bf57cdeaca9e/tree_sitter-0.23.2-cp312-cp312-win_arm64.whl", hash = "sha256:a0320eb6c7993359c5f7b371d22719ccd273f440d41cf1bd65dac5e9587f2046", size = 102496 },
{ url = "https://files.pythonhosted.org/packages/ba/c6/4ead9ce3113a7c27f37a2bdef163c09757efbaa85adbdfe7b3fbf0317c57/tree_sitter-0.23.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:eff630dddee7ba05accb439b17e559e15ce13f057297007c246237ceb6306332", size = 139266 },
{ url = "https://files.pythonhosted.org/packages/76/c9/b4197c5b0c1d6ba648202a547846ac910a53163b69a459504b2aa6cdb76e/tree_sitter-0.23.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:4780ba8f3894f2dea869fad2995c2aceab3fd5ab9e6a27c45475d2acd7f7e84e", size = 131959 },
{ url = "https://files.pythonhosted.org/packages/99/94/0f7c5580d2adff3b57d36f1998725b0caf6cf1af50ceafc00c6cdbc2fef6/tree_sitter-0.23.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f0b609460b8e3e256361fb12e94fae5b728cb835b16f0f9d590b5aadbf9d109b", size = 557582 },
{ url = "https://files.pythonhosted.org/packages/97/8a/f73ff06959d43fd47fc283cbcc4d8efa6550b2cc431d852b184504992447/tree_sitter-0.23.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:78d070d8eaeaeb36cf535f55e5578fddbfc3bf53c1980f58bf1a99d57466b3b5", size = 570891 },
{ url = "https://files.pythonhosted.org/packages/b8/86/bbda5ad09b88051ff7bf3275622a2f79bc4f728b4c283ff8b93b8fcdf36d/tree_sitter-0.23.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:878580b2ad5054c410ba3418edca4d34c81cc26706114d8f5b5541688bc2d785", size = 562343 },
{ url = "https://files.pythonhosted.org/packages/ca/55/b404fa49cb5c2926ad6fe1cac033dd486ef69f1afeb7828452d21e1e05c1/tree_sitter-0.23.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:29224bdc2a3b9af535b7725e249d3ee291b2e90708e82832e73acc175e40dc48", size = 574407 },
{ url = "https://files.pythonhosted.org/packages/c2/c8/eea2104443ab973091107ef3e730683bd8e6cb51dd025cef853d3fff9dae/tree_sitter-0.23.2-cp313-cp313-win_amd64.whl", hash = "sha256:c58d89348162fbc3aea1fe6511a66ee189fc0e4e4bbe937026f29e4ecef17763", size = 117854 },
{ url = "https://files.pythonhosted.org/packages/89/4d/1728d9ce32a1d851081911b7e47830f5e740431f2bb920f54bb8c26175bc/tree_sitter-0.23.2-cp313-cp313-win_arm64.whl", hash = "sha256:0ff2037be5edab7801de3f6a721b9cf010853f612e2008ee454e0e0badb225a6", size = 102492 },
{ url = "https://files.pythonhosted.org/packages/cb/ab/b39173a47d498cc6276e303c865f4a222134ceae890bd3c1b29427489805/tree_sitter-0.23.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:a5db8e585205faef8bf219da77d8993e2ef04d08eda2e3c8ad7e4df8297ee344", size = 139550 },
{ url = "https://files.pythonhosted.org/packages/4c/34/fa8f5b862dd7a6014fd5578810178e8f7601830cabb6d65d2aba050c2df1/tree_sitter-0.23.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9dbd110a30cf28be5da734ae4cd0e9031768228dbf6a79f2973962aa51de4ec7", size = 132686 },
{ url = "https://files.pythonhosted.org/packages/98/b9/ccdddf35705fc23395caa71557f767e0753d38afe4b5bb99efddbf62bb22/tree_sitter-0.23.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:569514b9a996a0fd458b3a891c46ca125298be0c03cf82f2b6f0c13d5d8f25dc", size = 554958 },
{ url = "https://files.pythonhosted.org/packages/8d/ba/20ae9079bdfc5cfac28b39d945a6c354c8e1385e73aec8142db6c53b635c/tree_sitter-0.23.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a357ed98a74e47787b812df99a74a2c35c0fe11e55c2095cc01d1cad144ef552", size = 568162 },
{ url = "https://files.pythonhosted.org/packages/40/00/b16bf6cf88c47c1b6c8e1cce1eb9e90badb5db9e5252ae0970d858d02592/tree_sitter-0.23.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:c2dfb8e8f760f4cc67888d03ef9e2dbd3353245f67f5efba375c2a14d944ac0e", size = 560278 },
{ url = "https://files.pythonhosted.org/packages/7a/8f/27ab9b96cc0261af78b080ec8a9846a38e216360ec38774ea27eba35bd3c/tree_sitter-0.23.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:3ead958df87a21d706903987e665e9e0e5df7b2c5021ff69ea349826840adc6a", size = 571255 },
{ url = "https://files.pythonhosted.org/packages/44/e0/95a3d66a7e5bb229574484ab10c6dc99d1c7a32972b890d194076e30dc4f/tree_sitter-0.23.2-cp39-cp39-win_amd64.whl", hash = "sha256:611cae16be332213c0e6ece72c0bfca202e30ff320a8b309b1526c6cb79ee4ba", size = 118232 },
{ url = "https://files.pythonhosted.org/packages/10/b5/9eaf794fc71490573ab14a366affca415bc1ddbf86a14d78e54583db4254/tree_sitter-0.23.2-cp39-cp39-win_arm64.whl", hash = "sha256:b848e0fdd522fbb8888cdb4f4d93f8fad97ae10d70c122fb922e51363c7febcd", size = 102787 },
]
[[package]]
name = "tree-sitter-bruno"
version = "0.1.0"
source = { editable = "." }
[package.optional-dependencies]
core = [
{ name = "tree-sitter" },
]
[package.dev-dependencies]
dev = [
{ name = "ruff" },
]
[package.metadata]
requires-dist = [{ name = "tree-sitter", marker = "extra == 'core'", specifier = "~=0.22" }]
[package.metadata.requires-dev]
dev = [{ name = "ruff", specifier = ">=0.8.3" }]