Skip to content

Commit

Permalink
Merge pull request #66 from vijay40/master
Browse files Browse the repository at this point in the history
Allow special symbols for direction along with acronyms
  • Loading branch information
knsv committed Dec 17, 2014
2 parents 0a3e9ac + cebe033 commit 8fa47da
Show file tree
Hide file tree
Showing 3 changed files with 182 additions and 82 deletions.
19 changes: 14 additions & 5 deletions src/diagrams/flowchart/parser/flow.jison
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
"." return 'DOT';
"<" return 'TAGSTART';
">" return 'TAGEND';
"^" return 'UP'
"v" return 'DOWN'
\-\-[x] return 'ARROW_CROSS';
\-\-\> return 'ARROW_POINT';
\-\-[o] return 'ARROW_CIRCLE';
Expand Down Expand Up @@ -128,14 +130,21 @@ expressions
;

graphConfig
: GRAPH SPACE DIR SEMI
{ yy.setDirection($3);$$ = $3;}
| GRAPH SPACE DIR NEWLINE
{ yy.setDirection($3);$$ = $3;}
| GRAPH SPACE DIR spaceList NEWLINE
: GRAPH SPACE DIR FirstStmtSeperator
{ yy.setDirection($3);$$ = $3;}
| GRAPH SPACE TAGEND FirstStmtSeperator
{ yy.setDirection("LR");$$ = $3;}
| GRAPH SPACE TAGSTART FirstStmtSeperator
{ yy.setDirection("RL");$$ = $3;}
| GRAPH SPACE UP FirstStmtSeperator
{ yy.setDirection("BT");$$ = $3;}
| GRAPH SPACE DOWN FirstStmtSeperator
{ yy.setDirection("TB");$$ = $3;}
;

FirstStmtSeperator
: SEMI | NEWLINE | spaceList NEWLINE ;

statements
: statement spaceListNewline statements
| statement statements
Expand Down
Loading

0 comments on commit 8fa47da

Please sign in to comment.