def until.decoded.go

gralha-xml-doc@0.1.0.1 · xml.bend:63

import gralha-xml-doc@0.1.0.1/xml.bend as Xml
import Base
import gralha-text-scan@0.1.0.1/scan.bend as U

63def until.decoded.go(hit: Bool, +c: U32, t: String, +end: U32, acc: String) -> U.Scan:
64  match hit:
65    case True{}: U.Scan{rev.decode(acc, ""), t}
66    case False{}:
67      match t:
68        case SNil{}: U.Scan{rev.decode(SCon{Chr{c}, acc}, ""), ""}
69        case SCon{Chr{c2}, t2}:
70          +cc = c2
71          until.decoded.go(U32.is_eq(cc, end), cc, t2, end, SCon{Chr{c}, acc})

Uses (7)

Used by (1)