(value: string, parentIndent: number)
| 1332 | } |
| 1333 | |
| 1334 | private parseQuotedValue(value: string, parentIndent: number): unknown { |
| 1335 | const quote = value[0] |
| 1336 | let output = quote |
| 1337 | let line = value.slice(1) |
| 1338 | while (true) { |
| 1339 | const end = closingQuote(line, quote, 0) |
| 1340 | if (end !== -1) { |
| 1341 | const rest = line.slice(end + 1) |
| 1342 | if (!isSeparationOnly(rest) && !/^[ \t]+#/.test(rest)) { |
| 1343 | throw new SyntaxError("Unexpected content after quoted YAML scalar") |
| 1344 | } |
| 1345 | return parseScalar(output + line.slice(0, end + 1)) |
| 1346 | } |
| 1347 | if (quote === "\"" && endsWithEscape(line)) { |
| 1348 | output += line.slice(0, -1) |
| 1349 | } else { |
| 1350 | const blankLines = this.skipBlankLines() |
| 1351 | this.rejectTabIndentedBlankLines(blankLines, parentIndent) |
| 1352 | output += trimFoldedEnd(line, quote) + foldLineBreak(blankLines) |
| 1353 | } |
| 1354 | const next = this.lineAt(this.index++) |
| 1355 | if (next === undefined) throw new SyntaxError("Unterminated quoted YAML scalar") |
| 1356 | this.rejectTabIndent(next) |
| 1357 | if (!isSeparationOnly(next.raw) && next.indent <= parentIndent) { |
| 1358 | this.fail(next, "Invalid quoted scalar indentation") |
| 1359 | } |
| 1360 | line = trimWhiteStart(next.raw) |
| 1361 | } |
| 1362 | } |
| 1363 | |
| 1364 | private parseBlockScalar(indicator: string, parentIndent: number): string { |
| 1365 | const style = indicator[0] |
no test coverage detected