mirror of
https://github.com/Nexoniarz/Finch.git
synced 2026-11-03 00:44:27 +00:00
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:
parent
051af1a04e
commit
84693aa655
3 changed files with 96 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue