Extract a Rust struct or union with a body; unit structs remain skipped.
(&mut self, node: Node<'t>, kind: &'static str)
| 592 | |
| 593 | /// Extract a Rust struct or union with a body; unit structs remain skipped. |
| 594 | fn extract_aggregate(&mut self, node: Node<'t>, kind: &'static str) { |
| 595 | stack_guard!(); |
| 596 | let Some(body) = node.child_by_field_name("body") else { return }; |
| 597 | let name = self.extract_name(node); |
| 598 | let extra = Extra { |
| 599 | docstring: preceding_docstring(node, self.src), |
| 600 | visibility: Some(self.visibility_of(node)), |
| 601 | ..Extra::default() |
| 602 | }; |
| 603 | let Some(row) = self.create_node(kind, &name, node, extra) else { return }; |
| 604 | self.extract_inheritance(node, row); |
| 605 | |
| 606 | self.stack.push(Scope { row, kind, name }); |
| 607 | for i in 0..body.named_child_count() { |
| 608 | if let Some(c) = body.named_child(i) { |
| 609 | self.visit_node(c); |
| 610 | } |
| 611 | } |
| 612 | self.stack.pop(); |
| 613 | } |
| 614 | |
| 615 | /// extractEnum — body required; enum_variant children → enum_member nodes |
| 616 | /// (name field only, payloads never walked); other children re-dispatched. |
no test coverage detected