Skip to content

Commit

Permalink
flow.jison is modified to include a single spaces between vertices an…
Browse files Browse the repository at this point in the history
…d link to improve readablity for issue #38. There should not be any space between vertex and its text and link and its text. flow.spec.js is modified to include three new tests for testing new graphs.
  • Loading branch information
vijay40 committed Dec 13, 2014
1 parent 3f3e23b commit d4451ef
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 31 deletions.
16 changes: 16 additions & 0 deletions src/diagrams/flowchart/parser/flow.jison
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,30 @@ verticeStatement:

vertex: alphaNum SQS text SQE
{$$ = $1;yy.addVertex($1,$3,'square');}
| alphaNum SQS text SQE SPACE
{$$ = $1;yy.addVertex($1,$3,'square');}
| alphaNum PS PS text PE PE
{$$ = $1;yy.addVertex($1,$4,'circle');}
| alphaNum PS PS text PE PE SPACE
{$$ = $1;yy.addVertex($1,$4,'circle');}
| alphaNum PS text PE
{$$ = $1;yy.addVertex($1,$3,'round');}
| alphaNum PS text PE SPACE
{$$ = $1;yy.addVertex($1,$3,'round');}
| alphaNum DIAMOND_START text DIAMOND_STOP
{$$ = $1;yy.addVertex($1,$3,'diamond');}
| alphaNum DIAMOND_START text DIAMOND_STOP SPACE
{$$ = $1;yy.addVertex($1,$3,'diamond');}
| alphaNum TAGEND text SQE
{$$ = $1;yy.addVertex($1,$3,'odd');}
| alphaNum TAGEND text SQE SPACE
{$$ = $1;yy.addVertex($1,$3,'odd');}
| alphaNum TAGSTART text TAGEND
{$$ = $1;yy.addVertex($1,$3,'diamond');}
| alphaNum
{$$ = $1;yy.addVertex($1);}
| alphaNum SPACE
{$$ = $1;yy.addVertex($1);}
;

alphaNum
Expand Down Expand Up @@ -218,9 +230,13 @@ alphaNumToken
;

link: linkStatement arrowText
{$1.text = $2;$$ = $1;}
| linkStatement arrowText SPACE
{$1.text = $2;$$ = $1;}
| linkStatement
{$$ = $1;}
| linkStatement SPACE
{$$ = $1;}
;

linkStatement: ARROW_POINT
Expand Down
Loading

0 comments on commit d4451ef

Please sign in to comment.