summaryrefslogtreecommitdiffstats
path: root/lexer
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2018-07-15 11:04:47 +0200
committerDave Davenport <qball@gmpclient.org>2018-07-15 11:04:47 +0200
commit06165f867a6431fc4dad55e5a1158ebc46416704 (patch)
tree8358d5e76e21d87930eb53c1a4ca9410c065fa00 /lexer
parente4d823774c9a6f5143247c40e9dd6204f9d4180d (diff)
[Lexer] Only allow configuration blocks before theme.
Diffstat (limited to 'lexer')
-rw-r--r--lexer/theme-parser.y19
1 files changed, 15 insertions, 4 deletions
diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y
index f5e11156..a2c53071 100644
--- a/lexer/theme-parser.y
+++ b/lexer/theme-parser.y
@@ -250,10 +250,24 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b)
%type <list> t_property_element_list_optional
%type <ival> t_property_orientation
%type <ival> t_name_prefix_optional
-%start t_entry_list
+%start t_main
%%
+/**
+ * First have the configuration blocks, then the theme.
+ */
+t_main
+: %empty {}
+| t_configuration_list t_entry_list {
+ // Dummy at this point.
+}
+;
+
+t_configuration_list:
+ %empty {}
+| t_configuration_list T_CONFIGURATION T_BOPEN t_config_property_list_optional T_BCLOSE {};
+
t_entry_list:
%empty {
// There is always a base widget.
@@ -300,9 +314,6 @@ t_name_prefix_optional t_entry_name_path_selectors T_BOPEN t_property_list_optio
g_hash_table_destroy ( $3 );
}
}
-| T_CONFIGURATION T_BOPEN t_config_property_list_optional T_BCLOSE {
- // Dummy at this point.
-}
;
t_config_property_list_optional