(typeName: string)
| 658 | ]); |
| 659 | |
| 660 | function 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 |
no test coverage detected