Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#615 Removed deprecated FoldedFlowLines and FlowOnOneLine #616

Merged
merged 2 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading