1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-18 13:54:36 -05:00

[ThemeParser] Give a more detailed error when only 7 elements are specified in argb syntax.

This commit is contained in:
Dave Davenport 2017-10-30 17:06:11 +01:00
parent 18c25e3ffe
commit ad877bb2e6
3 changed files with 5 additions and 0 deletions

View file

@ -1,4 +1,5 @@
v1.4.3 (dev): v1.4.3 (dev):
- Better error message on invalid argb syntax.
- Fix default theme border. - Fix default theme border.
- Make '#' in the parser optional. - Make '#' in the parser optional.
- Update themes. - Update themes.

View file

@ -474,6 +474,9 @@ if ( queue == NULL ){
yylval->colorval.green = rofi_theme_parse_convert_hex(yytext[9],yytext[10]); yylval->colorval.green = rofi_theme_parse_convert_hex(yytext[9],yytext[10]);
yylval->colorval.blue = rofi_theme_parse_convert_hex(yytext[11],yytext[12]); yylval->colorval.blue = rofi_theme_parse_convert_hex(yytext[11],yytext[12]);
return T_COLOR; return T_COLOR;
}
<PROPERTIES>argb:{HEX}{7} {
return T_ERROR_ARGB_SPEC;
} }
/* Color schemes */ /* Color schemes */
<PROPERTIES>{RGBA} { return T_COL_RGBA; } <PROPERTIES>{RGBA} { return T_COL_RGBA; }

View file

@ -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_NAMESTRING 4 "invalid element name"
%token <ival> T_ERROR_DEFAULTS 5 "invalid defaults name" %token <ival> T_ERROR_DEFAULTS 5 "invalid defaults name"
%token <ival> T_ERROR_INCLUDE 6 "invalid import value" %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 <ival> T_INT "Integer number"
%token <fval> T_DOUBLE "Floating-point number" %token <fval> T_DOUBLE "Floating-point number"
%token <sval> T_STRING "UTF-8 encoded string" %token <sval> T_STRING "UTF-8 encoded string"