(indent: number, parentIndent = indent - 1, allowIndentless = false)
| 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( |
no test coverage detected