○
Planned This feature is planned but not yet implemented.
Feature: Transition metatype — fields are enums (EventEnum/BranchEnum) and the
Code
// PIN: a Transition-metatype tap handler that stringifies its fields.
// taps.eventToString/branchToString ARE emitted into the output's taps
// namespace (src/emitter_helpers.zig), but flow syntax cannot reach them:
// call-in-argument is KORU104-refused, and passing the enum fields bare
// (`t.source`) emits zig that does not compile (EventEnum into []const u8).
const std = @import("std");
~import std/taps
~tor hello {}
~tor goodbye {}
~[comptime|runtime] tor logger { source: string, branch: string, destination: ?string }
~proc hello|zig {
std.debug.print("Hello executed\n", .{});
}
~proc goodbye|zig {
std.debug.print("Goodbye executed\n", .{});
}
~[comptime|runtime] proc logger|zig {
if (destination) |dest| {
std.debug.print("Transition: {s}.{s} -> {s}\n", .{source, branch, dest});
} else {
std.debug.print("Transition: {s}.{s} -> terminal\n", .{source, branch});
}
}
~tap(* -> *)
| Transition t |> logger(source: taps.eventToString(t.source), branch: taps.branchToString(t.branch), destination: if (t.destination) |d| taps.eventToString(d) else null)
~hello() |> goodbye()
Expected output
Transition: start.done -> terminal
Hello executed
Transition: hello.done -> goodbye
Goodbye executed
Transition: goodbye.done -> terminal
Transition: end.done -> terminal
Flows
flow ~tap click a branch to expand · @labels scroll to their anchor
tap (* -> *)
flow ~hello click a branch to expand · @labels scroll to their anchor
hello
Test Configuration
MUST_RUN