diff --git a/lexer/theme-lexer.l b/lexer/theme-lexer.l index 0b1c03de..f28e655e 100644 --- a/lexer/theme-lexer.l +++ b/lexer/theme-lexer.l @@ -362,7 +362,6 @@ if ( queue == NULL ) { BEGIN(INCLUDE); } {THEME} { - //rofi_theme_reset(); g_queue_push_head ( queue, GINT_TO_POINTER (YY_START) ); BEGIN(INCLUDE); return T_RESET_THEME; diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y index 6245c243..2f6d1213 100644 --- a/lexer/theme-parser.y +++ b/lexer/theme-parser.y @@ -30,7 +30,6 @@ %locations %glr-parser %skeleton "glr.c" -%debug %parse-param {const char *what} %code requires { #include "theme.h" @@ -267,6 +266,7 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b ) %token T_MEDIA_SEP "-" %type t_entry_list +%type t_entry_list_included %type t_entry_name_path %type t_entry_name_path_selectors %type t_color_list @@ -307,13 +307,12 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b ) * First have the configuration blocks, then the theme. */ t_main -: t_configuration_list t_entry_list { +: t_configuration_list t_entry_list_included { // Dummy at this point. if ( rofi_theme == NULL ) { rofi_theme_reset(); } - rofi_theme_widget_add_properties ( rofi_theme, $2->properties ); for ( unsigned int i = 0; i < $2->num_widgets; i++ ) { ThemeWidget *d = $2->widgets[i]; @@ -340,16 +339,21 @@ t_name_prefix_optional | %empty {} ; +t_entry_list_included: +t_entry_list { + $$ =$1; +} +| t_entry_list_included T_RESET_THEME t_entry_list { + rofi_theme_reset(); + rofi_theme_free($1); + $$ = $3; +} + + t_entry_list: %empty { $$ = g_slice_new0 ( ThemeWidget ); } -| t_entry_list T_RESET_THEME { - rofi_theme_reset(); - rofi_theme_free($1); - $$ = g_slice_new0 ( ThemeWidget ); -} - | t_entry_list t_name_prefix_optional t_entry_name_path_selectors T_BOPEN t_property_list_optional T_BCLOSE { for ( GList *liter = g_list_first ( $3); liter; liter = g_list_next ( liter ) ) {