summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Merry <dev@randomguy3.me.uk>2013-03-22 19:43:54 +0000
committerAlex Merry <dev@randomguy3.me.uk>2013-03-22 19:43:54 +0000
commita38c9405313dceae0f62c965fb99ae69b06b0548 (patch)
treea1de7c17c4089512b6d1a069fdf4979a38b64273
parent3fb7711dd09975c83de5995d5247cbdd8d150def (diff)
Anchors can have spaces in them
Parse anchors with spaces, like (3.north west).
-rw-r--r--tikzit/src/common/tikzparser.ym9
1 files changed, 8 insertions, 1 deletions
diff --git a/tikzit/src/common/tikzparser.ym b/tikzit/src/common/tikzparser.ym
index 9f03745..2277e23 100644
--- a/tikzit/src/common/tikzparser.ym
+++ b/tikzit/src/common/tikzparser.ym
@@ -70,6 +70,7 @@ extern void yyerror(const char *str);
%type<nsstr> nodename
%type<nsstr> anchor
+%type<nsstr> anchorsym
%type<nsstr> optanchor
%type<nsstr> nodeid
%type<pt> coords
@@ -147,7 +148,13 @@ nodelabel:
[n setLabel:$<nsstr>1];
}
-anchor: LWORD { $$ = $<nsstr>1; } | NATURALNUMBER { $$ = $<nsstr>1; };
+anchor: anchorsym { $$ = $<nsstr>1; }
+ | anchor anchorsym
+ {
+ NSString *s = [$<nsstr>1 stringByAppendingFormat:@" %@", $<nsstr>2];
+ $$ = s;
+ };
+anchorsym: LWORD { $$ = $<nsstr>1; } | NATURALNUMBER { $$ = $<nsstr>1; };
optanchor: { $$ = @""; } | FULLSTOP anchor { $$ = $<nsstr>2; };