tree-sitter-clean
Clean grammar for tree-sitter.
Description
Clean is a general-purpose, purely functional programming language with uniqueness typing. This grammar supports:
- Module system (
module,import,from...import) - Type system (
::, algebraic data types, records, type classes) - Functions (named, guards,
where/withclauses) - Patterns (variables, constructors, wildcards, lists, tuples)
- Expressions (application, infix operators, let, case, lambda)
- Comprehensions (list comprehensions with generators, guards, let qualifiers)
- Records (construction, update, field access)
Coverage
The grammar is validated against the real-world Clean corpus
(clean-stdlib, Clyde, cloogle.org — 120 .icl + 119 .dcl files):
- 1833 ERROR nodes across the
.iclcorpus vs 5129 before the grammar overhaul (2.8× better), with the core stdlib (StdEnv, StdList, StdString, StdMaybe) at 0 errors - 13 ERROR nodes across the
.dclcorpus (down from 282) - 55/55 corpus tests, parse throughput ~1.3× the pre-overhaul parser
Known Gaps
Clean constructs the grammar does not (fully) parse yet are documented in GRAMMAR-GAPS.md, along with the approaches that were tried and rejected on the full corpus. Remaining gaps are confined to regions the reference parser also fails heavily; closing them is blocked by a tree-sitter generator action-table ceiling (see the doc).
Node Types
The grammar produces 189 named node types for precise AST analysis, including:
application— function/constructor call detectionfield_access— record field accesslist_comprehension— withgenerator,guard,let_qualifierrecord_expression/record_update— record manipulationwildcard—_patterntype_definition/type_signature/class_context— the type system
Usage
Rust
let mut parser = tree_sitter::Parser::new();
parser.set_language(&tree_sitter_clean::LANGUAGE.into())?;
Add tree-sitter-clean to your Cargo.toml to use it as a dependency:
[dependencies]
tree-sitter-clean = "1.2"
JavaScript
const Parser = require("tree-sitter");
const Clean = require("tree-sitter-clean");
const parser = new Parser();
parser.setLanguage(Clean);
Python
import tree_sitter_clean
References
Releasing
See RELEASE.md for the verified procedure to publish to npm, PyPI, and crates.io.
Metadata
Release files for tree-sitter-clean 1.2.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tree_sitter_clean-1.2.7.tar.gz | 2.2 MB | Without provenance | Details for tree_sitter_clean-1.2.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tree_sitter_clean-1.2.7-cp310-abi3-manylinux_2_39_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.39+ x86-64 | Details for tree_sitter_clean-1.2.7-cp310-abi3-manylinux_2_39_x86_64.whl |
Total release size: 3.0 MB
Release files / tree_sitter_clean-1.2.7.tar.gz
| Download URL | tree_sitter_clean-1.2.7.tar.gz |
|---|---|
| Size | 2.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
843235e1c22dfffd7f57844b0035d1bdaef2056645bf7e10c3b8ced9882c4d25
|
|
BLAKE2b-256 checksum How to use checksums |
1ac644cb8321a0cd1df94eaf0c6927c6dd305e73172ee2eaf72556092b8d3e1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / tree_sitter_clean-1.2.7-cp310-abi3-manylinux_2_39_x86_64.whl
| Download URL | tree_sitter_clean-1.2.7-cp310-abi3-manylinux_2_39_x86_64.whl |
|---|---|
| Size | 806.9 kB |
| Tags | CPython 3.10 Linux glibc 2.39+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
fe6275486d093da98589999f047a6bb733f4842d9dfbdce014ec517a9f1160ce
|
|
BLAKE2b-256 checksum How to use checksums |
09d3900d0bcb1854f058899676a1fcf83fd01fb0dcc177bbd86110a20540e9e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for tree-sitter-clean 1.2.7
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.