diff options
author | Dave Davenport <qball@gmpclient.org> | 2017-10-30 17:06:11 +0100 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2017-10-30 17:07:13 +0100 |
commit | ad877bb2e6a8d80c1e23dc4094ef122933268c49 (patch) | |
tree | 1dc6b1d8ae54f49304252ac012e885098ae0ec87 /lexer | |
parent | 18c25e3ffeadd5814f686ca10a7fec4d131b4e24 (diff) |
[ThemeParser] Give a more detailed error when only 7 elements are specified in argb syntax.
Diffstat (limited to 'lexer')
-rw-r--r-- | lexer/theme-lexer.l | 3 | ||||
-rw-r--r-- | lexer/theme-parser.y | 1 |
2 files changed, 4 insertions, 0 deletions
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" |