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

Function blankCVaArgQualifiedTypeArgs

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

Source from the content-addressed store, hash-verified

1458 */
1459const C_VA_ARG_RE = /\bva_arg[ \t]*\(([^(),]+)(,[^()]*)\)/g;
1460export function blankCVaArgQualifiedTypeArgs(source: string): string {
1461 if (source.indexOf('va_arg') === -1) return source;
1462 C_VA_ARG_RE.lastIndex = 0;
1463 return source.replace(C_VA_ARG_RE, (m, arg1: string, rest: string) => {
1464 if (/^,[ \t]*[A-Za-z_]\w*[ \t]*$/.test(rest)) return m; // single token — parses natively
1465 return `va_arg(${arg1}${rest.replace(/[^\n\r]/g, ' ')})`;
1466 });
1467}
1468
1469/**
1470 * Blank the DOTS of a GNU NAMED-variadic function-like `#define` parameter —

Callers 2

preParseCSourceFunction · 0.85
extraction.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected