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.1.1.tar.gz (63.3 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.1.1-cp310-abi3-win_amd64.whl (41.8 kB view details)

Uploaded CPython 3.10+Windows x86-64

tree_sitter_toolang-0.1.1-cp310-abi3-musllinux_1_2_x86_64.whl (48.0 kB view details)

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

tree_sitter_toolang-0.1.1-cp310-abi3-musllinux_1_2_aarch64.whl (48.3 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

tree_sitter_toolang-0.1.1-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (48.8 kB view details)

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

tree_sitter_toolang-0.1.1-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (48.0 kB view details)

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

tree_sitter_toolang-0.1.1-cp310-abi3-macosx_10_9_universal2.whl (70.4 kB view details)

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

File details

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

File metadata

  • Download URL: tree_sitter_toolang-0.1.1.tar.gz
  • Upload date:
  • Size: 63.3 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.1.1.tar.gz
Algorithm Hash digest
SHA256 d6b9e59a64953b921aa5a3b906c7c58cc51fb90ef9404b4876ff0db67d1a530d
MD5 647af93a8d095eae543023cde1454a46
BLAKE2b-256 b80e623c0da38b3dd3343a5845e5d1a94ffd545340db9400e56ca54e70a38b6d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tree_sitter_toolang-0.1.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ada807987d0fdee0569e8ffae33defc859cc95b76a3dd52414768d01e2bff3f5
MD5 81a72346f1d7721c325ad797a8ab5d31
BLAKE2b-256 9a5bc5d2d2ea082795bef3f095d523ef8dd28d8441709f1099f12d4cee6043f3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tree_sitter_toolang-0.1.1-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2572553e62e7bbbc4dfd5e520aac726c4f56b1733676d11def13769ee0c67954
MD5 8af40bda66d16c9cee1934ed6f51bb6e
BLAKE2b-256 b705a1e6b8325ce623306af5782be3243098ae2a57ea9f6d2f2338c6843d1173

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tree_sitter_toolang-0.1.1-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 1677feecdbd9157cedddfae85848ac277432ae08df8b922d7728bd5e31d86c9d
MD5 01c2d8b0f23aa151158702b7a15bd15f
BLAKE2b-256 3a5dd20504494c02a72d8a363c8c506cb91c31131497b7f6dc98969bbda1dc43

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tree_sitter_toolang-0.1.1-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 790fd7b9e6461052c23bf2e340d2088864678b5f4bdf529a98467d1c80b0ffb2
MD5 8533c77977541815afd981299fb35d7d
BLAKE2b-256 940d0e57e060ecdf412e2dd9f416ccc5d4797c3a5f923df445168a6a0edd693e

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_toolang-0.1.1-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.1.1-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.1.1-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 2801f574ef9ad59e7a620d37b5dd6814b39436585dac353063a8e5d1dcfb018a
MD5 96d514c93e6eaf776f1f4ebf99a569cd
BLAKE2b-256 fb82e97f62003f715db261eacede35b966a747b0d1b7d3e9126306f50de5f817

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tree_sitter_toolang-0.1.1-cp310-abi3-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 3ce4b31f79de3d9ece1588534292975bc8fadfca297f359d4f40810821896e62
MD5 295881afed75e8a0ad964999cf9db46c
BLAKE2b-256 ce4f466c0e30de38ac0eb1a852210ec404a590ab346e6a2bacc45c463e579604

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_toolang-0.1.1-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