From ba296f921087453ca36c45af4be4e2ff3d6007a5 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Tue, 5 Sep 2017 13:52:21 +0200 Subject: Add `ch` as size unit. --- lexer/theme-lexer.l | 2 ++ lexer/theme-parser.y | 2 ++ 2 files changed, 4 insertions(+) (limited to 'lexer') diff --git a/lexer/theme-lexer.l b/lexer/theme-lexer.l index bf53b0f4..57ca2064 100644 --- a/lexer/theme-lexer.l +++ b/lexer/theme-lexer.l @@ -170,6 +170,7 @@ PNNUMBER [-+]?[[:digit:]]+ REAL [-+]?[[:digit:]]+(\.[[:digit:]]+)? PX (px) EM (em) +CH (ch) PERCENT (\%) ASTERIX \* @@ -411,6 +412,7 @@ if ( queue == NULL ){ } {EM} { return T_UNIT_EM; } +{CH} { return T_UNIT_CH; } {PX} { return T_UNIT_PX; } {PERCENT} { return T_PERCENT; } {LS_SOLID} { return T_SOLID; } diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y index 2b242260..3ad65543 100644 --- a/lexer/theme-parser.y +++ b/lexer/theme-parser.y @@ -182,6 +182,7 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b) %token T_UNIT_PX "pixels" %token T_UNIT_EM "em" +%token T_UNIT_CH "ch" %token T_UNIT_PERCENT "%" %token T_ANGLE_DEG "Degrees" @@ -470,6 +471,7 @@ t_property_distance t_property_unit : T_UNIT_PX { $$ = ROFI_PU_PX; } | T_UNIT_EM { $$ = ROFI_PU_EM; } +| T_UNIT_CH { $$ = ROFI_PU_CH; } | T_PERCENT { $$ = ROFI_PU_PERCENT; } ; /****** -- cgit v1.2.3