diff --git a/src/xkbcomp/parser.y b/src/xkbcomp/parser.y index 80420aae..95d1327d 100644 --- a/src/xkbcomp/parser.y +++ b/src/xkbcomp/parser.y @@ -210,7 +210,7 @@ resolve_keysym(struct parser_param *param, const char *name, xkb_keysym_t *sym_r %type MultiKeySymList KeySymList MultiActionList ActionList Action Coord CoordList %type OptExprList ExprList %type VarDecl SymbolsVarDecl -%type VarDeclList SymbolsBody +%type VarDeclList SymbolsBody OptSymbolsBody %type VModDef %type VModDefList VModDecl %type InterpretDecl InterpretMatch @@ -458,11 +458,15 @@ KeyTypeDecl : TYPE String OBRACE ; SymbolsDecl : KEY KEYNAME OBRACE - SymbolsBody + OptSymbolsBody CBRACE SEMI { $$ = SymbolsCreate($2, $4.head); } ; +OptSymbolsBody : SymbolsBody { $$ = $1; } + | { $$.head = $$.last = NULL; } + ; + SymbolsBody : SymbolsBody COMMA SymbolsVarDecl { $$.head = $1.head; $$.last->common.next = &$3->common; $$.last = $3; } | SymbolsVarDecl