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

Method extract_enum

codegraph-kernel/src/java.rs:683–704  ·  view source on GitHub ↗
(&mut self, node: Node<'t>)

Source from the content-addressed store, hash-verified

681 }
682
683 fn extract_enum(&mut self, node: Node<'t>) {
684 stack_guard!();
685 let Some(body) = node.child_by_field_name("body") else { return };
686 let name = self.extract_name(node);
687 let extra = Extra {
688 docstring: preceding_docstring(node, self.src),
689 visibility: self.visibility_of(node),
690 ..Extra::default()
691 };
692 let Some(row) = self.create_node("enum", &name, node, extra) else { return };
693 self.extract_inheritance(node, row);
694 self.stack.push(Scope { row, kind: "enum", name });
695 for child in body.named_children(&mut body.walk()) {
696 if child.kind() == "enum_constant" {
697 let member = self.extract_enum_members(child);
698 self.visit_enum_constant_body(child, member);
699 } else {
700 self.visit_node(child);
701 }
702 }
703 self.stack.pop();
704 }
705
706 fn extract_enum_members(&mut self, node: Node<'t>) -> Option<(u32, String)> {
707 let name_node = node.child_by_field_name("name")?;

Callers 2

visit_nodeMethod · 0.45

Calls 10

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

Tested by

no test coverage detected