def foreign.put
import ezx@1.11.0.0/src/pkg/pkg.bend as Pkgimport Base
804# a foreign body the tree holds, with the LICENSE beside it, or nothing when
805# it is not there. bend uploads only the ones that are there. It is named the
806# way the module importing it is named, from that module's own directory:
807# `bend --publish` writes `src/util/beep.c` for a body imported by
808# `src/util/math.bend`.
809def foreign.put(got: Look, +tree: Tree, +at: String, +raw: String) -> List<&2, Hit>:
810 match got:
811 case Here{text}:
812 Hit{raw, text} <> license.put(find(tree, beside(at)), beside(raw))
813 case Absent{}:
814 []
815 case Unasked{}:
816 []