From c2a42dd50378e34bc6b6e333517710fd5fd711a8 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 27 Sep 2009 17:00:37 +0200 Subject: [PATCH] lexer: Allow whitespace before comments --- src/cfgparse.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }