mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
Multiline comments
This commit is contained in:
parent
737e95c3f9
commit
e62027b73c
@ -9,7 +9,8 @@
|
||||
%x string generic struct
|
||||
|
||||
%%
|
||||
\%\%[^\n]*\n* /* do nothing */
|
||||
\%\%[^\n]*\n* /* skip comments */
|
||||
\%\%\*((.|\n)*)\*\%\% /* multiline skip comments */
|
||||
\n+ return 'NEWLINE';
|
||||
\s+ /* skip whitespace */
|
||||
"classDiagram" return 'CLASS_DIAGRAM';
|
||||
|
@ -10,7 +10,8 @@
|
||||
%x dir
|
||||
%x vertex
|
||||
%%
|
||||
\%\%[^\n]*\n* /* do nothing */
|
||||
\%\%[^\n]*\n* /* skip comments */
|
||||
\%\%\*((.|\n)*)\*\%\% /* multiline skip comments */
|
||||
["] this.begin("string");
|
||||
<string>["] this.popState();
|
||||
<string>[^"]* return "STR";
|
||||
|
@ -17,6 +17,7 @@
|
||||
\s+ /* skip whitespace */
|
||||
\#[^\n]* /* skip comments */
|
||||
\%%[^\n]* /* skip comments */
|
||||
\%\%\*((.|\n)*)\*\%\% /* multiline skip comments */
|
||||
|
||||
/*
|
||||
---interactivity command---
|
||||
|
@ -18,6 +18,7 @@
|
||||
\s+ /* skip all whitespace */
|
||||
\#[^\n]* /* skip comments */
|
||||
\%%[^\n]* /* skip comments */
|
||||
\%\%\*((.|\n)*)\*\%\% /* multiline skip comments */
|
||||
"gitGraph" return 'GG';
|
||||
"commit" return 'COMMIT';
|
||||
"branch" return 'BRANCH';
|
||||
|
@ -12,7 +12,8 @@
|
||||
%}
|
||||
|
||||
%%
|
||||
\%\%[^\n]* /* do nothing */
|
||||
\%\%[^\n]* /* skip comments */
|
||||
\%\%\*((.|\n)*)\*\%\% /* multiline skip comments */
|
||||
\s+ /* skip whitespace */
|
||||
"pie" return 'pie' ;
|
||||
[\s\n\r]+ return 'NL' ;
|
||||
|
@ -26,6 +26,7 @@
|
||||
<ID,ALIAS,LINE>((?!\n)\s)+ /* skip same-line whitespace */
|
||||
<INITIAL,ID,ALIAS,LINE>\#[^\n]* /* skip comments */
|
||||
\%%[^\n]* /* skip comments */
|
||||
\%\%\*((.|\n)*)\*\%\% /* multiline skip comments */
|
||||
"participant" { this.begin('ID'); return 'participant'; }
|
||||
<ID>[^\->:\n,;]+?(?=((?!\n)\s)+"as"(?!\n)\s|[#\n;]|$) { yytext = yytext.trim(); this.begin('ALIAS'); return 'ACTOR'; }
|
||||
<ALIAS>"as" { this.popState(); this.popState(); this.begin('LINE'); return 'AS'; }
|
||||
|
@ -37,6 +37,7 @@
|
||||
<ID,STATE,struct,LINE>((?!\n)\s)+ /* skip same-line whitespace */
|
||||
<INITIAL,ID,STATE,struct,LINE>\#[^\n]* /* skip comments */
|
||||
\%%[^\n]* /* skip comments */
|
||||
\%\%\*((.|\n)*)\*\%\% /* multiline skip comments */
|
||||
|
||||
"scale"\s+ { this.pushState('SCALE'); /* console.log('Got scale', yytext);*/ return 'scale'; }
|
||||
<SCALE>\d+ return 'WIDTH';
|
||||
|
Loading…
x
Reference in New Issue
Block a user