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

Function blankCppLeadingAttributeMacros

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

Source from the content-addressed store, hash-verified

1060 'gm'
1061);
1062export function blankCppLeadingAttributeMacros(source: string): string {
1063 if (!/(?:^|\]\])[ \t]*[A-Z][A-Z0-9]*_[A-Z0-9_]*\s/m.test(source)) return source;
1064 const code = maskCppCode(source);
1065 const spans: Array<[number, number]> = [];
1066 const re = new RegExp(CPP_LEADING_ATTR_RE.source, 'gm');
1067 let m: RegExpExecArray | null;
1068 while ((m = re.exec(code)) !== null) {
1069 const start = m.index + (m[1] as string).length;
1070 pushCppRunTokens(spans, m[2] as string, start);
1071 }
1072 return blankCppSpans(source, spans, code);
1073}
1074
1075/**
1076 * Blank a known inline-specifier macro sitting in front of a function's return

Callers 2

preParseCppSourceFunction · 0.85

Calls 4

maskCppCodeFunction · 0.85
pushCppRunTokensFunction · 0.85
blankCppSpansFunction · 0.85
execMethod · 0.65

Tested by

no test coverage detected