[PATCH] vbscript: improve parsing of separators after Option Explicit

Dmitry Kislyuk dimaki at rocketmail.com
Tue Oct 10 03:13:25 CDT 2017


One can only have a single Option Explicit statement in a test script. I chose to go ahead and modify the
line containing Option Explicit in lang.vbs because other test script files already test Option Explicit
on a line by itself. Other posibilities include not having a test at all or creating a separate test file
just to test this.
---
 dlls/vbscript/parser.y       | 2 +-
 dlls/vbscript/tests/lang.vbs | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y
index beb4e4c7d0..dcd7b73699 100644
--- a/dlls/vbscript/parser.y
+++ b/dlls/vbscript/parser.y
@@ -148,7 +148,7 @@ Program
 
 OptionExplicit_opt
     : /* empty */                { $$ = FALSE; }
-    | tOPTION tEXPLICIT tNL      { $$ = TRUE; }
+    | tOPTION tEXPLICIT StSep    { $$ = TRUE; }
 
 SourceElements
     : /* empty */
diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs
index 7f7c835631..2911778c55 100644
--- a/dlls/vbscript/tests/lang.vbs
+++ b/dlls/vbscript/tests/lang.vbs
@@ -16,7 +16,7 @@
 ' Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 '
 
-Option Explicit
+OPTION EXPLICIT  : : DIM W
 
 dim x, y, z
 Dim obj
@@ -53,6 +53,9 @@ Call ok(false = 0, "false <> 0")
 Call ok(&hff = 255, "&hff <> 255")
 Call ok(&Hff = 255, "&Hff <> 255")
 
+W = 5
+Call ok(W = 5, "W = " & W & " expected " & 5)
+
 x = "xx"
 Call ok(x = "xx", "x = " & x & " expected ""xx""")
 
-- 
2.14.1




More information about the wine-patches mailing list