diff --git a/lexer/theme-lexer.l b/lexer/theme-lexer.l index 9af32541..0df89107 100644 --- a/lexer/theme-lexer.l +++ b/lexer/theme-lexer.l @@ -31,6 +31,8 @@ PX (px) EM (em) PERCENT (\%) +ASTERIX \* + CENTER "center" NORTH "north" SOUTH "south" @@ -43,6 +45,7 @@ LS_SOLID "solid" %x PROPERTIES %x NAMESTR %x ENTRY +%x DEFAULTS %% %{ @@ -89,6 +92,18 @@ if ( queue == NULL ){ YY_LLOC_START } +{ASTERIX} { + g_queue_push_head ( queue, GINT_TO_POINTER (YY_START) ); + BEGIN(DEFAULTS); + return PDEFAULTS; +} +{WHITESPACE} {} +"\{" { + g_queue_push_head ( queue, GINT_TO_POINTER (YY_START) ); + BEGIN(ENTRY); + return BOPEN; +} + /* Go into parsing an entry */ "\{" { g_queue_push_head ( queue, GINT_TO_POINTER (YY_START) ); diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y index 01c66ee0..4bf811df 100644 --- a/lexer/theme-parser.y +++ b/lexer/theme-parser.y @@ -53,13 +53,13 @@ int yylex (YYSTYPE *, YYLTYPE *); %token NSEP "Name separator"; %token NAME_PREFIX "Name prefix"; %token WHITESPACE "White space"; +%token PDEFAULTS "Default settings"; %type entry %type pvalue %type entries %type start %type name_path -%type state_path %type property %type property_list %type optional_properties @@ -100,7 +100,12 @@ NAME_PREFIX name_path BOPEN optional_properties BCLOSE g_list_free ( $2 ); widget->set = TRUE; rofi_theme_widget_add_properties ( widget, $4); -}; +} +| + PDEFAULTS BOPEN optional_properties BCLOSE { + rofi_theme_widget_add_properties ( rofi_theme, $3); +} +; /** * properties