From: Jason Millard <jsm174(a)gmail.com> --- dlls/vbscript/parser.y | 3 +-- dlls/vbscript/tests/lang.vbs | 9 +++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index 382504a3d5a..03415dc2b1c 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -319,8 +319,7 @@ ElseIf Else_opt : /* empty */ { $$ = NULL; } - | tELSE tNL StatementsNl_opt { $$ = $3; } - | tELSE StatementsNl_opt { $$ = $2; } + | tELSE StSep_opt StatementsNl_opt { $$ = $3; } CaseClausules : /* empty */ { $$ = NULL; } diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index 3a67cd09dff..1707cc9a92b 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -298,6 +298,15 @@ Else x = true End If Call ok(x, "else not called?") +' Else with colon before statement following newline +x = false +If false Then + Call ok(false, "inside if false") +Else +: x = true +End If +Call ok(x, "else not called?") + x = false If false Then Call ok(false, "inside if false") -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2142