def name_step

bolt@1.27.0.0 · src/lsp/semantic.bend:307

import bolt@1.27.0.0/src/lsp/semantic.bend as Semantic
import Base
import bolt@1.27.0.0/src/syntax/bind.bend as Bind

307# a name token's type, taking the binder or the use that sits on it, and the
308# cursor after it
309def name_step(cur: Cursor, +all: Kinds, +name: String, +line: U32, +col: U32, +braced: Bool) -> Step:
310  Cursor{+binds, +uses} = cur
311  +bs = Bool.pick(List<&2, Bind.Bind>, behind_bind(binds, line, col), tail_binds(binds), binds)
312  +us = Bool.pick(List<&2, Bind.Use>, behind_use(uses, line, col), tail_uses(uses), uses)
313  +hb = at_head_bind(bs, line, col)
314  +hu = at_head_use(us, line, col)
315  +of_use = use_class(hu, us, all, name, braced)
316  +typ = Bool.pick(U32, hb, head_bind_kind(bs), of_use)
317  Step{Some{typ}, Cursor{Bool.pick(List<&2, Bind.Bind>, hb, tail_binds(bs), bs),
318    Bool.pick(List<&2, Bind.Use>, hu, tail_uses(us), us)}}

Uses (19)

Used by (1)