(L: Lexer)
| 270 | } |
| 271 | |
| 272 | function skipBlanks(L: Lexer): void { |
| 273 | while (L.i < L.len) { |
| 274 | const c = L.src[L.i]! |
| 275 | if (c === ' ' || c === '\t' || c === '\r') { |
| 276 | // \r is whitespace per tree-sitter-bash extras /\s/ — handles CRLF inputs |
| 277 | advance(L) |
| 278 | } else if (c === '\\') { |
| 279 | const nx = L.src[L.i + 1] |
| 280 | if (nx === '\n' || (nx === '\r' && L.src[L.i + 2] === '\n')) { |
| 281 | // Line continuation — tree-sitter extras: /\\\r?\n/ |
| 282 | advance(L) |
| 283 | advance(L) |
| 284 | if (nx === '\r') advance(L) |
| 285 | } else if (nx === ' ' || nx === '\t') { |
| 286 | // \<space> or \<tab> — tree-sitter's _whitespace is /\\?[ \t\v]+/ |
| 287 | advance(L) |
| 288 | advance(L) |
| 289 | } else { |
| 290 | break |
| 291 | } |
| 292 | } else { |
| 293 | break |
| 294 | } |
| 295 | } |
| 296 | } |
| 297 | |
| 298 | /** |
| 299 | * Scan next token. Context-sensitive: `cmd` mode treats [ as operator (test |
no test coverage detected