def width_go
import cli@0.2.0.0/cli.bend as Cliimport Base
992# acc, plus the width of step, the last code point's, and of s after it.
993def width_go(s: String, step: WidthStep, acc: Nat) -> Nat:
994 match s step:
995 case SNil{} WidthStep{w, run}: Nat.add(w, acc)
996 case SCon{head, tail} WidthStep{w, run}:
997 +code = Char.to_u32(head)
998 width_go(tail, code_step(code_class(code), run, code), Nat.add(w, acc))