1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-18 13:54:36 -05:00

[DSL] Move theme reset into the grammer parser and out of lexer.

This commit is contained in:
Dave Davenport 2021-06-09 02:03:29 +02:00
parent 3950204760
commit eb602b34fa
2 changed files with 9 additions and 1 deletions

View file

@ -339,9 +339,10 @@ if ( queue == NULL ){
BEGIN(INCLUDE); BEGIN(INCLUDE);
} }
<INITIAL>{THEME} { <INITIAL>{THEME} {
rofi_theme_reset(); //rofi_theme_reset();
g_queue_push_head ( queue, GINT_TO_POINTER (YY_START) ); g_queue_push_head ( queue, GINT_TO_POINTER (YY_START) );
BEGIN(INCLUDE); BEGIN(INCLUDE);
return T_RESET_THEME;
} }
/** Skip all whitespace */ /** Skip all whitespace */
<INCLUDE>{WHITESPACE} {} <INCLUDE>{WHITESPACE} {}

View file

@ -237,6 +237,7 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b)
%token T_WHITESPACE "White space" %token T_WHITESPACE "White space"
%token T_PDEFAULTS "Default settings section ( '* { ... }')" %token T_PDEFAULTS "Default settings section ( '* { ... }')"
%token T_CONFIGURATION "Configuration block" %token T_CONFIGURATION "Configuration block"
%token T_RESET_THEME "Reset Theme"
%token T_COLOR_TRANSPARENT "Transparent" %token T_COLOR_TRANSPARENT "Transparent"
@ -322,6 +323,12 @@ t_entry_list:
%empty { %empty {
$$ = g_slice_new0 ( ThemeWidget ); $$ = 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 | 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 ) ) { for ( GList *liter = g_list_first ( $3); liter; liter = g_list_next ( liter ) ) {