1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2025-07-31 21:59:25 -04:00

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} { <PROPERTIES>{CENTER} {
yylval->sval = WL_CENTER; yylval->ival = WL_CENTER;
return T_POSITION; return T_POSITION;
} }
<PROPERTIES>{EAST} { <PROPERTIES>{EAST} {
yylval->sval = WL_EAST; yylval->ival = WL_EAST;
return T_POSITION; return T_POSITION;
} }
<PROPERTIES>{WEST} { <PROPERTIES>{WEST} {
yylval->sval = WL_WEST; yylval->ival = WL_WEST;
return T_POSITION; return T_POSITION;
} }
<PROPERTIES>{SOUTH}{EAST} { <PROPERTIES>{SOUTH}{EAST} {
yylval->sval = WL_SOUTH_EAST; yylval->ival = WL_SOUTH_EAST;
return T_POSITION; return T_POSITION;
} }
<PROPERTIES>{SOUTH}{WEST} { <PROPERTIES>{SOUTH}{WEST} {
yylval->sval = WL_SOUTH_WEST; yylval->ival = WL_SOUTH_WEST;
return T_POSITION; return T_POSITION;
} }
<PROPERTIES>{SOUTH} { <PROPERTIES>{SOUTH} {
yylval->sval = WL_SOUTH; yylval->ival = WL_SOUTH;
return T_POSITION; return T_POSITION;
} }
<PROPERTIES>{NORTH}{EAST} { <PROPERTIES>{NORTH}{EAST} {
yylval->sval = WL_NORTH_EAST; yylval->ival = WL_NORTH_EAST;
return T_POSITION; return T_POSITION;
} }
<PROPERTIES>{NORTH}{WEST} { <PROPERTIES>{NORTH}{WEST} {
yylval->sval = WL_NORTH_WEST; yylval->ival = WL_NORTH_WEST;
return T_POSITION; return T_POSITION;
} }
<PROPERTIES>{NORTH} { <PROPERTIES>{NORTH} {
yylval->sval = WL_NORTH; yylval->ival = WL_NORTH;
return T_POSITION; return T_POSITION;
} }
<PROPERTIES>NORTH { <PROPERTIES>NORTH {
yylval->sval = WL_NORTH; yylval->ival = WL_NORTH;
return T_POSITION; return T_POSITION;
} }
<INITIAL><<EOF>> { <INITIAL><<EOF>> {

View file

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