scanFnRefSubtree: capture-only walk of subtrees the main walkers skip (variable-declaration initializers). Halts at nested functions/lambdas.
(&mut self, node: Node<'t>, depth: u32)
| 1736 | /// scanFnRefSubtree: capture-only walk of subtrees the main walkers skip |
| 1737 | /// (variable-declaration initializers). Halts at nested functions/lambdas. |
| 1738 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) { |
| 1739 | if depth > 12 { |
| 1740 | return; |
| 1741 | } |
| 1742 | if depth > 0 |
| 1743 | && matches!( |
| 1744 | node.kind(), |
| 1745 | "function_definition" | "arrow_function" | "function_expression" |
| 1746 | | "lambda_literal" | "lambda_expression" |
| 1747 | ) |
| 1748 | { |
| 1749 | return; |
| 1750 | } |
| 1751 | self.maybe_capture_fn_refs(node); |
| 1752 | for i in 0..node.named_child_count() { |
| 1753 | if let Some(c) = node.named_child(i) { |
| 1754 | self.scan_fn_ref_subtree(c, depth + 1); |
| 1755 | } |
| 1756 | } |
| 1757 | } |
| 1758 | |
| 1759 | /// flushFnRefCandidates with the cFamily gate policy: value/list positions |
| 1760 | /// at FILE scope skip the same-file/import gate (C has no symbol imports); |
no test coverage detected