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). */
| 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). */ |
| 8528 | static 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 |
| 8554 | static void extract_class_methods(CBMExtractCtx *ctx, TSNode class_node, const char *class_qn, |
no test coverage detected