Rightmost descendant-or-self named child of one of the given types.
(node: SyntaxNode, types: Set<string>)
| 626 | |
| 627 | /** Rightmost descendant-or-self named child of one of the given types. */ |
| 628 | function lastNamedOfType(node: SyntaxNode, types: Set<string>): SyntaxNode | null { |
| 629 | let found: SyntaxNode | null = null; |
| 630 | for (const child of node.namedChildren) { |
| 631 | if (!child) continue; |
| 632 | if (types.has(child.type)) found = child; |
| 633 | const deeper = lastNamedOfType(child, types); |
| 634 | if (deeper) found = deeper; |
| 635 | } |
| 636 | return found; |
| 637 | } |
| 638 | |
| 639 | function normalizeSpecial( |
| 640 | node: SyntaxNode, |