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

Function goToLeftParenthesis

lib/token.cpp:1465–1480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1463}
1464
1465static const Token* goToLeftParenthesis(const Token* start, const Token* end)
1466{
1467 // move start to lpar in such expression: '(*it).x'
1468 int par = 0;
1469 for (const Token *tok = start; tok && tok != end; tok = tok->next()) {
1470 if (tok->str() == "(")
1471 ++par;
1472 else if (tok->str() == ")") {
1473 if (par == 0)
1474 start = tok->link();
1475 else
1476 --par;
1477 }
1478 }
1479 return start;
1480}
1481
1482static const Token* goToRightParenthesis(const Token* start, const Token* end)
1483{

Callers 1

Calls 2

nextMethod · 0.80
strMethod · 0.45

Tested by

no test coverage detected