R: resolve function_definition name from parent binary_operator lhs.
| 540 | |
| 541 | // R: resolve function_definition name from parent binary_operator lhs. |
| 542 | static TSNode resolve_r_func_name(TSNode node) { |
| 543 | TSNode parent = ts_node_parent(node); |
| 544 | if (!ts_node_is_null(parent) && strcmp(ts_node_type(parent), "binary_operator") == 0) { |
| 545 | TSNode lhs = ts_node_child_by_field_name(parent, TS_FIELD("left")); |
| 546 | if (ts_node_is_null(lhs)) { |
| 547 | lhs = ts_node_child_by_field_name(parent, TS_FIELD("lhs")); |
| 548 | } |
| 549 | if (ts_node_is_null(lhs) && ts_node_named_child_count(parent) > 0) { |
| 550 | lhs = ts_node_named_child(parent, 0); |
| 551 | } |
| 552 | if (!ts_node_is_null(lhs)) { |
| 553 | return lhs; |
| 554 | } |
| 555 | } |
| 556 | TSNode null_node = {0}; |
| 557 | return null_node; |
| 558 | } |
| 559 | |
| 560 | // Max descent for the (System)Verilog name-wrapper search (module/class headers |
| 561 | // nest the identifier a few levels deep; bounding avoids walking large subtrees |
no outgoing calls
no test coverage detected