Skip to content

Commit

Permalink
Merge pull request #63 from vijay40/master
Browse files Browse the repository at this point in the history
New grammar will allow statements ending without semicolon as disccused in Issue #38
  • Loading branch information
knsv committed Dec 15, 2014
2 parents 13a65db + 3279eda commit e32cbe3
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 43 deletions.
19 changes: 19 additions & 0 deletions src/diagrams/flowchart/parser/flow.jison
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,20 @@

expressions
: graphConfig statements EOF
| graphConfig statements
| graphConfig spaceListNewline statements EOF
{$$=$1;}
| graphConfig spaceListNewline statements
{$$=$1;}
;

graphConfig
: GRAPH SPACE DIR SEMI
{ yy.setDirection($3);$$ = $3;}
| GRAPH SPACE DIR NEWLINE
{ yy.setDirection($3);$$ = $3;}
| GRAPH SPACE DIR spaceList NEWLINE
{ yy.setDirection($3);$$ = $3;}
;

statements
Expand All @@ -152,11 +159,23 @@ statement
: commentStatement NEWLINE
{$$='Comment';}
| verticeStatement SEMI
| verticeStatement NEWLINE
| verticeStatement EOF
| styleStatement SEMI
| styleStatement NEWLINE
| styleStatement EOF
| linkStyleStatement SEMI
| linkStyleStatement NEWLINE
| linkStyleStatement EOF
| classDefStatement SEMI
| classDefStatement NEWLINE
| classDefStatement EOF
| classStatement SEMI
| classStatement NEWLINE
| classStatement EOF
| clickStatement SEMI
| clickStatement NEWLINE
| clickStatement EOF
;

verticeStatement:
Expand Down
Loading

0 comments on commit e32cbe3

Please sign in to comment.