summaryrefslogtreecommitdiffstats
path: root/lexer/theme-parser.y
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-06-20 18:10:18 +0200
committerDave Davenport <qball@gmpclient.org>2017-06-20 18:10:18 +0200
commitda008484168b56b92646e7b5ddd676a1d17680d2 (patch)
tree65f53f602acad1faf6c53277536736191df6c576 /lexer/theme-parser.y
parent8375fbb5136c4aca009afa005d129ba580bf2cdc (diff)
Do better error reporting on configuration entries in rasi format.
Diffstat (limited to 'lexer/theme-parser.y')
-rw-r--r--lexer/theme-parser.y32
1 files changed, 23 insertions, 9 deletions
diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y
index 687a20c8..2b242260 100644
--- a/lexer/theme-parser.y
+++ b/lexer/theme-parser.y
@@ -275,18 +275,32 @@ T_NAME_PREFIX t_entry_name_path T_BOPEN t_property_list_optional T_BCLOSE
T_PDEFAULTS T_BOPEN t_property_list_optional T_BCLOSE {
rofi_theme_widget_add_properties ( rofi_theme, $3);
}
-| T_CONFIGURATION T_BOPEN t_property_list_optional T_BCLOSE {
- GHashTableIter iter;
- g_hash_table_iter_init ( &iter, $3 );
- gpointer key,value;
- while ( g_hash_table_iter_next ( &iter, &key, &value ) ) {
- Property *p = (Property *) value;
- config_parse_set_property ( p );
- }
- 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
+: %empty {}
+| t_config_property_list
+;
+
+t_config_property_list
+: t_config_property {
+}
+| t_config_property_list t_config_property {
+};
+
+t_config_property
+: t_property {
+ char *error = NULL;
+ if ( config_parse_set_property ( $1, &error ) ) {
+ // TODO Generate error.
+ yyerror ( &(@$), @$.filename, error );
+ g_free(error);
+ }
+}
+
/**
* properties
*/