(&mut self, node: Node<'t>, depth: u32)
| 1328 | } |
| 1329 | |
| 1330 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) { |
| 1331 | stack_guard!(); |
| 1332 | if depth > 12 { |
| 1333 | return; |
| 1334 | } |
| 1335 | // Halt list: functionTypes is EMPTY for scala, so only the literal |
| 1336 | // lambda kinds halt — the scan descends into nested |
| 1337 | // function_definitions inside hook-consumed vals. |
| 1338 | if depth > 0 |
| 1339 | && matches!( |
| 1340 | node.kind(), |
| 1341 | "arrow_function" | "function_expression" | "lambda_literal" | "lambda_expression" |
| 1342 | ) |
| 1343 | { |
| 1344 | return; |
| 1345 | } |
| 1346 | self.maybe_capture_fn_refs(node); |
| 1347 | let mut cursor = node.walk(); |
| 1348 | let children: Vec<Node<'t>> = node.named_children(&mut cursor).collect(); |
| 1349 | for c in children { |
| 1350 | self.scan_fn_ref_subtree(c, depth + 1); |
| 1351 | } |
| 1352 | } |
| 1353 | |
| 1354 | fn flush_fn_ref_candidates(&mut self) { |
| 1355 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected