diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y index 7a13702d..de22b98b 100644 --- a/lexer/theme-parser.y +++ b/lexer/theme-parser.y @@ -237,6 +237,7 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b) %type t_property_color_value_angle %type t_property_name %type t_property_distance +%type t_property_distance_zero %type t_property_unit %type t_property_position %type t_property_position_ew @@ -369,17 +370,17 @@ t_property $$->name = $1; $$->value.padding = (RofiPadding){ $3, $3, $3, $3 }; } -| t_property_name T_PSEP t_property_distance t_property_distance T_PCLOSE { +| t_property_name T_PSEP t_property_distance_zero t_property_distance_zero T_PCLOSE { $$ = rofi_theme_property_create ( P_PADDING ); $$->name = $1; $$->value.padding = (RofiPadding){ $3, $4, $3, $4 }; } -| t_property_name T_PSEP t_property_distance t_property_distance t_property_distance T_PCLOSE { +| t_property_name T_PSEP t_property_distance_zero t_property_distance_zero t_property_distance_zero T_PCLOSE { $$ = rofi_theme_property_create ( P_PADDING ); $$->name = $1; $$->value.padding = (RofiPadding){ $3, $4, $5, $4 }; } -| t_property_name T_PSEP t_property_distance t_property_distance t_property_distance t_property_distance T_PCLOSE { +| t_property_name T_PSEP t_property_distance_zero t_property_distance_zero t_property_distance_zero t_property_distance_zero T_PCLOSE { $$ = rofi_theme_property_create ( P_PADDING ); $$->name = $1; $$->value.padding = (RofiPadding){ $3, $4, $5, $6 }; @@ -469,6 +470,15 @@ t_property_highlight_style | T_SMALLCAPS { $$ = ROFI_HL_SMALL_CAPS; } ; + +t_property_distance_zero +: T_INT t_property_line_style { + $$.distance = (double) $1; + $$.type = ROFI_PU_PX; + $$.style = $2; +} +| t_property_distance { $$ = $1;} +; /** Distance. */ t_property_distance /** Interger unit and line style */