(source: string)
| 234 | * so C's heavier use of `struct TAG var;` never reaches it. |
| 235 | */ |
| 236 | export function blankCppExportMacros(source: string): string { |
| 237 | if (source.indexOf('class') === -1 && source.indexOf('struct') === -1) return source; |
| 238 | return source.replace( |
| 239 | /\b(class|struct)(\s+)([A-Z][A-Z0-9_]+)(?=\s+[A-Za-z_]\w*(?:\s+final)?\s*[:{])/g, |
| 240 | (_m, kw, ws, macro) => kw + ws + ' '.repeat(macro.length) |
| 241 | ); |
| 242 | } |
| 243 | |
| 244 | /** |
| 245 | * Blank a known inline-specifier macro sitting in front of a function's return |
no outgoing calls