summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-09-07 08:43:00 +0200
committerDave Davenport <qball@gmpclient.org>2017-09-07 08:43:00 +0200
commitd4bf5ad02081038da3247c5833bfa6aaf8010ade (patch)
tree85335f3258629327eee27b742120a0398c3cad4b
parent2a5cb6f62159e345441046028ff70bc9e2906b28 (diff)
Allow 0 in padding when passing more then 1 argument.
-rw-r--r--lexer/theme-parser.y16
1 files changed, 13 insertions, 3 deletions
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 <fval> t_property_color_value_angle
%type <sval> t_property_name
%type <distance> t_property_distance
+%type <distance> t_property_distance_zero
%type <ival> t_property_unit
%type <wloc> t_property_position
%type <wloc> 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 */