diff options
Diffstat (limited to 'lexer')
-rw-r--r-- | lexer/theme-lexer.l | 8 | ||||
-rw-r--r-- | lexer/theme-parser.y | 19 |
2 files changed, 26 insertions, 1 deletions
diff --git a/lexer/theme-lexer.l b/lexer/theme-lexer.l index 6a291a00..394afa98 100644 --- a/lexer/theme-lexer.l +++ b/lexer/theme-lexer.l @@ -474,6 +474,14 @@ if ( queue == NULL ){ return T_LINK; } +<SECTION>"\{" { + // Double to fit in scheme. + g_queue_push_head ( queue, GINT_TO_POINTER (YY_START) ); + g_queue_push_head ( queue, GINT_TO_POINTER (SECTION) ); + BEGIN(SECTION); + return T_BOPEN; +} + <PROPERTIES,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT>{EM} { return T_UNIT_EM; } <PROPERTIES,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT>{CH} { return T_UNIT_CH; } <PROPERTIES,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT,MEDIA_CONTENT>{PX} { return T_UNIT_PX; } diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y index 94bf3cd3..a7031161 100644 --- a/lexer/theme-parser.y +++ b/lexer/theme-parser.y @@ -318,7 +318,12 @@ t_main ; t_configuration_list: - %empty {} + %empty { + if ( rofi_configuration == NULL ) { + rofi_configuration = g_slice_new0 ( ThemeWidget ); + rofi_configuration->name = g_strdup ( "Configuration" ); + } +} | t_configuration_list T_CONFIGURATION T_BOPEN t_config_property_list_optional T_BCLOSE {}; @@ -429,6 +434,18 @@ t_config_property // We don't keep any reference to this after this point, so the property can be free'ed. rofi_theme_property_free ( $1 ); } +| t_property_name T_BOPEN t_property_list_optional T_BCLOSE +{ + ThemeWidget *widget = rofi_configuration; + widget = rofi_theme_find_or_create_name ( widget, $1 ); + widget->set = TRUE; + rofi_theme_widget_add_properties ( widget, $3); + if ( $3 ) { + g_hash_table_destroy ( $3 ); + } + g_free ( $1 ); +} +; /** * properties |