MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / resolve_r_func_name

Function resolve_r_func_name

internal/cbm/extract_defs.c:542–558  ·  view source on GitHub ↗

R: resolve function_definition name from parent binary_operator lhs.

Source from the content-addressed store, hash-verified

540
541// R: resolve function_definition name from parent binary_operator lhs.
542static 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

Callers 1

cbm_resolve_func_nameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected