Xml.entity.of: def of gralha-xml-doc@0.1.0.1 Import: import gralha-xml-doc@0.1.0.1/xml.bend as Xml Lines 13-17 of gralha-xml-doc@0.1.0.1/xml.bend: https://jend.leeeet.dev/read.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&start_line=13&end_line=17 import Base import gralha-text-scan@0.1.0.1/scan.bend as U def entity.of(+name: String) -> String: U.choose(String, U.string.equal(name, "amp"), "&", U.choose(String, U.string.equal(name, "lt"), "<", U.choose(String, U.string.equal(name, "gt"), ">", U.choose(String, U.string.equal(name, "quot"), "\"", U.choose(String, U.string.equal(name, "apos"), "'", U.choose(String, U.prefix(name, "#x"), SCon{Chr{U.hex(U.drop(name, "#x"), 0)}, ""}, U.choose(String, U.prefix(name, "#"), SCon{Chr{F32.to_u32(U.scalar(U.drop(name, "#"), 65533.0))}, ""}, "&" ++ name ++ ";"))))))) Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Char https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.to_u32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=choose https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=drop https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=hex https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=prefix https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=scalar https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=string.equal