macro(match): add guard/type normalization smoke; update CURRENT_TASK progress

This commit is contained in:
Selfhosting Dev
2025-09-20 05:01:58 +09:00
parent 166c374eec
commit c536b402a2
2 changed files with 30 additions and 0 deletions

View File

@ -82,6 +82,7 @@ Action Items (next 48h)
- [x] Golden normalizer (keyorder insensitive) for macro tests
- [x] Loop simple/twovars goldens with normalization
- [ ] Match guard: 内蔵変換If 連鎖)+ golden/smoke
- [x] Smoke for guard/type match normalizationno PeekExpr; If present
- [ ] LoopForm MVP2: twovars carrier safe normalization + tests/smokes
- [x] LLVM PHI hygiene smoke on LoopForm cases
- [x] LLVM PHI hygiene smoke on If cases

View File

@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -euo pipefail
root=$(cd "$(dirname "$0")"/../../../.. && pwd)
bin="$root/target/release/nyash"
src="apps/tests/match_guard_type_basic.nyash"
if [ ! -x "$bin" ]; then
echo "nyash binary not found at $bin; build first (cargo build --release)" >&2
exit 1
fi
export NYASH_MACRO_ENABLE=1
out=$("$bin" --dump-expanded-ast-json "$src")
# Expect: no PeekExpr remains and If exists
if echo "$out" | rg -q '"kind":"PeekExpr"'; then
echo "[FAIL] Expanded AST still contains PeekExpr for guard-type match" >&2
exit 2
fi
if ! echo "$out" | rg -q '"kind":"If"'; then
echo "[FAIL] Expanded AST has no If; expected If-chain after normalization" >&2
exit 2
fi
echo "[OK] match guard/type normalization smoke passed"