[PATCH 0/1] MR10310: vbscript: allow empty else
From: Francis De Brabandere <francisdb@gmail.com> --- dlls/vbscript/parser.y | 4 +++- dlls/vbscript/tests/lang.vbs | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index 20c30eed681..fa18f8648e6 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -310,7 +310,9 @@ IfStatement { $$ = new_if_statement(ctx, @$, $2, $5, $6, $7); CHECK_ERROR; } | tIF Expression tTHEN Statement EndIf_opt { $$ = new_if_statement(ctx, @$, $2, $4, NULL, NULL); CHECK_ERROR; } | tIF Expression tTHEN Statement tELSE Statement EndIf_opt - { $$ = new_if_statement(ctx, @$, $2, $4, NULL, $6); CHECK_ERROR; } + { $$ = new_if_statement(ctx, @$, $2, $4, NULL, $6); CHECK_ERROR; } + | tIF Expression tTHEN Statement tELSE EndIf_opt + { $$ = new_if_statement(ctx, @$, $2, $4, NULL, NULL); CHECK_ERROR; } EndIf_opt : /* empty */ diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index 0025bfeddcf..ef68711c8e5 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -359,6 +359,9 @@ ElseIf not False Then End If Call ok(x, "elseif not called?") +If false Then x = 1 Else +If false Then x = 1 Else: + x = false if 1 then x = true Call ok(x, "if 1 not run?") @@ -2289,4 +2292,5 @@ f1 not 1 = 0 arr (0) = 2 xor -2 + reportSuccess() -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10310
participants (2)
-
Francis De Brabandere -
Francis De Brabandere (@francisdb)