parse(
statements) ->script,err
Parse a sequence diagram's statements into a script
statements is what mermaid.source.statements returns after the
sequenceDiagram header.
The script:
| Field | Holds |
|---|---|
participants | { id, label, kind } in order of first mention; kind is "participant" or "actor" |
index | the participants by id |
events | the events in order |
title | the diagram's title as lines, or nil |
autonumber | true when messages are numbered |
An event is one of:
kind | Fields |
|---|---|
"message" | from, to, line, head, tail, text, activate, deactivate |
"activate", "deactivate" | who |
"note" | side ("left", "right" or "over"), who (one id, or two for a note over a span), text |
"open" | tag (loop, opt, alt, par, critical, break or rect), text |
"divider" | tag (else, and or option), text |
"close" | none |
A message's line is "solid" or "dotted", and its head is
"arrow", "open", "cross" or nil. activate is set by a + after
the arrow and starts an activation of the receiver; deactivate is set
by a - and ends one of the sender. Every text is lines, and may be
empty.
Returns nil and line N: reason for a statement outside the grammar,
create and destroy, a message with no colon, a deactivate with no
open activation, a divider outside its block, an end with no block, a
block left open, a script with no participant, and one over 50
participants or 500 events.