sapling/
lib.rs

1//! A Rust-native tree-sitter.
2#![cfg_attr(docsrs, feature(doc_cfg))]
3#![allow(clippy::multiple_crate_versions)]
4
5/// Core structures and parsing logic for Tree-sitter grammars.
6///
7/// This module defines how Sapling understands and manipulates the
8/// declarative shape of a language: the grammar itself. Everything else
9/// in the compiler builds upon these types.
10pub mod grammar;
11
12/// Grammar validation and consistency checking utilities.
13///
14/// Validation exists to protect downstream stages (like codegen and analysis)
15/// from malformed grammars. It enforces Tree-sitter's invariants and ensures
16/// that what's parsed is also semantically meaningful.
17pub mod validate;
18
19pub use grammar::{parse_grammar, Grammar, GrammarError, Rule};
20pub use validate::{validate, ValidationError};