marianoguerra/was/read does not have a README file

    Span

    A source span, as offsets into the file.

    ReadError

    pub(all) suberror ReadError {
    ReadError(
    Report
    )
    }

    A was read error, carrying a ready-to-render report.

    ReadError::report

    The report inside a parse error.

    Parts

    A group split into the three parts shrubbery guarantees it can have: the terms, then at most one block, then at most one run of alternatives.

    This shape is not a convention of wap's, it is the shrubbery grammar -- "a block list appears only at the end of a group list or just before an alts list that is at the end of the group list".

    as_id

    fn as_id(n :
    Node
    ) -> String?

    The identifier a term is, if it is one.

    as_kw

    fn as_kw(n :
    Node
    ) -> String?

    The keyword a term is, if it is one. Keywords are wap's labels: ~outer.

    as_op

    fn as_op(n :
    Node
    ) -> String?

    The operator a term is, if it is one.

    as_str

    fn as_str(n :
    Node
    ) -> String?

    The string a literal term is, if it is a string.

    fail_at

    fn[T] fail_at(msg : String, span :
    Span
    , source~ :
    SourceId
    , help? : String) -> T raise ReadError

    Fail at a span, with a message.

    has_source

    fn has_source(s :
    Span
    ) -> Bool

    True when a span points at real source text.

    is_id

    fn is_id(n :
    Node
    , name : String) -> Bool

    True when the term is exactly this identifier.

    is_op

    fn is_op(n :
    Node
    , name : String) -> Bool

    True when the term is exactly this operator.

    node_span

    The span of a shrubbery node.

    nowhere

    The span of something that was never written down.

    raw_text

    fn raw_text(n :
    Node
    ) -> String

    The source text of a term, which is how numeric literals keep the spelling they were written with. Shrubbery parses 0xFF to 255; Wax needs the digits back, because the checker's flexible-literal typing and the printer both depend on them.

    read_module

    fn read_module(text : String, fname? : String) -> Read raise ReadError

    Read was source into the Wax AST.

    Grouping errors come from shrubbery and are re-raised unchanged: there is no value in was paraphrasing them, and a shrubbery diagnostic already renders through error-report.

    split

    Split a group into head terms, block and alternatives.

    terms_span

    The span covering a run of terms, or nowhere if there are none.

    to_span

    A shrubbery span as an error-report span.

    idx is the UTF-16 index shrubbery keeps for exactly this purpose; line and pos are code-point positions for humans and are not used here.

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io