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

Method visit_enum_constant_body

codegraph-kernel/src/java.rs:732–742  ·  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

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