mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-22 16:59:48 +02:00
Add class name literals, with less conflicts.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
/* lexical grammar */
|
||||
%lex
|
||||
%x string
|
||||
%x bqstring
|
||||
%x generic
|
||||
%x struct
|
||||
%x href
|
||||
@@ -49,6 +50,10 @@
|
||||
<string>["] this.popState();
|
||||
<string>[^"]* return "STR";
|
||||
|
||||
[`] this.begin("bqstring");
|
||||
<bqstring>[`] this.popState();
|
||||
<bqstring>[^`]+ return "BQUOTE_STR";
|
||||
|
||||
/*
|
||||
---interactivity command---
|
||||
'href' adds a link to the specified node. 'href' can only be specified when the
|
||||
@@ -215,9 +220,10 @@ statements
|
||||
|
||||
className
|
||||
: alphaNumToken { $$=$1; }
|
||||
| classLiteralName { $$=$1; }
|
||||
| alphaNumToken className { $$=$1+$2; }
|
||||
| alphaNumToken GENERICTYPE className { $$=$1+'~'+$2+$3; }
|
||||
| alphaNumToken GENERICTYPE { $$=$1+'~'+$2; }
|
||||
| classLiteralName GENERICTYPE { $$=$1+'~'+$2; }
|
||||
;
|
||||
|
||||
statement
|
||||
@@ -309,4 +315,6 @@ textNoTagsToken: alphaNumToken | SPACE | MINUS | keywords ;
|
||||
|
||||
alphaNumToken : UNICODE_TEXT | NUM | ALPHA;
|
||||
|
||||
classLiteralName : BQUOTE_STR;
|
||||
|
||||
%%
|
||||
|
Reference in New Issue
Block a user