def classify
import bolt@1.27.0.0/src/lsp/semantic.bend as Semanticimport 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))