def entity.push
import gralha-xml-doc@0.1.0.1/xml.bend as Xmlimport Base
5# Reverse a scan's accumulator while decoding XML entities: the reversed
6# text shows an entity as its ';' first, then its name backwards, then '&';
7# a ';' without a short name and '&' behind it is plain text.
8def entity.push(+e: String, +out: String) -> String:
9 match e:
10 case SNil{}: out
11 case SCon{c, t}: SCon{c, entity.push(t, out)}