Module: wine Branch: master Commit: 8864c8dbae7db66662e7f022a91d84d11a65dcf7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=8864c8dbae7db66662e7f022a9...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Sep 15 14:18:56 2011 +0200
vbscript: Added nothing literal parser/compiler implementation.
---
dlls/vbscript/compile.c | 2 ++ dlls/vbscript/interp.c | 6 ++++++ dlls/vbscript/parse.h | 1 + dlls/vbscript/parser.y | 1 + dlls/vbscript/vbscript.h | 1 + 5 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index b9e05bd9..36bf04c 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -394,6 +394,8 @@ static HRESULT compile_expression(compile_ctx_t *ctx, expression_t *expr) 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_NOTHING: + return push_instr(ctx, OP_nothing) != -1 ? S_OK : E_OUTOFMEMORY; case EXPR_NULL: return push_instr(ctx, OP_null) != -1 ? S_OK : E_OUTOFMEMORY; case EXPR_OR: diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index b413243..4094ac1 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -597,6 +597,12 @@ static HRESULT interp_null(exec_ctx_t *ctx) return stack_push(ctx, &v); }
+static HRESULT interp_nothing(exec_ctx_t *ctx) +{ + FIXME("\n"); + return E_NOTIMPL; +} + static HRESULT interp_not(exec_ctx_t *ctx) { variant_val_t val; diff --git a/dlls/vbscript/parse.h b/dlls/vbscript/parse.h index 21f0d60..ac0f310 100644 --- a/dlls/vbscript/parse.h +++ b/dlls/vbscript/parse.h @@ -36,6 +36,7 @@ typedef enum { EXPR_NEQUAL, EXPR_NEW, EXPR_NOT, + EXPR_NOTHING, EXPR_NULL, EXPR_OR, EXPR_STRING, diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index 48a5ab4..50a4bf1 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -274,6 +274,7 @@ LiteralExpression | tDouble { $$ = new_double_expression(ctx, $1); CHECK_ERROR; } | tEMPTY { $$ = new_expression(ctx, EXPR_EMPTY, 0); CHECK_ERROR; } | tNULL { $$ = new_expression(ctx, EXPR_NULL, 0); CHECK_ERROR; } + | tNOTHING { $$ = new_expression(ctx, EXPR_NOTHING, 0); CHECK_ERROR; }
PrimaryExpression : '(' Expression ')' { $$ = $2; } diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index dabf52b..4c2d977 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -152,6 +152,7 @@ typedef enum { X(nequal, 1, 0, 0) \ X(new, 1, ARG_STR, 0) \ X(not, 1, 0, 0) \ + X(nothing, 1, 0, 0) \ X(null, 1, 0, 0) \ X(or, 1, 0, 0) \ X(ret, 0, 0, 0) \