✓
Passing Passing: the compiler rejects this program as expected.
Code
// Template engine: a condition outside the `{% if %}` grammar is a LOUD compile
// error (KORU125), never a silent false. `and` is not in the grammar — a
// condition is a bare key, or two operands compared with `==` / `!=`.
//
// The wall is what makes the grammar honest. Without it the whole condition
// text was looked up as one variable NAME, missed, and rendered `{% else %}`
// every time: a guarded branch that reads as live while being unreachable, and
// unreachable no matter what a later author writes inside it. Any fix attempted
// in that branch is inert, which is exactly how it stays undiscovered.
~import std/io
~pub tor probe-bad { n: usize }
~[template]proc probe-bad|zig {
{% if n and n %}@import("std").debug.print("never\n", .{});{% endif %}
}
~probe-bad(n: 1)
Actual compiler output
error[KORU125]: template condition `n and n` is not something `{% if %}` can evaluate
--> tests/regression/200_COMPILER_FEATURES/250_TEMPLATE_ENGINE/250_009_reject_unparseable_condition/input.kz:19:0
a condition is a bare key, or two operands compared with `==` / `!=`:
{% if arm.guard %} key is truthy (missing key = false)
{% if arm.guard != "" %} key is bound and non-empty
{% if node.kind == "call" %} key equals a literal
an operand is a key or a "quoted literal". `and`, `or`, `>` and filters
are not part of the grammar — restructure with nested tags, or move the
decision into the Zig side that builds the context.Must fail at runtime:
Program must error when executed.
Error output must contain
is not something `{% if %}` can evaluateFlows
flow ~probe-bad click a branch to expand · @labels scroll to their anchor
probe-bad (n: 1)
Test Configuration
MUST_ERROR