scanFnRefSubtree: capture-only walk of subtrees the main walkers skip. `walked`: subtrees a body walk has already been through.
(&mut self, node: Node<'t>, depth: u32, walked: Option<&HashSet<usize>>)
| 751 | /// scanFnRefSubtree: capture-only walk of subtrees the main walkers skip. |
| 752 | /// `walked`: subtrees a body walk has already been through. |
| 753 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32, walked: Option<&HashSet<usize>>) { |
| 754 | stack_guard!(); |
| 755 | if depth > 12 { |
| 756 | return; |
| 757 | } |
| 758 | if walked.map(|w| w.contains(&node.id())).unwrap_or(false) { |
| 759 | return; |
| 760 | } |
| 761 | let kind = node.kind(); |
| 762 | if depth > 0 |
| 763 | && (is_function_type(kind) || matches!(kind, "lambda_literal" | "lambda_expression")) |
| 764 | { |
| 765 | return; |
| 766 | } |
| 767 | self.maybe_capture_fn_refs(node); |
| 768 | for c in node.named_children(&mut node.walk()) { |
| 769 | self.scan_fn_ref_subtree(c, depth + 1, walked); |
| 770 | } |
| 771 | } |
| 772 | |
| 773 | fn flush_fn_ref_candidates(&mut self) { |
| 774 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected