summaryrefslogtreecommitdiffstats
path: root/lexer
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-09-06 10:03:44 +0200
committerDave Davenport <qball@gmpclient.org>2017-09-06 10:03:44 +0200
commit50998b8f04c6335c43bcc1923aa8f1d6d75db01d (patch)
tree9b38a2faa2af4111fa7178cb10841a68ffd3a173 /lexer
parent9b0a430fd48b390b7a1c14dab3b0e5fe4cd2b63a (diff)
Flatten hierarchy, don't inherit by default.
* add keyword inherit to language parser and theme structure.
Diffstat (limited to 'lexer')
-rw-r--r--lexer/theme-lexer.l8
-rw-r--r--lexer/theme-parser.y8
2 files changed, 13 insertions, 3 deletions
diff --git a/lexer/theme-lexer.l b/lexer/theme-lexer.l
index 57ca2064..6edea302 100644
--- a/lexer/theme-lexer.l
+++ b/lexer/theme-lexer.l
@@ -173,6 +173,8 @@ EM (em)
CH (ch)
PERCENT (\%)
+INHERIT (inherit)
+
ASTERIX \*
/* Position */
@@ -415,8 +417,10 @@ if ( queue == NULL ){
<PROPERTIES>{CH} { return T_UNIT_CH; }
<PROPERTIES>{PX} { return T_UNIT_PX; }
<PROPERTIES>{PERCENT} { return T_PERCENT; }
-<PROPERTIES>{LS_SOLID} { return T_SOLID; }
-<PROPERTIES>{LS_DASH} { return T_DASH; }
+<PROPERTIES>{LS_SOLID} { return T_SOLID; }
+<PROPERTIES>{LS_DASH} { return T_DASH; }
+
+<PROPERTIES>{INHERIT} { return T_INHERIT; }
/**
* Color parsing. It is easier to do this at lexer level.
diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y
index 3ad65543..a2bce6c2 100644
--- a/lexer/theme-parser.y
+++ b/lexer/theme-parser.y
@@ -219,6 +219,8 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b)
%token T_COLOR_TRANSPARENT "Transparent"
+%token T_INHERIT "Inherit"
+
%type <sval> t_entry
%type <theme> t_entry_list
%type <list> t_entry_name_path
@@ -322,7 +324,11 @@ t_property_list:
;
t_property
-: t_property_name T_PSEP T_INT T_PCLOSE {
+: t_property_name T_PSEP T_INHERIT T_PCLOSE {
+ $$ = rofi_theme_property_create ( P_INHERIT );
+ $$->name = $1;
+ }
+| t_property_name T_PSEP T_INT T_PCLOSE {
$$ = rofi_theme_property_create ( P_INTEGER );
$$->name = $1;
$$->value.i = $3;