Test macro args \0 and \<0>

This commit is contained in:
Rangi42
2024-08-09 23:22:36 -04:00
committed by Sylvie
parent 96a0481cba
commit ee3a93a442
3 changed files with 10 additions and 3 deletions

View File

@@ -672,9 +672,6 @@ static std::shared_ptr<std::string> readMacroArg(char name) {
error("Macro argument '\\<%" PRIu32 ">' not defined\n", num); error("Macro argument '\\<%" PRIu32 ">' not defined\n", num);
} }
return str; return str;
} else if (name == '0') {
error("Invalid macro argument '\\0'\n");
return nullptr;
} else { } else {
assume(name >= '1' && name <= '9'); assume(name >= '1' && name <= '9');

5
test/asm/macro-arg-0.asm Normal file
View File

@@ -0,0 +1,5 @@
MACRO m
def x = \0
def y = \<0> + 42
ENDM
m hello, world

5
test/asm/macro-arg-0.err Normal file
View File

@@ -0,0 +1,5 @@
error: macro-arg-0.asm(5) -> macro-arg-0.asm::m(2):
Begun line continuation, but encountered character '0'
error: macro-arg-0.asm(5) -> macro-arg-0.asm::m(3):
Invalid bracketed macro argument '\<0>'
error: Assembly aborted (2 errors)!