def foreigns
import ezx@1.11.0.0/src/pkg/pkg.bend as Pkgimport Base
import ezx@1.11.0.0/src/pkg/path.bend as P
818# every foreign body a file imports, named from the importing module's
819# directory
820def foreigns(+tree: Tree, +dir: String, +nd: String, ats: List<&2, String>) -> List<&2, Hit>:
821 match ats:
822 case []:
823 []
824 case +h <> t:
825 List.append(&2, Hit, foreign.put(find(tree, P.join(dir, h)), tree, P.join(dir, h),
826 P.join(nd, h)), foreigns(tree, dir, nd, t))