moonrockz/diagrams-plantuml/envelope

Types

Kind

pub(all) enum Kind {
  Regex
  Ebnf
  Json
  Yaml
  Activity
  State
} derive(Eq, @moonbitlang/core/debug.Debug)

The four supported native diagram kinds.

Source

Kind::equal

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

Source

Kind::not_equal

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

Source

Kind::to_repr

fn Kind::to_repr(Kind) -> @moonbitlang/core/debug.Repr

Source

Kind::word

fn Kind::word(self : Kind) -> String

The marker word of a kind, as in @start<word>.

Source

Limits

pub struct Limits {
  source : Int
  output : Int
  depth : Int
  nodes : Int
  regions : Int
  edges : Int
  work : Int
  diagnostics : Int
} derive(Eq, @moonbitlang/core/debug.Debug)

Explicit positive bounds for reading, writing and conversion.

Source

Limits::equal

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

Source

Limits::new

fn Limits::new(source? : Int, output? : Int, depth? : Int, nodes? : Int, regions? : Int, edges? : Int, work? : Int, diagnostics? : Int) -> Limits

Source

Limits::not_equal

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

Source

Limits::to_repr

fn Limits::to_repr(Limits) -> @moonbitlang/core/debug.Repr

Source

Limits::valid

fn Limits::valid(self : Limits) -> Bool

Source

Line

pub struct Line {
  number : Int
  offset : Int
  text : String
  newline : String
  role : Role
} derive(Eq, @moonbitlang/core/debug.Debug)

One source line between the block markers, without its line break.

Source

Line::equal

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

Source

Line::not_equal

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

Source

Line::to_repr

fn Line::to_repr(Line) -> @moonbitlang/core/debug.Repr

Source

Line::tokens

fn Line::tokens(self : Line, kind : @moonrockz/diagrams-plantuml/cst.TokenKind) -> Array[@moonrockz/diagrams-plantuml/cst.Element]

The tokens of a line as one text token plus its line break.

Source

Role

pub(all) enum Role {
  Body
  Statement(@moonrockz/diagrams-plantuml/cst.Node)
  Continuation
} derive(Eq, @moonbitlang/core/debug.Debug)

The role of one source line inside the block.

Source

Role::equal

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

Source

Role::not_equal

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

Source

Role::to_repr

fn Role::to_repr(Role) -> @moonbitlang/core/debug.Repr

Source

Scan

pub struct Scan {
  source : String
  kind : Kind?
  name : String?
  head : ReadOnlyArray[@moonrockz/diagrams-plantuml/cst.Node]
  lines : ReadOnlyArray[Line]
  tail : ReadOnlyArray[@moonrockz/diagrams-plantuml/cst.Node]
  statements : ReadOnlyArray[Statement]
  diagnostics : ReadOnlyArray[@moonrockz/diagrams.Diagnostic]
  lines_index : @moonrockz/diagrams-plantuml/cst.Lines
}

The scanned envelope of one native block.

Source

Scan::document

fn Scan::document(self : Scan, body : ArrayView[@moonrockz/diagrams-plantuml/cst.Node]) -> @moonrockz/diagrams-plantuml/cst.Node

Assemble the lossless document from the scanned envelope and the nodes that a kind reader made for its body lines.

Source

Scan::line_nodes

fn Scan::line_nodes(self : Scan, make : (Line) -> @moonrockz/diagrams-plantuml/cst.Node?) -> Array[@moonrockz/diagrams-plantuml/cst.Node]

The body nodes for lines with the Statement role, and one node per body line made by make, in source order.

Source

Scan::span

fn Scan::span(self : Scan, start : Int, end : Int) -> @moonrockz/diagrams.Span

Source

Scan::title

fn Scan::title(self : Scan) -> String?

The title of the block, if it has one. The last title wins.

Source

Statement

pub(all) enum Statement {
  Title(String)
  Caption(String)
  Header(String)
  Footer(String)
  Legend(ReadOnlyArray[String])
  Skinparam(ReadOnlyArray[String])
  Style(ReadOnlyArray[String])
  Skin(String)
  Scale(String)
  Hide(String)
  Pragma(String)
  Option(String)
} derive(Eq, @moonbitlang/core/debug.Debug)

One retained presentation or metadata statement. Library themes and options paint the diagram; these values are inert author data.

Source

Statement::equal

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

Source

Statement::lines

fn Statement::lines(self : Statement) -> Array[String]

The canonical text of a metadata statement, one line per entry, without line breaks at the end.

Source

Statement::not_equal

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

Source

Statement::to_repr

fn Statement::to_repr(Statement) -> @moonbitlang/core/debug.Repr

Source

Values

diagnostic_codes

let diagnostic_codes : ReadOnlyArray[String]

The stable diagnostic codes of envelope scanning.

Source

has_preprocessor_call

fn has_preprocessor_call(text : String) -> Bool

True when text calls a preprocessor function such as %date().

Source

java_trim

fn java_trim(text : String) -> String

text without leading and trailing code units up to U+0020, as Java String.trim removes them.

Source

kind_of_word

fn kind_of_word(word : String) -> Kind?

Source

scan

fn scan(source : String, limits? : Limits) -> Scan

Scan one native block. Multiple blocks, wrong end markers and text outside the block are errors, never a partial result.

Source

scan_body

fn scan_body(kind : Kind, body : String, limits? : Limits) -> Scan

Scan a raw body of an explicit kind, without block markers. Every line is a body line or a shared statement, with offsets into body.

Source

trim

fn trim(text : String) -> String

text without leading and trailing spaces, tabs and byte-order marks.

Source