Module: wine Branch: master Commit: afb2125cdf281e0f200d2c11b372f8f71fddff65 URL: https://gitlab.winehq.org/wine/wine/-/commit/afb2125cdf281e0f200d2c11b372f8f...
Author: Jason Millard jsm174@gmail.com Date: Thu Feb 9 12:14:37 2023 -0500
vbscript: Fix compile when colon follows Else on new line.
---
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")