From: Michael Stapelberg Date: Fri, 6 Nov 2009 16:19:01 +0000 (+0100) Subject: parser: solve shift/reduce conflict by moving WHITESPACE token to the right place X-Git-Tag: 3.d~19 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8e1945a9902e4a9b9bfccc84549a2cbc217a9fa7;p=i3%2Fi3 parser: solve shift/reduce conflict by moving WHITESPACE token to the right place --- diff --git a/src/cfgparse.y b/src/cfgparse.y index 548d7482..f212826e 100644 --- a/src/cfgparse.y +++ b/src/cfgparse.y @@ -276,7 +276,7 @@ word_or_number: ; mode: - TOKMODE WHITESPACE QUOTEDSTRING WHITESPACE '{' optional_whitespace modelines optional_whitespace '}' + TOKMODE WHITESPACE QUOTEDSTRING WHITESPACE '{' modelines '}' { if (strcasecmp($3, "default") == 0) { printf("You cannot use the name \"default\" for your mode\n"); @@ -298,19 +298,15 @@ mode: } ; -optional_whitespace: - /* empty */ - | WHITESPACE - ; modelines: /* empty */ - | modelines WHITESPACE modeline | modelines modeline ; modeline: - comment + WHITESPACE + | comment | binding { if (current_bindings == NULL) {