mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Store IF depth relative to each fstack context
This disallows starting/ending an IF inside an INCLUDEd file or a macro expansion
This commit is contained in:
@@ -20,3 +20,4 @@ rept 1
|
||||
break
|
||||
no endc
|
||||
endr
|
||||
println "done"
|
||||
|
||||
@@ -2,4 +2,5 @@ warning: break.asm(9): [-Wuser]
|
||||
done 5
|
||||
warning: break.asm(17): [-Wuser]
|
||||
OK
|
||||
error: Unterminated IF construct (1 levels)!
|
||||
FATAL: break.asm(18) -> break.asm::REPT~1(23):
|
||||
Ended block with 1 unterminated IF construct
|
||||
|
||||
3
test/asm/unterminated-if-include.inc
Normal file
3
test/asm/unterminated-if-include.inc
Normal file
@@ -0,0 +1,3 @@
|
||||
if 1
|
||||
println "inside include"
|
||||
; no endc
|
||||
15
test/asm/unterminated-if.asm
Normal file
15
test/asm/unterminated-if.asm
Normal file
@@ -0,0 +1,15 @@
|
||||
if 1
|
||||
if 0
|
||||
println "A"
|
||||
elif 1
|
||||
println "B"
|
||||
else
|
||||
println "C"
|
||||
endc
|
||||
else
|
||||
println "D"
|
||||
endc
|
||||
|
||||
INCLUDE "unterminated-if-include.inc"
|
||||
|
||||
println "done"
|
||||
2
test/asm/unterminated-if.err
Normal file
2
test/asm/unterminated-if.err
Normal file
@@ -0,0 +1,2 @@
|
||||
FATAL: unterminated-if.asm(13) -> unterminated-if-include.inc(4):
|
||||
Ended block with 1 unterminated IF construct
|
||||
2
test/asm/unterminated-if.out
Normal file
2
test/asm/unterminated-if.out
Normal file
@@ -0,0 +1,2 @@
|
||||
B
|
||||
inside include
|
||||
Reference in New Issue
Block a user