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.3.tar.gz (63.1 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.3-cp310-abi3-win_amd64.whl (44.4 kB view details)

Uploaded CPython 3.10+Windows x86-64

tree_sitter_toolang-0.1.3-cp310-abi3-musllinux_1_2_x86_64.whl (52.0 kB view details)

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

tree_sitter_toolang-0.1.3-cp310-abi3-musllinux_1_2_aarch64.whl (51.5 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

tree_sitter_toolang-0.1.3-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (52.0 kB view details)

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

tree_sitter_toolang-0.1.3-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (52.3 kB view details)

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

tree_sitter_toolang-0.1.3-cp310-abi3-macosx_10_9_universal2.whl (76.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.3.tar.gz.

File metadata

  • Download URL: tree_sitter_toolang-0.1.3.tar.gz
  • Upload date:
  • Size: 63.1 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.3.tar.gz
Algorithm Hash digest
SHA256 1eda32349b8cacc2210a1c6316f7e0479e73b1da2716bdfc36ccfca926de7b41
MD5 0f2c3c75d0331c4ac1756737ee67df1b
BLAKE2b-256 2bbfc09c8eae5cb1be060be6a3ba3e5be2d0b12194941ddb614e52ca033a7f34

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tree_sitter_toolang-0.1.3-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 329be5470a6de43adfb81a134687a7fe2941b91659754749669f0d0abe8cc930
MD5 924e0b4811cf6c45540143a75db4b1fe
BLAKE2b-256 8a73bea1a2a63f465079d173df96943bfbd240f9968b51cd06329c90806d2b34

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tree_sitter_toolang-0.1.3-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 223202681ea37e6f19f2b7a86838f1345eae62d660575b131765782011534864
MD5 394304ca6a0b55798aee5dab76ebbdb1
BLAKE2b-256 9300b652c41d7c41ab2118c138e0a075343bffff02281305eefbb6601d2ef294

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tree_sitter_toolang-0.1.3-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 5d584458a0ec86f396e1f281ea8678d7f27a25152081b607171d4411f57fbb61
MD5 6ab09e1137d50d88edb04b2795158e31
BLAKE2b-256 7619ba6640d776fc0194857582658d7918fef73d5fe4d44ca1119b6811563655

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tree_sitter_toolang-0.1.3-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 652858a7ce52096fb4d8a7d099e6a27979c5e9a5b2f3aef3319ee166422dec02
MD5 403fe5296db52cdd04d2f32b76a2df3c
BLAKE2b-256 80953b5e26b9db038e322261cd46449ca4fa06d9264d4b0869452eaa2036bf66

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_toolang-0.1.3-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.3-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.3-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 a4a09a1d7494f8defad9051caa89ce6bda04162e481556ce260aa92e46064e2e
MD5 0c4904b4d4dcb6e759524b17e521c29f
BLAKE2b-256 4217ee0aea9f46b45beed3b8dd68b59f37ac70c3e5ee1efff2ce541d17fe854c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tree_sitter_toolang-0.1.3-cp310-abi3-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 8de008f6e80a79d5cc65ef99630dd315de0e3bd224f45545036e36c082b0e42d
MD5 93c2536eafa21440b02d6f96f0cb7f33
BLAKE2b-256 d5ce422ab1c208321c611176fbaaf4137c36e8c1fc0cbebda39eb8f7122b67e6

See more details on using hashes here.

Provenance

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