Sign in

    moonrockz/diagrams-plantuml/json does not have a README file

    Conversion

    pub struct Conversion {
    tree :
    DataTree
    ?
    diagnostics : ReadOnlyArray[
    Diagnostic
    ]
    }

    The result of converting a document to a data tree.

    Document

    pub struct Document {
    name : String?
    statements : ReadOnlyArray[
    Statement
    ]
    highlights : ReadOnlyArray[
    Selector
    ]
    value : Value
    } derive(Eq,
    Debug
    )

    One parsed JSON diagram block.

    Document::equal

    fn Document::equal(Document, Document) -> Bool

    Document::logical_equal

    fn Document::logical_equal(self : Document, other : Document) -> Bool

    Compare two documents without spans and source spellings.

    Document::new

    A document. The constructor copies its arrays.

    Document::not_equal

    fn Document::not_equal(x : Document, y : Document) -> Bool

    Document::to_repr

    Member

    pub struct Member {
    name : Str
    value : Value
    span :
    Span
    ?
    } derive(Eq,
    Debug
    )

    One object member occurrence.

    Member::equal

    fn Member::equal(Member, Member) -> Bool

    Member::new

    fn Member::new(name : String, value : Value) -> Member

    Member::not_equal

    fn Member::not_equal(x : Member, y : Member) -> Bool

    Member::to_repr

    ReadResult

    pub struct ReadResult {
    nodes : Array[
    Node
    ]
    document : Document?
    diagnostics : ReadOnlyArray[
    Diagnostic
    ]
    }

    The result of reading a JSON body.

    Str

    pub struct Str {
    text : String
    raw : String?
    } derive(Eq,
    Debug
    )

    A JSON string. text is the decoded value. raw is the source spelling with its quotes, or None for a constructed value. Logical comparison and canonical writing use only text.

    Str::equal

    fn Str::equal(Str, Str) -> Bool

    Str::new

    fn Str::new(text : String) -> Str

    Str::not_equal

    fn Str::not_equal(x : Str, y : Str) -> Bool

    Str::to_repr

    Value

    One JSON value with its source span.

    Value::array

    fn Value::array(items : ArrayView[Value]) -> Value

    An array. The constructor copies items.

    Value::boolean

    fn Value::boolean(value : Bool) -> Value

    Value::equal

    fn Value::equal(Value, Value) -> Bool

    Value::kind_name

    fn Value::kind_name(self : Value) -> String

    The kind name of a value: object, array, string, number, boolean or null.

    Value::logical_equal

    fn Value::logical_equal(self : Value, other : Value) -> Bool

    Compare two values without spans and source spellings. The comparison uses an explicit stack, so deep values do not use the call stack.

    Value::not_equal

    fn Value::not_equal(x : Value, y : Value) -> Bool

    Value::null

    fn Value::null() -> Value

    Value::number

    fn Value::number(lexeme : String) -> Value

    A number with an exact decimal lexeme, for example -0.0 or 1e400. Writing gives an error when the lexeme is not a valid JSON number.

    Value::object

    fn Value::object(members : ArrayView[Member]) -> Value

    An object. The constructor copies members.

    Value::string

    fn Value::string(text : String) -> Value

    Value::to_repr

    ValueKind

    pub(all) enum ValueKind {
    Object(ReadOnlyArray[Member])
    Array(ReadOnlyArray[Value])
    String(Str)
    Number(String)
    Boolean(Bool)
    Null
    } derive(Eq,
    Debug
    )

    The kind and content of one JSON value.

    ValueKind::equal

    fn ValueKind::equal(ValueKind, ValueKind) -> Bool

    ValueKind::not_equal

    fn ValueKind::not_equal(x : ValueKind, y : ValueKind) -> Bool

    diagnostic_codes

    let diagnostic_codes : ReadOnlyArray[String]

    The stable diagnostic codes of the JSON reader, writer and converter.
    fn print_body(document : Document, limits? :
    Limits
    ) -> Result[String, ReadOnlyArray[
    Diagnostic
    ]]

    Write the canonical body of a JSON block: one #highlight line for each selector, then the value. Every line ends with a line break. The text has no block markers and no shared statements. On error there is no output.
    fn print_value(value : Value, limits? :
    Limits
    ) -> Result[String, ReadOnlyArray[
    Diagnostic
    ]]

    Write the canonical text of one value: two-space indentation, one member or element on each line, {} and [] for empty containers. The output has no trailing line break. Numbers keep their exact lexemes.

    read

    Read the JSON body of a scanned block. The reader keeps every member occurrence in order, exact number lexemes and decoded strings with their spellings. It follows the pinned PlantUML profile: a // comment can stand only before a member name or after a member value; malformed input is refused with a diagnostic, never coerced.

    to_data_tree

    fn to_data_tree(document : Document, id? : String, limits? :
    Limits
    ) -> Conversion

    Convert a JSON document to a structured-data model. Identities come from ordered ownership paths: the root value is v, member 2 of the value of root member 0 is m/0/2 and its value is v/0/2. Names and scalar text never define identity, so repeated members stay separate.

    The model keeps a scalar root and empty root containers as they are. PlantUML 1.2026.9 draws a scalar root as a one-element array and an empty root container as an array with one empty string; this library does not copy that projection. The title is the last title statement.

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io