Skip to main content

tree-sitter-compact

CI crates npm pypi

Compact grammar for tree-sitter.

This grammar parses the entire Compact programming language. It is based on the formal grammar published by the Midnight Foundation.

Compatibility

This grammar is a single superset grammar that accepts the Compact language across all currently supported toolchains — from 0.31.1 (language 0.23.0, runtime 0.16.0), the version on the current Midnight mainnet (ledger 8), through 0.35.0 (language 0.27.0, runtime 0.20.0), which targets ledger 9.

Support starts at 0.31.1: the grammar does not accept legacy syntax such as top-level body-less circuit declarations or the old assert expr "msg"; statement.

Grammar Compact language Compact toolchain Runtime Ledger
0.3.x 0.23.0 – 0.27.0 0.31.1 – 0.35.0 0.16.0 – 0.20.0 8, 9
0.2.x 0.23.0 0.31.1 0.16.0 8
0.1.x 0.23.0 0.31.1 0.16.0 8

The grammar is version-agnostic: it does not evaluate pragma language_version and accepts the union of supported syntax. Use the Compact compiler to enforce the language version; the grammar is intended for parsing, highlighting, and editor tooling. See COMPATIBILITY.md for the full mapping and release/versioning policy.

The grammar follows independent Semantic Versioning: the parse tree is the public API, so adding nodes or fields is a minor release and breaking tree changes are major. The supported Compact version is tracked in this table and in the package metadata, not in the grammar version.

Grammars are validated against the compiler's own corpus with scripts/conformance.sh; see scripts/grammar-delta.sh for checking a new Compact release.

Fork

This repository is a community fork of midnightntwrk/compact-tree-sitter. The upstream project is archived and no longer maintained, so this fork is developed and maintained independently.

It remains licensed under the Apache License 2.0, the same license as the upstream project. See NOTICE for attribution.

Features

  • Incremental — after an edit, tree-sitter updates the existing syntax tree and reuses the unchanged parts of it, so re-parsing is usually sub-millisecond.
  • Bindings — first-class bindings for C, Go, Node.js, Python, Rust, and Swift.
  • Highlighting — ships a highlights.scm query for syntax highlighting.
  • WASM — can be compiled to WebAssembly for use in the browser and editors.

Usage

Node.js

const Parser = require("tree-sitter");
const Compact = require("tree-sitter-compact");

const parser = new Parser();
parser.setLanguage(Compact);

Rust

[dependencies]
tree-sitter = "0.25"
tree-sitter-compact = "0.3"

Python

import tree_sitter_compact

References

License

Apache License 2.0

Metadata

Release files for tree-sitter-compact 0.3.0

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-compact 0.3.0
File Size Uploaded Provenance Actions
tree_sitter_compact-0.3.0.tar.gz 88.9 kB Without provenance Details for tree_sitter_compact-0.3.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for tree-sitter-compact 0.3.0
File Actions
tree_sitter_compact-0.3.0-cp310-abi3-win_arm64.whl CPython 3.10 abi3 Windows ARM64 Details for tree_sitter_compact-0.3.0-cp310-abi3-win_arm64.whl
tree_sitter_compact-0.3.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for tree_sitter_compact-0.3.0-cp310-abi3-win_amd64.whl
tree_sitter_compact-0.3.0-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details for tree_sitter_compact-0.3.0-cp310-abi3-musllinux_1_2_x86_64.whl
tree_sitter_compact-0.3.0-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details for tree_sitter_compact-0.3.0-cp310-abi3-musllinux_1_2_aarch64.whl
tree_sitter_compact-0.3.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64, Linux glibc 2.28+ ARM64 Details for tree_sitter_compact-0.3.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
tree_sitter_compact-0.3.0-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl CPython 3.10 abi3 Linux glibc 2.5+ x86-64, Linux glibc 2.28+ x86-64 Details for tree_sitter_compact-0.3.0-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
tree_sitter_compact-0.3.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for tree_sitter_compact-0.3.0-cp310-abi3-macosx_11_0_arm64.whl
tree_sitter_compact-0.3.0-cp310-abi3-macosx_10_9_x86_64.whl CPython 3.10 abi3 macOS 10.9+ x86-64 Details for tree_sitter_compact-0.3.0-cp310-abi3-macosx_10_9_x86_64.whl

Total release size: 541.9 kB

Release files / tree_sitter_compact-0.3.0.tar.gz

Download URL tree_sitter_compact-0.3.0.tar.gz
Size 88.9 kB
Tags Source
SHA-256 checksum
How to use checksums
20446d2fddbc55ae348d6d6c89b9f1005b2f3a81497526a82cd209935294b671
BLAKE2b-256 checksum
How to use checksums
f3824e9486265ea8bfb163278b332d999d658b49579c42cc94b64633d7470b6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / tree_sitter_compact-0.3.0-cp310-abi3-win_arm64.whl

Download URL tree_sitter_compact-0.3.0-cp310-abi3-win_arm64.whl
Size 53.8 kB
Tags CPython 3.10 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
c4e9201c10208661b0a43933caa6517ba2164df81ab81fad812e5784f697d089
BLAKE2b-256 checksum
How to use checksums
25fcfb454d21ecece041d0ea105cebf4479a1b01c30e69d07c0b458319209d29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / tree_sitter_compact-0.3.0-cp310-abi3-win_amd64.whl

Download URL tree_sitter_compact-0.3.0-cp310-abi3-win_amd64.whl
Size 54.1 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
c5db4c4fb230956ab21e9dc84c6550eef49f32d8e488ec06388984039226e889
BLAKE2b-256 checksum
How to use checksums
96649038bf9df11b2ac219eae97097dd364f895d95c8557e0cfe961116cbe082
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / tree_sitter_compact-0.3.0-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL tree_sitter_compact-0.3.0-cp310-abi3-musllinux_1_2_x86_64.whl
Size 60.6 kB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
3d6dcb166be8e9e34103c8dd63e6a5d1056ac96789661013606c3a9c61dd701d
BLAKE2b-256 checksum
How to use checksums
b8063b6fd377326877b856fedc10ac00bc3f9a68dd7a12f116ff04b2b174f8ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / tree_sitter_compact-0.3.0-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL tree_sitter_compact-0.3.0-cp310-abi3-musllinux_1_2_aarch64.whl
Size 60.7 kB
Tags CPython 3.10 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
0976cc7b75d011be33c8e0f17fbfe445002beb9a27fee802db84f0e679ff4aed
BLAKE2b-256 checksum
How to use checksums
6412f651976b24da68c99fddb999b2407652613db921ba3fbe0607731ddc5b9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / tree_sitter_compact-0.3.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Download URL tree_sitter_compact-0.3.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 61.2 kB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
6d5d8be942d4be2ce1be72a4539e952f1944a36b6d5bcf9144f3bafae41c94b5
BLAKE2b-256 checksum
How to use checksums
d50751e04483e60ce2344f179dda7d031f7dcb92ad1391abdf12ab7d2590fc32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / tree_sitter_compact-0.3.0-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl

Download URL tree_sitter_compact-0.3.0-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Size 60.6 kB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 abi3
SHA-256 checksum
How to use checksums
053d03f13cf13319903169126552a455873523f55306f0af030b4f51ff439490
BLAKE2b-256 checksum
How to use checksums
352a9b5e293c8d536770212ad22d67d1644b44dbf4ff5952d4b4c2b7d746e6ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / tree_sitter_compact-0.3.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL tree_sitter_compact-0.3.0-cp310-abi3-macosx_11_0_arm64.whl
Size 51.9 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c99d1960e560d418b1838ec5a2786bc59c7a887836370c9d02bfa6dc1fa60754
BLAKE2b-256 checksum
How to use checksums
97ecac27172cc85b77147da9bc33f2fc483d6513acf3ce5e4f19d89363a7934b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / tree_sitter_compact-0.3.0-cp310-abi3-macosx_10_9_x86_64.whl

Download URL tree_sitter_compact-0.3.0-cp310-abi3-macosx_10_9_x86_64.whl
Size 50.1 kB
Tags CPython 3.10 abi3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
32d265ba23368c7b5634d97bd17bf1654df6bce969d18234fa908b1d77c3e451
BLAKE2b-256 checksum
How to use checksums
f4ae528b001aaa1fa9772c7edae6bda92df4604154571730860c8699626f1fdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for tree-sitter-compact 0.3.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

9 release files No provenance

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