kdiff 1.1.0
Added
-
A diff tree can be walked with each node's path.
DiffNode.walk()yields every node of a
subtree paired with theFieldPaththat locates it, so a consumer descending a tree generically —
an audit writer, a renderer that indents by structure — no longer accumulates segments itself. The
node you start from comes first, paired with the empty path, sodiff.tree().walk()yields
absolute paths and a change reported at the root needs no special case; walking a node further down
yields paths relative to it.Nodes come out in the order
allChanges()reports their changes — a node before its descendants,
siblings in the orderchildrenholds them — so walking and collecting can be used
interchangeably. That is the tree's order, which groups a subtree together, and not in general the
order of the flat list. The sequence is lazy: a caller that finds the subtree it wanted stops
without visiting the rest.Nothing existing moves.
DiffNodekeeps its constructor, its three properties,isEmptyand
allChanges(), socopyandcomponentNare unaffected — which is why the path is supplied by
the walk rather than carried on the node. → diffing.md
Coordinates
implementation("io.github.rcapraro:kdiff-annotations:1.1.0")
implementation("io.github.rcapraro:kdiff-runtime:1.1.0")
ksp("io.github.rcapraro:kdiff-processor:1.1.0")