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

Function isEnumStart

lib/tokenize.cpp:81–91  ·  view source on GitHub ↗

Return whether tok is the "{" that starts an enumerator list */

Source from the content-addressed store, hash-verified

79
80/** Return whether tok is the "{" that starts an enumerator list */
81static bool isEnumStart(const Token* tok)
82{
83 if (!Token::simpleMatch(tok, "{"))
84 return false;
85 tok = tok->previous();
86 while (tok && (!tok->isKeyword() || Token::isStandardType(tok->str())) && Token::Match(tok, "%name%|::|:"))
87 tok = tok->previous();
88 if (Token::simpleMatch(tok, "class"))
89 tok = tok->previous();
90 return Token::simpleMatch(tok, "enum");
91}
92
93template<typename T>
94static void skipEnumBody(T *&tok)

Callers 4

simplifyTypedefCppMethod · 0.85
setVarIdClassDeclarationFunction · 0.85
setVarIdPass1Method · 0.85
simplifyBitfieldsMethod · 0.85

Calls 4

isStandardTypeFunction · 0.85
simpleMatchFunction · 0.70
isKeywordMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected