()
| 246 | } |
| 247 | |
| 248 | private parseMapping(): YamlRecord { |
| 249 | this.expect("{") |
| 250 | const output: YamlRecord = {} |
| 251 | this.skipWhitespace() |
| 252 | if (this.peek() === "}") { |
| 253 | this.index++ |
| 254 | return output |
| 255 | } |
| 256 | while (true) { |
| 257 | const key = this.parseKey() |
| 258 | this.skipWhitespace() |
| 259 | this.expect(":") |
| 260 | if (hasOwn.call(output, key)) this.fail(`Duplicate key '${key}'`) |
| 261 | setProperty(output, key, this.parseValue()) |
| 262 | this.skipWhitespace() |
| 263 | if (this.peek() === "}") { |
| 264 | this.index++ |
| 265 | return output |
| 266 | } |
| 267 | this.expect(",") |
| 268 | this.skipWhitespace() |
| 269 | if (this.peek() === "}") { |
| 270 | this.index++ |
| 271 | return output |
| 272 | } |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | private parseKey(): string { |
| 277 | this.skipWhitespace() |
no test coverage detected