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

Function skipLocalVars

lib/checkstl.cpp:1629–1650  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1627}
1628
1629static const Token* skipLocalVars(const Token* const tok)
1630{
1631 if (!tok)
1632 return tok;
1633 if (Token::simpleMatch(tok, "{"))
1634 return skipLocalVars(tok->next());
1635
1636 if (tok->isAssignmentOp()) {
1637 const Token *top = tok->astTop();
1638 const Token *varTok = top->astOperand1();
1639 const Variable *var = varTok->variable();
1640 if (!var)
1641 return tok;
1642 if (var->scope() != tok->scope())
1643 return tok;
1644 const Token *endTok = nextAfterAstRightmostLeaf(top);
1645 if (!endTok)
1646 return tok;
1647 return skipLocalVars(endTok->next());
1648 }
1649 return tok;
1650}
1651
1652static const Token *findInsertValue(const Token *tok, const Token *containerTok, const Token *keyTok, const Settings &settings)
1653{

Callers 1

findInsertValueFunction · 0.85

Calls 8

nextMethod · 0.80
isAssignmentOpMethod · 0.80
astTopMethod · 0.80
astOperand1Method · 0.80
variableMethod · 0.80
scopeMethod · 0.80
simpleMatchFunction · 0.70

Tested by

no test coverage detected