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

Method extract_modifiers

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

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

Callers 1

create_nodeMethod · 0.80

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected