(&mut self, node: Node<'t>)
| 785 | } |
| 786 | |
| 787 | fn visit_for_calls_and_structure(&mut self, node: Node<'t>) { |
| 788 | stack_guard!(); |
| 789 | let kind = node.kind(); |
| 790 | self.maybe_capture_fn_refs(node); |
| 791 | |
| 792 | if kind == "call_expression" { |
| 793 | self.extract_call(node); |
| 794 | } |
| 795 | // (INSTANTIATION_KINDS has no swift types; extractBareCall absent.) |
| 796 | |
| 797 | self.extract_static_member_ref(node); |
| 798 | |
| 799 | if kind == "function_declaration" { |
| 800 | let name = self.extract_name(node); |
| 801 | if name != "<anonymous>" { |
| 802 | self.extract_function(node); |
| 803 | return; |
| 804 | } |
| 805 | } |
| 806 | if kind == "class_declaration" { |
| 807 | let mut classified = "class"; |
| 808 | for c in node.children(&mut node.walk()) { |
| 809 | if c.kind() == "struct" { |
| 810 | classified = "struct"; |
| 811 | break; |
| 812 | } |
| 813 | if c.kind() == "enum" { |
| 814 | classified = "enum"; |
| 815 | break; |
| 816 | } |
| 817 | } |
| 818 | match classified { |
| 819 | "struct" => self.extract_struct(node), |
| 820 | "enum" => self.extract_enum(node), |
| 821 | _ => self.extract_class(node), |
| 822 | } |
| 823 | return; |
| 824 | } |
| 825 | if kind == "protocol_declaration" { |
| 826 | self.extract_interface(node); |
| 827 | return; |
| 828 | } |
| 829 | |
| 830 | for c in node.named_children(&mut node.walk()) { |
| 831 | self.visit_for_calls_and_structure(c); |
| 832 | } |
| 833 | } |
| 834 | |
| 835 | // --- extractors ----------------------------------------------------------------- |
| 836 |
no test coverage detected