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.8

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

Built distribution (wheel)

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

Total release size: 3.0 MB

Release files / tree_sitter_clean-1.2.8.tar.gz

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

Download URL tree_sitter_clean-1.2.8-cp310-abi3-manylinux_2_39_x86_64.whl
Size 807.5 kB
Tags CPython 3.10 Linux glibc 2.39+ x86-64 abi3
SHA-256 checksum
How to use checksums
5936d053ad2985d567e2c5e802e1c33279fb2911198ecbb581d4b664626863ec
BLAKE2b-256 checksum
How to use checksums
4e4832cfc3889bf2b24012d295c0ceec7c10c39a3d6ef93701c322c7a63fafc3
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.8

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