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

Method visit_enum_constant_body

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

714 /// `PLUS { int apply(…) { … } }`: a constant's own class_body declares
715 /// members of its own, scoped under the constant.
716 fn visit_enum_constant_body(&mut self, node: Node<'t>, member: Option<(u32, String)>) {
717 let Some((row, name)) = member else { return };
718 let Some(body) = (0..node.named_child_count()).filter_map(|i| node.named_child(i)).find(|c| c.kind() == "class_body") else { return };
719 self.stack.push(Scope { row, kind: "enum_member", name });
720 for c in body.named_children(&mut body.walk()) {
721 self.visit_node(c);
722 }
723 self.stack.pop();
724 }
725
726 /// extractField — each declarator becomes a field/constant node. Returns
727 /// the initializers walked under their fields, for the declaration scan to

Callers 1

extract_enumMethod · 0.80

Calls 3

pushMethod · 0.80
walkMethod · 0.45
visit_nodeMethod · 0.45

Tested by

no test coverage detected