summaryrefslogtreecommitdiffstats
path: root/lexer
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-09-05 13:52:21 +0200
committerDave Davenport <qball@gmpclient.org>2017-09-05 13:52:21 +0200
commitba296f921087453ca36c45af4be4e2ff3d6007a5 (patch)
tree9c67f8f2c0973f28fb469bba13ea805fee29bf25 /lexer
parent6dae152e3179f83d69c63850745e6638a280222e (diff)
Add `ch` as size unit.
Diffstat (limited to 'lexer')
-rw-r--r--lexer/theme-lexer.l2
-rw-r--r--lexer/theme-parser.y2
2 files changed, 4 insertions, 0 deletions
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 ){
}
<PROPERTIES>{EM} { return T_UNIT_EM; }
+<PROPERTIES>{CH} { return T_UNIT_CH; }
<PROPERTIES>{PX} { return T_UNIT_PX; }
<PROPERTIES>{PERCENT} { return T_PERCENT; }
<PROPERTIES>{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; }
;
/******