An implementation of "Strictly Pretty" (2000) by Christian Lindig [0].
Inspired by the Elixir implementation of the same paper in Inspect.Algebra. Thanks to the core team for their hard work!
Includes plenty of Erlang-specific additions.
[0] https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.34.2200doc() = doc_nil | {doc_cons, doc(), doc()} | {doc_text, binary()} | {doc_nest, integer(), doc()} | {doc_underneath, integer(), doc()} | {doc_break, binary()} | {doc_group, doc(), inherit()} | {doc_force_break, doc()}
inherit() = self | inherit
tokens() = steamroller_ast:tokens()
format_tokens/2 | |
from_the_paper/2 | |
generate_doc/1 | |
pretty/2 | |
repeat/2 |
format_tokens(Tokens::tokens(), Width::integer()) -> binary()
from_the_paper(Width::integer(), Indent::integer()) -> binary()
pretty(Doc::doc(), Width::integer()) -> binary()
repeat(Bin::binary(), Times::integer()) -> binary()
Generated by EDoc