| 91 | |
| 92 | template<class TFunc> |
| 93 | const Token* findAstNode(const Token* ast, const TFunc& pred) |
| 94 | { |
| 95 | const Token* result = nullptr; |
| 96 | visitAstNodes(ast, [&](const Token* tok) { |
| 97 | if (pred(tok)) { |
| 98 | result = tok; |
| 99 | return ChildrenToVisit::done; |
| 100 | } |
| 101 | return ChildrenToVisit::op1_and_op2; |
| 102 | }); |
| 103 | return result; |
| 104 | } |
| 105 | |
| 106 | template<class TFunc> |
| 107 | const Token* findParent(const Token* tok, const TFunc& pred) |
no test coverage detected