MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / expandArg

Method expandArg

externals/simplecpp/simplecpp.cpp:2227–2243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2225 }
2226
2227 bool expandArg(TokenList &output, const Token *tok, const std::vector<const Token*> &parametertokens) const {
2228 if (!tok->name)
2229 return false;
2230
2231 const unsigned int argnr = getArgNum(tok->str());
2232 if (argnr >= args.size())
2233 return false;
2234
2235 // empty variadic parameter
2236 if (variadic && argnr + 1U >= parametertokens.size())
2237 return true;
2238
2239 for (const Token *partok = parametertokens[argnr]->next; partok != parametertokens[argnr + 1U]; partok = partok->next)
2240 output.push_back(new Token(*partok));
2241
2242 return true;
2243 }
2244
2245 bool expandArg(TokenList &output, const Token *tok, const Location &loc, const MacroMap &macros, const std::set<TokenString> &expandedmacros, const std::vector<const Token*> &parametertokens) const {
2246 if (!tok->name)

Callers

nothing calls this directly

Calls 7

expandMethod · 0.80
strMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected