(&mut self, node: Node<'t>)
| 854 | } |
| 855 | |
| 856 | fn extract_struct(&mut self, node: Node<'t>) { |
| 857 | stack_guard!(); |
| 858 | // Body gate (:1876) — bodiless mints nothing (record exemption is C#). |
| 859 | let Some(body) = node.child_by_field_name("body") else { return }; |
| 860 | let name = self.extract_name(node); |
| 861 | let extra = Extra { |
| 862 | docstring: preceding_docstring(node, self.src), |
| 863 | visibility: Some(self.visibility_of(node)), |
| 864 | ..Extra::default() |
| 865 | }; |
| 866 | let Some(row) = self.create_node("struct", &name, node, extra) else { return }; |
| 867 | self.extract_inheritance(node, row); |
| 868 | // NO extractDecoratorsFor for structs (`@main struct` emits nothing). |
| 869 | self.stack.push(Scope { row, kind: "struct", name }); |
| 870 | for i in 0..body.named_child_count() { |
| 871 | if let Some(c) = body.named_child(i) { |
| 872 | self.visit_node(c); |
| 873 | } |
| 874 | } |
| 875 | self.stack.pop(); |
| 876 | } |
| 877 | |
| 878 | fn extract_enum(&mut self, node: Node<'t>) { |
| 879 | stack_guard!(); |
no test coverage detected