From 3f144b7713d82bb05618be912d4abd4f18ee9317 Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Mon, 27 Apr 2026 15:04:12 +0200 Subject: [PATCH] Add test case for local labels after block-ending keywords --- test/asm/local-after-end.asm | 21 +++++++++++++++++++++ test/asm/local-after-end.err | 14 ++++++++++++++ test/asm/local-after-end.out | 1 + 3 files changed, 36 insertions(+) create mode 100644 test/asm/local-after-end.asm create mode 100644 test/asm/local-after-end.err create mode 100644 test/asm/local-after-end.out diff --git a/test/asm/local-after-end.asm b/test/asm/local-after-end.asm new file mode 100644 index 00000000..ae31faf6 --- /dev/null +++ b/test/asm/local-after-end.asm @@ -0,0 +1,21 @@ +section "test", ROM0 +Global: + +if 0 + println "no" +endc.local_no +if 1 + println "yes" +endc.local_yes + +rept 0 + println "nope" +endr.local_nope +rept 1 + println "yep" +endr.local_yep + +macro mac + println "mac" +endm.local_mac +mac diff --git a/test/asm/local-after-end.err b/test/asm/local-after-end.err new file mode 100644 index 00000000..5a950475 --- /dev/null +++ b/test/asm/local-after-end.err @@ -0,0 +1,14 @@ +error: syntax error, unexpected local label, expecting end of line or end of buffer or end of fragment literal + at local-after-end.asm(6) +error: Identifier "endc.local_yes" begins with a keyword; did you mean to put a space between them? + at local-after-end.asm(9) +error: syntax error, unexpected local label, expecting end of line or end of buffer or end of fragment literal + at local-after-end.asm(13) +error: syntax error, unexpected local label, expecting end of line or end of buffer or end of fragment literal + at local-after-end.asm(16) +error: syntax error, unexpected local label, expecting end of line or end of buffer or end of fragment literal + at local-after-end.asm(20) +error: Undefined macro `mac` + at local-after-end.asm(21) +FATAL: Ended block with 2 unterminated conditionals (`IF`/`ELIF`/`ELSE` blocks) + at local-after-end.asm(22) diff --git a/test/asm/local-after-end.out b/test/asm/local-after-end.out new file mode 100644 index 00000000..7cfab5b0 --- /dev/null +++ b/test/asm/local-after-end.out @@ -0,0 +1 @@ +yes