(&mut self, node: Node<'t>)
| 926 | } |
| 927 | |
| 928 | fn extract_struct(&mut self, node: Node<'t>) { |
| 929 | stack_guard!(); |
| 930 | // Body gate (:1876) — bodiless mints nothing (record exemption is C#). |
| 931 | let Some(body) = node.child_by_field_name("body") else { return }; |
| 932 | let name = self.extract_name(node); |
| 933 | let extra = Extra { |
| 934 | docstring: preceding_docstring(node, self.src), |
| 935 | visibility: Some(self.visibility_of(node)), |
| 936 | ..Extra::default() |
| 937 | }; |
| 938 | let Some(row) = self.create_node("struct", &name, node, extra) else { return }; |
| 939 | self.extract_inheritance(node, row); |
| 940 | // NO extractDecoratorsFor for structs (`@main struct` emits nothing). |
| 941 | self.stack.push(Scope { row, kind: "struct", name }); |
| 942 | for i in 0..body.named_child_count() { |
| 943 | if let Some(c) = body.named_child(i) { |
| 944 | self.visit_node(c); |
| 945 | } |
| 946 | } |
| 947 | self.stack.pop(); |
| 948 | } |
| 949 | |
| 950 | fn extract_enum(&mut self, node: Node<'t>) { |
| 951 | stack_guard!(); |
no test coverage detected