@@ -2046,13 +2046,19 @@ namespace simplecpp {
20462046 calledMacro.expand (&temp, loc, tok, macros, expandedmacros);
20472047 return recursiveExpandToken (output, temp, loc, tok, macros, expandedmacros2, parametertokens);
20482048 }
2049- if (!sameline (tok, tok->next ) || tok-> next -> op != ' ( ' ) {
2049+ if (!sameline (tok, tok->next )) {
20502050 output->push_back (newMacroToken (tok->str (), loc, true , tok));
20512051 return tok->next ;
20522052 }
20532053 TokenList tokens (files);
20542054 tokens.push_back (new Token (*tok));
2055- const Token * const tok2 = appendTokens (&tokens, loc, tok->next , macros, expandedmacros, parametertokens);
2055+ const Token * tok2 = nullptr ;
2056+ if (tok->next ->op == ' (' )
2057+ tok2 = appendTokens (&tokens, loc, tok->next , macros, expandedmacros, parametertokens);
2058+ else if (expandArg (&tokens, tok->next , loc, macros, expandedmacros, parametertokens)) {
2059+ if (tokens.cfront ()->next && tokens.cfront ()->next ->op == ' (' )
2060+ tok2 = tok->next ;
2061+ }
20562062 if (!tok2) {
20572063 output->push_back (newMacroToken (tok->str (), loc, true , tok));
20582064 return tok->next ;
0 commit comments