My attempt to fix current directive parser which is broken. While the current parser recognizes "some" directives, it always assume the diagram definition to be Class diagram. Besides, directives are common with mermaid diagram in markdown code fence and currently they often make the main diagram syntax a total mess.
Here are few notes while I looked into this:
Directives are deprecated, so didn't attempt to make it more sophisticated than current one.
Directives are expected at the top of any diagram, so I removed the in-between diagram statements which make the diagram switch much better and less error-prone
I couldn't separate the directive ending }%% with directive body. Whenever I tried to separate the body and the ending token, I cannot get the parser recognize the directive boundaries. (I'm still a newbie with this tree-sitter parser stuff). If you can improve it, please do.
My attempt to fix current directive parser which is broken. While the current parser recognizes "some" directives, it always assume the diagram definition to be Class diagram. Besides, directives are common with mermaid diagram in markdown code fence and currently they often make the main diagram syntax a total mess.
Here are few notes while I looked into this:
}%%
with directive body. Whenever I tried to separate the body and the ending token, I cannot get the parser recognize the directive boundaries. (I'm still a newbie with this tree-sitter parser stuff). If you can improve it, please do.