Fix #1079: don't give error when macro() name used without open (.
This commit is contained in:
parent
e8d21388ed
commit
88e22a6090
6 changed files with 83 additions and 8 deletions
|
|
@ -1157,7 +1157,6 @@ int TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOka
|
|||
}
|
||||
|
||||
MacroSymbol* macro = macroAtom == 0 ? nullptr : lookupMacroDef(macroAtom);
|
||||
int token;
|
||||
int depth = 0;
|
||||
|
||||
// no recursive expansions
|
||||
|
|
@ -1179,13 +1178,12 @@ int TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOka
|
|||
TSourceLoc loc = ppToken->loc; // in case we go to the next line before discovering the error
|
||||
in->mac = macro;
|
||||
if (macro->args.size() > 0 || macro->emptyArgs) {
|
||||
token = scanToken(ppToken);
|
||||
int token = scanToken(ppToken);
|
||||
if (newLineOkay) {
|
||||
while (token == '\n')
|
||||
token = scanToken(ppToken);
|
||||
}
|
||||
if (token != '(') {
|
||||
parseContext.ppError(loc, "expected '(' following", "macro expansion", atomStrings.getString(macroAtom));
|
||||
UngetToken(token, ppToken);
|
||||
delete in;
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue