First `simple_identifier` in `node`'s subtree (breadth-ish, first-found). * Swift's property name nests as `property_declaration → pattern → * bound_identifier → simple_identifier`; this resolves it (and the bound name of * a Kotlin/Swift property declarator for the shadow prune). For a tu
(node: SyntaxNode | null)
| 234 | * a Kotlin/Swift property declarator for the shadow prune). For a tuple pattern |
| 235 | * (`let (a, b)`) it returns the first — acceptable, those are rare for consts. */ |
| 236 | function firstSimpleIdentifier(node: SyntaxNode | null): SyntaxNode | null { |
| 237 | const stack: SyntaxNode[] = node ? [node] : []; |
| 238 | let guard = 0; |
| 239 | while (stack.length > 0 && guard++ < 40) { |
| 240 | const n = stack.shift()!; |
| 241 | if (n.type === 'simple_identifier') return n; |
| 242 | for (let i = 0; i < n.namedChildCount; i++) { |
| 243 | const c = n.namedChild(i); |
| 244 | if (c) stack.push(c); |
| 245 | } |
| 246 | } |
| 247 | return null; |
| 248 | } |
| 249 | |
| 250 | /** Swift property facts: the bound name, whether it's a `let`, and whether it's |
| 251 | * a *computed* property (a getter block, no stored value — never a constant). */ |
no outgoing calls
no test coverage detected