Module: wine Branch: master Commit: beef0956544ed66d3b12bbb1c6668581029a1351 URL: http://source.winehq.org/git/wine.git/?a=commit;h=beef0956544ed66d3b12bbb1c6...
Author: Jacek Caban jacek@codeweavers.com Date: Mon Sep 19 14:07:12 2011 +0200
vbscript: Added more equality expressions parser/compiler implementation.
---
dlls/vbscript/compile.c | 8 ++++++++ dlls/vbscript/interp.c | 24 ++++++++++++++++++++++++ dlls/vbscript/parse.h | 4 ++++ dlls/vbscript/parser.y | 4 ++++ dlls/vbscript/vbscript.h | 4 ++++ 5 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index 60e4935..c939aea 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -381,10 +381,18 @@ static HRESULT compile_expression(compile_ctx_t *ctx, expression_t *expr) return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_eqv); case EXPR_EXP: return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_exp); + case EXPR_GT: + return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_gt); + case EXPR_GTEQ: + return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_gteq); case EXPR_IDIV: return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_idiv); case EXPR_IMP: return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_imp); + case EXPR_LT: + return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_lt); + case EXPR_LTEQ: + return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_lteq); case EXPR_MEMBER: return compile_member_expression(ctx, (member_expression_t*)expr, TRUE); case EXPR_MOD: diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index c8e0514..9a49396 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -941,6 +941,30 @@ static HRESULT interp_nequal(exec_ctx_t *ctx) return stack_push(ctx, &v); }
+static HRESULT interp_gt(exec_ctx_t *ctx) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT interp_gteq(exec_ctx_t *ctx) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT interp_lt(exec_ctx_t *ctx) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT interp_lteq(exec_ctx_t *ctx) +{ + FIXME("\n"); + return E_NOTIMPL; +} + static HRESULT interp_concat(exec_ctx_t *ctx) { variant_val_t r, l; diff --git a/dlls/vbscript/parse.h b/dlls/vbscript/parse.h index d121b72..ef7f139 100644 --- a/dlls/vbscript/parse.h +++ b/dlls/vbscript/parse.h @@ -27,8 +27,12 @@ typedef enum { EXPR_EQUAL, EXPR_EQV, EXPR_EXP, + EXPR_GT, + EXPR_GTEQ, EXPR_IDIV, EXPR_IMP, + EXPR_LT, + EXPR_LTEQ, EXPR_MEMBER, EXPR_MOD, EXPR_MUL, diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index b1b385b..d0c3f70 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -248,6 +248,10 @@ EqualityExpression : ConcatExpression { $$ = $1; } | EqualityExpression '=' ConcatExpression { $$ = new_binary_expression(ctx, EXPR_EQUAL, $1, $3); CHECK_ERROR; } | EqualityExpression tNEQ ConcatExpression { $$ = new_binary_expression(ctx, EXPR_NEQUAL, $1, $3); CHECK_ERROR; } + | EqualityExpression '>' ConcatExpression { $$ = new_binary_expression(ctx, EXPR_GT, $1, $3); CHECK_ERROR; } + | EqualityExpression '<' ConcatExpression { $$ = new_binary_expression(ctx, EXPR_LT, $1, $3); CHECK_ERROR; } + | EqualityExpression tGTEQ ConcatExpression { $$ = new_binary_expression(ctx, EXPR_GTEQ, $1, $3); CHECK_ERROR; } + | EqualityExpression tLTEQ ConcatExpression { $$ = new_binary_expression(ctx, EXPR_LTEQ, $1, $3); CHECK_ERROR; }
ConcatExpression : AdditiveExpression { $$ = $1; } diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index 12315ae..c73f11d 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -161,6 +161,8 @@ typedef enum { X(equal, 1, 0, 0) \ X(eqv, 1, 0, 0) \ X(exp, 1, 0, 0) \ + X(gt, 1, 0, 0) \ + X(gteq, 1, 0, 0) \ X(icall, 1, ARG_BSTR, ARG_UINT) \ X(icallv, 1, ARG_BSTR, ARG_UINT) \ X(idiv, 1, 0, 0) \ @@ -169,6 +171,8 @@ typedef enum { X(jmp_false, 0, ARG_ADDR, 0) \ X(jmp_true, 0, ARG_ADDR, 0) \ X(long, 1, ARG_INT, 0) \ + X(lt, 1, 0, 0) \ + X(lteq, 1, 0, 0) \ X(mcall, 1, ARG_BSTR, ARG_UINT) \ X(mcallv, 1, ARG_BSTR, ARG_UINT) \ X(mod, 1, 0, 0) \