Nikolay Sivov : vbscript: Support 'End If' for single line If statements.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Jan 16 14:12:31 CST 2015


Module: wine
Branch: master
Commit: e584edd379f798a37c7c4a87eb8ffbc2660f1e4b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e584edd379f798a37c7c4a87eb8ffbc2660f1e4b

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Thu Jan 15 09:26:26 2015 +0300

vbscript: Support 'End If' for single line If statements.

---

 dlls/vbscript/parser.y       | 6 +++---
 dlls/vbscript/tests/lang.vbs | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y
index 681a0c9..fb95dfb 100644
--- a/dlls/vbscript/parser.y
+++ b/dlls/vbscript/parser.y
@@ -246,10 +246,10 @@ Step_opt
 
 IfStatement
     : tIF Expression tTHEN tNL StatementsNl_opt ElseIfs_opt Else_opt tEND tIF
-                                            { $$ = new_if_statement(ctx, $2, $5, $6, $7); CHECK_ERROR; }
-    | tIF Expression tTHEN Statement        { $$ = new_if_statement(ctx, $2, $4, NULL, NULL); CHECK_ERROR; }
+                                               { $$ = 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; }
 
 EndIf_opt
     : /* empty */
diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs
index 3ee445c..b23b709 100644
--- a/dlls/vbscript/tests/lang.vbs
+++ b/dlls/vbscript/tests/lang.vbs
@@ -234,6 +234,7 @@ if false then :
 if false then x = y : if true then call ok(false, "embedded if called")
 
 if false then x=1 else x=2 end if
+if true then x=1 end if
 
 x = false
 if false then x = true : x = true




More information about the wine-cvs mailing list