Jacek Caban : vbscript: Added compiler support for equality expression.

Alexandre Julliard julliard at winehq.org
Fri Sep 9 10:56:47 CDT 2011


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Sep  9 14:48:25 2011 +0200

vbscript: Added compiler support for equality expression.

---

 dlls/vbscript/compile.c  |   17 +++++++++++++++++
 dlls/vbscript/interp.c   |    6 ++++++
 dlls/vbscript/vbscript.h |    1 +
 3 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c
index c64c30c..5ed19c4 100644
--- a/dlls/vbscript/compile.c
+++ b/dlls/vbscript/compile.c
@@ -176,11 +176,28 @@ static HRESULT compile_unary_expression(compile_ctx_t *ctx, unary_expression_t *
     return push_instr(ctx, op) == -1 ? E_OUTOFMEMORY : S_OK;
 }
 
+static HRESULT compile_binary_expression(compile_ctx_t *ctx, binary_expression_t *expr, vbsop_t op)
+{
+    HRESULT hres;
+
+    hres = compile_expression(ctx, expr->left);
+    if(FAILED(hres))
+        return hres;
+
+    hres = compile_expression(ctx, expr->right);
+    if(FAILED(hres))
+        return hres;
+
+    return push_instr(ctx, op) == -1 ? E_OUTOFMEMORY : S_OK;
+}
+
 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_EQUAL:
+        return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_equal);
     case EXPR_NOT:
         return compile_unary_expression(ctx, (unary_expression_t*)expr, OP_not);
     case EXPR_STRING:
diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c
index 0c3470b..29fed74 100644
--- a/dlls/vbscript/interp.c
+++ b/dlls/vbscript/interp.c
@@ -253,6 +253,12 @@ static HRESULT interp_not(exec_ctx_t *ctx)
     return stack_push(ctx, &v);
 }
 
+static HRESULT interp_equal(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 3f55b40..e717872 100644
--- a/dlls/vbscript/vbscript.h
+++ b/dlls/vbscript/vbscript.h
@@ -76,6 +76,7 @@ typedef enum {
 
 #define OP_LIST                                   \
     X(bool,           1, ARG_INT,     0)          \
+    X(equal,          1, 0,           0)          \
     X(icallv,         1, ARG_BSTR,    ARG_UINT)   \
     X(not,            1, 0,           0)          \
     X(ret,            0, 0,           0)          \




More information about the wine-cvs mailing list