diff options
Diffstat (limited to 'tikzit/src/common/tikzlexer.lm')
-rw-r--r-- | tikzit/src/common/tikzlexer.lm | 6 |
1 files changed, 3 insertions, 3 deletions
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]; |