Module: wine Branch: master Commit: ded37832fbe1951e52973f3afdd08bd808a6b0a9 URL: http://source.winehq.org/git/wine.git/?a=commit;h=ded37832fbe1951e52973f3afd...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Sep 8 14:57:31 2011 +0200
vbscript: Added compiler support for string literals.
---
dlls/vbscript/compile.c | 14 ++++++++++++++ dlls/vbscript/interp.c | 6 ++++++ dlls/vbscript/vbscript.h | 3 ++- 3 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index cc3b683..7e8fe3b 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -73,6 +73,18 @@ static HRESULT push_instr_int(compile_ctx_t *ctx, vbsop_t op, LONG arg) return S_OK; }
+static HRESULT push_instr_str(compile_ctx_t *ctx, vbsop_t op, const WCHAR *arg) +{ + unsigned ret; + + ret = push_instr(ctx, op); + if(ret == -1) + return E_OUTOFMEMORY; + + instr_ptr(ctx, ret)->arg1.str = arg; + return S_OK; +} + static BSTR alloc_bstr_arg(compile_ctx_t *ctx, const WCHAR *str) { if(!ctx->code->bstr_pool_size) { @@ -158,6 +170,8 @@ static HRESULT compile_expression(compile_ctx_t *ctx, expression_t *expr) switch(expr->type) { case EXPR_BOOL: return push_instr_int(ctx, OP_bool, ((bool_expression_t*)expr)->value); + case EXPR_STRING: + return push_instr_str(ctx, OP_string, ((string_expression_t*)expr)->value); default: FIXME("Unimplemented expression type %d\n", expr->type); return E_NOTIMPL; diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index a70a4dd..b498a91 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -119,6 +119,12 @@ static HRESULT interp_bool(exec_ctx_t *ctx) return E_NOTIMPL; }
+static HRESULT interp_string(exec_ctx_t *ctx) +{ + FIXME("\n"); + return E_NOTIMPL; +} + static const instr_func_t op_funcs[] = { #define X(x,n,a,b) interp_ ## x, OP_LIST diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index c0adc57..a1428bb 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -77,7 +77,8 @@ typedef enum { #define OP_LIST \ X(bool, 1, ARG_INT, 0) \ X(icallv, 1, ARG_BSTR, ARG_UINT) \ - X(ret, 0, 0, 0) + X(ret, 0, 0, 0) \ + X(string, 1, ARG_STR, 0)
typedef enum { #define X(x,n,a,b) OP_##x,