A property's CODE children: the named child right after the `=` token, a `property_delegate` (`by lazy { … }`), and an accessor the grammar nested under the declaration (`val x: Int get() = compute()` — written on ONE line; an accessor on its own line parses as a SIBLING of the property and is not reachable from here). What stays unwalked is the declaration itself — modifiers, the `val`/`var` keyw
(node: Node<'t>)
| 119 | /// for the same reason; this grammar exposes no fields at all, hence the `=` |
| 120 | /// anchor.) |
| 121 | fn property_initializers<'t>(node: Node<'t>) -> Vec<Node<'t>> { |
| 122 | let mut out: Vec<Node<'t>> = Vec::new(); |
| 123 | let mut after_eq = false; |
| 124 | for i in 0..node.child_count() { |
| 125 | let Some(c) = node.child(i) else { continue }; |
| 126 | if !c.is_named() { |
| 127 | if c.kind() == "=" { |
| 128 | after_eq = true; |
| 129 | } |
| 130 | continue; |
| 131 | } |
| 132 | if after_eq { |
| 133 | out.push(c); |
| 134 | after_eq = false; |
| 135 | } else if matches!(c.kind(), "property_delegate" | "getter" | "setter") { |
| 136 | out.push(c); |
| 137 | } |
| 138 | } |
| 139 | out |
| 140 | } |
| 141 | |
| 142 | /// Accessors written on their OWN line parse as SIBLINGS of the property, not |
| 143 | /// as children of it (same-line ones nest — see property_initializers). Walking |