mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Macro arguments within a string literal are read into the string, not expanded
Fixes #643
This commit is contained in:
19
test/asm/macro-arg-in-string.asm
Normal file
19
test/asm/macro-arg-in-string.asm
Normal file
@@ -0,0 +1,19 @@
|
||||
print: MACRO
|
||||
PRINTT "\1"
|
||||
PRINTT "\n"
|
||||
ENDM
|
||||
|
||||
print John "Danger" Smith
|
||||
print \\A\nB
|
||||
print C\
|
||||
D
|
||||
print E\!F ; illegal character escape
|
||||
|
||||
|
||||
iprint: MACRO
|
||||
PRINTT "{\1}"
|
||||
PRINTT "\n"
|
||||
ENDM
|
||||
|
||||
s EQUS "hello"
|
||||
iprint s
|
||||
3
test/asm/macro-arg-in-string.err
Normal file
3
test/asm/macro-arg-in-string.err
Normal file
@@ -0,0 +1,3 @@
|
||||
ERROR: macro-arg-in-string.asm(10) -> macro-arg-in-string.asm::print(2):
|
||||
Illegal character escape '!'
|
||||
error: Assembly aborted (1 errors)!
|
||||
6
test/asm/macro-arg-in-string.out
Normal file
6
test/asm/macro-arg-in-string.out
Normal file
@@ -0,0 +1,6 @@
|
||||
John "Danger" Smith
|
||||
\A
|
||||
B
|
||||
CD
|
||||
E\F
|
||||
hello
|
||||
Reference in New Issue
Block a user