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

Function cAliasTypeNames

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

Source from the content-addressed store, hash-verified

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