Installation
[]
= "1.0"
Or from the terminal:
Usage
Implement Pass for each transform, register them in order with PassManager::add, and run the pipeline. Each pass reports whether it changed the unit, so the manager can drive the pipeline to a fixpoint and tell you what happened.
use ;
// The unit is whatever a pass rewrites — here, a list of integers.
;
// Halve every value greater than one.
;
let mut pm = new;
pm.add.add;
let mut unit = vec!;
let report = pm.run_to_fixpoint.expect;
assert_eq!; // zeros dropped, 8 and 4 halved to 1
assert!;
A pass that cannot proceed returns a PassError instead of panicking; the manager stops the pipeline and names the pass that failed. The unit type is anything a pass rewrites — an IR, a function, a module, an AST, or a struct bundling an IR with the diagnostics and analysis a pass needs.
Runnable examples: examples/expr_optimizer.rs (constant folding and algebraic simplification to a fixpoint, with the error path), examples/text_normalizer.rs (the same machinery over a String), and examples/contextual_passes.rs (a unit that bundles code with a diagnostics log, so passes share context without a global).
Documentation
- API Reference — every public item, with examples.
- ROADMAP — the path to a frozen 1.0.
- CHANGELOG.
Contributing
See dev/DIRECTIVES.md for engineering standards and the definition of done. Before a PR: cargo fmt --all, cargo clippy --all-targets --all-features -- -D warnings, and cargo test --all-features must be clean.