(&mut self, node: Node<'t>)
| 721 | } |
| 722 | |
| 723 | fn extract_struct(&mut self, node: Node<'t>) { |
| 724 | stack_guard!(); |
| 725 | // Body gate — EXCEPT C# positional records (`record struct M(…);`, |
| 726 | // node type record_declaration), complete definitions with no body. |
| 727 | // A bodiless `struct Fwd;` mints NO node. (#831) |
| 728 | let body = node.child_by_field_name("body"); |
| 729 | if body.is_none() && node.kind() != "record_declaration" { |
| 730 | return; |
| 731 | } |
| 732 | let name = self.extract_name(node); |
| 733 | let extra = Extra { |
| 734 | docstring: preceding_docstring(node, self.src), |
| 735 | visibility: Some(self.visibility_of(node)), |
| 736 | ..Extra::default() |
| 737 | }; |
| 738 | let Some(row) = self.create_node("struct", &name, node, extra) else { return }; |
| 739 | self.extract_inheritance(node, row); |
| 740 | self.extract_primary_ctor_param_refs(node, row); |
| 741 | // NOTE: extractStruct does NOT call extractDecoratorsFor (TS parity). |
| 742 | if let Some(body) = body { |
| 743 | self.stack.push(Scope { row, kind: "struct", name }); |
| 744 | for c in body.named_children(&mut body.walk()) { |
| 745 | self.visit_node(c); |
| 746 | } |
| 747 | self.stack.pop(); |
| 748 | } |
| 749 | } |
| 750 | |
| 751 | fn extract_interface(&mut self, node: Node<'t>) { |
| 752 | stack_guard!(); |
no test coverage detected