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

Method parseMappingEntry

packages/effect/src/encoding/Yaml.ts:751–762  ·  view source on GitHub ↗
(mapping: MappingBuilder)

Source from the content-addressed store, hash-verified

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 {

Callers 2

parseSequenceEntryMethod · 0.95
parseMappingMethod · 0.95

Calls 10

parseKeyMethod · 0.95
skipWhitespaceMethod · 0.95
peekMethod · 0.95
expectMethod · 0.95
parseValueMethod · 0.95
isFlowPlainEndFunction · 0.85
isMergeKeyFunction · 0.85
parseKeyFunction · 0.85
mergeMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected