diff options
Diffstat (limited to 'src/data/tikzparser.y')
-rw-r--r-- | src/data/tikzparser.y | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/data/tikzparser.y b/src/data/tikzparser.y index aa6ac76..a4db3dd 100644 --- a/src/data/tikzparser.y +++ b/src/data/tikzparser.y @@ -62,7 +62,7 @@ #include "graphelementproperty.h" #include "tikzlexer.h" -#import "tikzgraphassembler.h" +#import "tikzassembler.h" /* the assembler (used by this parser) is stored in the lexer state as "extra" data */ #define assembler yyget_extra(scanner) @@ -127,9 +127,20 @@ void yyerror(YYLTYPE *yylloc, void *scanner, const char *str) { %% + +tikz: tikzstyles | tikzpicture; + +tikzstyles: tikzstyles tikzstyle | ; +tikzstyle: "\\tikzstyle" DELIMITEDSTRING "=" "[" properties "]" + { + if (assembler->isProject()) { + assembler->project()->addStyle(QString($2), $5); + } + } + tikzpicture: "\\begin{tikzpicture}" optproperties tikzcmds "\\end{tikzpicture}" { - if ($2) { + if (assembler->isGraph() && $2) { assembler->graph()->setData($2); } }; |