Skip to content

Commit

Permalink
413 If first sequence entry is a mapping starting on one line then us…
Browse files Browse the repository at this point in the history
…e a NullYamlLine as previous
  • Loading branch information
zsandoz committed Aug 16, 2022
1 parent 98b2abd commit 8b2e8c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/com/amihaiemil/eoyaml/ReadYamlSequence.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,13 @@ public Collection<YamlNode> values() {
)));
} else {
if(this.mappingStartsAtDash(line)) {
final YamlLine previous = line.number() == 0
? new YamlLine.NullYamlLine()
: this.all.line(line.number() - 1);
kids.add(
new ReadYamlMapping(
line.number() + 1,
this.all.line(line.number() - 1),
previous,
this.all,
this.guessIndentation
)
Expand Down

0 comments on commit 8b2e8c2

Please sign in to comment.