()
| 207 | } |
| 208 | |
| 209 | private parseValue(): unknown { |
| 210 | this.skipWhitespace() |
| 211 | const character = this.peek() |
| 212 | if (character === "[") return this.parseSequence() |
| 213 | if (character === "{") return this.parseMapping() |
| 214 | if (character === "\"" || character === "'") return parseScalar(this.readQuoted(character)) |
| 215 | if (character === "*") { |
| 216 | this.index++ |
| 217 | const name = this.readUntil(/[,\]}\s]/) |
| 218 | if (!this.anchors.has(name)) this.fail(`Unknown alias '*${name}'`) |
| 219 | return this.anchors.get(name) |
| 220 | } |
| 221 | return parseScalar(this.readUntil(/[,\]}]/).trim()) |
| 222 | } |
| 223 | |
| 224 | private parseSequence(): Array<unknown> { |
| 225 | this.expect("[") |
no test coverage detected