(&mut self, node: Node<'t>, depth: u32)
| 782 | } |
| 783 | |
| 784 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) { |
| 785 | if depth > 12 { |
| 786 | return; |
| 787 | } |
| 788 | // Halts at functionTypes ∪ the fixed arrow/lambda list — python's |
| 789 | // `lambda` kind is NOT in that list (mirrored). |
| 790 | if depth > 0 |
| 791 | && matches!( |
| 792 | node.kind(), |
| 793 | "function_definition" | "arrow_function" | "function_expression" | "lambda_literal" |
| 794 | | "lambda_expression" |
| 795 | ) |
| 796 | { |
| 797 | return; |
| 798 | } |
| 799 | self.maybe_capture_fn_refs(node); |
| 800 | for i in 0..node.named_child_count() { |
| 801 | if let Some(c) = node.named_child(i) { |
| 802 | self.scan_fn_ref_subtree(c, depth + 1); |
| 803 | } |
| 804 | } |
| 805 | } |
| 806 | |
| 807 | fn flush_fn_ref_candidates(&mut self) { |
| 808 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected