Project sequence origins from incoming to final item paths
This commit is contained in:
@@ -70,8 +70,14 @@ func mergeInheritanceOrigin(origins map[string]Origin, path Path, incoming Origi
|
||||
}
|
||||
|
||||
func copyInheritanceSubtree(target, incoming map[string]Origin, node *document.Node, root Path) {
|
||||
walkDocument(node, root, func(path Path, _ *document.Node) {
|
||||
target[path.String()] = cloneOrigin(incoming[path.String()])
|
||||
copyInheritanceSubtreeAt(target, incoming, node, root, root)
|
||||
}
|
||||
|
||||
func copyInheritanceSubtreeAt(target, incoming map[string]Origin, node *document.Node, from, to Path) {
|
||||
walkDocument(node, Path{}, func(relative Path, _ *document.Node) {
|
||||
source := appendDestination(from, relative)
|
||||
destination := appendDestination(to, relative)
|
||||
target[destination.String()] = cloneOrigin(incoming[source.String()])
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user