Module: wine Branch: master Commit: 887e72b24ead813facc3bd2ec9fd90a268d0dcd8 URL: https://gitlab.winehq.org/wine/wine/-/commit/887e72b24ead813facc3bd2ec9fd90a...
Author: Jason Millard jsm174@gmail.com Date: Tue Feb 14 10:02:09 2023 -0500
vbscript: Fix compile when statement after ElseIf or after separator.
---
dlls/vbscript/parser.y | 2 +- dlls/vbscript/tests/lang.vbs | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index 03415dc2b1c..9ae6c478bfa 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -314,7 +314,7 @@ ElseIfs | ElseIf ElseIfs { $1->next = $2; $$ = $1; }
ElseIf - : tELSEIF Expression tTHEN tNL StatementsNl_opt + : tELSEIF Expression tTHEN StSep_opt StatementsNl_opt { $$ = new_elseif_decl(ctx, @$, $2, $5); }
Else_opt diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index 1707cc9a92b..4a629627a16 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -337,6 +337,23 @@ ElseIf not False Then End If Call ok(x, "elseif not called?")
+' ElseIf with statement on same line +x = false +If false Then + Call ok(false, "inside if false") +ElseIf not False Then x = true +End If +Call ok(x, "elseif not called?") + +' ElseIf with statement following statement separator +x = false +If false Then + Call ok(false, "inside if false") +ElseIf not False Then +: x = true +End If +Call ok(x, "elseif not called?") + x = false if 1 then x = true Call ok(x, "if 1 not run?")