| 3348 | } |
| 3349 | |
| 3350 | static std::vector<const Token*> getConditions(const Token* tok, const char* op) |
| 3351 | { |
| 3352 | std::vector<const Token*> conds = {tok}; |
| 3353 | if (tok->str() == op) { |
| 3354 | std::vector<const Token*> args = astFlatten(tok, op); |
| 3355 | std::copy_if(args.cbegin(), args.cend(), std::back_inserter(conds), [&](const Token* tok2) { |
| 3356 | if (tok2->exprId() == 0) |
| 3357 | return false; |
| 3358 | if (tok2->hasKnownIntValue()) |
| 3359 | return false; |
| 3360 | if (Token::Match(tok2, "%var%|.") && !astIsBool(tok2)) |
| 3361 | return false; |
| 3362 | return true; |
| 3363 | }); |
| 3364 | } |
| 3365 | return conds; |
| 3366 | } |
| 3367 | |
| 3368 | static bool isBreakOrContinueScope(const Token* endToken) |
| 3369 | { |
no test coverage detected