Check if a node is inside a call expression (to avoid double-counting as usage)
| 51 | |
| 52 | // Check if a node is inside a call expression (to avoid double-counting as usage) |
| 53 | static bool is_inside_call(TSNode node, const CBMLangSpec *spec) { |
| 54 | TSNode cur = ts_node_parent(node); |
| 55 | while (!ts_node_is_null(cur)) { |
| 56 | if (cbm_kind_in_set(cur, spec->call_node_types)) { |
| 57 | return true; |
| 58 | } |
| 59 | cur = ts_node_parent(cur); |
| 60 | } |
| 61 | return false; |
| 62 | } |
| 63 | |
| 64 | // Check if a node is inside an import statement |
| 65 | static bool is_inside_import(TSNode node, const CBMLangSpec *spec) { |
no test coverage detected