✓
Passing This code compiles and runs correctly.
Code
// GREEN PIN (was RED; found by AoC day 4): a LABEL ANCHOR on a subflow RHS
// (`~spin = #loop step(...)` + `@loop` re-invocation) used to PANIC koruc:
// lexer.withoutLabelAnchor chopped the line at the LAST `#` without checking
// that a valid label followed, so a PRE-invocation label truncated the whole
// invocation to "" — zero path segments — and tap_transformer.zig:162 indexed
// segments[0]. Fixed 2026-06-12: withoutLabelAnchor validates the label,
// parseSubflowImpl extracts a leading `#name` into Flow.pre_label, and the
// subflow emitter routes pre_label folds through emitFlow (same state-loop
// lowering as the top-level form, which 810_231's VM already proved).
// SPELLING NOTE: the original pin spelled `spin` with a single no-payload
// branch, which dies on PARSE003 (void-event rule) before reaching the bug;
// branches are identity-typed here so the pin exercises what it claims.
~import std/io
~event step { n: i64 }
| next i64
| done i64
~proc step|zig {
if (n < 3) return .{ .next = n + 1 };
return .{ .done = n };
}
~event spin {}
| finished i64
~spin = #loop step(n: 0)
| next v |> @loop(n: v)
| done r => finished r
~spin()
| finished f |> std/io:print.ln("ok {{ f:d }}")
Actual
ok 3
Expected output
ok 3
Test Configuration
MUST_RUN