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

Function blankCppExportMacros

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

Source from the content-addressed store, hash-verified

291 * so C's heavier use of `struct TAG var;` never reaches it.
292 */
293export function blankCppExportMacros(source: string): string {
294 if (source.indexOf('class') === -1 && source.indexOf('struct') === -1) return source;
295 return source.replace(
296 /\b(class|struct)(\s+)([A-Z][A-Z0-9_]+)(?=\s+[A-Za-z_]\w*(?:\s+final)?\s*[:{])/g,
297 (_m, kw, ws, macro) => kw + ws + ' '.repeat(macro.length)
298 );
299}
300
301/**
302 * 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