If the scope is a non-range for loop
| 320 | |
| 321 | // If the scope is a non-range for loop |
| 322 | static bool isBasicForLoop(const Token* tok) |
| 323 | { |
| 324 | if (!tok) |
| 325 | return false; |
| 326 | if (Token::simpleMatch(tok, "}")) |
| 327 | return isBasicForLoop(tok->link()); |
| 328 | if (!Token::simpleMatch(tok->previous(), ") {")) |
| 329 | return false; |
| 330 | const Token* start = tok->linkAt(-1); |
| 331 | if (!start) |
| 332 | return false; |
| 333 | if (!Token::simpleMatch(start->previous(), "for (")) |
| 334 | return false; |
| 335 | if (!Token::simpleMatch(start->astOperand2(), ";")) |
| 336 | return false; |
| 337 | return true; |
| 338 | } |
| 339 | |
| 340 | static void programMemoryParseCondition(ProgramMemory& pm, const Token* tok, const Token* endTok, const Settings& settings, bool then) |
| 341 | { |
no test coverage detected