def visit.put

ezx@1.11.0.0 · src/pkg/pkg.bend:869

import ezx@1.11.0.0/src/pkg/pkg.bend as Pkg
import Base
import ezx@1.11.0.0/src/pkg/path.bend as P

869# a file whose LICENSE and foreign bodies are all settled: itself, the LICENSE
870# beside it and its foreign bodies found, and the modules it imports put at
871# the front of the queue, so the walk goes depth first the way bend's does. A foreign body that stops the walk
872# leaves the file queued, so an answered question visits it again.
873def visit.put(
874  fstop: Stop,
875  +tree: Tree,
876  +sc: Scan,
877  +text: String,
878  +file: String,
879  +ns: String,
880  eb: String,
881  seen: List<&2, String>,
882  out: List<&2, Hit>,
883  rest: List<&2, Task>
884) -> State:
885  match fstop:
886    case Going{}:
887      +d = P.dir(file)
888      +nd = nsdir(ns)
889      +raw = raw_of(ns, eb)
890      State{file <> seen,
891        Hit{raw, text} <> List.append(&2, Hit,
892          license.put(find(tree, beside(file)), beside(raw)),
893          List.append(&2, Hit, foreigns(tree, d, nd, scan.foreign(sc)), out)),
894        Going{},
895        List.append(&2, Task, tasks(d, nd, scan.mods(sc)), rest)}
896    case Missing{at}:
897      State{seen, out, Missing{at}, Task{file, ns} <> rest}
898    case Climbs{at}:
899      State{seen, out, Climbs{at}, Task{file, ns} <> rest}
900    case Asking{at}:
901      State{seen, out, Asking{at}, Task{file, ns} <> rest}
902    case Spent{}:
903      State{seen, out, Spent{}, Task{file, ns} <> rest}
904    case Unnamed{nv}:
905      State{seen, out, Unnamed{nv}, Task{file, ns} <> rest}

Uses (19)

Used by (1)