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

Method scan_fn_ref_subtree

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

Source from the content-addressed store, hash-verified

1351 }
1352
1353 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
1354 stack_guard!();
1355 if depth > 12 {
1356 return;
1357 }
1358 // Halts at functionTypes (function_definition) + arrow_function (in
1359 // the fixed list); anonymous_function is NOT halted — scans descend
1360 // into closures.
1361 if depth > 0
1362 && matches!(
1363 node.kind(),
1364 "function_definition" | "arrow_function" | "function_expression" | "lambda_literal"
1365 | "lambda_expression"
1366 )
1367 {
1368 return;
1369 }
1370 self.maybe_capture_fn_refs(node);
1371 for i in 0..node.named_child_count() {
1372 if let Some(c) = node.named_child(i) {
1373 self.scan_fn_ref_subtree(c, depth + 1);
1374 }
1375 }
1376 }
1377
1378 fn flush_fn_ref_candidates(&mut self) {
1379 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