(source: string)
| 1458 | */ |
| 1459 | const C_VA_ARG_RE = /\bva_arg[ \t]*\(([^(),]+)(,[^()]*)\)/g; |
| 1460 | export 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 — |
no outgoing calls
no test coverage detected