()
| 1049 | } |
| 1050 | |
| 1051 | private parseDocument(): unknown { |
| 1052 | const start = this.lines[this.index] |
| 1053 | if (isDocumentStart(start)) this.index++ |
| 1054 | // Scanning forward from the current line keeps a stream of many documents linear. |
| 1055 | let end = this.index |
| 1056 | while (end < this.lines.length && !isDocumentMarker(this.lines[end])) end++ |
| 1057 | this.documentEnd = end |
| 1058 | const value = this.parseDocumentContent(start) |
| 1059 | this.documentEnd = this.lines.length |
| 1060 | return value |
| 1061 | } |
| 1062 | |
| 1063 | private parseDocumentContent(start: Line): unknown { |
| 1064 | if (isDocumentStart(start)) { |
no test coverage detected