Skip to main content

tree-sitter-clean

CI discord matrix npm pypi crates.io

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/with clauses)
  • 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 .icl corpus 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 .dcl corpus (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 detection
  • field_access — record field access
  • list_comprehension — with generator, guard, let_qualifier
  • record_expression / record_update — record manipulation
  • wildcard — _ pattern
  • type_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.6

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-clean 1.2.6
File Size Uploaded Provenance Actions
tree_sitter_clean-1.2.6.tar.gz 2.2 MB Without provenance Details for tree_sitter_clean-1.2.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tree-sitter-clean 1.2.6
File Interpreter ABI Platform Actions
tree_sitter_clean-1.2.6-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.6-cp310-abi3-manylinux_2_39_x86_64.whl

Total release size: 3.1 MB

Release files / tree_sitter_clean-1.2.6.tar.gz

Download URL tree_sitter_clean-1.2.6.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
8f979299969d7a6bca217a4ab1d8330e294d9f2fa60751eb91e70f6027f32b46
BLAKE2b-256 checksum
How to use checksums
528fb72a2b62c467a28e7f7fa703f05c5b6af1fc68d0f4bb8e638db0b31dbc63
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.6-cp310-abi3-manylinux_2_39_x86_64.whl

Download URL tree_sitter_clean-1.2.6-cp310-abi3-manylinux_2_39_x86_64.whl
Size 806.3 kB
Tags CPython 3.10 Linux glibc 2.39+ x86-64 abi3
SHA-256 checksum
How to use checksums
4f33385d14cc6616a78375ce51794716ff51303724786a69e795a43d62a7d9cc
BLAKE2b-256 checksum
How to use checksums
4121c5d73458184518b9288328e4d40cce86ba684b84d57394aabc6f6bed535f
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.6

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.

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