mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-22 08:50:13 +02:00
#2032 Adding new statement to add choice shape in state diagrams
This commit is contained in:
@@ -56,8 +56,10 @@
|
||||
<INITIAL,struct>"state"\s+ { console.log('Starting STATE');this.pushState('STATE'); }
|
||||
<STATE>.*"<<fork>>" {this.popState();yytext=yytext.slice(0,-8).trim(); /*console.warn('Fork Fork: ',yytext);*/return 'FORK';}
|
||||
<STATE>.*"<<join>>" {this.popState();yytext=yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yytext);*/return 'JOIN';}
|
||||
<STATE>.*"<<choice>>" {this.popState();yytext=yytext.slice(0,-10).trim();/*console.warn('Fork Join: ',yytext);*/return 'CHOICE';}
|
||||
<STATE>.*"[[fork]]" {this.popState();yytext=yytext.slice(0,-8).trim();/*console.warn('Fork Fork: ',yytext);*/return 'FORK';}
|
||||
<STATE>.*"[[join]]" {this.popState();yytext=yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yytext);*/return 'JOIN';}
|
||||
<STATE>.*"[[choice]]" {this.popState();yytext=yytext.slice(0,-10).trim();/*console.warn('Fork Join: ',yytext);*/return 'CHOICE';}
|
||||
<STATE>["] { console.log('Starting STATE_STRING');this.begin("STATE_STRING");}
|
||||
<STATE>\s*"as"\s+ {this.popState();this.pushState('STATE_ID');return "AS";}
|
||||
<STATE_ID>[^\n\{]* {this.popState();/* console.log('STATE_ID', yytext);*/return "ID";}
|
||||
@@ -168,6 +170,9 @@ statement
|
||||
| JOIN {
|
||||
$$={ stmt: 'state', id: $1, type: 'join' }
|
||||
}
|
||||
| CHOICE {
|
||||
$$={ stmt: 'state', id: $1, type: 'choice' }
|
||||
}
|
||||
| CONCURRENT {
|
||||
$$={ stmt: 'state', id: yy.getDividerId(), type: 'divider' }
|
||||
}
|
||||
|
@@ -96,6 +96,11 @@ g.stateGroup line {
|
||||
stroke: ${options.nodeBorder};
|
||||
stroke-width: 1px;
|
||||
}
|
||||
.node polygon {
|
||||
fill: ${options.mainBkg};
|
||||
stroke: ${options.nodeBorder};
|
||||
stroke-width: 1px;
|
||||
}
|
||||
#statediagram-barbEnd {
|
||||
fill: ${options.lineColor};
|
||||
}
|
||||
|
Reference in New Issue
Block a user