Allow absent inputs to use import contexts

This commit is contained in:
2026-10-24 15:55:10 +00:00
parent 2f0900535d
commit 53ce6c63d8
13 changed files with 176 additions and 31 deletions

View File

@@ -47,7 +47,10 @@ func Mapping(label string, values map[string]any) Source {
return Source{value: engine.Mapping(label, values)}
}
// NoSource explicitly selects a defaults-only input. It creates no source record.
// NoSource selects an absent input for defaults and resolution. It creates no
// source record and has no main declarations to traverse when imports are enabled.
// An explicit filesystem context may be supplied; active overlays are not
// available for absent inputs.
func NoSource() Source { return Source{value: engine.NoSource()} }
func (s Source) toEngine() engine.Source { return s.value }