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.2.tar.gz (63.8 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.2-cp310-abi3-win_amd64.whl (45.8 kB view details)

Uploaded CPython 3.10+Windows x86-64

tree_sitter_toolang-0.1.2-cp310-abi3-musllinux_1_2_x86_64.whl (53.5 kB view details)

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

tree_sitter_toolang-0.1.2-cp310-abi3-musllinux_1_2_aarch64.whl (52.9 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

tree_sitter_toolang-0.1.2-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (53.3 kB view details)

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

tree_sitter_toolang-0.1.2-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (53.8 kB view details)

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

tree_sitter_toolang-0.1.2-cp310-abi3-macosx_10_9_universal2.whl (79.9 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.2.tar.gz.

File metadata

  • Download URL: tree_sitter_toolang-0.1.2.tar.gz
  • Upload date:
  • Size: 63.8 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.2.tar.gz
Algorithm Hash digest
SHA256 cba1c60265959f0e675cf3205c47d6551d00f80d9982838087a7858d7e6a7c4e
MD5 1f5b715daa8b205a2e48db26af9c467b
BLAKE2b-256 c0e053ad316498ecef028e0bff8499828366107fc49b1f2df72c82e447fdd98f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tree_sitter_toolang-0.1.2-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 833419801fed81a816cca664f26cc31a3a04b88e2169a0fedeae04a3755177c5
MD5 3d852852ea398004897b900f22344336
BLAKE2b-256 9c99cd8b0304b3e6668273bc1da7ef531a7e507854fb866771b63623fa6af839

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tree_sitter_toolang-0.1.2-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 4019a039957a583704af16eb78e6e811b3a6c59d3b9528f0cf29293c08436867
MD5 392dc738477dd1a5d6f5736b2474cb99
BLAKE2b-256 97dfd0e392a70a8bd0c178c6a39fe7139d4cb88412a55d087e46b746dd13dc1a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tree_sitter_toolang-0.1.2-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 7d2a56bde026bbf605cf291521a391a0ae6bcd8dd4a1bea45a17ebb20955ad91
MD5 d72da4a88e1487534012452495c62914
BLAKE2b-256 acf29047efebc0a9ac9d41af34df3d8ab14f45def2f182cf683d0e0a5368cda3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tree_sitter_toolang-0.1.2-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b495e15124162dc4010d602b8cce269c68debcd0345f97e505bd2c470149bda6
MD5 1090454c8d74091f12881d7729db5698
BLAKE2b-256 1566bb6337bc2afc02b0a1e391143ddd08b4e1492e709922eb6b416000b8ab9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_toolang-0.1.2-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.2-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.2-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 fdb8f33cfe8d3c8d20da9c246457f1b9afcdeb14199e3ded531294c7cf2e4e0b
MD5 598fa06ab410ec34f1788d725b91e7b2
BLAKE2b-256 a6bcce62dadbddae9667615494ee48b3e2011840589f147ec621846f3ced0ae3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tree_sitter_toolang-0.1.2-cp310-abi3-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 6808617e5462079dabb345def53737c9c92d1205ba88bbb23ba0dcda4dca75be
MD5 20a902b2a87cf4b44ca33031b7a6e6b3
BLAKE2b-256 cc174ee0a9359525951c7c98828edbeff2651189b2d22469a80ab999f899cc6a

See more details on using hashes here.

Provenance

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