marianoguerra/shrubbery/raw does not have a README file

    Meta

    pub(all) struct Meta {
    prefix : Raw
    inner_prefix : Raw
    raw : Raw
    opaque_content : Raw
    opaque_raw : Raw
    tail : Raw
    inner_suffix : Raw
    suffix : Raw
    srcloc :
    Span
    ?
    }

    The nine raw-text properties a node can carry.

    The field order is the emission order, and it is load-bearing: prefix, inner prefix, raw, then either the children or opaque_content, then tail, inner suffix, suffix. Anything that emits these in a different order round-trips wrongly on exactly the inputs that have comments in the awkward places, and on nothing else.

    Meta::is_empty

    fn Meta::is_empty(self : Meta) -> Bool

    Whether anything at all is recorded here.

    Meta::new

    fn Meta::new() -> Meta

    Raw

    pub(all) enum Raw {
    Empty
    Str(String)
    Cons(Raw, Raw)
    } derive(Eq)

    Original source text, as a tree.

    A tree rather than a string because the parser splices pieces together on nearly every step -- a comment moves from one node's prefix to another's suffix, a commented-out group is rendered into the text around it -- and a String would make each of those a copy. It is flattened once, by a preorder walk, when something finally asks for the text.

    Raw::combine

    fn Raw::combine(self : Raw, other : Raw) -> Raw

    The reference's combine-shrubbery-raw: joins two, and answers with the other one when either is empty.

    Raw::is_empty

    fn Raw::is_empty(self : Raw) -> Bool

    Raw::to_text

    fn Raw::to_text(self : Raw) -> String

    Raw::write_to

    fn Raw::write_to(self : Raw, buf : StringBuilder) -> Unit

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io