vbscript: Added nothing literal parser/compiler implementation.

This commit is contained in:
Jacek Caban 2011-09-15 14:18:56 +02:00 committed by Alexandre Julliard
parent efc59d1b19
commit 8864c8dbae
5 changed files with 11 additions and 0 deletions

View File

@ -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:

View File

@ -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;

View File

@ -36,6 +36,7 @@ typedef enum {
EXPR_NEQUAL,
EXPR_NEW,
EXPR_NOT,
EXPR_NOTHING,
EXPR_NULL,
EXPR_OR,
EXPR_STRING,

View File

@ -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; }

View File

@ -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) \