summaryrefslogtreecommitdiffstats
path: root/lexer
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-01-03 19:23:09 +0100
committerDave Davenport <qball@gmpclient.org>2017-01-03 19:23:09 +0100
commitf9fc01b176f177bc744aaba643c9a12d0b511e30 (patch)
tree130f5622f1c43028272414162160c13c2c6b00ae /lexer
parent7600668bffacb5844e9e6064cb7b75c9aa737230 (diff)
Add percentage option to border,padding
Diffstat (limited to 'lexer')
-rw-r--r--lexer/theme-lexer.l6
1 files changed, 6 insertions, 0 deletions
diff --git a/lexer/theme-lexer.l b/lexer/theme-lexer.l
index 08aab7aa..d0d2e01d 100644
--- a/lexer/theme-lexer.l
+++ b/lexer/theme-lexer.l
@@ -27,6 +27,7 @@ NUMBER [[:digit:]]
REAL [[:digit:]]+(\.[[:digit:]]+)?
PX (px)
EM (em)
+PERCENT (\%)
NEWLINES (\r|\n)+
%x PROPERTIES
@@ -117,6 +118,11 @@ if ( queue == NULL ){
yylval->distance.type = PW_PX;
return T_PIXEL;
}
+<PROPERTIES>{REAL}{PERCENT} {
+ yylval->distance.distance = (double)g_ascii_strtod(yytext, NULL);
+ yylval->distance.type = PW_PERCENT;
+ return T_PIXEL;
+}
<PROPERTIES>#{HEX}{8} {
union { unsigned int val; struct { unsigned char b,g,r,a;};} val;
val.val = (unsigned int)strtoull ( &yytext[1], NULL, 16);