Cli.utf8_tail: def of cli@0.2.0.0 Import: import cli@0.2.0.0/cli.bend as Cli Lines 7929-7938 of cli@0.2.0.0/cli.bend: https://jend.leeeet.dev/read.txt?path=cli@0.2.0.0/cli.bend&start_line=7929&end_line=7938 import Base # The code point acc continues to through the first more bytes of rest, # each a continuation byte (80..BF); None if rest ends first or one is not. def utf8_tail(rest: List<&2, U32>, more: Nat, acc: U32) -> Maybe<&2, U32>: match rest more: case Nil{} 0n: Some{acc} case Nil{} 1n+m: None{} case Con{b, t} 0n: Some{acc} case Con{+b, t} 1n+m: utf8_next(U32.is_lt((b - 128 : U32), 64), utf8_tail(t, m, (acc * 64 + (b - 128) : U32))) Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=utf8_next