MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / extract_class

Method extract_class

codegraph-kernel/src/ccpp/mod.rs:1122–1140  ·  view source on GitHub ↗

extractClass for cpp class_specifier (skipBodilessClass, #1093).

(&mut self, node: Node<'t>)

Source from the content-addressed store, hash-verified

1120
1121 /// extractClass for cpp class_specifier (skipBodilessClass, #1093).
1122 fn extract_class(&mut self, node: Node<'t>) {
1123 stack_guard!();
1124 let Some(body) = node.child_by_field_name("body") else { return };
1125 let name = self.extract_name(node);
1126 let extra = Extra {
1127 docstring: preceding_docstring(node, self.src),
1128 visibility: self.visibility_of(node),
1129 ..Extra::default()
1130 };
1131 let Some(row) = self.create_node("class", &name, node, extra) else { return };
1132 self.extract_inheritance(node, row);
1133 self.stack.push(Scope { row, kind: "class", name });
1134 for i in 0..body.named_child_count() {
1135 if let Some(c) = body.named_child(i) {
1136 self.visit_node(c);
1137 }
1138 }
1139 self.stack.pop();
1140 }
1141
1142 /// Extract a struct-like declaration while preserving its semantic kind.
1143 fn extract_aggregate(&mut self, node: Node<'t>, kind: &'static str) {

Callers 2

visit_nodeMethod · 0.45

Calls 7

preceding_docstringFunction · 0.85
pushMethod · 0.80
extract_nameMethod · 0.45
visibility_ofMethod · 0.45
create_nodeMethod · 0.45
extract_inheritanceMethod · 0.45
visit_nodeMethod · 0.45

Tested by

no test coverage detected