Expand description
Printer infrastructure: allocators, traits, and the printing pipeline.
This module contains the common plumbing that backends and printers rely on to turn AST values into formatted text:
- [
Allocator]: a thin wrapper around theprettycrate’s allocator, parameterized by the backend, used to producepretty::Docnodes. PrettyAst: the trait that printers implement to provide per-type formatting of Hax AST nodes (re-exported frompretty_ast).- The resugaring pipeline: a sequence of local AST rewrites that make emitted code idiomatic for the target language before pretty-printing.
Re-exports§
pub use pretty_ast::PrettyAst;
Modules§
- pretty_
ast - Pretty-printing support for the hax AST.
- render_
view - Tools for rendering Rust paths into strings.
Structs§
- Source
Map - Placeholder type for sourcemaps.
Traits§
- HasLinked
Item Graph - Getter and setter for
LinkedItemGraph, useful for printers. - Helper trait to print AST fragments.
- Printer
- A printer defines a list of resugaring phases.
- Resugaring
- A resugaring is an erased mapper visitor with a name.
A resugaring is a local transformation on the AST that produces exclusively
ast::resugarednodes. Any involved or non-local transformation should be a phase, not a resugaring.