(&mut self, node: Node<'t>, depth: u32)
| 1424 | } |
| 1425 | |
| 1426 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) { |
| 1427 | stack_guard!(); |
| 1428 | if depth > 12 { |
| 1429 | return; |
| 1430 | } |
| 1431 | // functionTypes is EMPTY for C#; the literal halt list applies — |
| 1432 | // lambda_expression IS C#'s lambda, so initializer lambdas stop the |
| 1433 | // scan; anonymous_method_expression is NOT listed and scans through. |
| 1434 | if depth > 0 |
| 1435 | && matches!( |
| 1436 | node.kind(), |
| 1437 | "arrow_function" | "function_expression" | "lambda_literal" | "lambda_expression" |
| 1438 | ) |
| 1439 | { |
| 1440 | return; |
| 1441 | } |
| 1442 | self.maybe_capture_fn_refs(node); |
| 1443 | for i in 0..node.named_child_count() { |
| 1444 | if let Some(c) = node.named_child(i) { |
| 1445 | self.scan_fn_ref_subtree(c, depth + 1); |
| 1446 | } |
| 1447 | } |
| 1448 | } |
| 1449 | |
| 1450 | fn flush_fn_ref_candidates(&mut self) { |
| 1451 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected