macro(match): add guard/type normalization smoke; update CURRENT_TASK progress
This commit is contained in:
@ -82,6 +82,7 @@ Action Items (next 48h)
|
||||
- [x] Golden normalizer (key‑order insensitive) for macro tests
|
||||
- [x] Loop simple/two‑vars goldens with normalization
|
||||
- [ ] Match guard: 内蔵変換(If 連鎖)+ golden/smoke
|
||||
- [x] Smoke for guard/type match normalization(no PeekExpr; If present)
|
||||
- [ ] LoopForm MVP‑2: two‑vars carrier safe normalization + tests/smokes
|
||||
- [x] LLVM PHI hygiene smoke on LoopForm cases
|
||||
- [x] LLVM PHI hygiene smoke on If cases
|
||||
|
||||
29
tools/test/smoke/macro/match_guard_type_smoke.sh
Normal file
29
tools/test/smoke/macro/match_guard_type_smoke.sh
Normal 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"
|
||||
|
||||
Reference in New Issue
Block a user