extractModifiers — expect/actual platform modifiers, matched by NODE TYPE (never text), in order. Runs inside create_node for every node.
(&self, node: Node)
| 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) ------------------------------------------------ |