* Whether a member declarator declares a member function (`Status Get(int);`, * `Foo* Make();`, `Slice operator[](int);`), rather than data, which may be a * pointer to a function (`void (*cb)(int);`), whose function declarator wraps * a parenthesized one.
(declarator: SyntaxNode)
| 71 | * a parenthesized one. |
| 72 | */ |
| 73 | function declaresMemberFunction(declarator: SyntaxNode): boolean { |
| 74 | let d: SyntaxNode | null = declarator; |
| 75 | while (d && (d.type === 'pointer_declarator' || d.type === 'reference_declarator')) d = innerDeclarator(d); |
| 76 | return d?.type === 'function_declarator' && getChildByField(d, 'declarator')?.type !== 'parenthesized_declarator'; |
| 77 | } |
| 78 | |
| 79 | /** Is this class-like specifier an unnamed member of another (`struct S { union { … } u; };`)? */ |
| 80 | export function isUnnamedMemberType(specifier: SyntaxNode): boolean { |
no test coverage detected