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

Function goToRightParenthesis

lib/token.cpp:1482–1497  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1480}
1481
1482static const Token* goToRightParenthesis(const Token* start, const Token* end)
1483{
1484 // move end to rpar in such expression: '2>(x+1)'
1485 int par = 0;
1486 for (const Token *tok = end; tok && tok != start; tok = tok->previous()) {
1487 if (tok->str() == ")")
1488 ++par;
1489 else if (tok->str() == "(") {
1490 if (par == 0)
1491 end = tok->link();
1492 else
1493 --par;
1494 }
1495 }
1496 return end;
1497}
1498
1499std::pair<const Token *, const Token *> Token::findExpressionStartEndTokens() const
1500{

Callers 1

Calls 1

strMethod · 0.45

Tested by

no test coverage detected