Expand description
Eure formatter.
This crate provides formatting functionality for Eure files, using an IR-based architecture inspired by Wadler’s “A Prettier Printer” algorithm.
§Architecture
The formatter uses a three-stage pipeline:
- Parse - Source text → CST (done externally via
eure-parol) - Build - CST → Doc IR (intermediate representation)
- Print - Doc IR → Formatted string
§Example
ⓘ
use eure_fmt::{format, FormatConfig};
let input = "a={b=1,c=2}";
let config = FormatConfig::default();
let formatted = format(input, &config).unwrap();Re-exports§
pub use config::FormatConfig;pub use doc::Doc;pub use source::build_source_doc;pub use source::format_source_document;
Modules§
- config
- Formatter configuration.
- doc
- Document IR for the Eure formatter.
- printer
- Wadler-style pretty printer.
- source
- Formatter for SourceDocument.
Structs§
- Text
Edit - A text edit representing a change to apply.
Enums§
- Format
Check Result - Result of checking if a file is formatted.
- Format
Error - Error that can occur during formatting.
Functions§
- build_
doc - Build a Doc IR from a CST.
- compute_
edits - Compute text edits to transform input into formatted output.
- format_
cst - Format Eure source code using an already-parsed CST.