[PATCH 0/1] MR10343: vbscript: Document expected parser conflicts with %expect 8.
The 8 shift/reduce conflicts are inherent ambiguities where bison's default shift gives the correct behavior: colon chains extend greedily, and Else/End If bind to the innermost inline If (dangling-else rule). -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10343
From: Francis De Brabandere <francisdb@gmail.com> The 8 shift/reduce conflicts are inherent ambiguities where bison's default shift gives the correct behavior: colon chains extend greedily, and Else/End If bind to the innermost inline If (dangling-else rule). --- dlls/vbscript/parser.y | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index c5d2764562e..6281a6deb2b 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -93,6 +93,23 @@ static statement_t *link_statements(statement_t*,statement_t*); %define api.pure %start Program +/* 8 expected shift/reduce conflicts, all resolved correctly by bison's + * default shift: + * + * - 2 from Statement colon chains: "x : :" can extend the current + * Statement or start a new one; both produce the same result. + * + * - 3 from nested inline If + colon: "If a Then If b Then x :" where + * ':' binds to the innermost If's statement list. + * + * - 1 classic dangling Else: "If a Then If b Then x Else y" where + * Else binds to the innermost If. + * + * - 2 dangling End If: "If a Then If b Then x End If" where End If + * binds to the innermost If. + */ +%expect 8 + %union { const WCHAR *string; statement_t *statement; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10343
This makes the build fail if any new conflicts are added. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10343#note_132334
participants (2)
-
Francis De Brabandere -
Francis De Brabandere (@francisdb)