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

Method parseNode

packages/effect/src/encoding/Yaml.ts:1088–1098  ·  view source on GitHub ↗
(indent: number, parentIndent = indent - 1, allowIndentless = false)

Source from the content-addressed store, hash-verified

1086 // `allowIndentless` is set for a mapping value, whose block sequence may sit at the mapping's
1087 // indentation (YAML 1.2.2 §8.2.1), also after node properties on their own lines.
1088 private parseNode(indent: number, parentIndent = indent - 1, allowIndentless = false): unknown {
1089 this.skipIgnored()
1090 const line = this.lineAt(this.index)
1091 if (line === undefined) return null
1092 if (line.indent !== indent) this.fail(line, `Expected indentation of ${indent} spaces`)
1093 if (isExplicitKey(line.text)) this.fail(line, explicitKeyError)
1094 if (isSequenceEntry(line.text)) return this.parseSequence(indent)
1095 if (line.separator !== -1) return this.parseMapping(indent)
1096 this.index++
1097 return this.parseNodeValue(line.text, parentIndent, allowIndentless)
1098 }
1099
1100 // `first` is the entry on a sequence item's line, parsed once the mapping counts toward the depth.
1101 private parseMapping(

Callers 2

parseDocumentContentMethod · 0.95
parseBlockValueMethod · 0.95

Calls 8

skipIgnoredMethod · 0.95
lineAtMethod · 0.95
failMethod · 0.95
parseSequenceMethod · 0.95
parseMappingMethod · 0.95
parseNodeValueMethod · 0.95
isExplicitKeyFunction · 0.85
isSequenceEntryFunction · 0.85

Tested by

no test coverage detected