(source: string)
| 2668 | */ |
| 2669 | const C_VA_ARG_RE = /\bva_arg[ \t]*\(([^(),]+)(,[^()]*)\)/g; |
| 2670 | export function blankCVaArgQualifiedTypeArgs(source: string): string { |
| 2671 | if (source.indexOf('va_arg') === -1) return source; |
| 2672 | C_VA_ARG_RE.lastIndex = 0; |
| 2673 | return source.replace(C_VA_ARG_RE, (m, arg1: string, rest: string) => { |
| 2674 | if (/^,[ \t]*[A-Za-z_]\w*[ \t]*$/.test(rest)) return m; // single token — parses natively |
| 2675 | return `va_arg(${arg1}${rest.replace(/[^\n\r]/g, ' ')})`; |
| 2676 | }); |
| 2677 | } |
| 2678 | |
| 2679 | /** |
| 2680 | * Blank the DOTS of a GNU NAMED-variadic function-like `#define` parameter — |
no outgoing calls
no test coverage detected