lexer: return HEX instead of NUMBER when parsing colors

This commit is contained in:
Michael Stapelberg 2009-09-19 19:34:02 +02:00
parent b1ebbde153
commit 0ed2d62263

View File

@ -18,8 +18,8 @@
%% %%
<BIND_A2WS_COND>[^\n]+ { BEGIN(INITIAL); yylval.string = strdup(yytext); return STR; } <BIND_A2WS_COND>[^\n]+ { BEGIN(INITIAL); yylval.string = strdup(yytext); return STR; }
^#[^\n]* { return TOKCOMMENT; } ^#[^\n]* { return TOKCOMMENT; }
[0-9]+ { yylval.number = atoi(yytext); return NUMBER; }
<COLOR_COND>[0-9a-fA-F]+ { yylval.string = strdup(yytext); return HEX; } <COLOR_COND>[0-9a-fA-F]+ { yylval.string = strdup(yytext); return HEX; }
[0-9]+ { yylval.number = atoi(yytext); return NUMBER; }
bind { BEGIN(BIND_COND); return TOKBIND; } bind { BEGIN(BIND_COND); return TOKBIND; }
bindsym { BEGIN(BIND_COND); return TOKBINDSYM; } bindsym { BEGIN(BIND_COND); return TOKBINDSYM; }
floating_modifier { return TOKFLOATING_MODIFIER; } floating_modifier { return TOKFLOATING_MODIFIER; }