summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndriy Gapon <avg@icyb.net.ua>2006-10-29 02:59:53 +0300
committerDaniel Stone <daniels@endtroducing.fooishbar.org>2006-10-29 02:59:53 +0300
commitd920bbadb94684287f70e50ded2a35d65186c188 (patch)
treea3f2a152be18b59b1223159a2f60b999fe52424c
parent0e8fd676de161ba52bb4544f8641be756bc580a1 (diff)
parser: accept negative numbers in geometry co-ordinates (bug #8763)
Accept negative co-ordinates for geometry, per the spec.
-rw-r--r--xkbparse.y8
1 files changed, 6 insertions, 2 deletions
diff --git a/xkbparse.y b/xkbparse.y
index b50b9e8..662325b 100644
--- a/xkbparse.y
+++ b/xkbparse.y
@@ -136,7 +136,7 @@
DoodadDef *doodad;
XkbFile *file;
}
-%type <ival> Number Integer Float
+%type <ival> Number Integer Float SignedNumber
%type <uval> XkbCompositeType FileType MergeMode OptMergeMode KeySym
%type <uval> DoodadType Flag Flags OptFlags
%type <str> KeyName MapName OptMapName
@@ -534,7 +534,7 @@ CoordList : CoordList COMMA Coord
{ $$= $1; }
;
-Coord : OBRACKET Number COMMA Number CBRACKET
+Coord : OBRACKET SignedNumber COMMA SignedNumber CBRACKET
{
ExprDef *expr;
expr= ExprCreate(ExprCoord,TypeUnknown);
@@ -746,6 +746,10 @@ KeySym : IDENT
}
;
+SignedNumber : MINUS Number { $$= -$2; }
+ | Number { $$= $1; }
+ ;
+
Number : FLOAT { $$= scanInt; }
| INTEGER { $$= scanInt*XkbGeomPtsPerMM; }
;