| 2100 | } |
| 2101 | |
| 2102 | const Token *recursiveExpandToken(TokenList &output, TokenList &temp, const Location &loc, const Token *tok, const MacroMap ¯os, const std::set<TokenString> &expandedmacros, const std::vector<const Token*> ¶metertokens) const { |
| 2103 | if (!temp.cback() || !temp.cback()->name || !tok->next || tok->next->op != '(') { |
| 2104 | output.takeTokens(temp); |
| 2105 | return tok->next; |
| 2106 | } |
| 2107 | |
| 2108 | if (!sameline(tok, tok->next)) { |
| 2109 | output.takeTokens(temp); |
| 2110 | return tok->next; |
| 2111 | } |
| 2112 | |
| 2113 | const MacroMap::const_iterator it = macros.find(temp.cback()->str()); |
| 2114 | if (it == macros.end() || expandedmacros.find(temp.cback()->str()) != expandedmacros.end()) { |
| 2115 | output.takeTokens(temp); |
| 2116 | return tok->next; |
| 2117 | } |
| 2118 | |
| 2119 | const Macro &calledMacro = it->second; |
| 2120 | if (!calledMacro.functionLike()) { |
| 2121 | output.takeTokens(temp); |
| 2122 | return tok->next; |
| 2123 | } |
| 2124 | |
| 2125 | TokenList temp2(files); |
| 2126 | temp2.push_back(new Token(temp.cback()->str(), tok->location)); |
| 2127 | |
| 2128 | const Token * const tok2 = appendTokens(temp2, loc, tok->next, macros, expandedmacros, parametertokens); |
| 2129 | if (!tok2) |
| 2130 | return tok->next; |
| 2131 | output.takeTokens(temp); |
| 2132 | output.deleteToken(output.back()); |
| 2133 | calledMacro.expand(output, loc, temp2.cfront(), macros, expandedmacros); |
| 2134 | return tok2->next; |
| 2135 | } |
| 2136 | |
| 2137 | const Token *expandToken(TokenList &output, const Location &loc, const Token *tok, const MacroMap ¯os, const std::set<TokenString> &expandedmacros, const std::vector<const Token*> ¶metertokens) const { |
| 2138 | // Not name.. |
nothing calls this directly
no test coverage detected