mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-23 09:20:03 +02:00
#945 Support for forks and joins
This commit is contained in:
@@ -43,8 +43,10 @@
|
||||
<SCALE>\s+"width" {this.popState();}
|
||||
|
||||
<INITIAL,struct>"state"\s+ { this.pushState('STATE'); }
|
||||
<STATE>.*"<<fork>>" {this.popState();console.log('Fork: ',yytext);return 'FORK';}
|
||||
<STATE>.*"<<join>>" {this.popState();console.log('Join: ',yytext);return 'JOIN';}
|
||||
<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>.*"[[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>["] this.begin("STATE_STRING");
|
||||
<STATE>"as"\s* {this.popState();this.pushState('STATE_ID');return "AS";}
|
||||
<STATE_ID>[^\n\{]* {this.popState();console.log('STATE_ID', yytext);return "ID";}
|
||||
@@ -135,8 +137,12 @@ statement
|
||||
//console.warn('Adding document for state with id ', $3, $4); yy.addDocument($3);
|
||||
$$={ stmt: 'state', id: $3, type: 'default', description: $1, doc: $5 }
|
||||
}
|
||||
| FORK
|
||||
| JOIN
|
||||
| FORK {
|
||||
$$={ stmt: 'state', id: $1, type: 'fork' }
|
||||
}
|
||||
| JOIN {
|
||||
$$={ stmt: 'state', id: $1, type: 'join' }
|
||||
}
|
||||
| CONCURRENT
|
||||
| note notePosition ID NOTE_TEXT
|
||||
{
|
||||
|
Reference in New Issue
Block a user