From 48e69ae28bb8b40d5a2281f0ea26141220b3bf5e Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sat, 21 Jan 2017 11:18:41 +0100 Subject: added testing --- tikzit/src/data/tikzlexer.l | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'tikzit/src/data/tikzlexer.l') diff --git a/tikzit/src/data/tikzlexer.l b/tikzit/src/data/tikzlexer.l index 0a5ca6f..adb6fef 100644 --- a/tikzit/src/data/tikzlexer.l +++ b/tikzit/src/data/tikzlexer.l @@ -20,10 +20,10 @@ */ #include "tikzparserdefs.h" -#include "tikzparser.h" +#include "tikzparser.parser.hpp" + +#include -#include -#include #define YY_USER_ACTION \ yylloc->first_line = yylloc->last_line; \ @@ -80,12 +80,12 @@ to { return TO; } BEGIN(xcoord); } {FLOAT} { - yylval->pt.x=(float)strtod(yytext,NULL); + yylval->pt->setX(strtod(yytext,NULL)); BEGIN(ycoord); } , { } {FLOAT} { - yylval->pt.y=(float)strtod(yytext,NULL); + yylval->pt->setY(strtod(yytext,NULL)); } \) { BEGIN(INITIAL); @@ -103,7 +103,7 @@ to { return TO; } property names or values, but in practice this is unlikely and screws up our line counting */ [^=,\{\] \t\n]([^=,\{\]\n]*[^=,\{\] \t\n])? { - yylval->nsstr=[NSString stringWithUTF8String:yytext]; + yylval->qstr= new QString(yytext); return PROPSTRING; } \] { @@ -121,7 +121,7 @@ to { return TO; } /* we assume node names (and anchor names) never contain newlines */ [^\.\{\)\n]+ { - yylval->qstr=QString(yytext); + yylval->qstr = new QString(yytext); return REFSTRING; } \) { @@ -134,7 +134,7 @@ to { return TO; } unsigned int brace_depth = 1; unsigned int escape = 0; while (1) { - char c = input(yyscanner); + char c = yyinput(yyscanner); // eof reached before closing brace if (c == '\0' || c == EOF) { return UNCLOSED_DELIM_STR; @@ -157,8 +157,10 @@ to { return TO; } } buf << c; } + + - yylval->qstr = QString(buf.str()); + yylval->qstr = new QString(QString::fromStdString(buf.str())); return DELIMITEDSTRING; } -- cgit v1.2.3