From 6aab45e7a4e2e94842adf12bdc6fc621aee3ef7c Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Fri, 6 Nov 2009 15:42:03 +0100 Subject: [PATCH] configfile: make whitespace optional for modes (Thanks tsdh) --- src/cfgparse.y | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 2.39.5