summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tikzit/src/common/tikzlexer.lm10
1 files changed, 8 insertions, 2 deletions
diff --git a/tikzit/src/common/tikzlexer.lm b/tikzit/src/common/tikzlexer.lm
index 816d91c..26cddd9 100644
--- a/tikzit/src/common/tikzlexer.lm
+++ b/tikzit/src/common/tikzlexer.lm
@@ -94,13 +94,19 @@ at { tokenpos += yyleng; return AT; }
\{ {
NSMutableString *buf = [NSMutableString string];
unsigned int brace_depth = 1;
+ unsigned int escape = 0;
while (1) {
char c = input();
// eof reached before closing brace
if (c == '\0' || c == EOF) yyterminate();
- if (c == '{') brace_depth++;
- else if (c == '}') {
+ if (escape) {
+ escape = 0;
+ } else if (c == '\\') {
+ escape = 1;
+ } else if (c == '{') {
+ brace_depth++;
+ } else if (c == '}') {
brace_depth--;
if (brace_depth == 0) break;
}