Prevent ELIF or ELSE after an ELSE

Fixes #749
This commit is contained in:
Rangi
2021-02-24 21:19:08 -05:00
committed by Eldred Habert
parent dd892d61d8
commit d4028fff10
12 changed files with 163 additions and 45 deletions

View 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