mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
18
test/asm/elif-after-else.asm
Normal file
18
test/asm/elif-after-else.asm
Normal file
@@ -0,0 +1,18 @@
|
||||
if 0
|
||||
println "zero"
|
||||
else
|
||||
println "one"
|
||||
if 1
|
||||
println "A"
|
||||
else
|
||||
println "B"
|
||||
elif 2
|
||||
println "C"
|
||||
else
|
||||
println "D"
|
||||
endc
|
||||
elif 2
|
||||
println "two"
|
||||
else
|
||||
println "three"
|
||||
endc
|
||||
2
test/asm/elif-after-else.err
Normal file
2
test/asm/elif-after-else.err
Normal file
@@ -0,0 +1,2 @@
|
||||
FATAL: elif-after-else.asm(14):
|
||||
Found ELIF after an ELSE block
|
||||
2
test/asm/elif-after-else.out
Normal file
2
test/asm/elif-after-else.out
Normal file
@@ -0,0 +1,2 @@
|
||||
one
|
||||
A
|
||||
@@ -0,0 +1,2 @@
|
||||
FATAL: multiple-else.asm(11):
|
||||
Found ELSE after an ELSE block
|
||||
|
||||
17
test/asm/skip-elif-condition.asm
Normal file
17
test/asm/skip-elif-condition.asm
Normal file
@@ -0,0 +1,17 @@
|
||||
mac: MACRO
|
||||
if (\1) < 10
|
||||
println "small \1"
|
||||
elif (\1) > 100
|
||||
println "large \1"
|
||||
elif (\1) / 0 == 42 ; only evaluated if the "large" condition was taken
|
||||
println "division by zero!?"
|
||||
elif syntax! error?
|
||||
println "X_X"
|
||||
else
|
||||
println "unreachable"
|
||||
endc
|
||||
ENDM
|
||||
|
||||
mac 2 + 2
|
||||
mac STRLEN("abcdef")
|
||||
mac 101
|
||||
2
test/asm/skip-elif-condition.err
Normal file
2
test/asm/skip-elif-condition.err
Normal file
@@ -0,0 +1,2 @@
|
||||
FATAL: skip-elif-condition.asm(17) -> skip-elif-condition.asm::mac(6):
|
||||
Division by zero
|
||||
3
test/asm/skip-elif-condition.out
Normal file
3
test/asm/skip-elif-condition.out
Normal file
@@ -0,0 +1,3 @@
|
||||
small 2 + 2
|
||||
small STRLEN("abcdef")
|
||||
large 101
|
||||
Reference in New Issue
Block a user