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

Function normalizeCppTypeName

src/resolution/name-matcher.ts:660–674  ·  view source on GitHub ↗
(typeName: string)

Source from the content-addressed store, hash-verified

658]);
659
660function normalizeCppTypeName(typeName: string): string | null {
661 const normalized = typeName
662 .replace(/\b(const|volatile|mutable|typename|class|struct)\b/g, ' ')
663 .replace(/[&*]+/g, ' ')
664 .replace(/<[^>]*>/g, ' ')
665 .replace(/\s+/g, ' ')
666 .trim();
667
668 if (!normalized) return null;
669 const parts = normalized.split(/::/).filter(Boolean);
670 const last = parts[parts.length - 1];
671 if (!last) return null;
672 if (CPP_NON_TYPE_TOKENS.has(last)) return null;
673 return last;
674}
675
676// Declarator regex: matches `Type receiver`, `Type* receiver`, `Type *receiver`,
677// `Type*receiver`, `Type<X> receiver`, etc., REQUIRING a declarator terminator

Callers 1

inferCppReceiverTypeFunction · 0.85

Calls 1

hasMethod · 0.80

Tested by

no test coverage detected