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

Allow special symbols for direction along with acronyms #66

Merged
merged 1 commit into from
Dec 17, 2014
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
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