Walks two trees in parallel and returns the first path/subtree pair where
they diverge, or NULL if they are structurally identical. The returned
prefix follows tree_path() syntax; a and b are the tree_repr()
strings of the diverging subtrees.
Arguments
- a, b
(
RTree)
Trees to compare, as returned bybuild_tree().
Examples
tree_diff(build_tree(list(a = 1)), build_tree(list(a = list(1, 2))))
#> $prefix
#> [1] "a"
#>
#> $a
#> [1] "*"
#>
#> $b
#> [1] "list(*, *)"
#>