(&mut self, node: Node<'t>, depth: u32)
| 795 | } |
| 796 | |
| 797 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) { |
| 798 | stack_guard!(); |
| 799 | if depth > 12 { |
| 800 | return; |
| 801 | } |
| 802 | // Halts at functionTypes ∪ the fixed arrow/lambda list — python's |
| 803 | // `lambda` kind is NOT in that list (mirrored). |
| 804 | if depth > 0 |
| 805 | && matches!( |
| 806 | node.kind(), |
| 807 | "function_definition" | "arrow_function" | "function_expression" | "lambda_literal" |
| 808 | | "lambda_expression" |
| 809 | ) |
| 810 | { |
| 811 | return; |
| 812 | } |
| 813 | self.maybe_capture_fn_refs(node); |
| 814 | for i in 0..node.named_child_count() { |
| 815 | if let Some(c) = node.named_child(i) { |
| 816 | self.scan_fn_ref_subtree(c, depth + 1); |
| 817 | } |
| 818 | } |
| 819 | } |
| 820 | |
| 821 | fn flush_fn_ref_candidates(&mut self) { |
| 822 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected