Diagramming for MoonBit: Mermaid, PlantUML, Draw.io, Graphviz DOT and more
| Package | Contents |
|---|---|
| moonrockz/diagrams | Diagnostic, Severity, Span and Position, which all modules use |
| moonrockz/diagrams/sequence | The immutable Sequence model, links, render properties and link resolution |
| moonrockz/diagrams/bpmn | Immutable process/collaboration views, graphical markers and ownership |
| moonrockz/diagrams/swimlane | Immutable responsibility lanes, groups, shapes, connections and validation |
| moonrockz/diagrams/flowchart | Immutable actions, control regions, graph connections, groups, explicit lanes, notes and validation |
| moonrockz/diagrams/regex | Immutable regex expressions: literals, classes, sets, anchors, groups, lookarounds, alternatives and symbolic repeats |
| moonrockz/diagrams/ebnf | Immutable grammars: ordered rules and notes, terminals, symbolic references, options, repetitions, counts and exclusions |
| moonrockz/diagrams/data-tree | Immutable ordered data: objects, arrays, exact-number scalars, member identities and view highlights |
| moonrockz/diagrams/railroad-trace | Railroad topology, immutable trace values, the RailroadTraceProvider trait and trace validation |
| moonrockz/diagrams/animation | Source-bound catalogs, oriented routes and explicit-time motion |
| moonrockz/diagrams/render | The Renderer trait, the Diagram enum and the Rendered result |
///|
test "a constructed grammar keeps a recursive reference symbolic" {
let grammar = @ebnf.Grammar::new(
"lists",
[Rule(@ebnf.Rule::new("r", "list", body="s"))],
[
@ebnf.Node::new("s", Sequence(["x", "o"])),
@ebnf.Node::new("x", Terminal("x", Double)),
@ebnf.Node::new("o", Optional("again")),
@ebnf.Node::new("again", Reference("list", None)),
],
)
let index = @ebnf.Index::build(grammar).index.unwrap()
assert_eq(index.resolution("again"), Some(Resolved("r")))
assert_eq(grammar.nodes.length(), 4)
}