Skip to main content

Toolang grammar for tree-sitter

Project description

tree-sitter-toolang

Tree-sitter grammar for Toolang.

This repository publishes:

  • the npm grammar package tree-sitter-toolang
  • the Python extension package tree-sitter-toolang
  • the Rust crate tree-sitter-toolang

Install

Python

python -m pip install tree-sitter-toolang tree-sitter
import tree_sitter_toolang
from tree_sitter import Language, Parser

language = Language(tree_sitter_toolang.language())
parser = Parser(language)
tree = parser.parse(b"use skill a/b\n")

The Python package also exposes packaged query strings: HIGHLIGHTS_QUERY, INJECTIONS_QUERY, INDENTS_QUERY, OUTLINE_QUERY, and TAGS_QUERY.

Tree-sitter CLI

Install tree-sitter-toolang or clone this repository, then make sure the directory that contains tree-sitter-toolang is listed in your Tree-sitter parser-directories.

tree-sitter init-config
tree-sitter dump-languages
tree-sitter parse path/to/file.too
tree-sitter highlight path/to/file.too
tree-sitter tags path/to/file.too

Installing the npm package alone does not make tree-sitter dump-languages discover Toolang automatically. The package must still live under one of the configured parser-directories, or the grammar path must be provided explicitly.

Rust

[dependencies]
tree-sitter = "0.25"
tree-sitter-toolang = "0.0.5"
let language = tree_sitter::Language::new(tree_sitter_toolang::LANGUAGE);

Development

Edit:

  • grammar.js
  • queries/*.scm
  • test/corpus/*.txt

Regenerate and test:

npm install
npm run generate
npm test
npm run test:cli
npm run build:wasm
cargo test
python -m pip install -e .[tests]
pytest tests

Publishing

Trusted publishers are configured in GitHub Actions with release.yml.

Verify the npm package locally:

npm publish --dry-run

Verify the Python distributions locally:

python -m pip install --upgrade pip build twine
python -m build
python -m twine check dist/*

Verify the Rust crate:

cargo publish --dry-run

Release checklist:

  1. Bump the version in package.json, pyproject.toml, and Cargo.toml.
  2. Confirm CI is green.
  3. Push the version commit to main.
  4. Create and push a matching tag such as v0.0.6.
  5. GitHub Actions publishes npm and PyPI automatically.
  6. Optionally publish the Rust crate to crates.io.

The release workflow skips npm or PyPI if that version already exists on the registry. The git tag must match the package version.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tree_sitter_toolang-0.0.5.tar.gz (22.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tree_sitter_toolang-0.0.5-cp310-abi3-win_amd64.whl (18.1 kB view details)

Uploaded CPython 3.10+Windows x86-64

tree_sitter_toolang-0.0.5-cp310-abi3-musllinux_1_2_x86_64.whl (26.7 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

tree_sitter_toolang-0.0.5-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (26.9 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

tree_sitter_toolang-0.0.5-cp310-abi3-macosx_11_0_arm64.whl (16.1 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file tree_sitter_toolang-0.0.5.tar.gz.

File metadata

  • Download URL: tree_sitter_toolang-0.0.5.tar.gz
  • Upload date:
  • Size: 22.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tree_sitter_toolang-0.0.5.tar.gz
Algorithm Hash digest
SHA256 3120cc86146fa74c441954ffc25920e9b44187a05ae90418dd941d5b63e8dbd0
MD5 a7426d2e48b48cdf31008ea567f03590
BLAKE2b-256 c91069150e2de4c9d3c65297e19486d3d2d5da29ad04d400068817a811cb3ca1

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_toolang-0.0.5.tar.gz:

Publisher: release.yml on openhat-ai/tree-sitter-toolang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tree_sitter_toolang-0.0.5-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for tree_sitter_toolang-0.0.5-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7216cedbbb48835a10db3cada9ebf1ddcaeec4616a88f2468926387cfbd3f6a9
MD5 5657f8c622264d1626fd6333974c91f7
BLAKE2b-256 c3adde4091029bc2a156dd69df8163334280f5a8865aedc4a38aa08e019aa171

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_toolang-0.0.5-cp310-abi3-win_amd64.whl:

Publisher: release.yml on openhat-ai/tree-sitter-toolang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tree_sitter_toolang-0.0.5-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_toolang-0.0.5-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 359af338d15709df33a362c47df1f827b335a9137442cccd4d6bc90b03cad375
MD5 bb8d6e9fb68c90c28b671a2f90b06b54
BLAKE2b-256 543604e8a800dc4fa3bde4fbd068256a6a87c2f53d719bef490e9d7a6fa92bb6

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_toolang-0.0.5-cp310-abi3-musllinux_1_2_x86_64.whl:

Publisher: release.yml on openhat-ai/tree-sitter-toolang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tree_sitter_toolang-0.0.5-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_toolang-0.0.5-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 8f2a1189118cc96afa53cb35cafa0055e79ad428ee9de6828ca13b9ba3c570cd
MD5 420039f70b6c42c872e6d223dda9b6af
BLAKE2b-256 86f11e1e82a8438df16337e09cef10edfaa669cd2265f0495a5bd73bdf395106

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_toolang-0.0.5-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:

Publisher: release.yml on openhat-ai/tree-sitter-toolang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tree_sitter_toolang-0.0.5-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_toolang-0.0.5-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a78ccdcbfac3bff01d2fa6bc374f3e7a846731ce9a8c83cec85eb08603241e83
MD5 4d6a3a05bb32caf354eb22a92e7e2faa
BLAKE2b-256 dbc7bcba374d6eb0bd5472aaa7f9b699c4716cf191a4aaa1931d883fb5e277a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_toolang-0.0.5-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on openhat-ai/tree-sitter-toolang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page