diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/Edge.m | 1 | ||||
-rw-r--r-- | src/common/RegularPolyShape.m | 1 | ||||
-rw-r--r-- | src/common/tikzlexer.lm | 2 | ||||
-rw-r--r-- | src/common/tikzparser.ym | 8 | ||||
-rw-r--r-- | src/common/util.h | 4 |
5 files changed, 10 insertions, 6 deletions
diff --git a/src/common/Edge.m b/src/common/Edge.m index 9ecfebc..c89be6d 100644 --- a/src/common/Edge.m +++ b/src/common/Edge.m @@ -24,7 +24,6 @@ #import "Edge.h" #import "util.h" - @implementation Edge - (id)init { diff --git a/src/common/RegularPolyShape.m b/src/common/RegularPolyShape.m index a369ae1..cd5858c 100644 --- a/src/common/RegularPolyShape.m +++ b/src/common/RegularPolyShape.m @@ -24,6 +24,7 @@ #import "RegularPolyShape.h" #import "Node.h" #import "Edge.h" +#import "util.h" @implementation RegularPolyShape diff --git a/src/common/tikzlexer.lm b/src/common/tikzlexer.lm index ef1cf8e..4fe39d1 100644 --- a/src/common/tikzlexer.lm +++ b/src/common/tikzlexer.lm @@ -67,7 +67,7 @@ at return AT; \\?[a-zA-Z<>\-\']+ { //' yylval.nsstr=[NSString stringWithUTF8String:yytext]; - return WORD; + return LWORD; } diff --git a/src/common/tikzparser.ym b/src/common/tikzparser.ym index fe8e1d9..e55a881 100644 --- a/src/common/tikzparser.ym +++ b/src/common/tikzparser.ym @@ -60,7 +60,7 @@ extern void yyerror(const char *str); %token AT %token REALNUMBER %token NATURALNUMBER -%token WORD +%token LWORD %token QUOTEDSTRING %token DELIMITEDSTRING @@ -113,7 +113,7 @@ propsyms: }; propsym: - WORD { $$ = $<nsstr>1; } + LWORD { $$ = $<nsstr>1; } | number { $$ = $<nsstr>1; }; @@ -138,7 +138,7 @@ nodelabel: optanchor: | ANCHORCENTER; nodename: LEFTPARENTHESIS nodeid optanchor RIGHTPARENTHESIS { $$ = $<nsstr>2; }; -nodeid: WORD { $$ = $<nsstr>1; } | NATURALNUMBER { $$ = $<nsstr>1; }; +nodeid: LWORD { $$ = $<nsstr>1; } | NATURALNUMBER { $$ = $<nsstr>1; }; coords: LEFTPARENTHESIS number COMMA number RIGHTPARENTHESIS @@ -166,7 +166,7 @@ optedgenode: } bbox_ignoreprops: - | LEFTBRACKET WORD WORD WORD WORD RIGHTBRACKET; + | LEFTBRACKET LWORD LWORD LWORD LWORD RIGHTBRACKET; boundingbox: PATH bbox_ignoreprops coords RECTANGLE coords SEMICOLON diff --git a/src/common/util.h b/src/common/util.h index 652278e..74871dc 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -22,6 +22,10 @@ #include <math.h> +#ifndef M_PI +#define M_PI 3.141592654 +#endif + /*! @brief Compute a bounding rectangle for two given points. @param p1 a point. |