mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Add test case for some macro+interpolation behavior
This commit is contained in:
30
test/asm/blue-paint.asm
Normal file
30
test/asm/blue-paint.asm
Normal 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
test/asm/blue-paint.err
Normal file
23
test/asm/blue-paint.err
Normal 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
test/asm/blue-paint.out
Normal file
2
test/asm/blue-paint.out
Normal file
@@ -0,0 +1,2 @@
|
||||
This is the song that never ends~
|
||||
This is the song that never ends~
|
||||
Reference in New Issue
Block a user