Pass effective destinations through import traversal
This commit is contained in:
@@ -29,6 +29,13 @@ func normalizeDestination(path Path) (Path, error) {
|
||||
return Path{segments: segments}, nil
|
||||
}
|
||||
|
||||
// appendDestination combines validated mapping-key paths with owned segments.
|
||||
func appendDestination(parent, relative Path) Path {
|
||||
segments := clonePathSegments(parent.segments, len(relative.segments))
|
||||
segments = append(segments, relative.segments...)
|
||||
return Path{segments: segments}
|
||||
}
|
||||
|
||||
func invalidDestinationDiagnostic(destination Path) Diagnostic {
|
||||
return Diagnostic{
|
||||
Code: CodeOptionsInvalid, Severity: SeverityError,
|
||||
@@ -37,12 +44,6 @@ func invalidDestinationDiagnostic(destination Path) Diagnostic {
|
||||
}
|
||||
}
|
||||
|
||||
func setSourceDestinations(sources []SourceInfo, destination Path) {
|
||||
for index := range sources {
|
||||
sources[index].Destination = destination.clone()
|
||||
}
|
||||
}
|
||||
|
||||
// placeDocument checks all per-document bounds before allocating destination
|
||||
// wrappers. Aggregate accounting remains the caller's responsibility.
|
||||
func placeDocument(body *document.Node, destination Path, sourceRoot document.Location, maxDepth, maxNodes int) (Path, *document.Node, error) {
|
||||
|
||||
Reference in New Issue
Block a user