Disallow labels before ENDC

This commit is contained in:
Rangi42
2025-10-31 18:21:59 -04:00
parent df5162edca
commit 558d3ca0fc
5 changed files with 24 additions and 8 deletions

View File

@@ -12,4 +12,5 @@ error: syntax error, unexpected PRINTLN, expecting end of line
at code-after-endm-endr-endc.asm(23)
error: syntax error, unexpected PRINTLN, expecting end of line or end of buffer or end of fragment literal
at code-after-endm-endr-endc.asm(25)
Assembly aborted with 7 errors!
FATAL: Ended block with 2 unterminated conditionals (`IF`/`ELIF`/`ELSE` blocks)
at code-after-endm-endr-endc.asm(28)

View File

@@ -0,0 +1,7 @@
section "test", rom0
if 1
println "one"
label0: endc
if 2
println "two"
label1: endc

View File

@@ -0,0 +1,6 @@
error: syntax error, unexpected ENDC
at label-before-endc.asm(4)
error: syntax error, unexpected ENDC
at label-before-endc.asm(7)
FATAL: Ended block with 2 unterminated conditionals (`IF`/`ELIF`/`ELSE` blocks)
at label-before-endc.asm(8)

View File

@@ -0,0 +1,2 @@
one
two