moonrockz/diagrams

Diagramming for MoonBit. The library will support formats such as Mermaid, PlantUML, Draw.io and Graphviz DOT.

Types

Diagnostic

pub(all) struct Diagnostic {
  code : String
  severity : Severity
  message : String
  span : Span?
} derive(Eq, @moonbitlang/core/debug.Debug)

A problem that a reader, a converter or a renderer found. code is stable, for example mermaid/unknown-statement. span is absent when the problem has no place in a source text.

Source

Diagnostic::equal

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

Source

Diagnostic::error

fn Diagnostic::error(code : String, message : String, span? : Span) -> Diagnostic

An error diagnostic.

Source

Diagnostic::not_equal

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

Source

Diagnostic::to_repr

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

Source

Diagnostic::warning

fn Diagnostic::warning(code : String, message : String, span? : Span) -> Diagnostic

A warning diagnostic.

Source

Position

pub(all) struct Position {
  offset : Int
  line : Int
  column : Int
} derive(Eq, @moonbitlang/core/debug.Debug)

A place in a source text. offset counts UTF-16 code units from the start. line and column start at 1, and column also counts UTF-16 code units.

Source

Position::equal

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

Source

Position::not_equal

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

Source

Position::to_repr

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

Source

Severity

pub(all) enum Severity {
  Error
  Warning
  Info
} derive(Eq, @moonbitlang/core/debug.Debug)

How serious a diagnostic is.

Source

Severity::equal

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

Source

Severity::not_equal

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

Source

Severity::to_repr

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

Source

Span

pub(all) struct Span {
  start : Position
  end : Position
} derive(Eq, @moonbitlang/core/debug.Debug)

The half-open range from start to end in a source text.

Source

Span::equal

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

Source

Span::not_equal

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

Source

Span::to_repr

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

Source

Values

version

fn version() -> String

The module version, kept in sync with the root moon.mod.

Source