From 1cc98f5a48924d750fbef7ea6b05a1ba49c28589 Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 5 Nov 2012 07:36:16 +0100 Subject: xserver mesa xkbcomp git update 5 nov 2012 xserver: a194630f7f7b287cb4ea4a459df0745f4c0d4c1a mesa: ccbfe3dde94cd50a4e6468cfeabf95c79c9d8072 xkbcomp: a68c5b7b29eb1433b1be73b50c4248e10eab8e64 --- xkbcomp/parseutils.c | 2 +- xkbcomp/parseutils.h | 3 +-- xkbcomp/xkbcomp.c | 2 +- xkbcomp/xkbparse.y | 10 +++++++++- xkbcomp/xkbscan.c | 10 +++++++++- 5 files changed, 21 insertions(+), 6 deletions(-) (limited to 'xkbcomp') diff --git a/xkbcomp/parseutils.c b/xkbcomp/parseutils.c index 253cd9dae..a1b6e9e2f 100644 --- a/xkbcomp/parseutils.c +++ b/xkbcomp/parseutils.c @@ -797,7 +797,7 @@ XKBParseFile(FILE * file, XkbFile ** pRtrn) { if (file) { - yyin = file; + scan_set_file(file); rtrnValue = NULL; if (yyparse() == 0) { diff --git a/xkbcomp/parseutils.h b/xkbcomp/parseutils.h index 8b8a6c11d..8c381d408 100644 --- a/xkbcomp/parseutils.h +++ b/xkbcomp/parseutils.h @@ -198,11 +198,10 @@ extern int yywrap(void); extern int yylex(void); extern int yyparse(void); +extern void scan_set_file(FILE *file); extern int setScanState(char * /* file */ , int /* line */ ); -extern FILE *yyin; - #endif /* XKBPARSE_H */ diff --git a/xkbcomp/xkbcomp.c b/xkbcomp/xkbcomp.c index 063ae8741..116bcfa4b 100644 --- a/xkbcomp/xkbcomp.c +++ b/xkbcomp/xkbcomp.c @@ -883,7 +883,7 @@ main(int argc, char *argv[]) XkbFileInfo result; Status status; - yyin = stdin; + scan_set_file(stdin); uSetEntryFile(NullString); uSetDebugFile(NullString); uSetErrorFile(NullString); diff --git a/xkbcomp/xkbparse.y b/xkbcomp/xkbparse.y index 51b3bf7e9..d816bee6e 100644 --- a/xkbcomp/xkbparse.y +++ b/xkbcomp/xkbparse.y @@ -141,7 +141,7 @@ unsigned int parseDebug; %type KeyName MapName OptMapName KeySym %type FieldSpec Ident Element String %type DeclList Decl -%type OptExprList ExprList Expr Term Lhs Terminal ArrayInit +%type OptExprList ExprList Expr Term Lhs Terminal ArrayInit KeySyms %type OptKeySymList KeySymList Action ActionList Coord CoordList %type VarDecl VarDeclList SymbolsBody SymbolsVarDecl %type VModDecl VModDefList VModDef @@ -717,8 +717,12 @@ OptKeySymList : KeySymList { $$= $1; } KeySymList : KeySymList COMMA KeySym { $$= AppendKeysymList($1,$3); } + | KeySymList COMMA KeySyms + { $$= AppendKeysymList($1,strdup("NoSymbol")); } | KeySym { $$= CreateKeysymList($1); } + | KeySyms + { $$= CreateKeysymList(strdup("NoSymbol")); } ; KeySym : IDENT { $$= strdup(scanBuf); } @@ -730,6 +734,10 @@ KeySym : IDENT { $$= strdup(scanBuf); } } ; +KeySyms : OBRACE KeySymList CBRACE + { $$= $2; } + ; + SignedNumber : MINUS Number { $$= -$2; } | Number { $$= $1; } ; diff --git a/xkbcomp/xkbscan.c b/xkbcomp/xkbscan.c index 22a034fd9..a05d56988 100644 --- a/xkbcomp/xkbscan.c +++ b/xkbcomp/xkbscan.c @@ -37,7 +37,7 @@ unsigned int scanDebug; -FILE *yyin = NULL; +static FILE *yyin; static char scanFileBuf[1024] = {0}; char *scanFile = scanFileBuf; @@ -269,6 +269,14 @@ tokText(int tok) } #endif +void +scan_set_file(FILE *file) +{ + readBufLen = 0; + readBufPos = 0; + yyin = file; +} + static int scanchar(void) { -- cgit v1.2.3