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

Method removeMacroInClassDef

lib/tokenize.cpp:6768–6781  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6766//---------------------------------------------------------------------------
6767
6768void Tokenizer::removeMacroInClassDef()
6769{
6770 for (Token *tok = list.front(); tok; tok = tok->next()) {
6771 if (!Token::Match(tok, "class|struct %name% %name% final| {|:"))
6772 continue;
6773
6774 const bool nextIsUppercase = tok->next()->isUpperCaseName();
6775 const bool afterNextIsUppercase = tok->tokAt(2)->isUpperCaseName();
6776 if (nextIsUppercase && !afterNextIsUppercase)
6777 tok->deleteNext();
6778 else if (!nextIsUppercase && afterNextIsUppercase)
6779 tok->next()->deleteNext();
6780 }
6781}
6782
6783//---------------------------------------------------------------------------
6784

Callers

nothing calls this directly

Calls 5

frontMethod · 0.80
nextMethod · 0.80
isUpperCaseNameMethod · 0.80
deleteNextMethod · 0.80
tokAtMethod · 0.45

Tested by

no test coverage detected