This library is in flux. APIs may change without notice. Generated from source with koruc 0.1.7 on 10/5/2026.
Compiler.with
~import std/compiler.withKoru Standard Library: the `with` part of compiler.kz.
compiler.with.kz · 1 tors
Koru Standard Library: the `with` part of compiler.kz. · 23 more lines
Koru Standard Library: the `with` part of compiler.kz.
Joined via `~part with` in compiler.kz; merged into the compiler
module at load.
resolve-with-scopes: the [with] vocabulary pass and its helpers.
[with] scoped-vocabulary resolution (641_010; concept
frag-with-declares-the-flows-vocabulary). Stage-A canonicalize stamps the
MAIN module onto every bare name with no import lookup, so a bare `match`
inside a grammar region arrives here as `<main>:match` and would die as an
unknown tor. `[with]` colors its whole flow — position is meaningless, the
gather runs over the entire subtree before any restamp — and the open set
is the union of every opener it finds: bare `[with]` derives the annotated
invocation's own module, `[with(a, b)]` names modules explicitly
(import-spelled, and each must be imported — KORU142). A bare name stamped
to its flow's home module that is NOT a real tor there but IS a real tor of
an opened module is re-qualified to it; matching is on the full dotted
event name, so `say.hi` and `log.hi` never collide on `hi`. Unresolved-only
— a name that genuinely resolves at home is never shadowed. Runs BEFORE
run-pre-transforms so the grammar transform (parser.kz `isVerb` keys off
the qualifier being present) sees the resolved `std.parser:match`. Mirrors
canonicalize_names' own flow/continuation/node recursion, so it visits
exactly the paths it does.
resolve-with-scopes
koru_std/compiler.with.kz:24// Koru Standard Library: the `with` part of compiler.kz.
// Joined via `~part with` in compiler.kz; merged into the compiler
// module at load.
//
// resolve-with-scopes: the [with] vocabulary pass and its helpers.
//
// [with] scoped-vocabulary resolution (641_010; concept
// frag-with-declares-the-flows-vocabulary). Stage-A canonicalize stamps the
// MAIN module onto every bare name with no import lookup, so a bare `match`
// inside a grammar region arrives here as `<main>:match` and would die as an
// unknown tor. `[with]` colors its whole flow — position is meaningless, the
// gather runs over the entire subtree before any restamp — and the open set
// is the union of every opener it finds: bare `[with]` derives the annotated
// invocation's own module, `[with(a, b)]` names modules explicitly
// (import-spelled, and each must be imported — KORU142). A bare name stamped
// to its flow's home module that is NOT a real tor there but IS a real tor of
// an opened module is re-qualified to it; matching is on the full dotted
// event name, so `say.hi` and `log.hi` never collide on `hi`. Unresolved-only
// — a name that genuinely resolves at home is never shadowed. Runs BEFORE
// run-pre-transforms so the grammar transform (parser.kz `isVerb` keys off
// the qualifier being present) sees the resolved `std.parser:match`. Mirrors
// canonicalize_names' own flow/continuation/node recursion, so it visits
// exactly the paths it does.
~pub tor resolve-with-scopes { ctx: CompilerContext } -> CompilerContext