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

Function blankCLeadingAttrMacros

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

Source from the content-addressed store, hash-verified

834const C_LEADING_ATTR_MACRO_RE =
835 /^([ \t]*)([A-Z][A-Z0-9_]{2,})(?=\s+[A-Za-z_]\w*[\s*]+[A-Za-z_]\w*\s*\()/gm;
836export function blankCLeadingAttrMacros(source: string): string {
837 return source.replace(
838 C_LEADING_ATTR_MACRO_RE,
839 (_m, ws: string, macro: string) => ws + ' '.repeat(macro.length)
840 );
841}
842
843/**
844 * Blank the body of `#ifdef __cplusplus … #endif` guard regions in C sources.

Callers 3

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

Calls

no outgoing calls

Tested by

no test coverage detected