summaryrefslogtreecommitdiffstats
path: root/lexer
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-06-14 08:18:59 +0200
committerDave Davenport <qball@gmpclient.org>2017-06-14 08:18:59 +0200
commit32f67ab5a5a55fa6e5dc37c28f8875e1e01c6219 (patch)
tree36b9af2e060962256ff38c893a0e54f6d7780bd7 /lexer
parent8f035bf9195cc350ab903939d0da3894d7bf197c (diff)
Add list property test, allow empty lists.
Diffstat (limited to 'lexer')
-rw-r--r--lexer/theme-parser.y8
1 files changed, 7 insertions, 1 deletions
diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y
index e5a2a7ac..687a20c8 100644
--- a/lexer/theme-parser.y
+++ b/lexer/theme-parser.y
@@ -240,6 +240,7 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b)
%type <ival> t_property_highlight_style
%type <ival> t_property_line_style
%type <list> t_property_element_list
+%type <list> t_property_element_list_optional
%type <ival> t_property_orientation
%start t_entry_list
@@ -372,7 +373,7 @@ t_property
$$->name = $1;
$$->value.color = $3;
}
-| t_property_name T_PSEP T_LIST_OPEN t_property_element_list T_LIST_CLOSE T_PCLOSE {
+| t_property_name T_PSEP T_LIST_OPEN t_property_element_list_optional T_LIST_CLOSE T_PCLOSE {
$$ = rofi_theme_property_create ( P_LIST );
$$->name = $1;
$$->value.list = $4;
@@ -385,6 +386,11 @@ t_property
;
/** List of elements */
+t_property_element_list_optional
+: %empty { $$ = NULL; }
+| t_property_element_list { $$ = $1; }
+;
+
t_property_element_list
: T_ELEMENT { $$ = g_list_append ( NULL, $1); }
| t_property_element_list T_COMMA T_ELEMENT {