CodeBuilder¶
Import: import system.codegen;
CodeBuilder¶
Accumulates Dream source lines for generator emit_extend / emit_file bodies. Indentation mirrors C# / Rust IndentedTextWriter: indent() / dedent() adjust depth; line / append apply the current indent only at the start of a line.
constructor¶
Creates a builder that indents with four spaces.
with_spaces¶
Creates a builder whose indent unit is spaces ASCII spaces.
indent¶
Increases the indent depth by one unit.
dedent¶
Decreases the indent depth by one unit (no-op at zero).
line¶
Writes text as a full line at the current indent, then starts a new line.
append¶
Appends text without a trailing newline (indent applied only at line start).
to_string¶
Returns the accumulated source text.