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
test/asm/blue-paint.asm Normal file
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}