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

Function skipInitializerList

lib/tokenize.cpp:5213–5228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5211
5212template<typename T>
5213static T* skipInitializerList(T* tok)
5214{
5215 T* const start = tok;
5216 while (Token::Match(tok, "[:,] ::| %name%")) {
5217 tok = tok->tokAt(tok->strAt(1) == "::" ? 1 : 2);
5218 while (Token::Match(tok, ":: %name%"))
5219 tok = tok->tokAt(2);
5220 if (!Token::Match(tok, "[({<]") || !tok->link())
5221 return start;
5222 const bool isTemplate = tok->str() == "<";
5223 tok = tok->link()->next();
5224 if (isTemplate && tok && tok->link())
5225 tok = tok->link()->next();
5226 }
5227 return tok;
5228}
5229
5230void Tokenizer::setVarIdPass2()
5231{

Callers 2

setVarIdPass2Method · 0.85

Calls 3

nextMethod · 0.80
tokAtMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected