Extract a Rust struct or union — the body field is OPTIONAL. A unit struct (`struct U;`) has no body and is still a complete definition, so it mints a node with no members; tuple structs' ordered_field_declaration_list is a body. Mirrors the TS reference's `allowBodilessStruct`.
(&mut self, node: Node<'t>, kind: &'static str)
| 649 | /// so it mints a node with no members; tuple structs' ordered_field_declaration_list |
| 650 | /// is a body. Mirrors the TS reference's `allowBodilessStruct`. |
| 651 | fn extract_aggregate(&mut self, node: Node<'t>, kind: &'static str) { |
| 652 | stack_guard!(); |
| 653 | let name = self.extract_name(node); |
| 654 | let extra = Extra { |
| 655 | docstring: preceding_docstring(node, self.src), |
| 656 | visibility: Some(self.visibility_of(node)), |
| 657 | ..Extra::default() |
| 658 | }; |
| 659 | let Some(row) = self.create_node(kind, &name, node, extra) else { return }; |
| 660 | self.extract_inheritance(node, row); |
| 661 | |
| 662 | // Unit structs have no body to walk — the node itself is the whole |
| 663 | // definition. |
| 664 | let Some(body) = node.child_by_field_name("body") else { return }; |
| 665 | |
| 666 | self.stack.push(Scope { row, kind, name }); |
| 667 | for i in 0..body.named_child_count() { |
| 668 | if let Some(c) = body.named_child(i) { |
| 669 | self.visit_node(c); |
| 670 | } |
| 671 | } |
| 672 | self.stack.pop(); |
| 673 | } |
| 674 | |
| 675 | /// extractEnum — body required; enum_variant children → enum_member nodes |
| 676 | /// (name field only, payloads never walked); other children re-dispatched. |
no test coverage detected