Skip to content

Commit 3f144b7

Browse files
committed
Add test case for local labels after block-ending keywords
1 parent eeb3a73 commit 3f144b7

3 files changed

Lines changed: 36 additions & 0 deletions

File tree

test/asm/local-after-end.asm

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
section "test", ROM0
2+
Global:
3+
4+
if 0
5+
println "no"
6+
endc.local_no
7+
if 1
8+
println "yes"
9+
endc.local_yes
10+
11+
rept 0
12+
println "nope"
13+
endr.local_nope
14+
rept 1
15+
println "yep"
16+
endr.local_yep
17+
18+
macro mac
19+
println "mac"
20+
endm.local_mac
21+
mac

test/asm/local-after-end.err

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: syntax error, unexpected local label, expecting end of line or end of buffer or end of fragment literal
2+
at local-after-end.asm(6)
3+
error: Identifier "endc.local_yes" begins with a keyword; did you mean to put a space between them?
4+
at local-after-end.asm(9)
5+
error: syntax error, unexpected local label, expecting end of line or end of buffer or end of fragment literal
6+
at local-after-end.asm(13)
7+
error: syntax error, unexpected local label, expecting end of line or end of buffer or end of fragment literal
8+
at local-after-end.asm(16)
9+
error: syntax error, unexpected local label, expecting end of line or end of buffer or end of fragment literal
10+
at local-after-end.asm(20)
11+
error: Undefined macro `mac`
12+
at local-after-end.asm(21)
13+
FATAL: Ended block with 2 unterminated conditionals (`IF`/`ELIF`/`ELSE` blocks)
14+
at local-after-end.asm(22)

test/asm/local-after-end.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
yes

0 commit comments

Comments
 (0)