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

Function findNextTokenFromBreak

lib/astutils.cpp:942–954  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

940}
941
942const Token *findNextTokenFromBreak(const Token *breakToken)
943{
944 const Scope *scope = breakToken->scope();
945 while (scope) {
946 if (scope->isLoopScope() || scope->type == ScopeType::eSwitch) {
947 if (scope->type == ScopeType::eDo && Token::simpleMatch(scope->bodyEnd, "} while ("))
948 return scope->bodyEnd->linkAt(2)->next();
949 return scope->bodyEnd;
950 }
951 scope = scope->nestedIn;
952 }
953 return nullptr;
954}
955
956bool extractForLoopValues(const Token *forToken,
957 nonneg int &varid,

Callers 4

checkRecursiveMethod · 0.85
fwdanalysis.cppFile · 0.85
va_list_usageMethod · 0.85
updateRangeFunction · 0.85

Calls 4

scopeMethod · 0.80
nextMethod · 0.80
linkAtMethod · 0.80
simpleMatchFunction · 0.70

Tested by

no test coverage detected