Jacek Caban : vbscript: Added stop statement semi-stub implementation.

Alexandre Julliard julliard at winehq.org
Thu Sep 15 12:34:55 CDT 2011


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Sep 15 14:22:27 2011 +0200

vbscript: Added stop statement semi-stub implementation.

---

 dlls/vbscript/compile.c      |    3 +++
 dlls/vbscript/interp.c       |    8 ++++++++
 dlls/vbscript/parse.h        |    3 ++-
 dlls/vbscript/parser.y       |    1 +
 dlls/vbscript/tests/lang.vbs |    3 +++
 dlls/vbscript/vbscript.h     |    1 +
 6 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c
index 32707dc..10b2a9d 100644
--- a/dlls/vbscript/compile.c
+++ b/dlls/vbscript/compile.c
@@ -615,6 +615,9 @@ static HRESULT compile_statement(compile_ctx_t *ctx, statement_t *stat)
         case STAT_SET:
             hres = compile_assign_statement(ctx, (assign_statement_t*)stat, TRUE);
             break;
+        case STAT_STOP:
+            hres = push_instr(ctx, OP_stop) == -1 ? E_OUTOFMEMORY : S_OK;
+            break;
         default:
             FIXME("Unimplemented statement type %d\n", stat->type);
             hres = E_NOTIMPL;
diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c
index a0e926d..27da9d3 100644
--- a/dlls/vbscript/interp.c
+++ b/dlls/vbscript/interp.c
@@ -576,6 +576,14 @@ static HRESULT interp_ret(exec_ctx_t *ctx)
     return S_OK;
 }
 
+static HRESULT interp_stop(exec_ctx_t *ctx)
+{
+    WARN("\n");
+
+    /* NOTE: this should have effect in debugging mode (that we don't support yet) */
+    return S_OK;
+}
+
 static HRESULT interp_bool(exec_ctx_t *ctx)
 {
     const VARIANT_BOOL arg = ctx->instr->arg1.lng;
diff --git a/dlls/vbscript/parse.h b/dlls/vbscript/parse.h
index 94ba0cf..918a6db 100644
--- a/dlls/vbscript/parse.h
+++ b/dlls/vbscript/parse.h
@@ -97,7 +97,8 @@ typedef enum {
     STAT_EXITSUB,
     STAT_FUNC,
     STAT_IF,
-    STAT_SET
+    STAT_SET,
+    STAT_STOP
 } statement_type_t;
 
 typedef struct _statement_t {
diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y
index 3eacf2f..63423d1 100644
--- a/dlls/vbscript/parser.y
+++ b/dlls/vbscript/parser.y
@@ -157,6 +157,7 @@ Statement
     | tEXIT tSUB                            { $$ = new_statement(ctx, STAT_EXITSUB, 0); CHECK_ERROR; }
     | tSET MemberExpression Arguments_opt '=' Expression
                                             { $2->args = $3; $$ = new_set_statement(ctx, $2, $5); CHECK_ERROR; }
+    | tSTOP                                 { $$ = new_statement(ctx, STAT_STOP, 0); CHECK_ERROR; }
 
 MemberExpression
     : tIdentifier                           { $$ = new_member_expression(ctx, NULL, $1); CHECK_ERROR; }
diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs
index 9e4bc44..3511707 100644
--- a/dlls/vbscript/tests/lang.vbs
+++ b/dlls/vbscript/tests/lang.vbs
@@ -376,6 +376,9 @@ Private Function TestPrivateFunc
 End Function
 Call TestPrivateFunc
 
+' Stop has an effect only in debugging mode
+Stop
+
 set x = testObj
 Call ok(getVT(x) = "VT_DISPATCH*", "getVT(x=testObj) = " & getVT(x))
 
diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h
index 1dcbc15..26892db 100644
--- a/dlls/vbscript/vbscript.h
+++ b/dlls/vbscript/vbscript.h
@@ -169,6 +169,7 @@ typedef enum {
     X(set_ident,      1, ARG_BSTR,    0)          \
     X(set_member,     1, ARG_BSTR,    0)          \
     X(short,          1, ARG_INT,     0)          \
+    X(stop,           1, 0,           0)          \
     X(string,         1, ARG_STR,     0)          \
     X(sub,            1, 0,           0)          \
     X(xor,            1, 0,           0)




More information about the wine-cvs mailing list