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

Function blankCTrailingParamAttrMacros

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

Source from the content-addressed store, hash-verified

1099 */
1100const C_TRAILING_PARAM_ATTR_RE = /\b([A-Za-z_]\w*)([ \t]+)([A-Z][A-Z0-9_]{2,})(?=[ \t]*[,)])/g;
1101export function blankCTrailingParamAttrMacros(source: string): string {
1102 if (!C_TRAILING_PARAM_ATTR_RE.test(source)) {
1103 C_TRAILING_PARAM_ATTR_RE.lastIndex = 0;
1104 return source;
1105 }
1106 C_TRAILING_PARAM_ATTR_RE.lastIndex = 0;
1107 return source.replace(
1108 C_TRAILING_PARAM_ATTR_RE,
1109 (_m, name: string, ws: string, macro: string) => name + ws + ' '.repeat(macro.length)
1110 );
1111}
1112
1113/**
1114 * Blank the Linux-kernel/sparse declaration-annotation macros — `static int

Callers 2

preParseCSourceFunction · 0.85
extraction.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected