From: Michael Stapelberg Date: Fri, 6 Nov 2009 14:42:03 +0000 (+0100) Subject: configfile: make whitespace optional for modes (Thanks tsdh) X-Git-Tag: 3.d~21 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6aab45e7a4e2e94842adf12bdc6fc621aee3ef7c;p=i3%2Fi3 configfile: make whitespace optional for modes (Thanks tsdh) --- diff --git a/src/cfgparse.y b/src/cfgparse.y index fbbd5c0e..548d7482 100644 --- a/src/cfgparse.y +++ b/src/cfgparse.y @@ -276,7 +276,7 @@ word_or_number: ; mode: - TOKMODE WHITESPACE QUOTEDSTRING WHITESPACE '{' WHITESPACE modelines WHITESPACE '}' + TOKMODE WHITESPACE QUOTEDSTRING WHITESPACE '{' optional_whitespace modelines optional_whitespace '}' { if (strcasecmp($3, "default") == 0) { printf("You cannot use the name \"default\" for your mode\n"); @@ -298,6 +298,11 @@ mode: } ; +optional_whitespace: + /* empty */ + | WHITESPACE + ; + modelines: /* empty */ | modelines WHITESPACE modeline