def resolve.local

bolt@1.27.0.0 · src/syntax/bind.bend:252

import bolt@1.27.0.0/src/syntax/bind.bend as Bind
import Base
import bolt@1.27.0.0/src/lazy/lazy.bend as Lazy

252def resolve.local(mm: Maybe<&2, Bind>, +name: String, ns: Names) -> Target:
253  match mm:
254    case Some{Bind{n, l, c, k, note}}:
255      TLocal{l, c}
256    case None{}:
257      Names{its, als} = ns
258      +cs = String.to_list(name)
259      +head = head_of(cs)
260      Bool.pick(Target, has_item(its, name), TItem{name},
261        Lazy.stop(Target, Bool.not(Bool.and(String.contains(name, "."), has(als, head))), TFree{},
262          _u => TQual{head, rest_of(cs)}))

Uses (15)

Used by (1)