Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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

Building from this branch requires Python 3.11 or newer. The published 0.4.0a1 release still supports Python 3.10.

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"with 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.4.0-alpha.4"
let language = tree_sitter::Language::new(tree_sitter_toolang::LANGUAGE);

Grammar

GRAMMAR.md documents the public Toolang syntax and CST contract. grammar.js is the parser source of truth; generated artifacts live under src/.

Version 0.4.0-alpha.4 adds async run and single-handle await for handles from async runs or spawn, including named and nameless let bindings. local_name is now a leaf, and await _ is invalid. See the migration notes; execution and binding effects require matching Toolang runtime support.

Version 0.4.0-alpha.3 allows an optional until at any position in a repeat, including a named runnable condition. It changes the repeat CST and rejects keyword-named variables. See the migration notes; Toolang consumers need the matching CST update.

Version 0.4.0-alpha.2 adds named and inline spawn targets, including typed inline targets and optional let bindings. See the spawn syntax notes. Execution and handle semantics require matching Toolang runtime support.

Version 0.4.0-alpha.1 uses run in place of scatter/gather, renames storm/settle to generate/reduce, and requires using only for named collection targets. See the migration notes. These forms require a matching Toolang runtime release.

Install this prerelease explicitly with python -m pip install tree-sitter-toolang==0.4.0a4 or npm install tree-sitter-toolang@0.4.0-alpha.4.

Version 0.3.4 adds named and inline exec statements in flows and repeats. See the Flow reference for syntax and CST fields.

Version 0.3.3 shares configuration directives between agics and flows, removes the count from scatter, adds optional from: initializers to settle, and adds windowing N to repeat. See the 0.3.3 migration notes.

Documentation comments use #@ for modules and ## for items, including ## @param NAME DESCRIPTION. The legacy ##! module marker remains accepted. See comments and documentation for syntax, CST fields, and the 0.3.2 node-name migration.

Development

Edit:

  • GRAMMAR.md
  • grammar.js
  • queries/*.scm
  • test/corpus/*.txt
  • tests/fixtures/*.too
  • tests/*.py

Regenerate and test:

npm ci
python -m venv .venv
.venv/bin/python -m pip install -e '.[tests]'

npm run check
.venv/bin/python -m pytest tests
.venv/bin/python -m unittest discover -s scripts -p 'test_*.py'
cargo test

Publishing

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

Python wheels use the cp311-abi3 tag for compatibility with Python 3.11 and later. Both wheel and release workflows build Linux x86_64 and ARM64 wheels on separate native runners, covering manylinux and musllinux. macOS universal2 and Windows AMD64 builds are also retained. Every wheel build runs the full Python test suite.

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, package-lock.json, pyproject.toml, Cargo.toml, Cargo.lock, and tree-sitter.json.
  2. Confirm CI is green.
  3. Merge the version bump PR into main.
  4. Create and push a matching tag such as v0.4.0-alpha.1.
  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.

Prereleases use X.Y.Z-alpha.N, X.Y.Z-beta.N, or X.Y.Z-rc.N consistently in source metadata and tags. Python packaging normalizes these to X.Y.ZaN, X.Y.ZbN, or X.Y.ZrcN; for example, 0.4.0-alpha.1 is published on PyPI as 0.4.0a1. npm prereleases use the next dist-tag; stable releases use latest.

Metadata

Release files for tree-sitter-toolang 0.4.0a4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tree-sitter-toolang 0.4.0a4
File Size Uploaded
tree_sitter_toolang-0.4.0a4.tar.gz 127.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for tree-sitter-toolang 0.4.0a4
File
tree_sitter_toolang-0.4.0a4-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
tree_sitter_toolang-0.4.0a4-cp311-abi3-musllinux_1_2_x86_64.whl CPython 3.11 abi3 Linux musl 1.2+ x86-64 Details
tree_sitter_toolang-0.4.0a4-cp311-abi3-musllinux_1_2_aarch64.whl CPython 3.11 abi3 Linux musl 1.2+ ARM64 Details
tree_sitter_toolang-0.4.0a4-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64, Linux glibc 2.28+ ARM64 Details
tree_sitter_toolang-0.4.0a4-cp311-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl CPython 3.11 abi3 Linux glibc 2.5+ x86-64, Linux glibc 2.28+ x86-64 Details
tree_sitter_toolang-0.4.0a4-cp311-abi3-macosx_10_9_universal2.whl CPython 3.11 abi3 macOS 10.9+ universal2 (ARM64, x86-64) Details

Total release size: 578.4 kB

Release files / tree_sitter_toolang-0.4.0a4.tar.gz

Download URL tree_sitter_toolang-0.4.0a4.tar.gz
Size 127.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d854c3f5bc3c044593993b5fb537595adb482a7c991a895370633d1539032f12
BLAKE2b-256 checksum
How to use checksums
1764e5de7f225910e2fe7c95b43dcfb8247b7c06c2f924c70abe084fb18a7d22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release files / tree_sitter_toolang-0.4.0a4-cp311-abi3-win_amd64.whl

Download URL tree_sitter_toolang-0.4.0a4-cp311-abi3-win_amd64.whl
Size 53.1 kB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
f32c32032dc6c9bc42ab3407aa4397e2a530a01dd4b3735b1f90044849fe09d7
BLAKE2b-256 checksum
How to use checksums
badbfbed9729a1e9ec420d7c5fccd6b9c0a5fb64bff5392f355b47335d0f02ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release files / tree_sitter_toolang-0.4.0a4-cp311-abi3-musllinux_1_2_x86_64.whl

Download URL tree_sitter_toolang-0.4.0a4-cp311-abi3-musllinux_1_2_x86_64.whl
Size 76.0 kB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
0173d746bc906eb265cd671f39a6e193017cc9c5e3d22bbfb78c8116f76e669e
BLAKE2b-256 checksum
How to use checksums
e9fb4e57929fa90e338e9fa974fbaafea5cc2a5bd0cbc84e02528397627196d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release files / tree_sitter_toolang-0.4.0a4-cp311-abi3-musllinux_1_2_aarch64.whl

Download URL tree_sitter_toolang-0.4.0a4-cp311-abi3-musllinux_1_2_aarch64.whl
Size 75.9 kB
Tags CPython 3.11 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
e3f4928a4b7274f6a18407b3a713fa8ec36167faff17100089ad2c155c537137
BLAKE2b-256 checksum
How to use checksums
5997accfb51c6b0dd463c7d4596edd7919f68f99fddd4b11be063e084fb99040
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release files / tree_sitter_toolang-0.4.0a4-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Download URL tree_sitter_toolang-0.4.0a4-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 77.2 kB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
d7cadf3e44052ef1ac2a711e2ea0cc2b7c471e87ba9eed288ea1b6ab0d03ba7c
BLAKE2b-256 checksum
How to use checksums
efbee5cab2d11e3353648359d650b0f5595af4444d778c6b9894cf575b4af609
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release files / tree_sitter_toolang-0.4.0a4-cp311-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl

Download URL tree_sitter_toolang-0.4.0a4-cp311-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Size 76.3 kB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 abi3
SHA-256 checksum
How to use checksums
b4abeb5d000814bcfe08f72db24cd67ab48fb178f8cbc580b6bcded61bccdab7
BLAKE2b-256 checksum
How to use checksums
f570fe0251c6cc77b4101410c037685053aa3b41f95d71d791b7100eeb86e1f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release files / tree_sitter_toolang-0.4.0a4-cp311-abi3-macosx_10_9_universal2.whl

Download URL tree_sitter_toolang-0.4.0a4-cp311-abi3-macosx_10_9_universal2.whl
Size 92.0 kB
Tags CPython 3.11 abi3 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
f93388503a72d4cf5bc63c386b9fd26e926cf45e7fa54d3b290f5a725465f37c
BLAKE2b-256 checksum
How to use checksums
b48fccd24f2e4f6f139f663948de4907cd9c9286149c279d4f7c8c94aefc3d00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page