(&mut self, node: Node<'t>, depth: u32, walked: &HashSet<usize>)
| 938 | } |
| 939 | |
| 940 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32, walked: &HashSet<usize>) { |
| 941 | stack_guard!(); |
| 942 | if depth > 12 { |
| 943 | return; |
| 944 | } |
| 945 | // Subtrees the body walker has already been through. |
| 946 | if walked.contains(&node.id()) { |
| 947 | return; |
| 948 | } |
| 949 | // Halts at functionTypes ∪ the fixed arrow/lambda list — python's |
| 950 | // `lambda` kind is NOT in that list (mirrored). |
| 951 | if depth > 0 |
| 952 | && matches!( |
| 953 | node.kind(), |
| 954 | "function_definition" | "arrow_function" | "function_expression" | "lambda_literal" |
| 955 | | "lambda_expression" |
| 956 | ) |
| 957 | { |
| 958 | return; |
| 959 | } |
| 960 | self.maybe_capture_fn_refs(node); |
| 961 | for c in node.named_children(&mut node.walk()) { |
| 962 | self.scan_fn_ref_subtree(c, depth + 1, walked); |
| 963 | } |
| 964 | } |
| 965 | |
| 966 | fn flush_fn_ref_candidates(&mut self) { |
| 967 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected