(node: SyntaxNode | null)
| 11 | * function-pointer var) — return null so it isn't extracted as a variable. |
| 12 | */ |
| 13 | export function cDeclaratorIdentifier(node: SyntaxNode | null): SyntaxNode | null { |
| 14 | let cur: SyntaxNode | null = node; |
| 15 | let guard = 0; |
| 16 | while (cur && guard++ < 12) { |
| 17 | switch (cur.type) { |
| 18 | case 'identifier': |
| 19 | return cur; |
| 20 | case 'function_declarator': |
| 21 | return null; |
| 22 | case 'init_declarator': |
| 23 | case 'pointer_declarator': |
| 24 | case 'array_declarator': |
| 25 | case 'parenthesized_declarator': |
| 26 | cur = getChildByField(cur, 'declarator'); |
| 27 | break; |
| 28 | default: |
| 29 | return null; |
| 30 | } |
| 31 | } |
| 32 | return null; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Whether a C or Objective-C declaration is a constant: a `const` or |
no test coverage detected