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

Method scan_fn_ref_subtree

codegraph-kernel/src/php.rs:1510–1533  ·  view source on GitHub ↗
(&mut self, node: Node<'t>, depth: u32)

Source from the content-addressed store, hash-verified

1508 }
1509
1510 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
1511 stack_guard!();
1512 if depth > 12 {
1513 return;
1514 }
1515 // Halts at functionTypes (function_definition) + arrow_function (in
1516 // the fixed list); anonymous_function is NOT halted — scans descend
1517 // into closures.
1518 if depth > 0
1519 && matches!(
1520 node.kind(),
1521 "function_definition" | "arrow_function" | "function_expression" | "lambda_literal"
1522 | "lambda_expression"
1523 )
1524 {
1525 return;
1526 }
1527 self.maybe_capture_fn_refs(node);
1528 for i in 0..node.named_child_count() {
1529 if let Some(c) = node.named_child(i) {
1530 self.scan_fn_ref_subtree(c, depth + 1);
1531 }
1532 }
1533 }
1534
1535 fn flush_fn_ref_candidates(&mut self) {
1536 let cands = std::mem::take(&mut self.fn_ref_cands);

Callers 1

visit_nodeMethod · 0.45

Calls 1

maybe_capture_fn_refsMethod · 0.45

Tested by

no test coverage detected