def entities.loop

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

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

349def entities.loop(s: String, +acc: String) -> String:
350  match s:
351    case SNil{}: U.rev(acc, "")
352    case SCon{Chr{c}, t}:
353      +ch = c
354      +tail = t
355      U.branch(String, U32.is_eq(ch, 38),
356        _ => entities.more(U.until(tail, 59, ""), acc, rest => text => entities.loop(rest, text)),
357        _ => entities.loop(tail, SCon{Chr{ch}, acc}))

Uses (7)

Used by (1)