✓
Passing This code compiles and runs correctly.
Code
// 230_035: `.location` literals in backend_output_emitted.zig must escape
// backslashes. emitInvocationMetaFields wrote `loc.file` raw into a Zig
// string literal — on a Windows host the absolute path arrives as
// `W:\src\...` and the emitted file cannot parse (`\s`, `\k` are not Zig
// escapes). post.sh pins the literal shape: any `\` inside a .file literal
// must be part of a `\\` pair. Vacuous on POSIX (no backslashes in paths);
// on Windows the backend build itself would refuse first — this names it.
import std/io
std/io:print.blk {
loc file literal pin
}
Actual
loc file literal pin
Expected output
loc file literal pin
Flows
flow ~print.blk click a branch to expand · @labels scroll to their anchor
print.blk (source: loc file literal pin)
Test Configuration
MUST_RUN
Post-validation Script:
#!/bin/bash
# Pin: every `.file = "…"` literal in backend_output_emitted.zig escapes
# backslashes. Strip all `\\` pairs, then any remaining `\` is a raw
# Windows path separator that zig's lexer would refuse.
set -u
src=backend_output_emitted.zig
if [ ! -f "$src" ]; then
echo "FAIL: no $src"
exit 1
fi
bad=$(grep -o '\.file = "[^"]*"' "$src" | sed 's/\\\\//g' | grep -c '\\' || true)
if [ "$bad" != "0" ]; then
echo "FAIL: $bad .file literal(s) carry unescaped backslashes"
grep -o '\.file = "[^"]*"' "$src" | sed 's/\\\\//g' | grep '\\' | head -3
exit 1
fi
echo "PASS: all .file literals escape backslashes"
exit 0