(&mut self, node: Node<'t>)
| 358 | } |
| 359 | |
| 360 | fn visit_for_calls_and_structure(&mut self, node: Node<'t>) { |
| 361 | let kind = node.kind(); |
| 362 | self.maybe_capture_fn_refs(node); |
| 363 | |
| 364 | if kind == "call" { |
| 365 | self.extract_call(node); |
| 366 | } |
| 367 | |
| 368 | // Nested NAMED functions become their own nodes. |
| 369 | if kind == "function_definition" { |
| 370 | let name = self.extract_name(node); |
| 371 | if name != "<anonymous>" { |
| 372 | self.extract_function(node); |
| 373 | return; |
| 374 | } |
| 375 | } |
| 376 | if kind == "class_definition" { |
| 377 | self.extract_class(node); |
| 378 | return; |
| 379 | } |
| 380 | |
| 381 | for i in 0..node.named_child_count() { |
| 382 | if let Some(c) = node.named_child(i) { |
| 383 | self.visit_for_calls_and_structure(c); |
| 384 | } |
| 385 | } |
| 386 | } |
| 387 | |
| 388 | // --- extractors -------------------------------------------------------------- |
| 389 |
no test coverage detected