(mapping: MappingBuilder)
| 749 | |
| 750 | // YAML 1.2.2 §7.4: a key followed by `,` or the end of the collection has an empty value. |
| 751 | private parseMappingEntry(mapping: MappingBuilder): void { |
| 752 | const fail = (message: string) => this.fail(message) |
| 753 | const text = this.parseKey() |
| 754 | this.skipWhitespace() |
| 755 | let value: unknown = null |
| 756 | if (!isFlowPlainEnd(this.peek().charCodeAt(0))) { |
| 757 | this.expect(":") |
| 758 | value = this.parseValue() |
| 759 | } |
| 760 | if (isMergeKey(text)) mapping.merge(value, fail) |
| 761 | else mapping.set(parseKey(text), value, fail) |
| 762 | } |
| 763 | |
| 764 | // Return source text for the same key conversion used in block mappings. |
| 765 | private parseKey(): string { |
no test coverage detected