(node: SyntaxNode)
| 11 | } from './c-cpp'; |
| 12 | |
| 13 | function findCompoundStatement(node: SyntaxNode): SyntaxNode | null { |
| 14 | for (let i = 0; i < node.namedChildCount; i++) { |
| 15 | const child = node.namedChild(i); |
| 16 | if (child?.type === 'compound_statement') { |
| 17 | return child; |
| 18 | } |
| 19 | } |
| 20 | return null; |
| 21 | } |
| 22 | |
| 23 | /** Build ObjC selector: `greet`, `doThing:`, or `doThing:with:`. */ |
| 24 | function extractObjcMethodName(node: SyntaxNode, source: string): string | undefined { |