Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiline comments #1281

Merged
merged 1 commit into from
Feb 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/diagrams/class/parser/classDiagram.jison
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
3 changes: 2 additions & 1 deletion src/diagrams/flowchart/parser/flow.jison
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
1 change: 1 addition & 0 deletions src/diagrams/gantt/parser/gantt.jison
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
\s+ /* skip whitespace */
\#[^\n]* /* skip comments */
\%%[^\n]* /* skip comments */
\%\%\*((.|\n)*)\*\%\% /* multiline skip comments */

/*
---interactivity command---
Expand Down
1 change: 1 addition & 0 deletions src/diagrams/git/parser/gitGraph.jison
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
3 changes: 2 additions & 1 deletion src/diagrams/pie/parser/pie.jison
Original file line number Diff line number Diff line change
Expand Up @@ -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' ;
Expand Down
1 change: 1 addition & 0 deletions src/diagrams/sequence/parser/sequenceDiagram.jison
Original file line number Diff line number Diff line change
Expand Up @@ -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'; }
Expand Down
5 changes: 3 additions & 2 deletions src/diagrams/state/parser/stateDiagram.jison
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@
%%

[\n]+ return 'NL';
\s+ /* skip all whitespace */
\s+ /* skip all whitespace */
<ID,STATE,struct,LINE>((?!\n)\s)+ /* skip same-line whitespace */
<INITIAL,ID,STATE,struct,LINE>\#[^\n]* /* skip comments */
\%%[^\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';
Expand Down