This library is in flux. APIs may change without notice. Generated from source with koruc 0.1.7 on 9/16/2026.
Compiler.control
~import std/compiler.controlCompiler pipeline control flow.
compiler.control.kz · 2 tors
Compiler pipeline control flow.
[template] constructs (std/control:if, cond, for) splice host source text
and only expand where the per-call template pass reaches. Compiler pipeline
definitions — coordinate overrides and other impl-of-comptime flows — are
rebuilt downstream of that pass, so templates never expand there; the
fallback (calling the unreachable stub handler) always fails. Branch here
on VALUES instead: a plain proc returning a branch union lowers in every
position — pipeline overrides, walked flows, and plain runtime code.
// Compiler pipeline control flow.
//
// [template] constructs (std/control:if, cond, for) splice host source text
// and only expand where the per-call template pass reaches. Compiler pipeline
// definitions — coordinate overrides and other impl-of-comptime flows — are
// rebuilt downstream of that pass, so templates never expand there; the
// fallback (calling the unreachable stub handler) always fails. Branch here
// on VALUES instead: a plain proc returning a branch union lowers in every
// position — pipeline overrides, walked flows, and plain runtime code.
~[comptime] pub tor branch { cond: bool }
| yes
| nometrics-format
koru_std/compiler.control.kz:22// Helper: Format metrics string
~pub tor metrics-format {
passes_completed: u32,
allocator: std.mem.Allocator
} -> string