| 48 | #include <utility> |
| 49 | |
| 50 | const Token* findExpression(const nonneg int exprid, |
| 51 | const Token* start, |
| 52 | const Token* end, |
| 53 | const std::function<bool(const Token*)>& pred) |
| 54 | { |
| 55 | if (exprid == 0) |
| 56 | return nullptr; |
| 57 | if (!precedes(start, end)) |
| 58 | return nullptr; |
| 59 | for (const Token* tok = start; tok != end; tok = tok->next()) { |
| 60 | if (tok->exprId() != exprid) |
| 61 | continue; |
| 62 | if (pred(tok)) |
| 63 | return tok; |
| 64 | } |
| 65 | return nullptr; |
| 66 | } |
| 67 | |
| 68 | static int findArgumentPosRecursive(const Token* tok, const Token* tokToFind, bool &found, nonneg int depth=0) |
| 69 | { |
no test coverage detected