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

Method extract_modifiers

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

558 /// extractModifiers — expect/actual platform modifiers, matched by NODE
559 /// TYPE (never text), in order. Runs inside create_node for every node.
560 fn extract_modifiers(&self, node: Node) -> Option<Vec<String>> {
561 let mut mods: Vec<String> = Vec::new();
562 for i in 0..node.child_count() {
563 let Some(child) = node.child(i) else { continue };
564 if child.kind() != "modifiers" {
565 continue;
566 }
567 for j in 0..child.child_count() {
568 let Some(pm) = child.child(j) else { continue };
569 if pm.kind() != "platform_modifier" {
570 continue;
571 }
572 for k in 0..pm.child_count() {
573 let Some(kw) = pm.child(k) else { continue };
574 if matches!(kw.kind(), "expect" | "actual") {
575 mods.push(kw.kind().to_string());
576 }
577 }
578 }
579 }
580 if mods.is_empty() { None } else { Some(mods) }
581 }
582
583 // --- the visitNode hook (property branch ONLY — fun-interface recovery is
584 // defer-shielded and not ported) ------------------------------------------------

Callers 1

create_nodeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected