mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-02-05 16:51:27 +08:00
preproc: smacro argument lists can't be preceded by space
The smacro argument list cannot be preceded by whitespace, or we wouldn't be able to define no-argument smacros the expansion of which starts with (. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
parent
ffe89ddaed
commit
d4607846a4
@ -2320,10 +2320,14 @@ static int parse_smacro_template(Token ***tpp, SMacro *tmpl)
|
||||
Token *t = *tn;
|
||||
Token *name;
|
||||
|
||||
while (t && t->type == TOK_WHITESPACE) {
|
||||
tn = &t->next;
|
||||
t = *tn;
|
||||
}
|
||||
/*
|
||||
* DO NOT skip whitespace here, or we won't be able to distinguish:
|
||||
*
|
||||
* %define foo (a,b) ; no arguments, (a,b) is the expansion
|
||||
* %define bar(a,b) ; two arguments, empty expansion
|
||||
*
|
||||
* This ambiguity was inherited from C.
|
||||
*/
|
||||
|
||||
if (!tok_is_(t, "("))
|
||||
goto finish;
|
||||
|
Loading…
Reference in New Issue
Block a user