mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-23 17:29:54 +02:00
Add specialChars in textNoTagsToken, alphaNumToken
This will ensure that alphaNumToken does not lose any of the previously used tokens in its definition. The same tokens were added to textNoTagsToken explicitly, because it used to have alphaNumToken in its definition before I removed it. Previously, textNoTagsToken and alphaNumToken had many tokens in common in their definition. To avoid grammar conflicts, the alphaNumStatement grammar was created. However, I found this unintuitive and was an extra step just to avoid repetition in the definitions. I opted to have repetition in the definitions of textNoTagsToken and alphaNumToken and it be explicitly clear right away, rather than have extra grammar statements like alphaNumStatement which don't look like they do anything at first glance
This commit is contained in:
@@ -576,11 +576,11 @@ idStringToken : NUM | NODE_STRING | DOWN | MINUS | DEFAULT | COMMA | COLON | A
|
||||
|
||||
textToken : TEXT | TAGSTART | TAGEND | UNICODE_TEXT;
|
||||
|
||||
textNoTagsToken: NUM | NODE_STRING | SPACE | MINUS | keywords | START_LINK ;
|
||||
textNoTagsToken: NUM | NODE_STRING | SPACE | MINUS | AMP | UNICODE_TEXT | COLON | MULT | BRKT | keywords | START_LINK ;
|
||||
|
||||
edgeTextToken : EDGE_TEXT | UNICODE_TEXT ;
|
||||
|
||||
alphaNumToken : NUM | UNICODE_TEXT | NODE_STRING | DIR | DOWN | MINUS | COMMA;
|
||||
alphaNumToken : NUM | UNICODE_TEXT | NODE_STRING | DIR | DOWN | MINUS | COMMA | COLON | AMP | BRKT | MULT;
|
||||
|
||||
idString
|
||||
:idStringToken
|
||||
|
Reference in New Issue
Block a user