From da45cb6f70f72d804e0a9ed58562e94455672359 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Fri, 20 Jan 2017 12:30:31 +0100 Subject: parsing --- tikzit/src/data/tikzlexer.lpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tikzit/src/data/tikzlexer.lpp') diff --git a/tikzit/src/data/tikzlexer.lpp b/tikzit/src/data/tikzlexer.lpp index 19c4d85..7040d52 100644 --- a/tikzit/src/data/tikzlexer.lpp +++ b/tikzit/src/data/tikzlexer.lpp @@ -23,6 +23,7 @@ #include "tikzparser.h" #include +#include #define YY_USER_ACTION \ yylloc->first_line = yylloc->last_line; \ @@ -120,7 +121,7 @@ to { return TO; } /* we assume node names (and anchor names) never contain newlines */ [^\.\{\)\n]+ { - yylval->nsstr=[NSString stringWithUTF8String:yytext]; + yylval->qstr=QString(yytext); return REFSTRING; } \) { @@ -129,7 +130,7 @@ to { return TO; } } \{ { - NSMutableString *buf = [NSMutableString string]; + std::stringstream buf; unsigned int brace_depth = 1; unsigned int escape = 0; while (1) { @@ -154,10 +155,10 @@ to { return TO; } yylloc->last_line += 1; yylloc->last_column = 0; } - [buf appendFormat:@"%c", c]; + buf << c; } - yylval->nsstr = buf; + yylval->qstr = QString(buf.str()); return DELIMITEDSTRING; } -- cgit v1.2.3