()
| 2345 | let contentStart = P.L.b |
| 2346 | let contentStartI = P.L.i |
| 2347 | const flushContent = (): void => { |
| 2348 | if (P.L.b > contentStart) { |
| 2349 | // Tree-sitter's extras rule /\s/ has higher precedence than |
| 2350 | // string_content (prec -1), so whitespace-only segments are elided. |
| 2351 | // `" ${x} "` → (string (expansion)) not (string (string_content)(expansion)(string_content)). |
| 2352 | // Note: this intentionally diverges from preserving all content — cc |
| 2353 | // tests relying on whitespace-only string_content need updating |
| 2354 | // (CCReconcile). |
| 2355 | const txt = P.src.slice(contentStartI, P.L.i) |
| 2356 | if (!/^[ \t]+$/.test(txt)) { |
| 2357 | parts.push(mk(P, 'string_content', contentStart, P.L.b, [])) |
| 2358 | } |
| 2359 | } |
| 2360 | } |
| 2361 | while (P.L.i < P.L.len) { |
| 2362 | const c = peek(P.L) |
| 2363 | if (c === '"') break |
no test coverage detected