Skip to content

Commit

Permalink
Add more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jevanlingen committed Nov 18, 2024
1 parent b2738e9 commit 65f8e16
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ public Yaml.Document visitDocument(Yaml.Document document, ExecutionContext ctx)
);

if (getCursor().getMessage("RemovePrefix", false)) {
System.out.println("|||| after visit document");
System.out.println(System.identityHashCode(getCursor()));
return d.withEnd(d.getEnd().withPrefix(""));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,13 @@ public Yaml visitSequence(Yaml.Sequence existingSeq, P p) {

@Override
public Yaml visitMapping(Yaml.Mapping existingMapping, P p) {
System.out.println("<<< visitMapping");
//System.out.println("<<< visitMapping");
if (getCursor().toString().equals("Cursor{Mapping->Document->Documents->root}")) {
System.out.println("ja!!");
System.out.println(System.identityHashCode(getCursor()));
System.out.println(getCursor());
System.out.println((boolean) (getCursor().getMessage("RemovePrefix", false)));
}
System.out.println(getCursor());
System.out.println((boolean) (getCursor().getMessage("RemovePrefix", false)));

if (existing.isScope(existingMapping) && incoming instanceof Yaml.Mapping) {
return mergeMapping(existingMapping, (Yaml.Mapping) incoming, p, getCursor());
}
Expand Down Expand Up @@ -217,9 +218,10 @@ private Yaml.Mapping mergeMapping(Yaml.Mapping m1, Yaml.Mapping m2, P p, Cursor


// int index2 = ((Yaml.Mapping) currCursor.getValue()).getEntries().size() -1;
System.out.println(">>>");
System.out.println(c);
System.out.println(">>> RemovePrefix");
System.out.println(System.identityHashCode(c));
c.putMessage("RemovePrefix", true);
System.out.println(c);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ public <Y2 extends Yaml> Y2 autoFormat(Y2 y, @Nullable Yaml stopAfter, P p, Curs
}

public Yaml visitDocuments(Yaml.Documents documents, P p) {
System.out.println("visitDocumentSSSSSS");
return documents.withDocuments(ListUtils.map(documents.getDocuments(), d -> visitAndCast(d, p)))
.withMarkers(visitMarkers(documents.getMarkers(), p));
}

public Yaml visitDocument(Yaml.Document document, P p) {
System.out.println("visitDocument");
return document.withBlock((Yaml.Block) visit(document.getBlock(), p))
.withMarkers(visitMarkers(document.getMarkers(), p));
}
Expand Down

0 comments on commit 65f8e16

Please sign in to comment.