MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / scan_fn_ref_subtree

Method scan_fn_ref_subtree

codegraph-kernel/src/ccpp/mod.rs:2436–2456  ·  view source on GitHub ↗

scanFnRefSubtree: capture-only walk of subtrees the main walkers skip (variable-declaration initializers). Halts at nested functions/lambdas.

(&mut self, node: Node<'t>, depth: u32)

Source from the content-addressed store, hash-verified

2434 /// scanFnRefSubtree: capture-only walk of subtrees the main walkers skip
2435 /// (variable-declaration initializers). Halts at nested functions/lambdas.
2436 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
2437 stack_guard!();
2438 if depth > 12 {
2439 return;
2440 }
2441 if depth > 0
2442 && matches!(
2443 node.kind(),
2444 "function_definition" | "arrow_function" | "function_expression"
2445 | "lambda_literal" | "lambda_expression"
2446 )
2447 {
2448 return;
2449 }
2450 self.maybe_capture_fn_refs(node);
2451 for i in 0..node.named_child_count() {
2452 if let Some(c) = node.named_child(i) {
2453 self.scan_fn_ref_subtree(c, depth + 1);
2454 }
2455 }
2456 }
2457
2458 /// flushFnRefCandidates with the cFamily gate policy: value/list positions
2459 /// at FILE scope skip the same-file/import gate (C has no symbol imports);

Callers 1

dispatch_nodeMethod · 0.45

Calls 1

maybe_capture_fn_refsMethod · 0.45

Tested by

no test coverage detected