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

Method scan_fn_ref_subtree

codegraph-kernel/src/ccpp/mod.rs:2419–2437  ·  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

2417 /// scanFnRefSubtree: capture-only walk of subtrees the main walkers skip
2418 /// (variable-declaration initializers). Halts at nested functions/lambdas.
2419 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
2420 stack_guard!();
2421 if depth > 12 {
2422 return;
2423 }
2424 if depth > 0
2425 && matches!(
2426 node.kind(),
2427 "function_definition" | "arrow_function" | "function_expression"
2428 | "lambda_literal" | "lambda_expression"
2429 )
2430 {
2431 return;
2432 }
2433 self.maybe_capture_fn_refs(node);
2434 for c in node.named_children(&mut node.walk()) {
2435 self.scan_fn_ref_subtree(c, depth + 1);
2436 }
2437 }
2438
2439 /// flushFnRefCandidates with the cFamily gate policy: value/list positions
2440 /// at FILE scope skip the same-file/import gate (C has no symbol imports);

Callers 1

dispatch_nodeMethod · 0.45

Calls 2

maybe_capture_fn_refsMethod · 0.45
walkMethod · 0.45

Tested by

no test coverage detected