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

Method visit_enum_constant_body

codegraph-kernel/src/java.rs:734–744  ·  view source on GitHub ↗

`PLUS { int apply(…) { … } }`: a constant's own class_body declares members of its own, scoped under the constant.

(&mut self, node: Node<'t>, member: Option<(u32, String)>)

Source from the content-addressed store, hash-verified

732 /// `PLUS { int apply(…) { … } }`: a constant's own class_body declares
733 /// members of its own, scoped under the constant.
734 fn visit_enum_constant_body(&mut self, node: Node<'t>, member: Option<(u32, String)>) {
735 let Some((row, name)) = member else { return };
736 let Some(body) = (0..node.named_child_count()).filter_map(|i| node.named_child(i)).find(|c| c.kind() == "class_body") else { return };
737 self.stack.push(Scope { row, kind: "enum_member", name });
738 for i in 0..body.named_child_count() {
739 if let Some(c) = body.named_child(i) {
740 self.visit_node(c);
741 }
742 }
743 self.stack.pop();
744 }
745
746 /// extractField — each declarator becomes a field/constant node. Returns
747 /// the initializers walked under their fields, for the declaration scan to

Callers 1

extract_enumMethod · 0.80

Calls 2

pushMethod · 0.80
visit_nodeMethod · 0.45

Tested by

no test coverage detected