mirror of
https://github.com/Nexoniarz/Finch.git
synced 2026-11-03 00:44:27 +00:00
boot: sized numbers (i8..u64, f32), conversions, unsigned arithmetic
The self-hosted compiler now has the numeric types the C++ one has: int and float stay the i64 and f64 defaults, the others lower to their LLVM sizes; literals adapt to the other operand if they fit, smaller types widen into bigger ones, signed and unsigned mixing is refused, division and shifts and comparisons pick their signedness, and u8(x), f32(x), bool(x) convert. boot.sh: 11 passed, 0 failed, 10 skipped (was 9 / 12).
This commit is contained in:
parent
393327b353
commit
873b52565d
3 changed files with 301 additions and 96 deletions
|
|
@ -21,12 +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, sized numbers, defer, maps, methods or errors as values
|
||||
# the bootstrap compiler doesn't do C imports, defer, maps, methods 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 |0x| or |try |map\[|!\s*\{|^fn [A-Z][A-Za-z0-9_]*\.|for [a-z_]+, ' $files ||
|
||||
grep -qwE 'u8|u16|u32|u64|i8|i16|i32|f32|f64' $files; then
|
||||
if grep -qE '^import "|^link |defer | or |try |map\[|!\s*\{|^fn [A-Z][A-Za-z0-9_]*\.|for [a-z_]+, ' $files; then
|
||||
skipped=$((skipped + 1))
|
||||
continue
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue