(&mut self, node: Node<'t>, depth: u32, walked: &HashSet<usize>)
| 1232 | } |
| 1233 | |
| 1234 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32, walked: &HashSet<usize>) { |
| 1235 | stack_guard!(); |
| 1236 | if depth > 12 { |
| 1237 | return; |
| 1238 | } |
| 1239 | // Subtrees the body walker has already been through. |
| 1240 | if walked.contains(&node.id()) { |
| 1241 | return; |
| 1242 | } |
| 1243 | // (functionTypes is empty for Java; lambda_expression halts the scan) |
| 1244 | if depth > 0 && matches!(node.kind(), "lambda_literal" | "lambda_expression") { |
| 1245 | return; |
| 1246 | } |
| 1247 | self.maybe_capture_fn_refs(node); |
| 1248 | for c in node.named_children(&mut node.walk()) { |
| 1249 | self.scan_fn_ref_subtree(c, depth + 1, walked); |
| 1250 | } |
| 1251 | } |
| 1252 | |
| 1253 | fn flush_fn_ref_candidates(&mut self) { |
| 1254 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected