From 96bb49b438646b54f1a667a66a9bb1b2c27d7b4f Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Tue, 29 May 2012 16:10:59 +0100 Subject: Fix handling for property values containing = or , Equals and comma are special values that need to be quoted with curly braces. This both parses and generates such quoted strings, although they are only generated when necessary. --- tikzit/src/common/tikzlexer.lm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tikzit/src/common/tikzlexer.lm') diff --git a/tikzit/src/common/tikzlexer.lm b/tikzit/src/common/tikzlexer.lm index c6deb3f..9418d83 100644 --- a/tikzit/src/common/tikzlexer.lm +++ b/tikzit/src/common/tikzlexer.lm @@ -77,19 +77,19 @@ at return AT; } \{ { - NSMutableString *buf = [NSMutableString stringWithString:@"{"]; + NSMutableString *buf = [NSMutableString string]; unsigned int brace_depth = 1; while (1) { char c = input(); // eof reached before closing brace if (c == '\0' || c == EOF) yyterminate(); - - [buf appendFormat:@"%c", c]; + if (c == '{') brace_depth++; else if (c == '}') { brace_depth--; if (brace_depth == 0) break; } + [buf appendFormat:@"%c", c]; } NSString *s = [buf copy]; -- cgit v1.2.3