This is to add multiline support called out in #64.
In order to add multiline support. the graph entities and graph links needed to be re-structured. Previously, the graph links were dependent upon an entity first existing (hanging off of begin/end patterns identifying an entity). But multiline graph links now required multiple graph link patterns based upon whether the graph link spanned one line or multiple. If the graph link was a multiline text version it needed a different end pattern than a single line version.
With the previous entity structure, each entity pattern would need all of these graph patterns:
(Entity From)
(Graph Link Single Line)
(Graph Link Multi Line)
(Entity From)(Edge Shape)
(Graph Link Single Line)
(Graph Link Multi Line)
But this could still cause problems for chained links such as:
A -- text --> B -- text2 --> C
Instead, entities and graph links needed to be separated so that they can highlight independently and not explode the complexity (and duplication) of the patterns. The new structure defines them separately allowing for the above to work:
(Entity From)
(Entity From)(Edge Shape)
(Graph Link Single Line)
(Graph Link Multi Line)
The tradeoff is that this now can highlight improper statements such as where the initial entity is missing:
-- text --> B -- text2 --> C
But this will reveal itself in whatever renderer the user is using to view the diagrams. And the syntax highlighter shouldn't necessarily be responsible for asserting the syntax is correct.
This is to add multiline support called out in #64.
In order to add multiline support. the graph entities and graph links needed to be re-structured. Previously, the graph links were dependent upon an entity first existing (hanging off of
begin
/end
patterns identifying an entity). But multiline graph links now required multiple graph link patterns based upon whether the graph link spanned one line or multiple. If the graph link was a multiline text version it needed a different end pattern than a single line version.With the previous entity structure, each entity pattern would need all of these graph patterns:
But this could still cause problems for chained links such as:
Instead, entities and graph links needed to be separated so that they can highlight independently and not explode the complexity (and duplication) of the patterns. The new structure defines them separately allowing for the above to work:
The tradeoff is that this now can highlight improper statements such as where the initial entity is missing:
But this will reveal itself in whatever renderer the user is using to view the diagrams. And the syntax highlighter shouldn't necessarily be responsible for asserting the syntax is correct.