scanFnRefSubtree: capture-only walk of subtrees the main walkers skip.
(&mut self, node: Node<'t>, depth: u32)
| 550 | |
| 551 | /// scanFnRefSubtree: capture-only walk of subtrees the main walkers skip. |
| 552 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) { |
| 553 | if depth > 12 { |
| 554 | return; |
| 555 | } |
| 556 | let kind = node.kind(); |
| 557 | if depth > 0 |
| 558 | && (is_function_type(kind) || matches!(kind, "lambda_literal" | "lambda_expression")) |
| 559 | { |
| 560 | return; |
| 561 | } |
| 562 | self.maybe_capture_fn_refs(node); |
| 563 | for i in 0..node.named_child_count() { |
| 564 | if let Some(c) = node.named_child(i) { |
| 565 | self.scan_fn_ref_subtree(c, depth + 1); |
| 566 | } |
| 567 | } |
| 568 | } |
| 569 | |
| 570 | fn flush_fn_ref_candidates(&mut self) { |
| 571 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected