Skip to content

Commit 149c8fb

Browse files
committed
use isEnumStart
1 parent 71cb315 commit 149c8fb

1 file changed

Lines changed: 3 additions & 16 deletions

File tree

lib/tokenize.cpp

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5271,22 +5271,9 @@ void Tokenizer::setVarIdPass2()
52715271
std::list<const Token *> usingnamespaces;
52725272
const Token *enumEnd = nullptr;
52735273
for (Token *tok = list.front(); tok; tok = tok->next()) {
5274-
if (tok->str() == "enum") {
5275-
tok = tok->next();
5276-
if (tok->str() == "class")
5277-
tok = tok->next();
5278-
if (tok->isName())
5279-
tok = tok->next();
5280-
if (tok->str() == ":") {
5281-
tok = tok->next();
5282-
if (tok->str() == "::")
5283-
tok = tok->next();
5284-
while (Token::Match(tok, "%name% ::"))
5285-
tok = tok->tokAt(2);
5286-
tok = tok->next();
5287-
}
5288-
if (tok->str() == "{")
5289-
enumEnd = tok->link();
5274+
if (isEnumStart(tok)) {
5275+
enumEnd = tok->link();
5276+
continue;
52905277
}
52915278
if (tok == enumEnd) {
52925279
enumEnd = nullptr;

0 commit comments

Comments
 (0)