✓
Passing This code compiles and runs correctly.
Code
// Template engine: `{% if %}` control block in a |template| body.
// `flag` is a provided arg; non-empty captured text -> truthy -> guarded block
// emits. Anchors the cluster.
~import std/io
~pub tor maybe { flag: usize }
~[template]proc maybe|zig {
@import("std").debug.print("always\n", .{});
{% if flag %}
@import("std").debug.print("flag-set\n", .{});
{% endif %}
}
// JS sibling — the pin is the ENGINE (`{% if %}` over a provided arg's captured
// text), and the engine is target-blind: the same liquid render decides the same
// way for both variants. Only the guarded/unguarded statements are host text.
// `console.log` supplies the trailing newline.
~[template]proc maybe|js {
console.log("always");
{% if flag %}
console.log("flag-set");
{% endif %}
}
~maybe(flag: 1)
Actual
always
flag-set
Expected output
always
flag-set
Flows
flow ~maybe click a branch to expand · @labels scroll to their anchor
maybe (flag: 1)
Test Configuration
MUST_RUN