gralha-xml-doc Releases (1): 0.1.0.1 0x083872843a8a55fa2adcfae9f7ed7d1e indexed https://jend.leeeet.dev/files.txt?path=gralha-xml-doc@0.1.0.1 Definitions (80): Xml.entity.push (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=entity.push) # Reverse a scan's accumulator while decoding XML entities: the reversed # text shows an entity as its ';' first, then its name backwards, then '&'; # a ';' without a short name and '&' behind it is plain text. def entity.push(+e: String, +out: String) -> String: Xml.entity.of (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=entity.of) def entity.of(+name: String) -> String: Xml.Step (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=Step) # One step of the decoding reversal: kind 0 a plain character, 1 an entity # (its name collected backwards up to the '&'), 2 a ';' that began no # entity (the collected text stays as it was), 3 the end. type Step is Data: Step{kind: U32, ch: U32, name: String, rest: String} @unsafe Xml.entity.take (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=entity.take) def entity.take(s: String, +name: String, +n: U32) -> Step: Xml.rev.next.at (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=rev.next.at) def rev.next.at(semi: Bool, +ch: U32, t: String) -> Step: Xml.rev.next (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=rev.next) def rev.next(s: String) -> Step: Xml.rev.decode.go (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=rev.decode.go) def rev.decode.go(st: Step, +out: String) -> String: Xml.rev.decode (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=rev.decode) def rev.decode(s: String, +out: String) -> String: Xml.until.decoded.go (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=until.decoded.go) def until.decoded.go(hit: Bool, +c: U32, t: String, +end: U32, acc: String) -> U.Scan: Xml.until.decoded (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=until.decoded) def until.decoded(s: String, +end: U32, acc: String) -> U.Scan: Xml.name.stop (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=name.stop) def name.stop(+c: U32) -> Bool: Xml.name.go (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=name.go) def name.go(stop: Bool, +c: U32, t: String, acc: String) -> U.Scan: Xml.xml.name (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=xml.name) def xml.name(s: String, acc: String) -> U.Scan: Xml.value.go (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=value.go) def value.go(quoted: Bool, +ch: U32, rest: String) -> U.Scan: Xml.value (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=value) def value(s: String) -> U.Scan: Xml.equals (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=equals) def equals(s: String) -> U.Scan: Xml.Attr (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=Attr) type Attr is Data: Attr{key: String, val: String} Xml.Tag (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=Tag) type Tag is Data: Tag{attrs: List<&2, Attr>, tail: String, closed: Bool} Xml.attr.kind (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=attr.kind) # The parse position after an attribute: the kind of the next character # (see attr.kind; 4 at the end of the text) with the attributes so far. # What a character starts inside a tag: 0 space, 1 the end of the tag, # 2 a self-closing slash, 3 an attribute. def attr.kind(+c: U32) -> U32: Xml.Next (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=Next) type Next is Data: Next{kind: U32, ch: U32, attrs: List<&2, Attr>, tail: String} Xml.next.of (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=next.of) def next.of(attrs: List<&2, Attr>, tail: String) -> Next: Xml.attr.append (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=attr.append) def attr.append(k: String, b: U.Scan, attrs: List<&2, Attr>) -> Next: Xml.attr.read.scan (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=attr.read.scan) def attr.read.scan(a: U.Scan, attrs: List<&2, Attr>) -> Next: Xml.attr.read (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=attr.read) def attr.read(s: String, attrs: List<&2, Attr>) -> Next: Xml.attributes.close (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=attributes.close) def attributes.close(scan: U.Scan, attrs: List<&2, Attr>) -> Tag: Xml.attributes.go (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=attributes.go) def attributes.go(step: Next) -> Tag: Xml.attributes (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=attributes) def attributes(s: String, attrs: List<&2, Attr>) -> Tag: Xml.Token (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=Token) type Token is Data: Open{name: String, attrs: List<&2, Attr>, closed: Bool} Shut{name: String} Chars{content: String} Xml.Lexeme (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=Lexeme) type Lexeme is Data: Lexeme{token: Token, tail: String} Xml.lex.open (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=lex.open) def lex.open(n: String, tag: Tag) -> Lexeme: Xml.lex.named (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=lex.named) def lex.named(scan: U.Scan) -> Lexeme: Xml.lex.shut (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=lex.shut) def lex.shut(scan: U.Scan) -> Lexeme: Xml.xml.raw (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=xml.raw) def xml.raw(s: String) -> String: Xml.lex.cdata (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=lex.cdata) def lex.cdata(scan: U.Scan) -> Lexeme: Xml.lex.tag (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=lex.tag) def lex.tag(+s: String) -> Lexeme: Xml.lex.more (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=lex.more) def lex.more(item: Lexeme, next: String -> List<&2, Token>) -> List<&2, Token>: Xml.lex.after (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=lex.after) def lex.after(s: String, next: String -> List<&2, Token>) -> List<&2, Token>: Xml.lex.text (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=lex.text) def lex.text(scan: U.Scan, next: String -> List<&2, Token>) -> List<&2, Token>: Xml.tokenize (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=tokenize) def tokenize(s: String) -> List<&2, Token>: Xml.Element (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=Element) type Element is Data: Element{name: String, attrs: List<&2, Attr>, children: List<&2, Element>, text: String} Xml.elements.rev (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=elements.rev) def elements.rev(xs: List<&2, Element>, acc: List<&2, Element>) -> List<&2, Element>: Xml.element.finish (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=element.finish) def element.finish(e: Element) -> Element: Xml.stack.add (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=stack.add) def stack.add(s: List<&2, Element>, node: Element) -> List<&2, Element>: Xml.stack.text (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=stack.text) def stack.text(+s: List<&2, Element>, +text: String) -> List<&2, Element>: Xml.stack.close (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=stack.close) def stack.close(s: List<&2, Element>) -> List<&2, Element>: Xml.tree.step (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=tree.step) def tree.step(tok: Token, +s: List<&2, Element>) -> List<&2, Element>: Xml.tree (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=tree) def tree(tokens: List<&2, Token>, s: List<&2, Element>) -> List<&2, Element>: Xml.tree.root (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=tree.root) def tree.root(s: List<&2, Element>) -> Element: Xml.annotate (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=annotate) def annotate(xs: List<&2, Token>, +i: U32) -> List<&2, Token>: Xml.attr.pick (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=attr.pick) def attr.pick(hit: Bool, +v: String, rest: Maybe<&2, String>) -> Maybe<&2, String>: Xml.attr.find.go (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=attr.find.go) def attr.find.go(hit: Bool, v: String, t: List<&2, Attr>, +key: String) -> Maybe<&2, String>: Xml.attr.find (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=attr.find) def attr.find(attrs: List<&2, Attr>, +key: String) -> Maybe<&2, String>: Xml.attr.or (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=attr.or) def attr.or(found: Maybe<&2, String>, +fallback: String) -> String: Xml.attr.get (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=attr.get) def attr.get(attrs: List<&2, Attr>, +key: String, +fallback: String) -> String: Xml.attrs.append (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=attrs.append) def attrs.append(xs: List<&2, Attr>, ys: List<&2, Attr>) -> List<&2, Attr>: Xml.element.prefer (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=element.prefer) def element.prefer(a: Maybe<&2, Element>, b: Maybe<&2, Element>) -> Maybe<&2, Element>: Xml.element.find (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=element.find) def element.find(+xs: List<&2, Element>, +id: String) -> Maybe<&2, Element>: Xml.entity (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=entity) # Decode XML entities before interpreting attributes or exposing source editing. def entity(+s: String) -> String: Xml.entities.more (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=entities.more) def entities.more(scan: U.Scan, acc: String, next: String -> String -> String) -> String: Xml.entities.loop (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=entities.loop) def entities.loop(s: String, +acc: String) -> String: Xml.entities (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=entities) def entities(s: String) -> String: Xml.decode.attrs (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=decode.attrs) def decode.attrs(as: List<&2, Attr>) -> List<&2, Attr>: Xml.decode.nodes (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=decode.nodes) # Attribute values were decoded as they were read; text still is here. def decode.nodes(xs: List<&2, Element>) -> List<&2, Element>: Xml.parse (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=parse) def parse(s: String) -> Element: Xml.attrs.remove (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=attrs.remove) # Editor support: identifiers are private metadata and never serialized. def attrs.remove(+as: List<&2, Attr>, +key: String) -> List<&2, Attr>: Xml.attrs.set (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=attrs.set) def attrs.set(as: List<&2, Attr>, +key: String, value: String) -> List<&2, Attr>: Xml.Taken (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=Taken) # One attribute's value taken out of the list, so its text has a single # owner; "" and the untouched list when absent. type Taken is Data: Taken{value: String, rest: List<&2, Attr>} Xml.taken.push (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=taken.push) def taken.push(t: Taken, a: Attr) -> Taken: Xml.attrs.take.go (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=attrs.take.go) def attrs.take.go(hit: Bool, kk: String, v: String, rest: List<&2, Attr>, +key: String) -> Taken: Xml.attrs.take (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=attrs.take) def attrs.take(as: List<&2, Attr>, +key: String) -> Taken: Xml.escape.rev (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=escape.rev) # Build escaped XML in reverse, so large data URIs do not grow the host stack. def escape.rev(s: String, acc: String) -> String: Xml.escape (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=escape) def escape(s: String) -> String: Xml.serialize.attrs.rev (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=serialize.attrs.rev) def serialize.attrs.rev(as: List<&2, Attr>, +acc: String) -> String: Xml.serialize.attrs (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=serialize.attrs) def serialize.attrs(as: List<&2, Attr>) -> String: Xml.serialize.element (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=serialize.element) def serialize.element(+n: String, as: List<&2, Attr>, kids: List<&2, Element>, txt: String, +acc: String, children: List<&2, Element> -> String -> String) -> String: Xml.serialize.nodes.rev (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=serialize.nodes.rev) def serialize.nodes.rev(xs: List<&2, Element>, acc: String) -> String: Xml.serialize.nodes (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=serialize.nodes) def serialize.nodes(xs: List<&2, Element>) -> String: Xml.serialize (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=serialize) def serialize(root: Element) -> String: Xml.elements.kinds (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=elements.kinds) # The number of elements in a forest, the roots included. # Which of four element names the tree holds, as bits: 1 image, 2 use, 4 text, 8 style. def elements.kinds(xs: List<&2, Element>, +acc: U32) -> U32: Xml.elements.count (https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=elements.count) def elements.count(xs: List<&2, Element>) -> U32: