mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Support multi-digit macro arguments in parentheses
This allows access to arguments past \9 without using 'shift'
This commit is contained in:
1
test/asm/invalid-empty-macro-arg.asm
Normal file
1
test/asm/invalid-empty-macro-arg.asm
Normal file
@@ -0,0 +1 @@
|
||||
\()
|
||||
2
test/asm/invalid-empty-macro-arg.err
Normal file
2
test/asm/invalid-empty-macro-arg.err
Normal file
@@ -0,0 +1,2 @@
|
||||
FATAL: invalid-empty-macro-arg.asm(1):
|
||||
Empty parenthetic macro argument
|
||||
0
test/asm/invalid-empty-macro-arg.out
Normal file
0
test/asm/invalid-empty-macro-arg.out
Normal file
1
test/asm/invalid-macro-arg-character.asm
Normal file
1
test/asm/invalid-macro-arg-character.asm
Normal file
@@ -0,0 +1 @@
|
||||
\(10!)
|
||||
2
test/asm/invalid-macro-arg-character.err
Normal file
2
test/asm/invalid-macro-arg-character.err
Normal file
@@ -0,0 +1,2 @@
|
||||
FATAL: invalid-macro-arg-character.asm(1):
|
||||
Invalid character in parenthetic macro argument '!'
|
||||
0
test/asm/invalid-macro-arg-character.out
Normal file
0
test/asm/invalid-macro-arg-character.out
Normal file
17
test/asm/parenthetic-macro-args.asm
Normal file
17
test/asm/parenthetic-macro-args.asm
Normal file
@@ -0,0 +1,17 @@
|
||||
MACRO printargs
|
||||
PRINTLN "first = \(1)"
|
||||
FOR I, 2, _NARG
|
||||
PRINTLN "next = \({d:I})"
|
||||
ENDR
|
||||
PRINTLN "last = \({d:_NARG})"
|
||||
ENDM
|
||||
|
||||
printargs A, B, C, D
|
||||
|
||||
MACRO mac
|
||||
println \(2__) + \(1_2) + \(\1)
|
||||
x = 2
|
||||
println \({d:x}) + \(1_{d:x}) + \(\(\(13)))
|
||||
ENDM
|
||||
|
||||
mac 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 1
|
||||
0
test/asm/parenthetic-macro-args.err
Normal file
0
test/asm/parenthetic-macro-args.err
Normal file
6
test/asm/parenthetic-macro-args.out
Normal file
6
test/asm/parenthetic-macro-args.out
Normal file
@@ -0,0 +1,6 @@
|
||||
first = A
|
||||
next = B
|
||||
next = C
|
||||
last = D
|
||||
$F0
|
||||
$F0
|
||||
Reference in New Issue
Block a user