(&mut self, node: Node<'t>)
| 1105 | } |
| 1106 | |
| 1107 | fn visit_for_calls_and_structure(&mut self, node: Node<'t>) { |
| 1108 | let kind = node.kind(); |
| 1109 | self.maybe_capture_fn_refs(node); |
| 1110 | |
| 1111 | // Rocket route macros: handler paths live in a raw token tree. |
| 1112 | if kind == "macro_invocation" { |
| 1113 | self.extract_rust_route_macro(node); |
| 1114 | } |
| 1115 | |
| 1116 | if kind == "call_expression" { |
| 1117 | self.extract_call(node); |
| 1118 | } else if kind == "struct_expression" { |
| 1119 | self.extract_instantiation(node); |
| 1120 | } |
| 1121 | |
| 1122 | // Nested NAMED fns become their own nodes (a nested fn inside an impl |
| 1123 | // method walks up to the impl and indexes as a METHOD). |
| 1124 | if matches!(kind, "function_item" | "function_signature_item") { |
| 1125 | let name = self.extract_name(node); |
| 1126 | if name != "<anonymous>" { |
| 1127 | self.extract_fn_or_method(node); |
| 1128 | return; |
| 1129 | } |
| 1130 | } |
| 1131 | |
| 1132 | // Structural nodes inside bodies. |
| 1133 | if kind == "struct_item" { |
| 1134 | self.extract_struct(node); |
| 1135 | return; |
| 1136 | } |
| 1137 | if kind == "enum_item" { |
| 1138 | self.extract_enum(node); |
| 1139 | return; |
| 1140 | } |
| 1141 | if kind == "trait_item" { |
| 1142 | self.extract_interface(node); |
| 1143 | return; |
| 1144 | } |
| 1145 | |
| 1146 | for i in 0..node.named_child_count() { |
| 1147 | if let Some(c) = node.named_child(i) { |
| 1148 | self.visit_for_calls_and_structure(c); |
| 1149 | } |
| 1150 | } |
| 1151 | } |
| 1152 | |
| 1153 | // --- fn refs (RUST_SPEC) ---------------------------------------------------- |
| 1154 |
no test coverage detected