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

Function blankCVaArgQualifiedTypeArgs

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

Source from the content-addressed store, hash-verified

2669 */
2670const C_VA_ARG_RE = /\bva_arg[ \t]*\(([^(),]+)(,[^()]*)\)/g;
2671export function blankCVaArgQualifiedTypeArgs(source: string): string {
2672 if (source.indexOf('va_arg') === -1) return source;
2673 C_VA_ARG_RE.lastIndex = 0;
2674 return source.replace(C_VA_ARG_RE, (m, arg1: string, rest: string) => {
2675 if (/^,[ \t]*[A-Za-z_]\w*[ \t]*$/.test(rest)) return m; // single token — parses natively
2676 return `va_arg(${arg1}${rest.replace(/[^\n\r]/g, ' ')})`;
2677 });
2678}
2679
2680/**
2681 * 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