✓
Passing This code compiles and runs correctly.
Code
// Cut-2 restriction: no capture groups under alternation — a group on an
// untaken branch has no span, and "empty when skipped" is a silent lie.
// Rejected loudly at the match site.
import std/io
import std/regex
std/regex:match("b")
| `a|(?<x>b)` { x } |> std/io:print.ln("{{ x:s }}")
| no-match |> std/io:print.ln("no")
Must contain:
GroupUnderAlternationError Verification
Actual Compiler Output
🎯 Compiler coordination: Passes: 14 (flow-based: frontend, analysis, emission)
Error: output_emitted.zig:10:16: error: regex: cannot compile pattern `a|(?<x>b)`: GroupUnderAlternation
comptime { @compileError("regex: cannot compile pattern `a|(?<x>b)`: GroupUnderAlternation"); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
main_module: output_emitted.zig:9:25
main: output_emitted.zig:438:5
4 reference(s) hidden; use '-freference-trace=6' to see all referencesTest Configuration
MUST_FAIL