def classify

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

import bolt@1.27.0.0/src/lsp/semantic.bend as Semantic
import Base
import bolt@1.27.0.0/src/syntax/lex.bend as Lex

369# every token, in order, against the cursor
370def classify(toks: List<&2, Lex.Tok>, cur: Cursor, +all: Kinds) -> List<&2, Sem>:
371  match toks:
372    case Nil{}:
373      Nil{}
374    case Con{Lex.Tok{k, +t, +l, +c}, +rest}:
375      +st = of_tok(k, cur, all, t, l, c, opens_brace(rest))
376      put(typ_of(st), l, c, U32.from_nat(String.length(t)), classify(rest, cur_of(st), all))

Uses (12)

Used by (1)