MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / declaresMemberFunction

Function declaresMemberFunction

src/extraction/languages/c-cpp.ts:73–77  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

71 * a parenthesized one.
72 */
73function 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; };`)? */
80export function isUnnamedMemberType(specifier: SyntaxNode): boolean {

Callers 1

collectMemberTypeNamesFunction · 0.85

Calls 2

getChildByFieldFunction · 0.90
innerDeclaratorFunction · 0.85

Tested by

no test coverage detected