From 81b00705e848d6968f8462d64f2e8035b7593804 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Fri, 24 Apr 2020 18:17:01 +0200 Subject: [Theme] Add modulo to calc. --- lexer/theme-parser.y | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lexer/theme-parser.y') diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y index 1da0bda0..c93e8c7f 100644 --- a/lexer/theme-parser.y +++ b/lexer/theme-parser.y @@ -211,10 +211,10 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b) %token T_LIST_OPEN "List open ('[')" %token T_LIST_CLOSE "List close (']')" -%token T_MODIFIER_ADD "Add ('+')" -%token T_MODIFIER_SUBTRACT "Subtract ('-')" -%token T_MODIFIER_DIVIDE "Divide ('/')" -%token T_MODIFIER_MULTIPLY "Multiply ('*')" +%token T_MODIFIER_ADD "Add ('+')" +%token T_MODIFIER_SUBTRACT "Subtract ('-')" +%token T_MODIFIER_DIVIDE "Divide ('/')" +%token T_MODIFIER_MULTIPLY "Multiply ('*')" %token T_CALC "calc" @@ -672,6 +672,12 @@ t_property_distance_unit_math $$->right = $3; $$->modtype = ROFI_DISTANCE_MODIFIER_DIVIDE; } +| t_property_distance_unit_math T_PERCENT t_property_distance_unit { + $$ = g_slice_new0(RofiDistanceUnit); + $$->left = $1; + $$->right = $3; + $$->modtype = ROFI_DISTANCE_MODIFIER_MODULO; +} | t_property_distance_unit { $$ = $1; }; -- cgit v1.2.3