From 0d9804f108fa0610f774446fb8e69ab26dfeb374 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Sat, 7 Jan 2017 00:23:39 +0100 Subject: [PATCH] Don't allow global properties, need to be in a * { } --- lexer/theme-lexer.l | 20 ++++++++++---------- lexer/theme-parser.y | 17 ++--------------- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/lexer/theme-lexer.l b/lexer/theme-lexer.l index 0df89107..5a946cae 100644 --- a/lexer/theme-lexer.l +++ b/lexer/theme-lexer.l @@ -237,43 +237,43 @@ if ( queue == NULL ){ } {CENTER} { - yylval->sval = WL_CENTER; + yylval->ival = WL_CENTER; return T_POSITION; } {EAST} { - yylval->sval = WL_EAST; + yylval->ival = WL_EAST; return T_POSITION; } {WEST} { - yylval->sval = WL_WEST; + yylval->ival = WL_WEST; return T_POSITION; } {SOUTH}{EAST} { - yylval->sval = WL_SOUTH_EAST; + yylval->ival = WL_SOUTH_EAST; return T_POSITION; } {SOUTH}{WEST} { - yylval->sval = WL_SOUTH_WEST; + yylval->ival = WL_SOUTH_WEST; return T_POSITION; } {SOUTH} { - yylval->sval = WL_SOUTH; + yylval->ival = WL_SOUTH; return T_POSITION; } {NORTH}{EAST} { - yylval->sval = WL_NORTH_EAST; + yylval->ival = WL_NORTH_EAST; return T_POSITION; } {NORTH}{WEST} { - yylval->sval = WL_NORTH_WEST; + yylval->ival = WL_NORTH_WEST; return T_POSITION; } {NORTH} { - yylval->sval = WL_NORTH; + yylval->ival = WL_NORTH; return T_POSITION; } NORTH { - yylval->sval = WL_NORTH; + yylval->ival = WL_NORTH; return T_POSITION; } <> { diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y index 4bf811df..d0f52f50 100644 --- a/lexer/theme-parser.y +++ b/lexer/theme-parser.y @@ -14,7 +14,6 @@ #include -#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 T_DOUBLE %token T_STRING %token N_STRING -%token T_POSITION; +%token T_POSITION; %token NAME_ELEMENT %token T_BOOLEAN %token T_COLOR @@ -58,23 +57,14 @@ int yylex (YYSTYPE *, YYLTYPE *); %type entry %type pvalue %type entries -%type start %type name_path %type property %type property_list %type 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); } ;