| 137 | } |
| 138 | |
| 139 | nonneg int astCount(const Token* tok, const char* op, int depth) |
| 140 | { |
| 141 | --depth; |
| 142 | if (!tok || depth < 0) |
| 143 | return 0; |
| 144 | if (strcmp(tok->str().c_str(), op) == 0) |
| 145 | return astCount(tok->astOperand1(), op, depth) + astCount(tok->astOperand2(), op, depth); |
| 146 | return 1; |
| 147 | } |
| 148 | |
| 149 | bool astHasToken(const Token* root, const Token * tok) |
| 150 | { |
no test coverage detected