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

Method extract_modifiers

codegraph-kernel/src/kotlin.rs:728–746  ·  view source on GitHub ↗

extractModifiers — expect/actual platform modifiers, matched by NODE TYPE (never text), in order. Runs inside create_node for every node.

(&self, node: Node)

Source from the content-addressed store, hash-verified

726 /// extractModifiers — expect/actual platform modifiers, matched by NODE
727 /// TYPE (never text), in order. Runs inside create_node for every node.
728 fn extract_modifiers(&self, node: Node) -> Option<Vec<String>> {
729 let mut mods: Vec<String> = Vec::new();
730 for child in node.children(&mut node.walk()) {
731 if child.kind() != "modifiers" {
732 continue;
733 }
734 for pm in child.children(&mut child.walk()) {
735 if pm.kind() != "platform_modifier" {
736 continue;
737 }
738 for kw in pm.children(&mut pm.walk()) {
739 if matches!(kw.kind(), "expect" | "actual") {
740 mods.push(kw.kind().to_string());
741 }
742 }
743 }
744 }
745 if mods.is_empty() { None } else { Some(mods) }
746 }
747
748 // --- the visitNode hook (property branch ONLY — fun-interface recovery is
749 // defer-shielded and not ported) ------------------------------------------------

Callers 1

create_nodeMethod · 0.80

Calls 3

childrenMethod · 0.80
pushMethod · 0.80
walkMethod · 0.45

Tested by

no test coverage detected