1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Compiler passes for the typeset pretty printing library
//!
//! This module contains all the individual compiler passes that transform
//! the Layout AST through various intermediate representations before
//! producing the final Doc structure.
//!
//! The passes execute in the following order:
//! 1. broken - Layout → Edsl (collapse broken sequences)
//! 2. serialize - Edsl → Serial (serialize to normalize)
//! 3. linearize - Serial → LinearDoc (lift newlines to spine)
//! 4. fixed - LinearDoc → FixedDoc (coalesce fixed comps)
//! 5. structurize - FixedDoc → RebuildDoc (rebuild with graph structure)
//! 6. denull - RebuildDoc → DenullDoc (remove null identities)
//! 7. identities - DenullDoc → DenullDoc (remove grp/seq identities)
//! 8. reassociate - DenullDoc → DenullDoc (reassociate compositions)
//! 9. rescope - DenullDoc → FinalDoc (rescope nest and pack)
//! 10. heap - FinalDoc → Doc (move to heap)
// Re-export all pass functions
pub use broken;
pub use denull;
pub use fixed;
pub use move_to_heap;
pub use identities;
pub use linearize;
pub use reassociate;
pub use rescope;
pub use serialize;
pub use structurize;