* Skip an invalid key-value pair in recovery mode. * Consumes the current (invalid) token and the next token (its would-be value).
()
| 371 | * Consumes the current (invalid) token and the next token (its would-be value). |
| 372 | */ |
| 373 | private skipInvalidPair(): void { |
| 374 | // Skip the invalid key |
| 375 | this.shift(); |
| 376 | |
| 377 | this.ensureBufferFilled(); |
| 378 | |
| 379 | // Check if we hit end or dict close |
| 380 | if (this.buf1 === null || this.buf1.type === "eof") { |
| 381 | return; |
| 382 | } |
| 383 | |
| 384 | if (this.buf1.type === "delimiter" && this.buf1.value === ">>") { |
| 385 | return; |
| 386 | } |
| 387 | |
| 388 | // Skip the would-be value |
| 389 | this.shift(); |
| 390 | } |
| 391 | } |
no test coverage detected