sqlode/codegen/builder
Minimal line-oriented builder for emitting generated Gleam source code.
A Block is an ordered list of already-rendered lines. Callers stitch
blocks together with concat, add blank separators with blank, and
attach leading indentation with indent. render flattens a block to
the final String by joining on "\n".
The builder intentionally does not try to model reflow (Wadler-style
Doc) — generated Gleam code is layout-deterministic and lists of
lines are the idiom already used across the codegen modules.
Types
Values
pub fn blank() -> Block
A block containing a single empty line, used as a visual separator.
pub fn empty() -> Block
A block containing no lines at all. Useful for conditional sections.
pub fn indent(block: Block, by by: Int) -> Block
Prepend by spaces to every non-empty line in the block.
Empty lines stay empty so the output never has trailing whitespace.
pub fn lines(values: List(String)) -> Block
A block from an explicit list of pre-split lines.