[PATCH] vbscript: colon used in for loop

Robert Wilhelm robert.wilhelm at gmx.net
Sun Aug 23 01:59:01 CDT 2020


Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35782
Signed-off-by: Robert Wilhelm <robert.wilhelm at gmx.net>
---
 dlls/vbscript/parser.y       | 2 ++
 dlls/vbscript/tests/lang.vbs | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y
index 71bea72b1b..ad606c1b26 100644
--- a/dlls/vbscript/parser.y
+++ b/dlls/vbscript/parser.y
@@ -221,6 +221,8 @@ SimpleStatement
     | tON tERROR tRESUME tNEXT              { $$ = new_onerror_statement(ctx, @$, TRUE); CHECK_ERROR; }
     | tON tERROR tGOTO '0'                  { $$ = new_onerror_statement(ctx, @$, FALSE); CHECK_ERROR; }
     | tCONST ConstDeclList                  { $$ = new_const_statement(ctx, @$, $2); CHECK_ERROR; }
+    | tFOR Identifier '=' Expression tTO Expression Step_opt ':' SimpleStatement ':' tNEXT
+                                            { $$ = new_forto_statement(ctx, @$, $2, $4, $6, $7, $9); CHECK_ERROR; }
     | tFOR Identifier '=' Expression tTO Expression Step_opt StSep StatementsNl_opt tNEXT
                                             { $$ = new_forto_statement(ctx, @$, $2, $4, $6, $7, $9); CHECK_ERROR; }
     | tFOR tEACH Identifier tIN Expression StSep StatementsNl_opt tNEXT
diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs
index 94e2bbd436..5754292079 100644
--- a/dlls/vbscript/tests/lang.vbs
+++ b/dlls/vbscript/tests/lang.vbs
@@ -542,6 +542,12 @@ for x = 1 to 5 :
     Call ok(false, "exit for not escaped the loop?")
 next

+dim a1(8)
+a1(6)=8
+for x=1 to 8:a1(x)=x-1:next
+Call ok(a1(6) = 5, "colon used in for loop")
+
+
 do while true
     for x = 1 to 100
         exit do
--
2.26.2





More information about the wine-devel mailing list