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

Function recoverMangledCppName

src/extraction/languages/c-cpp.ts:1180–1188  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

1178 * that is a bare primitive/keyword rather than a real identifier.
1179 */
1180export function recoverMangledCppName(name: string): string {
1181 if (!/\s/.test(name) || name.startsWith('operator') || name.startsWith('~')) return name;
1182 if (/^\S+\s+\([A-Za-z_]\w*\)/.test(name)) return name; // `Ret (name)` idiom — leave alone
1183 const beforeParams = name.includes('(') ? name.slice(0, name.indexOf('(')) : name;
1184 const tokens = beforeParams.trim().split(/\s+/);
1185 const candidate = tokens[tokens.length - 1];
1186 if (!candidate || !/^[A-Za-z_]\w*$/.test(candidate) || CPP_PRIMITIVE_NAMES.has(candidate)) return name;
1187 return candidate;
1188}
1189
1190/**
1191 * Blank Metal Shading Language `[[attribute]]` annotations before parsing.

Callers 1

extraction.test.tsFile · 0.90

Calls 1

hasMethod · 0.80

Tested by

no test coverage detected