def step
bolt@1.27.0.0 · src/syntax/lex.bend:294
import bolt@1.27.0.0/src/syntax/lex.bend as Lex
import Base
import bolt@1.27.0.0/src/lazy/lazy.bend as Lazy
294
295
296
297def step(+cc: Char, st: St) -> St:
298 St{+mode, +kind, +line, +col, +sl, +sc, +buf, +toks} = st
299 +cls = classify(cc)
300 +nl = is_newline(cc)
301 +line2 = Bool.pick(U32, nl, (line + 1 : U32), line)
302 +col2 = Bool.pick(U32, nl, 0, (col + 1 : U32))
303 Lazy.either(St, continues(mode, cls),
304 _u => St{after(mode, cls), kind, line2, col2, sl, sc, cc <> buf, toks},
305 _v => St{begin.mode(cls), begin.kind(cls), line2, col2, line, col, [cc], flush(kind, sl, sc, buf, toks)})