def string.equal.go
import gralha-text-scan@0.1.0.1/scan.bend as Scanimport Base
40# `same` says whether the characters before `a` and `b` matched: deciding
41# it one step ahead keeps the loop a tail call on the shrinking `a`.
42def string.equal.go(a: String, b: String, same: Bool) -> Bool:
43 match a b same:
44 case SNil{} SNil{} True{}: True{}
45 case SCon{Chr{x}, xs} SCon{Chr{y}, ys} True{}: string.equal.go(xs, ys, U32.is_eq(x, y))
46 case _ _ _: False{}