From: Michael Stapelberg Date: Sun, 27 Sep 2009 15:00:37 +0000 (+0200) Subject: lexer: Allow whitespace before comments X-Git-Tag: 3.d~74 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c2a42dd50378e34bc6b6e333517710fd5fd711a8;p=i3%2Fi3 lexer: Allow whitespace before comments --- diff --git a/src/cfgparse.l b/src/cfgparse.l index 7880ef7c..3ca8dcbd 100644 --- a/src/cfgparse.l +++ b/src/cfgparse.l @@ -18,7 +18,7 @@ %% [^\n]+ { BEGIN(INITIAL); yylval.string = strdup(yytext); return STR; } -^#[^\n]* { return TOKCOMMENT; } +^[ \t]*#[^\n]* { return TOKCOMMENT; } [0-9a-fA-F]+ { yylval.string = strdup(yytext); return HEX; } [0-9]+ { yylval.number = atoi(yytext); return NUMBER; } bind { BEGIN(BIND_COND); return TOKBIND; }