Add test case for some macro+interpolation behavior

This commit is contained in:
Rangi42
2025-07-29 01:34:55 -04:00
parent d21e6669ce
commit cecbf0aa0e
3 changed files with 55 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
OPT r5
DEF statement EQUS "println \"This is the song that never ends~\""
; macro arguments are painted blue
MACRO arg_to_arg
\1statement\2
ENDM
arg_to_arg \\3, \\4, \{, \}
; ...but...
MACRO arg_to_interp
\1statement\2
ENDM
arg_to_interp \{, \}
; interpolations are not
DEF open EQUS "\{"
DEF close EQUS "\}"
{open}statement{close}
; which is why this halts
MACRO endless
\1
ENDM
endless \\1
; ...but this doesn't
DEF infinite EQUS "\{infinite\}"
{infinite}
+23
View File
@@ -0,0 +1,23 @@
error: blue-paint.asm(9) -> blue-paint.asm::arg_to_arg(7):
Invalid character after line continuation '3'
error: blue-paint.asm(9) -> blue-paint.asm::arg_to_arg(7):
syntax error, unexpected number
error: blue-paint.asm(9) -> blue-paint.asm::arg_to_arg(7):
Unknown character '}'
error: blue-paint.asm(15) -> blue-paint.asm::arg_to_interp(13):
Unknown character '{'
error: blue-paint.asm(15) -> blue-paint.asm::arg_to_interp(13):
Unknown character '}'
error: blue-paint.asm(26) -> blue-paint.asm::endless(24):
Invalid character after line continuation '1'
error: blue-paint.asm(26) -> blue-paint.asm::endless(24):
syntax error, unexpected number
FATAL: blue-paint.asm(30):
Recursion limit (5) exceeded
while expanding symbol "{infinite}"
while expanding symbol "{infinite}"
while expanding symbol "{infinite}"
while expanding symbol "{infinite}"
while expanding symbol "{infinite}"
while expanding symbol "{infinite}"
while expanding symbol "{infinite}"
+2
View File
@@ -0,0 +1,2 @@
This is the song that never ends~
This is the song that never ends~