diff options
author | Dave Davenport <qball@blame.services> | 2021-06-09 02:03:29 +0200 |
---|---|---|
committer | Dave Davenport <qball@blame.services> | 2021-06-09 02:03:29 +0200 |
commit | eb602b34fae476498b1453334f765954fd74c5b6 (patch) | |
tree | b47df3f4972638151335aaa4b0523b52eb8014d9 /lexer | |
parent | 3950204760a5887b4af73a2f731d59d59efbab1a (diff) |
[DSL] Move theme reset into the grammer parser and out of lexer.
Diffstat (limited to 'lexer')
-rw-r--r-- | lexer/theme-lexer.l | 3 | ||||
-rw-r--r-- | lexer/theme-parser.y | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lexer/theme-lexer.l b/lexer/theme-lexer.l index 48d043a8..74d203b3 100644 --- a/lexer/theme-lexer.l +++ b/lexer/theme-lexer.l @@ -339,9 +339,10 @@ if ( queue == NULL ){ BEGIN(INCLUDE); } <INITIAL>{THEME} { - rofi_theme_reset(); + //rofi_theme_reset(); g_queue_push_head ( queue, GINT_TO_POINTER (YY_START) ); BEGIN(INCLUDE); + return T_RESET_THEME; } /** Skip all whitespace */ <INCLUDE>{WHITESPACE} {} diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y index 8efcdc58..5e1f49c4 100644 --- a/lexer/theme-parser.y +++ b/lexer/theme-parser.y @@ -237,6 +237,7 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b) %token T_WHITESPACE "White space" %token T_PDEFAULTS "Default settings section ( '* { ... }')" %token T_CONFIGURATION "Configuration block" +%token T_RESET_THEME "Reset Theme" %token T_COLOR_TRANSPARENT "Transparent" @@ -322,6 +323,12 @@ 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 ) ) { |