diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index 21b50bdf4f7..9b74bb77b33 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -356,6 +356,8 @@ static HRESULT compile_expression(compile_ctx_t *ctx, expression_t *expr) switch(expr->type) { case EXPR_ADD: return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_add); + case EXPR_AND: + return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_and); case EXPR_BOOL: return push_instr_int(ctx, OP_bool, ((bool_expression_t*)expr)->value); case EXPR_CONCAT: diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index 5c75a14f001..5b57306f56c 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -564,6 +564,12 @@ static HRESULT interp_not(exec_ctx_t *ctx) return stack_push(ctx, &v); } +static HRESULT interp_and(exec_ctx_t *ctx) +{ + FIXME("\n"); + return E_NOTIMPL; +} + static HRESULT cmp_oper(exec_ctx_t *ctx) { variant_val_t l, r; diff --git a/dlls/vbscript/parse.h b/dlls/vbscript/parse.h index 6406fc2ed32..d61a5f0370d 100644 --- a/dlls/vbscript/parse.h +++ b/dlls/vbscript/parse.h @@ -18,6 +18,7 @@ typedef enum { EXPR_ADD, + EXPR_AND, EXPR_BOOL, EXPR_CONCAT, EXPR_DIV, diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index 870a6654d9f..5c0468106ba 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -98,7 +98,7 @@ static arg_decl_t *new_argument_decl(parser_ctx_t*,const WCHAR*,BOOL); %type Statement StatementNl StatementsNl StatementsNl_opt IfStatement Else_opt %type Expression LiteralExpression PrimaryExpression EqualityExpression CallExpression %type ConcatExpression AdditiveExpression ModExpression IntdivExpression MultiplicativeExpression ExpExpression -%type NotExpression UnaryExpression +%type NotExpression UnaryExpression AndExpression %type MemberExpression %type Arguments_opt ArgumentList_opt ArgumentList %type OptionExplicit_opt @@ -188,7 +188,11 @@ EmptyBrackets_opt | tEMPTYBRACKETS Expression - : NotExpression { $$ = $1; } + : AndExpression { $$ = $1; } + +AndExpression + : NotExpression { $$ = $1; } + | AndExpression tAND NotExpression { $$ = new_binary_expression(ctx, EXPR_AND, $1, $3); CHECK_ERROR; } NotExpression : EqualityExpression { $$ = $1; } diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index 3fb57e4c4eb..1d2f95d68d1 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -117,6 +117,7 @@ typedef enum { #define OP_LIST \ X(add, 1, 0, 0) \ + X(and, 1, 0, 0) \ X(assign_ident, 1, ARG_BSTR, 0) \ X(assign_member, 1, ARG_BSTR, 0) \ X(bool, 1, ARG_INT, 0) \