diff --git a/test/asm/blue-paint.asm b/test/asm/blue-paint.asm new file mode 100644 index 00000000..a7743ffd --- /dev/null +++ b/test/asm/blue-paint.asm @@ -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} diff --git a/test/asm/blue-paint.err b/test/asm/blue-paint.err new file mode 100644 index 00000000..e603b804 --- /dev/null +++ b/test/asm/blue-paint.err @@ -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}" diff --git a/test/asm/blue-paint.out b/test/asm/blue-paint.out new file mode 100644 index 00000000..cbe59cc9 --- /dev/null +++ b/test/asm/blue-paint.out @@ -0,0 +1,2 @@ +This is the song that never ends~ +This is the song that never ends~