✗
Failing This test is currently failing.
Failed: backend-exec
Error Details
output_emitted.zig:102:31: error: expected '=', found '}'
Failure Output
🎯 Compiler coordination: Passes: 17 (flow-based: frontend, analysis, emission)
Error: output_emitted.zig:102:31: error: expected '=', found '}'
return { r.c, r.m };
^ Code
// AoC 2015 Day 8 Part 1 — ported to use std/switch:char for the two
// char-dispatch sites in the escape scanner. Output must match the original
// if-tree implementation (12).
import std/io
import std/fs
import std/switch
pub event measure { line: []const u8 } -> { c: i64, m: i64 }
measure = capture { c: 0[i64], m: 0[i64], st: 0[i64] }
! as a |> for(line)
! each ch |> captured { c: a.c + 1 } |> if(a.st == 0)
| then |> captured { st: 1 }
| else |> if(a.st == 2)
| then |> std/switch:char(ch)
| `x` _ |> captured { st: 3 }
| no-match |> captured { m: a.m + 1, st: 1 }
| else |> if(a.st == 3)
| then |> captured { st: 4 }
| else |> if(a.st == 4)
| then |> captured { m: a.m + 1, st: 1 }
| else |> std/switch:char(ch)
| `\` _ |> captured { st: 2 }
| `"` _ |> captured { st: 5 }
| no-match |> captured { m: a.m + 1 }
| captured r -> { r.c, r.m }
capture { diff: 0[i64] }
! as acc |> std/fs:read-lines(path: "tests/regression/600_STDLIB/645_SWITCH/645_004_day08_switch/input.txt")
! line l |> measure(line: l)
| counted { c, m } |> captured { diff: acc.diff + c - m }
| done _ |> _
| failed e |> std/io:print.ln("FAILED {{ e:s }}")
| captured total |> std/io:print.ln("{{ total.diff:d }}")
Expected output
12
Flows
subflow ~measure click a branch to expand · @labels scroll to their anchor
capture (source: c: 0[i64], m: 0[i64], st: 0[i64])
flow ~capture click a branch to expand · @labels scroll to their anchor
capture (source: diff: 0[i64])
Test Configuration
MUST_RUN