(&mut self, node: Node<'t>)
| 580 | } |
| 581 | |
| 582 | fn visit_for_calls_and_structure(&mut self, node: Node<'t>) { |
| 583 | stack_guard!(); |
| 584 | let kind = node.kind(); |
| 585 | self.maybe_capture_fn_refs(node); |
| 586 | |
| 587 | if kind == "call" { |
| 588 | self.extract_call(node); |
| 589 | } else if let Some(bare) = self.bare_call_name(node) { |
| 590 | // extractBareCall: statement-level identifiers in BLOCK_PARENTS |
| 591 | // bodies (`do…end` = body_statement; brace blocks are block_body — |
| 592 | // NOT in the set, so `5.times { beep }` emits nothing for beep). |
| 593 | let name = bare.to_string(); |
| 594 | let from = self.top_row(); |
| 595 | self.push_ref_at(from, &name, edge_kind_index("calls").unwrap(), node); |
| 596 | } |
| 597 | |
| 598 | // (No INSTANTIATION_KINDS for ruby — `.new` is handled in extract_call; |
| 599 | // extractStaticMemberRef is gated off; no type annotations.) |
| 600 | |
| 601 | // Nested NAMED defs become their own function nodes; classes extract. |
| 602 | // A `module` inside a body mints NOTHING (the visitNode hook does not |
| 603 | // run here) — its children just recurse. Same for singleton_method |
| 604 | // (functionTypes-only check): unmatched, recursed. |
| 605 | if kind == "method" { |
| 606 | let name = self.extract_name(node); |
| 607 | if name != "<anonymous>" { |
| 608 | self.extract_function(node); |
| 609 | return; |
| 610 | } |
| 611 | } |
| 612 | if kind == "class" { |
| 613 | self.extract_class(node); |
| 614 | return; |
| 615 | } |
| 616 | |
| 617 | for c in node.named_children(&mut node.walk()) { |
| 618 | self.visit_for_calls_and_structure(c); |
| 619 | } |
| 620 | } |
| 621 | |
| 622 | /// rubyExtractor.extractBareCall (languages/ruby.ts:77-105). |
| 623 | fn bare_call_name(&self, node: Node) -> Option<&'t str> { |
no test coverage detected