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

Method isUnaryPreOp

lib/token.cpp:1577–1594  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1575}
1576
1577bool Token::isUnaryPreOp() const
1578{
1579 if (!astOperand1() || astOperand2())
1580 return false;
1581 if (this->tokType() != Token::eIncDecOp)
1582 return true;
1583 const Token *tokbefore = mPrevious;
1584 const Token *tokafter = mNext;
1585 for (int distance = 1; distance < 10 && tokbefore; distance++) {
1586 if (tokbefore == mImpl->mAstOperand1)
1587 return false;
1588 if (tokafter == mImpl->mAstOperand1)
1589 return true;
1590 tokbefore = tokbefore->mPrevious;
1591 tokafter = tokafter->mPrevious;
1592 }
1593 return false; // <- guess
1594}
1595
1596static std::string stringFromTokenRange(const Token* start, const Token* end)
1597{

Callers 1

Calls 2

astOperand1Function · 0.85
astOperand2Function · 0.85

Tested by

no test coverage detected