(&mut self, node: Node<'t>)
| 921 | } |
| 922 | |
| 923 | fn visit_for_calls_and_structure(&mut self, node: Node<'t>) { |
| 924 | stack_guard!(); |
| 925 | let kind = node.kind(); |
| 926 | self.maybe_capture_fn_refs(node); |
| 927 | |
| 928 | if kind == "call_expression" { |
| 929 | self.extract_call(node); |
| 930 | } else if kind == "infix_expression" { |
| 931 | self.extract_infix_call(node); |
| 932 | } |
| 933 | // (INSTANTIATION_KINDS has no kotlin members; extractBareCall absent.) |
| 934 | |
| 935 | self.extract_static_member_ref(node); |
| 936 | |
| 937 | // `object : Api.Listener { … }` in a body or an initializer — an |
| 938 | // anonymous class; its header is this body's code. |
| 939 | if kind == "object_literal" && self.extract_object_literal(node, true) { |
| 940 | return; |
| 941 | } |
| 942 | |
| 943 | if kind == "function_declaration" { |
| 944 | let name = self.extract_name(node); |
| 945 | if name != "<anonymous>" { |
| 946 | // extractFunction diverts receiver-bearing nested fns to |
| 947 | // extractMethod itself. |
| 948 | self.extract_function(node); |
| 949 | return; |
| 950 | } |
| 951 | } |
| 952 | if kind == "class_declaration" { |
| 953 | let mut classified = "class"; |
| 954 | for i in 0..node.child_count() { |
| 955 | if let Some(c) = node.child(i) { |
| 956 | if c.kind() == "interface" { |
| 957 | classified = "interface"; |
| 958 | break; |
| 959 | } |
| 960 | if c.kind() == "enum" { |
| 961 | classified = "enum"; |
| 962 | break; |
| 963 | } |
| 964 | } |
| 965 | } |
| 966 | match classified { |
| 967 | "interface" => self.extract_interface(node), |
| 968 | "enum" => self.extract_enum(node), |
| 969 | _ => self.extract_class(node), |
| 970 | } |
| 971 | return; |
| 972 | } |
| 973 | // object_declaration is NOT dispatched here — a body-local object's |
| 974 | // `fun`s hit the function branch above and leak out as FUNCTIONS |
| 975 | // under the enclosing fn; its properties mint nothing (quirk). |
| 976 | |
| 977 | for i in 0..node.named_child_count() { |
| 978 | if let Some(c) = node.named_child(i) { |
| 979 | self.visit_for_calls_and_structure(c); |
| 980 | } |
no test coverage detected