`parent` is `node`'s parent, handed down by the walk (None at a body's root): `Node::parent()` walks down from the tree's root on every call.
(&mut self, node: Node<'t>, parent: Option<Node<'t>>)
| 1259 | /// `parent` is `node`'s parent, handed down by the walk (None at a body's |
| 1260 | /// root): `Node::parent()` walks down from the tree's root on every call. |
| 1261 | fn visit_for_calls_and_structure(&mut self, node: Node<'t>, parent: Option<Node<'t>>) { |
| 1262 | stack_guard!(); |
| 1263 | let kind = node.kind(); |
| 1264 | self.maybe_capture_fn_refs(node); |
| 1265 | |
| 1266 | // Rocket route macros: handler paths live in a raw token tree. |
| 1267 | if kind == "macro_invocation" { |
| 1268 | self.extract_rust_route_macro(node); |
| 1269 | self.extract_rust_macro_refs(node); |
| 1270 | } |
| 1271 | |
| 1272 | if kind == "call_expression" { |
| 1273 | self.extract_call(node); |
| 1274 | } else if kind == "struct_expression" { |
| 1275 | self.extract_instantiation(node); |
| 1276 | } |
| 1277 | self.extract_static_member_ref(node, parent); |
| 1278 | |
| 1279 | // Nested NAMED fns become their own nodes (a nested fn inside an impl |
| 1280 | // method walks up to the impl and indexes as a METHOD). |
| 1281 | if matches!(kind, "function_item" | "function_signature_item") { |
| 1282 | let name = self.extract_name(node); |
| 1283 | if name != "<anonymous>" { |
| 1284 | self.extract_fn_or_method(node); |
| 1285 | return; |
| 1286 | } |
| 1287 | } |
| 1288 | |
| 1289 | // Structural nodes inside bodies. |
| 1290 | if kind == "struct_item" { |
| 1291 | self.extract_aggregate(node, "struct"); |
| 1292 | return; |
| 1293 | } |
| 1294 | if kind == "union_item" { |
| 1295 | self.extract_aggregate(node, "union"); |
| 1296 | return; |
| 1297 | } |
| 1298 | if kind == "enum_item" { |
| 1299 | self.extract_enum(node); |
| 1300 | return; |
| 1301 | } |
| 1302 | if kind == "trait_item" { |
| 1303 | self.extract_interface(node); |
| 1304 | return; |
| 1305 | } |
| 1306 | |
| 1307 | for c in node.named_children(&mut node.walk()) { |
| 1308 | self.visit_for_calls_and_structure(c, Some(node)); |
| 1309 | } |
| 1310 | } |
| 1311 | |
| 1312 | /// extractStaticMemberRef — the rust branch (#2328): an enum variant |
| 1313 | /// written as a path (`Mode::A`, `mode::Mode::B`, a `Mode::C(x)` / |
no test coverage detected