Lex.step: def of emerging-ezjson@1.3.0.0 Import: import emerging-ezjson@1.3.0.0/src/lex.bend as Lex Lines 247-287 of emerging-ezjson@1.3.0.0/src/lex.bend: https://jend.leeeet.dev/read.txt?path=emerging-ezjson@1.3.0.0/src/lex.bend&start_line=247&end_line=287 import Base # one char, by the mode and the char's class def step(mode: Mode, cls: Class, ch: Char, buf: List<&2, Char>, toks: List<&2, Tok>) -> Lex: match mode cls: case Idle{} CPunct{t}: Lex{Idle{}, [], t <> toks} case Idle{} CQuote{}: Lex{Str{}, [], toks} case Idle{} CSpace{}: Lex{Idle{}, [], toks} case Idle{} CBack{}: Lex{Bad{}, [], toks} case Idle{} COther{}: Lex{Word{}, [ch], toks} case Word{} CPunct{t}: Lex{Idle{}, [], t <> TWord{text(buf)} <> toks} case Word{} CQuote{}: Lex{Str{}, [], TWord{text(buf)} <> toks} case Word{} CSpace{}: Lex{Idle{}, [], TWord{text(buf)} <> toks} case Word{} CBack{}: Lex{Bad{}, [], toks} case Word{} COther{}: Lex{Word{}, ch <> buf, toks} case Str{} CQuote{}: Lex{Idle{}, [], TStr{text(buf)} <> toks} case Str{} CBack{}: Lex{Esc{}, buf, toks} case Str{} other: step.str(ch, buf, toks) case Esc{} other: escape(ch, buf, toks) case Uni{left, acc} other: unicode(left, acc, ch, buf, toks) case Hi{hi} other: step.hi(hi, ch, buf, toks) case HiEsc{hi} other: step.hiesc(hi, ch, buf, toks) case Lo{left, acc, hi} other: unicode.low(left, acc, hi, ch, buf, toks) case Bad{} other: Lex{Bad{}, [], toks} Uses (13): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Char https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/lex.bend&name=Class https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/lex.bend&name=Lex https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/lex.bend&name=Mode https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/lex.bend&name=Tok https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/lex.bend&name=escape https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/lex.bend&name=step.hi https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/lex.bend&name=step.hiesc https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/lex.bend&name=step.str https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/lex.bend&name=text https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/lex.bend&name=unicode https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/lex.bend&name=unicode.low