Skip to main content

Clean grammar for tree-sitter

Project description

tree-sitter-clean

CI discord matrix crates npm pypi

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)

Node Types

The grammar produces 69 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

Usage

Rust

let mut parser = tree_sitter::Parser::new();
parser.set_language(&tree_sitter_clean::LANGUAGE.into())?;

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tree_sitter_clean-1.0.0.tar.gz (59.7 kB view details)

Uploaded Source

File details

Details for the file tree_sitter_clean-1.0.0.tar.gz.

File metadata

  • Download URL: tree_sitter_clean-1.0.0.tar.gz
  • Upload date:
  • Size: 59.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for tree_sitter_clean-1.0.0.tar.gz
Algorithm Hash digest
SHA256 86d9522820e2f513a96b4c847b6b41f1bbf34b09a23c55951c37e4908a5d2c05
MD5 f434897e36202acd4ebff89ebccf7f51
BLAKE2b-256 29941ab3c890aa099a515547c3fe4bdd8fe6cf4e359f274b9f0b59accb7b613f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page