diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index 32707dc648..10b2a9dbd1 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 a0e926de4b..27da9d31ca 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 94ba0cff2d..918a6dbd07 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 3eacf2f16d..63423d168b 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 9e4bc44833..3511707712 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 1dcbc15dd6..26892dba76 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)