moonrockz/diagrams-mermaid/syntax

Types

ParseResult

pub struct ParseResult {
  tree : @moonrockz/diagrams-mermaid/cst.Node
  diagnostics : ReadOnlyArray[@moonrockz/diagrams.Diagnostic]
}

The lossless syntax tree of a source and the syntax diagnostics.

Source

Values

arrows

let arrows : ReadOnlyArray[String]

The arrows of the Mermaid 12.2.0 sequence grammar. The scanner takes the longest arrow that matches.

Source

diagnostic_codes

let diagnostic_codes : ReadOnlyArray[String]

Every diagnostic code that the parser gives.

Source

parse

fn parse(source : String) -> ParseResult

Parse a Mermaid sequence diagram, as the Mermaid 12.2.0 grammar reads it. The text of the tree is always equal to source. A statement that does not parse becomes an error node with a diagnostic, and the parser continues at the next statement.

Source