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

Method scan_fn_ref_subtree

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

Source from the content-addressed store, hash-verified

789 }
790
791 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
792 if depth > 12 {
793 return;
794 }
795 // Halts at functionTypes ∪ the fixed arrow/lambda list — python's
796 // `lambda` kind is NOT in that list (mirrored).
797 if depth > 0
798 && matches!(
799 node.kind(),
800 "function_definition" | "arrow_function" | "function_expression" | "lambda_literal"
801 | "lambda_expression"
802 )
803 {
804 return;
805 }
806 self.maybe_capture_fn_refs(node);
807 for i in 0..node.named_child_count() {
808 if let Some(c) = node.named_child(i) {
809 self.scan_fn_ref_subtree(c, depth + 1);
810 }
811 }
812 }
813
814 fn flush_fn_ref_candidates(&mut self) {
815 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