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

Function cAliasTypeNames

src/extraction/languages/c-cpp.ts:125–134  ·  view source on GitHub ↗
(alias: SyntaxNode, ownName: string, source: string)

Source from the content-addressed store, hash-verified

123 * Skipped as in cMemberTypeNames: `typedef struct dict dict;` names no other type.
124 */
125export function cAliasTypeNames(alias: SyntaxNode, ownName: string, source: string): CTypeName[] {
126 const names: CTypeName[] = [];
127 const own = new Set([ownName]);
128 const type = getChildByField(alias, 'type');
129 if (type) collectCTypeNames(type, own, source, names);
130 for (const declarator of alias.childrenForFieldName('declarator')) {
131 if (declarator) collectDeclaratorTypeNames(declarator, own, source, names);
132 }
133 return names;
134}
135
136function collectMemberTypeNames(list: SyntaxNode, own: ReadonlySet<string>, source: string, names: CTypeName[]): void {
137 for (const child of list.namedChildren) {

Callers 1

extractTypeAliasMethod · 0.90

Calls 3

getChildByFieldFunction · 0.90
collectCTypeNamesFunction · 0.85

Tested by

no test coverage detected