boot: defer, str.bytes()

defer runs when its scope ends and before return, break and continue leave it,
newest first, and sees only the variables declared before it. Not allowed
inside a defer: defer, return, break, continue.

boot.sh: 14 passed, 0 failed, 8 skipped.
This commit is contained in:
Nexoniarz 2026-10-25 18:47:24 +01:00
commit 84693aa655
3 changed files with 96 additions and 9 deletions

View file

@ -21,11 +21,11 @@ fi
pass=0; failed=0; skipped=0
for f in tests/run/*.fch; do
grep -q "^fn main" "$f" || continue
# the bootstrap compiler doesn't do C imports, defer, maps or errors as values
# the bootstrap compiler doesn't do C imports, maps or errors as values
# (checked in the test and in the modules it imports)
files="$f"
for m in $(sed -n 's/^import \([a-z_]*\)$/\1/p' "$f"); do files="$files tests/run/$m.fch"; done
if grep -qE '^import "|^link |defer | or |try |map\[|!\s*\{|for [a-z_]+, ' $files; then
if grep -qE '^import "|^link | or |try |map\[|!\s*\{|for [a-z_]+, ' $files; then
skipped=$((skipped + 1))
continue
fi