Commit beef0956 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

vbscript: Added more equality expressions parser/compiler implementation.

parent c2feafb9
......@@ -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:
......
......@@ -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;
......
......@@ -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,
......
......@@ -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; }
......
......@@ -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) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment