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

Function extract_objc_impl_methods

internal/cbm/extract_defs.c:8528–8551  ·  view source on GitHub ↗

Objective-C wraps every @implementation member in an implementation_definition, * and a #if/#else block inside @implementation wraps each branch's members in * another one: walk those nested wrappers too (worklist, no recursion). */

Source from the content-addressed store, hash-verified

8526 * and a #if/#else block inside @implementation wraps each branch's members in
8527 * another one: walk those nested wrappers too (worklist, no recursion). */
8528static void extract_objc_impl_methods(CBMExtractCtx *ctx, TSNode impl_node, const char *class_qn,
8529 const CBMLangSpec *spec) {
8530 TSNode pending[MEMBER_CONDITIONAL_DEPTH_MAX];
8531 int count = 0;
8532 pending[count++] = impl_node;
8533 while (count > 0) {
8534 TSNode cur = pending[--count];
8535 member_iter_t it;
8536 member_iter_init(&it, cur, ctx->language, false);
8537 TSNode inner;
8538 while (member_iter_next(&it, &inner)) {
8539 if (cbm_kind_in_set(inner, spec->function_node_types)) {
8540 TSNode nm = resolve_method_name(inner, ctx->language);
8541 if (!ts_node_is_null(nm)) {
8542 push_method_def(ctx, inner, impl_node, class_qn, spec, nm);
8543 }
8544 } else if (count < MEMBER_CONDITIONAL_DEPTH_MAX &&
8545 strcmp(ts_node_type(inner), "implementation_definition") == 0) {
8546 pending[count++] = inner;
8547 }
8548 }
8549 member_iter_done(&it);
8550 }
8551}
8552
8553// Extract methods inside a class body
8554static void extract_class_methods(CBMExtractCtx *ctx, TSNode class_node, const char *class_qn,

Callers 1

extract_class_methodsFunction · 0.85

Calls 6

member_iter_initFunction · 0.85
member_iter_nextFunction · 0.85
cbm_kind_in_setFunction · 0.85
resolve_method_nameFunction · 0.85
push_method_defFunction · 0.85
member_iter_doneFunction · 0.85

Tested by

no test coverage detected