From: Michael Stapelberg Date: Thu, 16 Feb 2012 18:41:48 +0000 (+0000) Subject: cfgparse: also accept negative numbers X-Git-Tag: 4.2~68 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d78da44ad1b0d029296cbbbfb1b658900251bf3f;p=i3%2Fi3 cfgparse: also accept negative numbers --- diff --git a/src/cfgparse.l b/src/cfgparse.l index 4885c66d..7fbbefcb 100644 --- a/src/cfgparse.l +++ b/src/cfgparse.l @@ -170,7 +170,7 @@ EOL (\r?\n) [ \t]+ { BEGIN(WANT_STRING); } --no-startup-id { printf("no startup id\n"); yy_pop_state(); return TOK_NO_STARTUP_ID; } . { printf("anything else: *%s*\n", yytext); yyless(0); yy_pop_state(); yy_pop_state(); } -[0-9]+ { yylval.number = atoi(yytext); return NUMBER; } +[0-9-]+ { yylval.number = atoi(yytext); return NUMBER; } bar { yy_push_state(BAR); return TOK_BAR; } mode { return TOKMODE; } bind { yy_push_state(WANT_STRING); yy_push_state(EAT_WHITESPACE); yy_push_state(EAT_WHITESPACE); return TOKBINDCODE; }