def of_kind

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

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

42# the legend's type for a binder of this kind (an item is a type when
43# capitalized, else a function)
44def of_kind(kk: Bind.BindKind, +name: String) -> U32:
45  match kk:
46    case Bind.KItem{}:
47      Bool.pick(U32, upper_first(String.to_list(name)), 2, 1)
48    case Bind.KCtor{}:
49      3
50    case Bind.KParam{}:
51      4
52    case Bind.KLocal{}:
53      5
54    case Bind.KPat{}:
55      5
56    case Bind.KFor{}:
57      5
58    case Bind.KField{}:
59      6
60    case Bind.KTypeParam{}:
61      10
62    case Bind.KTypeVar{}:
63      10

Uses (6)

Used by (2)