Don't allow global properties, need to be in a * { }

This commit is contained in:
Dave Davenport 2017-01-07 00:23:39 +01:00
parent e388aa95c7
commit 0d9804f108
2 changed files with 12 additions and 25 deletions

View file

@ -237,43 +237,43 @@ if ( queue == NULL ){
}
<PROPERTIES>{CENTER} {
yylval->sval = WL_CENTER;
yylval->ival = WL_CENTER;
return T_POSITION;
}
<PROPERTIES>{EAST} {
yylval->sval = WL_EAST;
yylval->ival = WL_EAST;
return T_POSITION;
}
<PROPERTIES>{WEST} {
yylval->sval = WL_WEST;
yylval->ival = WL_WEST;
return T_POSITION;
}
<PROPERTIES>{SOUTH}{EAST} {
yylval->sval = WL_SOUTH_EAST;
yylval->ival = WL_SOUTH_EAST;
return T_POSITION;
}
<PROPERTIES>{SOUTH}{WEST} {
yylval->sval = WL_SOUTH_WEST;
yylval->ival = WL_SOUTH_WEST;
return T_POSITION;
}
<PROPERTIES>{SOUTH} {
yylval->sval = WL_SOUTH;
yylval->ival = WL_SOUTH;
return T_POSITION;
}
<PROPERTIES>{NORTH}{EAST} {
yylval->sval = WL_NORTH_EAST;
yylval->ival = WL_NORTH_EAST;
return T_POSITION;
}
<PROPERTIES>{NORTH}{WEST} {
yylval->sval = WL_NORTH_WEST;
yylval->ival = WL_NORTH_WEST;
return T_POSITION;
}
<PROPERTIES>{NORTH} {
yylval->sval = WL_NORTH;
yylval->ival = WL_NORTH;
return T_POSITION;
}
<PROPERTIES>NORTH {
yylval->sval = WL_NORTH;
yylval->ival = WL_NORTH;
return T_POSITION;
}
<INITIAL><<EOF>> {

View file

@ -14,7 +14,6 @@
#include <glib.h>
#include "theme.h"
#include "lexer/theme-parser.h"
ThemeWidget *rofi_theme = NULL;
void yyerror(YYLTYPE *yylloc, const char* s);
@ -38,7 +37,7 @@ int yylex (YYSTYPE *, YYLTYPE *);
%token <fval> T_DOUBLE
%token <sval> T_STRING
%token <sval> N_STRING
%token <sval> T_POSITION;
%token <ival> T_POSITION;
%token <sval> NAME_ELEMENT
%token <bval> T_BOOLEAN
%token <colorval> T_COLOR
@ -58,23 +57,14 @@ int yylex (YYSTYPE *, YYLTYPE *);
%type <sval> entry
%type <sval> pvalue
%type <theme> entries
%type <theme> start
%type <name_path> name_path
%type <property> property
%type <property_list> property_list
%type <property_list> optional_properties
%start start
%start entries
%%
start:
entries
optional_properties
{
$$ = $1;
rofi_theme_widget_add_properties ( $$, $2 );
}
;
entries:
%empty {
// There is always a base widget.
@ -82,10 +72,7 @@ entries:
rofi_theme->name = g_strdup ( "Root" );
}
| entries
optional_properties
entry {
$$ = $1;
rofi_theme_widget_add_properties ( $$, $2);
}
;