summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-10-30 17:06:11 +0100
committerDave Davenport <qball@gmpclient.org>2017-10-30 17:07:13 +0100
commitad877bb2e6a8d80c1e23dc4094ef122933268c49 (patch)
tree1dc6b1d8ae54f49304252ac012e885098ae0ec87
parent18c25e3ffeadd5814f686ca10a7fec4d131b4e24 (diff)
[ThemeParser] Give a more detailed error when only 7 elements are specified in argb syntax.
-rw-r--r--Changelog1
-rw-r--r--lexer/theme-lexer.l3
-rw-r--r--lexer/theme-parser.y1
3 files changed, 5 insertions, 0 deletions
diff --git a/Changelog b/Changelog
index 9bce46e7..4a810ad3 100644
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,5 @@
v1.4.3 (dev):
+ - Better error message on invalid argb syntax.
- Fix default theme border.
- Make '#' in the parser optional.
- Update themes.
diff --git a/lexer/theme-lexer.l b/lexer/theme-lexer.l
index b906b59c..e7430355 100644
--- a/lexer/theme-lexer.l
+++ b/lexer/theme-lexer.l
@@ -475,6 +475,9 @@ if ( queue == NULL ){
yylval->colorval.blue = rofi_theme_parse_convert_hex(yytext[11],yytext[12]);
return T_COLOR;
}
+<PROPERTIES>argb:{HEX}{7} {
+ return T_ERROR_ARGB_SPEC;
+}
/* Color schemes */
<PROPERTIES>{RGBA} { return T_COL_RGBA; }
<PROPERTIES>{HSL} { return T_COL_HSL; }
diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y
index de2acf6f..c9714ff3 100644
--- a/lexer/theme-parser.y
+++ b/lexer/theme-parser.y
@@ -155,6 +155,7 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b)
%token <ival> T_ERROR_NAMESTRING 4 "invalid element name"
%token <ival> T_ERROR_DEFAULTS 5 "invalid defaults name"
%token <ival> T_ERROR_INCLUDE 6 "invalid import value"
+%token <ival> T_ERROR_ARGB_SPEC 7 "invalid argb color. Requires 8 (not 7) elements: argb:AARRGGBB."
%token <ival> T_INT "Integer number"
%token <fval> T_DOUBLE "Floating-point number"
%token <sval> T_STRING "UTF-8 encoded string"