BAML grammar companion for treesitter-chunker
This optional package provides a pinned Tree-sitter BAML grammar through a Python
language() capsule. It is separate from the universal treesitter-chunker
wheel so projects that do not use BAML do not install a native extension.
The grammar comes from BoundaryML's read-only baml-treesitter mirror at the
commit recorded in pin.json. overlay.patch makes one source change:
prompt_field accepts the grammar's existing backtick_string production as
well as raw_string. This preserves the original source bytes, including
interpolation and line endings. The overlay is temporary until the upstream
BAML grammar accepts this prompt form. The package still needs a separate
distribution until treesitter-chunker deliberately adopts an upstream BAML
grammar in its pinned language pack.
from tree_sitter import Language, Parser
from treesitter_chunker_baml_grammar import language
parser = Parser(Language(language()))
tree = parser.parse(b"function greet() -> string { prompt: `Hello` }")
assert not tree.root_node.has_error
The source distribution needs a C compiler at installation time. The wheel
workflow builds cp311-abi3 wheels for Linux glibc x86_64/aarch64, macOS
x86_64/arm64, and Windows x86_64 and tests them on Python 3.11–3.13. Other
platforms use the source distribution until a wheel is tested there. Run
python scripts/check_baml_grammar.py to verify vendored hashes offline;
explicit regeneration requires the pinned tree-sitter-cli executable.
Feasibility evidence
At the pinned mirror commit, the unmodified grammar rejected the BAML 0.20.1
backtick prompt: form. The one-rule overlay generated an ABI-15 parser with
Tree-sitter CLI 0.25.10 without a conflict or warning. All 65 upstream corpus
cases passed. The focused fixtures cover the release example, old raw prompts,
multiline and block interpolation, adjacent declarations, bigints, generics,
Unicode, CRLF, and every initial declaration kind. They parse without ERROR
or MISSING nodes. Tests check original byte spans for prompt delimiters,
interpolations, and CRLF declarations. pin.json records the upstream source,
overlay, generator executable, and generated output SHA-256 values.
implements_for_declaration exposes interface and target fields but no
name field. The chunker integration must derive its stable symbol from those
fields; the grammar package preserves both spans.
Metadata
Release files for treesitter-chunker-baml-grammar 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| treesitter_chunker_baml_grammar-0.1.0.tar.gz | 175.6 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| treesitter_chunker_baml_grammar-0.1.0-cp311-abi3-win_amd64.whl | CPython 3.11 | abi3 | Windows x86-64 | Details |
| treesitter_chunker_baml_grammar-0.1.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl | CPython 3.11 | abi3 | Linux glibc 2.28+ ARM64, Linux glibc 2.17+ ARM64 | Details |
| treesitter_chunker_baml_grammar-0.1.0-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 |
| treesitter_chunker_baml_grammar-0.1.0-cp311-abi3-macosx_11_0_arm64.whl | CPython 3.11 | abi3 | macOS 11.0+ ARM64 | Details |
| treesitter_chunker_baml_grammar-0.1.0-cp311-abi3-macosx_10_9_x86_64.whl | CPython 3.11 | abi3 | macOS 10.9+ x86-64 | Details |
Total release size: 548.8 kB
Release files / treesitter_chunker_baml_grammar-0.1.0.tar.gz
| Download URL | treesitter_chunker_baml_grammar-0.1.0.tar.gz |
|---|---|
| Size | 175.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1bec385331cc37430e1e88a2160c250267993dcb576868d5d126e74dfcba1e3c
|
|
BLAKE2b-256 checksum How to use checksums |
e75edc2dc77d32e046f39c86ee8d5e56b2e315685bfc8c6ceb102617914ec903
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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 Sep 29, 2026.
Transparency logRelease files / treesitter_chunker_baml_grammar-0.1.0-cp311-abi3-win_amd64.whl
| Download URL | treesitter_chunker_baml_grammar-0.1.0-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 66.7 kB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
abc60a2b9d2e4d1e5b17c19ea768c4795b8d854b8aea0c3f78331b5fdb193c9e
|
|
BLAKE2b-256 checksum How to use checksums |
1c62c7191bd1f99615f192b1a26c9f3ad6d9d2c6d0bd155411477ba3e517b663
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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 Sep 29, 2026.
Transparency logRelease files / treesitter_chunker_baml_grammar-0.1.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
| Download URL | treesitter_chunker_baml_grammar-0.1.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 89.7 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
4c31e016ff1289eaa152ace7bc0469d1363185892765089f110ada0f93717cc4
|
|
BLAKE2b-256 checksum How to use checksums |
d281d8f7be8aa1ac092ab7f757ea06107a71cbf025162a59061d40472149bcf0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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 Sep 29, 2026.
Transparency logRelease files / treesitter_chunker_baml_grammar-0.1.0-cp311-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
| Download URL | treesitter_chunker_baml_grammar-0.1.0-cp311-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl |
|---|---|
| Size | 84.8 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 |
ca9781c691c22a8c171aa6df7989aa517e7275e92f718feaaf945a65abf3cb9a
|
|
BLAKE2b-256 checksum How to use checksums |
5d2a7d833c0a5c0643836953ae7218df9366da6cce9af20b53ab2740bb5c902a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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 Sep 29, 2026.
Transparency logRelease files / treesitter_chunker_baml_grammar-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | treesitter_chunker_baml_grammar-0.1.0-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 67.7 kB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5f37cb3c5ac757220f677a588ad36d5f641e4e08340c9d58926a2832c61180b5
|
|
BLAKE2b-256 checksum How to use checksums |
3f8e313bc03cdc0e0d8025a641190c84b8f52d06583daeebc45daebf648df107
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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 Sep 29, 2026.
Transparency logRelease files / treesitter_chunker_baml_grammar-0.1.0-cp311-abi3-macosx_10_9_x86_64.whl
| Download URL | treesitter_chunker_baml_grammar-0.1.0-cp311-abi3-macosx_10_9_x86_64.whl |
|---|---|
| Size | 64.3 kB |
| Tags | CPython 3.11 abi3 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
5a7bdb8df7c77d59b03362f6b082bddeefc1671ee0ee3dcf5ec7d63dc3ae5f21
|
|
BLAKE2b-256 checksum How to use checksums |
efbf37bb78bfbbd645061cee0e81ed06ad2db749e48546302f31dd0adab719d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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 Sep 29, 2026.
Transparency log