def end
import emerging-ezhttp@0.21.0.0/src/unescape.bend as Unescapeimport Base
317# the end of the text: a reference left open ends there, an `&`, `&#` or
318# `&#x` with nothing after it is text
319def end(st: Scan) -> String:
320 match st:
321 case Txt{}:
322 ""
323 case Amp{}:
324 "&"
325 case Hash{}:
326 "&#"
327 case HashX{x}:
328 SCon{'&', SCon{'#', SCon{x, ""}}}
329 case Num{hex, n}:
330 code(n)
331 case Name{s, len}:
332 named(s)