(quote: string)
| 283 | } |
| 284 | |
| 285 | private readQuoted(quote: string): string { |
| 286 | const start = this.index++ |
| 287 | let escaped = false |
| 288 | while (this.index < this.input.length) { |
| 289 | const character = this.input[this.index++] |
| 290 | if (quote === "\"" && escaped) escaped = false |
| 291 | else if (quote === "\"" && character === "\\") escaped = true |
| 292 | else if (quote === "'" && character === quote && this.input[this.index] === quote) this.index++ |
| 293 | else if (character === quote) return this.input.slice(start, this.index) |
| 294 | } |
| 295 | this.fail("Unterminated quoted scalar") |
| 296 | } |
| 297 | |
| 298 | private readUntil(stop: RegExp): string { |
| 299 | const start = this.index |
no test coverage detected