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

Function singleStatement

lib/checkstl.cpp:2637–2648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2635}
2636
2637static const Token *singleStatement(const Token *start)
2638{
2639 if (start->str() != "{")
2640 return nullptr;
2641 const Token *endToken = start->link();
2642 const Token *endStatement = Token::findsimplematch(start->next(), ";");
2643 if (!Token::simpleMatch(endStatement, "; }"))
2644 return nullptr;
2645 if (endStatement->next() != endToken)
2646 return nullptr;
2647 return endStatement;
2648}
2649
2650enum class LoopType : std::uint8_t { OTHER, RANGE, ITERATOR, INDEX };
2651

Callers 1

singleAssignInScopeFunction · 0.85

Calls 4

findsimplematchFunction · 0.85
nextMethod · 0.80
simpleMatchFunction · 0.70
strMethod · 0.45

Tested by

no test coverage detected