summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Merry <alex.merry@cs.ox.ac.uk>2013-02-04 17:24:43 +0000
committerAlex Merry <alex.merry@cs.ox.ac.uk>2013-02-04 17:24:43 +0000
commit4a8841380e52cbad171997a1b70e45502f5e05e8 (patch)
tree7057da6de525cec383e86c50789dd5ba25020b7f
parentbd5255daf24b860f44f9d1654f5753017abec2f5 (diff)
Fix property list parsing
QUOTEDSTRING (double quotes) is just not a thing in tikz. Also, allow keys to be {-quoted as well as values.
-rw-r--r--tikzit/src/common/tikzlexer.lm6
-rw-r--r--tikzit/src/common/tikzparser.ym9
2 files changed, 4 insertions, 11 deletions
diff --git a/tikzit/src/common/tikzlexer.lm b/tikzit/src/common/tikzlexer.lm
index 26cddd9..f0b6546 100644
--- a/tikzit/src/common/tikzlexer.lm
+++ b/tikzit/src/common/tikzlexer.lm
@@ -85,12 +85,6 @@ at { tokenpos += yyleng; return AT; }
}
-\"[^\"]*\" /* " */ {
- tokenpos += yyleng;
- yylval.nsstr=[NSString stringWithUTF8String:yytext];
- return QUOTEDSTRING;
-}
-
\{ {
NSMutableString *buf = [NSMutableString string];
unsigned int brace_depth = 1;
diff --git a/tikzit/src/common/tikzparser.ym b/tikzit/src/common/tikzparser.ym
index 487cfd4..26f0e0d 100644
--- a/tikzit/src/common/tikzparser.ym
+++ b/tikzit/src/common/tikzparser.ym
@@ -1,4 +1,4 @@
-%expect 6
+// %expect 3
%{
//
@@ -66,7 +66,6 @@ extern void yyerror(const char *str);
%token REALNUMBER
%token NATURALNUMBER
%token LWORD
-%token QUOTEDSTRING
%token DELIMITEDSTRING
%type<nsstr> nodename
@@ -94,14 +93,14 @@ properties: property extraproperties;
extraproperties: COMMA property extraproperties | property extraproperties | ;
property:
- propsyms EQUALS val
+ val EQUALS val
{
TikzGraphAssembler *a = [TikzGraphAssembler currentAssembler];
GraphElementProperty *p = [[GraphElementProperty alloc] initWithPropertyValue:$<nsstr>3 forKey:$<nsstr>1];
[[a data] addObject:p];
[p release];
}
- | propsyms
+ | val
{
TikzGraphAssembler *a = [TikzGraphAssembler currentAssembler];
GraphElementProperty *p = [[GraphElementProperty alloc] initWithAtomName:$<nsstr>1];
@@ -109,7 +108,7 @@ property:
[p release];
};
-val: propsyms { $$ = $<nsstr>1; } | QUOTEDSTRING { $$ = $<nsstr>1; } | DELIMITEDSTRING { $$ = $<nsstr>1; };
+val: propsyms { $$ = $<nsstr>1; } | DELIMITEDSTRING { $$ = $<nsstr>1; };
propsyms:
propsym { $$ = $<nsstr>1; }
| propsyms propsym