MCPcopy Create free account
hub / github.com/Effect-TS/effect / parseMapping

Method parseMapping

packages/effect/src/encoding/Yaml.ts:725–748  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

723 }
724
725 private parseMapping(): YamlRecord {
726 this.expect("{")
727 const mapping = new MappingBuilder(this.merges)
728 this.skipWhitespace()
729 if (this.peek() === "}") {
730 this.index++
731 return mapping.output
732 }
733 while (true) {
734 this.skipWhitespace()
735 this.parseMappingEntry(mapping)
736 this.skipWhitespace()
737 if (this.peek() === "}") {
738 this.index++
739 return mapping.output
740 }
741 this.expect(",")
742 this.skipWhitespace()
743 if (this.peek() === "}") {
744 this.index++
745 return mapping.output
746 }
747 }
748 }
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 {

Callers 1

parseValueMethod · 0.95

Calls 4

expectMethod · 0.95
skipWhitespaceMethod · 0.95
peekMethod · 0.95
parseMappingEntryMethod · 0.95

Tested by

no test coverage detected