MCPcopy
hub / github.com/colbymchenry/codegraph / blankCppExportMacros

Function blankCppExportMacros

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

Source from the content-addressed store, hash-verified

234 * so C's heavier use of `struct TAG var;` never reaches it.
235 */
236export 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

Callers 3

checkFunction · 0.90
extraction.test.tsFile · 0.90
preParseCppSourceFunction · 0.85

Calls

no outgoing calls

Tested by 1

checkFunction · 0.72