Increase parser test coverage

This commit is contained in:
Rangi42
2025-07-20 13:37:43 -04:00
parent 9e0e7ef9a1
commit 89ca6a325c
10 changed files with 15 additions and 5 deletions

View File

@@ -1 +0,0 @@
println x

View File

@@ -1 +0,0 @@
def x = 42

View File

@@ -3,10 +3,10 @@ SECTION "fixed", ROM0[0]
FixedBase: FixedBase:
assert FixedBase ; This should eval (and fail) at compile time assert FixedBase ; This should eval (and fail) at compile time
ds 0 ds 1
static_assert @ == 0, "@ ain't 0 now? (Hint: it's {@})" static_assert @ - FixedBase == 0, "@ ain't 0 now? (Hint: it's {@})"
ds 42 ds 41
assert WARN, @ - FixedBase != 42 ; This should also eval at compile time assert WARN, @ - FixedBase != 42 ; This should also eval at compile time
SECTION "floating", ROM0 SECTION "floating", ROM0

View File

@@ -1,5 +1,7 @@
error: assert.asm(4): error: assert.asm(4):
Assertion failed Assertion failed
error: assert.asm(7):
Assertion failed: @ ain't 0 now? (Hint: it's $1)
warning: assert.asm(10): [-Wassert] warning: assert.asm(10): [-Wassert]
Assertion failed Assertion failed
error: assert.asm(18): error: assert.asm(18):

View File

@@ -0,0 +1 @@
assert round(3.6, 42) == 4.0

View File

@@ -0,0 +1,3 @@
error: bad-precision.asm(1):
Fixed-point precision must be between 1 and 31, not 42
Assembly aborted with 1 error!

View File

@@ -0,0 +1 @@
ELIF 1

View File

@@ -0,0 +1,2 @@
FATAL: elif-outside-if.asm(1):
Found ELIF outside of an IF construct

View File

@@ -0,0 +1 @@
ELSE

View File

@@ -0,0 +1,2 @@
FATAL: else-outside-if.asm(1):
Found ELSE outside of an IF construct