diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index d1720cf20e8..b9e05bd91cb 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -390,6 +390,8 @@ static HRESULT compile_expression(compile_ctx_t *ctx, expression_t *expr) return compile_unary_expression(ctx, (unary_expression_t*)expr, OP_neg); case EXPR_NEQUAL: return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_nequal); + case EXPR_NEW: + return push_instr_str(ctx, OP_new, ((string_expression_t*)expr)->value); case EXPR_NOT: return compile_unary_expression(ctx, (unary_expression_t*)expr, OP_not); case EXPR_NULL: diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index 705992c6175..dd4f4ffd37d 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -444,6 +444,13 @@ static HRESULT interp_set_member(exec_ctx_t *ctx) return E_NOTIMPL; } +static HRESULT interp_new(exec_ctx_t *ctx) +{ + const WCHAR *arg = ctx->instr->arg1.bstr; + FIXME("%s\n", debugstr_w(arg)); + return E_NOTIMPL; +} + static HRESULT interp_jmp(exec_ctx_t *ctx) { const unsigned arg = ctx->instr->arg1.uint; diff --git a/dlls/vbscript/parse.h b/dlls/vbscript/parse.h index 76f8775a22c..21f0d60e60f 100644 --- a/dlls/vbscript/parse.h +++ b/dlls/vbscript/parse.h @@ -34,6 +34,7 @@ typedef enum { EXPR_MUL, EXPR_NEG, EXPR_NEQUAL, + EXPR_NEW, EXPR_NOT, EXPR_NULL, EXPR_OR, diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index 2e0140e85ab..48a5ab4a322 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -43,6 +43,7 @@ static expression_t *new_long_expression(parser_ctx_t*,expression_type_t,LONG); static expression_t *new_double_expression(parser_ctx_t*,double); static expression_t *new_unary_expression(parser_ctx_t*,expression_type_t,expression_t*); static expression_t *new_binary_expression(parser_ctx_t*,expression_type_t,expression_t*,expression_t*); +static expression_t *new_new_expression(parser_ctx_t*,const WCHAR*); static member_expression_t *new_member_expression(parser_ctx_t*,expression_t*,const WCHAR*); @@ -256,6 +257,7 @@ ExpExpression UnaryExpression : LiteralExpression { $$ = $1; } | CallExpression { $$ = $1; } + | tNEW tIdentifier { $$ = new_new_expression(ctx, $2); CHECK_ERROR; } | '-' UnaryExpression { $$ = new_unary_expression(ctx, EXPR_NEG, $2); CHECK_ERROR; } CallExpression @@ -430,6 +432,18 @@ static member_expression_t *new_member_expression(parser_ctx_t *ctx, expression_ return expr; } +static expression_t *new_new_expression(parser_ctx_t *ctx, const WCHAR *identifier) +{ + string_expression_t *expr; + + expr = new_expression(ctx, EXPR_NEW, sizeof(*expr)); + if(!expr) + return NULL; + + expr->value = identifier; + return &expr->expr; +} + static void *new_statement(parser_ctx_t *ctx, statement_type_t type, size_t size) { statement_t *stat; diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index 96559780c6e..3e3af5bf417 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -146,6 +146,7 @@ typedef enum { X(mul, 1, 0, 0) \ X(neg, 1, 0, 0) \ X(nequal, 1, 0, 0) \ + X(new, 1, ARG_STR, 0) \ X(not, 1, 0, 0) \ X(null, 1, 0, 0) \ X(or, 1, 0, 0) \