]> git.sur5r.net Git - i3/i3/commitdiff
cfgparse: also accept negative numbers
authorMichael Stapelberg <michael@stapelberg.de>
Thu, 16 Feb 2012 18:41:48 +0000 (18:41 +0000)
committerMichael Stapelberg <michael@stapelberg.de>
Thu, 16 Feb 2012 18:41:48 +0000 (18:41 +0000)
src/cfgparse.l

index 4885c66dc72aabb7273cdf7d26009f6643ccdd7d..7fbbefcb3e098d6790ee7a8f85c942a89902604b 100644 (file)
@@ -170,7 +170,7 @@ EOL     (\r?\n)
 <ASSIGN_TARGET_COND>[ \t]+      { BEGIN(WANT_STRING); }
 <EXEC>--no-startup-id           { printf("no startup id\n"); yy_pop_state(); return TOK_NO_STARTUP_ID; }
 <EXEC>.                         { 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; }