This library is in flux. APIs may change without notice. Generated from source with koruc 0.1.7 on 10/5/2026.
Compiler.stages
~import std/compiler.stagesKoru Standard Library: the `stages` part of compiler.kz.
compiler.stages.kz · 2 tors
Koru Standard Library: the `stages` part of compiler.kz.
Joined via `~part stages` in compiler.kz; merged into the compiler module at load.
The pre-emission AST stage procs: the per-call template pass and the
`.pre` transform stage that must run before it. They live apart from the
pass-runner body because they are a named family — graft-aware ordering
is their whole contract.
Template processor: walks AST, renders any proc whose variant chain
starts with `template|...` through Liquid, then strips the `template`
tag so downstream emission sees a plain host-language proc. See
memory project_proc_variant_pipeline / docs/EFFECT_BRANCHES for the
`host[:processor]` story this implements.
process-template-procs
koru_std/compiler.stages.kz:14// Koru Standard Library: the `stages` part of compiler.kz.
// Joined via `~part stages` in compiler.kz; merged into the compiler module at load.
//
// The pre-emission AST stage procs: the per-call template pass and the
// `.pre` transform stage that must run before it. They live apart from the
// pass-runner body because they are a named family — graft-aware ordering
// is their whole contract.
//
// Template processor: walks AST, renders any proc whose variant chain
// starts with `template|...` through Liquid, then strips the `template`
// tag so downstream emission sees a plain host-language proc. See
// memory project_proc_variant_pipeline / docs/EFFECT_BRANCHES for the
// `host[:processor]` story this implements.
~pub tor process-template-procs { ctx: CompilerContext } -> CompilerContextrun-pre-transforms
koru_std/compiler.stages.kz:39// Pre-stage transforms: run the transform runner's `.pre` stage BEFORE the
// template pass. A transform that GRAFTS templated code — e.g. std/constructor
// dissolving into a comptime list plus a `for` over the var it just defined —
// must dissolve FIRST, so the template pass then processes the graft as ordinary
// code. Only `.pre`-tagged transforms fire here; `.main`/`.post` still run at
// Phase 2.4 (evaluate-comptime). `.pre` transforms carry @pass_ran, so that later
// all-stages run re-visits them as no-ops. This is the named-stage design: the
// pipeline sprinkles transform stages where they belong, deliberately.
~pub tor run-pre-transforms { ctx: CompilerContext } -> CompilerContext