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

Method extract_modifiers

codegraph-kernel/src/kotlin.rs:677–698  ·  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

675 /// extractModifiers — expect/actual platform modifiers, matched by NODE
676 /// TYPE (never text), in order. Runs inside create_node for every node.
677 fn extract_modifiers(&self, node: Node) -> Option<Vec<String>> {
678 let mut mods: Vec<String> = Vec::new();
679 for i in 0..node.child_count() {
680 let Some(child) = node.child(i) else { continue };
681 if child.kind() != "modifiers" {
682 continue;
683 }
684 for j in 0..child.child_count() {
685 let Some(pm) = child.child(j) else { continue };
686 if pm.kind() != "platform_modifier" {
687 continue;
688 }
689 for k in 0..pm.child_count() {
690 let Some(kw) = pm.child(k) else { continue };
691 if matches!(kw.kind(), "expect" | "actual") {
692 mods.push(kw.kind().to_string());
693 }
694 }
695 }
696 }
697 if mods.is_empty() { None } else { Some(mods) }
698 }
699
700 // --- the visitNode hook (property branch ONLY — fun-interface recovery is
701 // defer-shielded and not ported) ------------------------------------------------

Callers 1

create_nodeMethod · 0.80

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected