(&mut self, node: Node<'t>)
| 799 | } |
| 800 | |
| 801 | fn visit_for_calls_and_structure(&mut self, node: Node<'t>) { |
| 802 | stack_guard!(); |
| 803 | let kind = node.kind(); |
| 804 | self.maybe_capture_fn_refs(node); |
| 805 | |
| 806 | if kind == "call_expression" { |
| 807 | self.extract_call(node); |
| 808 | } |
| 809 | // (INSTANTIATION_KINDS has no swift types; extractBareCall absent.) |
| 810 | |
| 811 | self.extract_static_member_ref(node); |
| 812 | |
| 813 | if kind == "function_declaration" { |
| 814 | let name = self.extract_name(node); |
| 815 | if name != "<anonymous>" { |
| 816 | self.extract_function(node); |
| 817 | return; |
| 818 | } |
| 819 | } |
| 820 | if kind == "class_declaration" { |
| 821 | let mut classified = "class"; |
| 822 | for i in 0..node.child_count() { |
| 823 | if let Some(c) = node.child(i) { |
| 824 | if c.kind() == "struct" { |
| 825 | classified = "struct"; |
| 826 | break; |
| 827 | } |
| 828 | if c.kind() == "enum" { |
| 829 | classified = "enum"; |
| 830 | break; |
| 831 | } |
| 832 | } |
| 833 | } |
| 834 | match classified { |
| 835 | "struct" => self.extract_struct(node), |
| 836 | "enum" => self.extract_enum(node), |
| 837 | _ => self.extract_class(node), |
| 838 | } |
| 839 | return; |
| 840 | } |
| 841 | if kind == "protocol_declaration" { |
| 842 | self.extract_interface(node); |
| 843 | return; |
| 844 | } |
| 845 | |
| 846 | for i in 0..node.named_child_count() { |
| 847 | if let Some(c) = node.named_child(i) { |
| 848 | self.visit_for_calls_and_structure(c); |
| 849 | } |
| 850 | } |
| 851 | } |
| 852 | |
| 853 | // --- extractors ----------------------------------------------------------------- |
| 854 |
no test coverage detected