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.11"
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.

To publish the Rust crate automatically, add the repository secret CRATES_IO_TOKEN.

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.11.
  5. GitHub Actions publishes npm and PyPI automatically.
  6. GitHub Actions also publishes the Rust crate when CRATES_IO_TOKEN is set.

The release workflow skips npm, PyPI, or crates.io 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.14.tar.gz (36.2 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.14-cp310-abi3-win_amd64.whl (24.5 kB view details)

Uploaded CPython 3.10+Windows x86-64

tree_sitter_toolang-0.0.14-cp310-abi3-musllinux_1_2_x86_64.whl (30.1 kB view details)

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

tree_sitter_toolang-0.0.14-cp310-abi3-musllinux_1_2_aarch64.whl (30.3 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

tree_sitter_toolang-0.0.14-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (30.9 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

tree_sitter_toolang-0.0.14-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (30.1 kB view details)

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

tree_sitter_toolang-0.0.14-cp310-abi3-macosx_10_9_universal2.whl (36.8 kB view details)

Uploaded CPython 3.10+macOS 10.9+ universal2 (ARM64, x86-64)

File details

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

File metadata

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

File hashes

Hashes for tree_sitter_toolang-0.0.14.tar.gz
Algorithm Hash digest
SHA256 d27227cc5feb61a2c0a70dd6f7a81dfc973a7be31379c6f4962a80d295050f27
MD5 ff6552aae649b54e401a346aa85adc48
BLAKE2b-256 d8464105d73110e8046d76d2ab90407d5895afe09fa949b58a6e2d27fd28294d

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_toolang-0.0.14.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.14-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for tree_sitter_toolang-0.0.14-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 74bf348e37dee69074c717144535bf9b151c2e4b324822497359baf195fee51c
MD5 d9b7e9ab1fcf5751fae9105b578460e2
BLAKE2b-256 0cec8e12ef399d78753ae9ba6286e6fc5e0ef1b2fa26ef22bfa60b9ccfa4ec28

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_toolang-0.0.14-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.14-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_toolang-0.0.14-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ab3d8fa47222d82a1655a8c60258010401a231b0c84505a326ebed73313289ac
MD5 97558952a222c85aff3fc45f072bc850
BLAKE2b-256 190def5c1c241735bfb9aa119d6031cf9b10fa822fc1fa1846f0e6d9b71cfdc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_toolang-0.0.14-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.14-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_toolang-0.0.14-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 39305614fba76f3cc9e519474b2c060334828149ff45d37237e63c2093d43e4a
MD5 414101e0dd651bc4848cb0427a1317c8
BLAKE2b-256 4248cebfcab515b63a00a3d754efb00ef6555578b7934d46970e17941edd326d

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_toolang-0.0.14-cp310-abi3-musllinux_1_2_aarch64.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.14-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_toolang-0.0.14-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5adcbe6c5703af7b254ce1f180ce0d384085cf9516617170fe8b2315132da50f
MD5 dc64d99ad03a8780eb588bf8369ea4e8
BLAKE2b-256 b2cc668d8f9c60c582e780763f0e984fad7101d9a79fc8f6ad4d16abf5b74379

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_toolang-0.0.14-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.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.14-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.14-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 8448bedca8681285477959a620745b6fefd19ad540d9791d8bc8c43393a59592
MD5 20cb0785c677168af33ee6726d8c4ec1
BLAKE2b-256 a440afc5dbb6e746227e9b030318beb9a5ecf5c6846ad59e59926a9f1341417e

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_toolang-0.0.14-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.14-cp310-abi3-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for tree_sitter_toolang-0.0.14-cp310-abi3-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 060b4055755b60a64743616a7bac63373c4dd812e39fe298ab4ad3fd048a003e
MD5 298e25f2f30b278f4ad5e9db0c4bc8cb
BLAKE2b-256 bbe4072da7d7bb3fd1460e843b38659a4ab67add08463ebf98383fe4a4a41745

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_toolang-0.0.14-cp310-abi3-macosx_10_9_universal2.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