Extract a struct-like declaration while preserving its semantic kind.
(&mut self, node: Node<'t>, kind: &'static str)
| 980 | |
| 981 | /// Extract a struct-like declaration while preserving its semantic kind. |
| 982 | fn extract_aggregate(&mut self, node: Node<'t>, kind: &'static str) { |
| 983 | stack_guard!(); |
| 984 | let Some(body) = node.child_by_field_name("body") else { return }; |
| 985 | let name = self.extract_name(node); |
| 986 | let extra = Extra { |
| 987 | docstring: preceding_docstring(node, self.src), |
| 988 | visibility: if self.variant == Variant::Cpp { self.visibility_of(node) } else { None }, |
| 989 | ..Extra::default() |
| 990 | }; |
| 991 | let Some(row) = self.create_node(kind, &name, node, extra) else { return }; |
| 992 | self.extract_inheritance(node, row); |
| 993 | self.stack.push(Scope { row, kind, name }); |
| 994 | for i in 0..body.named_child_count() { |
| 995 | if let Some(c) = body.named_child(i) { |
| 996 | self.visit_node(c); |
| 997 | } |
| 998 | } |
| 999 | self.stack.pop(); |
| 1000 | } |
| 1001 | |
| 1002 | fn extract_enum(&mut self, node: Node<'t>) { |
| 1003 | stack_guard!(); |
no test coverage detected