Skip to content

Commit

Permalink
Merge branch '__rultor'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Apr 4, 2024
2 parents 53cfbcc + 7bffbc4 commit f308a5f
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 483 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/amihaiemil/eoyaml/AllYamlLines.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ private YamlNode mappingSequenceOrPlainScalar(final YamlLine prev) {
} else if (matcher.group(4) != null) {
node = new ReadYamlMapping(prev.number(), prev, this);
}
} else if (this.original().size() == 1) {
} else if (this.lines.size() == 1) {
node = new ReadPlainScalar(this, first);
}
}
Expand Down
116 changes: 0 additions & 116 deletions src/main/java/com/amihaiemil/eoyaml/FlowOnOneLine.java

This file was deleted.

197 changes: 0 additions & 197 deletions src/main/java/com/amihaiemil/eoyaml/FoldedFlowLines.java

This file was deleted.

12 changes: 6 additions & 6 deletions src/main/java/com/amihaiemil/eoyaml/ReadFlowMapping.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@
* @since 8.0.0
* @todo #601:30min Modify the yaml printing visitor, so it prints the flow
* nodes in Flow style instead of block.
* @todo #607:60min Refactor this class to not use FoldedFlowLines anymore.
* FoldedFlowLines is deprecated and the collapsing/folding logic is now
* implemented with {@link CollapsedFlowLines}. ReadFlowSequence needs the
* same refactoring after that.
* @todo #615:60min Implement the comment() method properly (at the moment
* it always assumes there is no comment).
*/
final class ReadFlowMapping extends BaseYamlMapping {

Expand All @@ -72,10 +70,11 @@ final class ReadFlowMapping extends BaseYamlMapping {
* Ctor.
* @param previous Line just before the start of this flow mapping.
* @param lines All lines of the YAML document.
* @checkstyle AvoidInlineConditionals (30 lines)
*/
ReadFlowMapping(final YamlLine previous, final AllYamlLines lines) {
this(
new FoldedFlowLines(
new CollapsedFlowLines(
new Skip(
lines,
line -> line.number() <= previous.number(),
Expand All @@ -87,7 +86,7 @@ final class ReadFlowMapping extends BaseYamlMapping {
),
'{',
'}'
).iterator().next()
).line(previous.number() < 0 ? 0 : previous.number() + 1)
);
}

Expand All @@ -98,6 +97,7 @@ final class ReadFlowMapping extends BaseYamlMapping {
*/
ReadFlowMapping(final YamlLine folded) {
this.entries = new StringEntries(folded);
System.out.println("FLOW LINE: " + folded.value());
this.folded = folded;
}

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/amihaiemil/eoyaml/ReadFlowSequence.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ final class ReadFlowSequence extends BaseYamlSequence {
* Ctor.
* @param previous Line just before the start of this flow sequence.
* @param lines All lines of the YAML document.
* @checkstyle AvoidInlineConditionals (30 lines)
*/
ReadFlowSequence(final YamlLine previous, final AllYamlLines lines) {
this(
new FoldedFlowLines(
new CollapsedFlowLines(
new Skip(
lines,
line -> line.number() <= previous.number(),
Expand All @@ -77,7 +78,7 @@ final class ReadFlowSequence extends BaseYamlSequence {
),
'[',
']'
).iterator().next()
).line(previous.number() < 0 ? 0 : previous.number() + 1)
);
}

Expand Down
Loading

0 comments on commit f308a5f

Please sign in to comment.