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

Function declaresMemberFunction

src/extraction/languages/c-cpp.ts:76–80  ·  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

74 * a parenthesized one.
75 */
76function declaresMemberFunction(declarator: SyntaxNode): boolean {
77 let d: SyntaxNode | null = declarator;
78 while (d && (d.type === 'pointer_declarator' || d.type === 'reference_declarator')) d = innerDeclarator(d);
79 return d?.type === 'function_declarator' && getChildByField(d, 'declarator')?.type !== 'parenthesized_declarator';
80}
81
82/** Is this class-like specifier an unnamed member of another (`struct S { union { … } u; };`)? */
83export function isUnnamedMemberType(specifier: SyntaxNode): boolean {

Callers 1

collectMemberTypeNamesFunction · 0.85

Calls 2

getChildByFieldFunction · 0.90
innerDeclaratorFunction · 0.85

Tested by

no test coverage detected