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

Function go_method_node

src/pipeline/doc_links_go.c:1348–1359  ·  view source on GitHub ↗

The node of the method `recv.name`: its receiver-qualified node, else the * flat node . when the method is the one that kept it (the last * declaration of that name in the node's file). */

Source from the content-addressed store, hash-verified

1346 * flat node <dir>.<name> when the method is the one that kept it (the last
1347 * declaration of that name in the node's file). */
1348static const cbm_gbuf_node_t *go_method_node(const go_ctx_t *c, const go_pkg_t *pkg, go_str_t recv,
1349 go_str_t name) {
1350 const cbm_gbuf_node_t *qualified = go_member_node(c, pkg, GO_MEM_METHOD, recv, name);
1351 if (qualified) {
1352 return qualified;
1353 }
1354 const cbm_gbuf_node_t *n = go_find_node(c, pkg, name, GO_NO_STR);
1355 const go_flat_t *fl = go_flat_owner(c, n, pkg, name);
1356 bool owns = fl && fl->owner == GO_KIND_METHOD && fl->method_recv &&
1357 go_str_eq(recv, fl->method_recv) && go_label_is(n, "Method");
1358 return owns ? n : NULL;
1359}
1360
1361static bool go_one_bit(int bits) {
1362 return bits != 0 && (bits & (bits - SKIP_ONE)) == 0;

Callers 1

go_bind_memberFunction · 0.85

Calls 5

go_member_nodeFunction · 0.85
go_find_nodeFunction · 0.85
go_flat_ownerFunction · 0.85
go_str_eqFunction · 0.85
go_label_isFunction · 0.85

Tested by

no test coverage detected