This merge request allows for statements on the same line as ELSE:
``` Dim vrOption vrOption = 3
If vrOption = 1 Then Wscript.Echo "vroption is 1" ElseIf vrOption = 2 Then Wscript.Echo "vroption is 2" Else If vrOption = 3 Then Wscript.Echo "vroption is 3" End If End If ```
Fixes https://bugs.winehq.org/show_bug.cgi?id=53873
Combined effort from myself and Nikolay Sivov
From: Jason Millard jsm174@gmail.com
--- dlls/vbscript/parser.y | 1 + dlls/vbscript/tests/lang.vbs | 8 ++++++++ 2 files changed, 9 insertions(+)
diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index 42838d34f17..4b9d53d3bca 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -318,6 +318,7 @@ ElseIf Else_opt : /* empty */ { $$ = NULL; } | tELSE tNL StatementsNl_opt { $$ = $3; } + | tELSE StatementsNl_opt { $$ = $2; }
CaseClausules : /* empty */ { $$ = NULL; } diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index 2467b814eff..61258355496 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -282,6 +282,14 @@ Else End If Call ok(x, "else not called?")
+' Else without 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")
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=126225
Your paranoid android.
=== debian11 (32 bit report) ===
d3d9: device.c:4385: Test failed: Expected message 0x3 for window 0x1, but didn't receive it, i=1.
d3drm: d3drm.c:4407: Test failed: Cannot create IDirect3DRMDevice3 interface, hr 0x8007000e. d3drm.c:4409: Test failed: expected ref3 > ref1, got ref1 = 1 , ref3 = 1. d3drm.c:4413: Test failed: expected cref2 > cref1, got cref1 = 1 , cref2 = 1. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x004129aa).
=== debian11 (build log) ===
0538:err:winediag:d3d_device_create The application wants to create a Direct3D device, but the current DirectDrawRenderer does not support this.
This merge request was approved by Jacek Caban.