vbscipt: Added object member assign parser/compiler implementation.

This commit is contained in:
Jacek Caban 2011-09-13 11:35:33 +02:00 committed by Alexandre Julliard
parent 4c7f394b74
commit a822569db2
4 changed files with 14 additions and 4 deletions

View File

@ -303,8 +303,11 @@ static HRESULT compile_assign_statement(compile_ctx_t *ctx, assign_statement_t *
}
if(stat->member_expr->obj_expr) {
FIXME("obj_expr not implemented\n");
hres = E_NOTIMPL;
hres = compile_expression(ctx, stat->member_expr->obj_expr);
if(FAILED(hres))
return hres;
hres = push_instr_bstr(ctx, OP_assign_member, stat->member_expr->identifier);
}else {
hres = push_instr_bstr(ctx, OP_assign_ident, stat->member_expr->identifier);
}

View File

@ -257,6 +257,12 @@ static HRESULT interp_assign_ident(exec_ctx_t *ctx)
return assign_ident(ctx, arg, v.v, v.owned);
}
static HRESULT interp_assign_member(exec_ctx_t *ctx)
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT interp_ret(exec_ctx_t *ctx)
{
TRACE("\n");

View File

@ -113,8 +113,8 @@ Statement
{ $1->args = $2; $$ = new_assign_statement(ctx, $1, $4); CHECK_ERROR; }
MemberExpression
: tIdentifier { $$ = new_member_expression(ctx, NULL, $1); CHECK_ERROR; }
/* FIXME: MemberExpressionArgs '.' tIdentifier */
: tIdentifier { $$ = new_member_expression(ctx, NULL, $1); CHECK_ERROR; }
| CallExpression '.' tIdentifier { $$ = new_member_expression(ctx, $1, $3); CHECK_ERROR; }
Arguments_opt
: EmptyBrackets_opt { $$ = NULL; }

View File

@ -91,6 +91,7 @@ typedef enum {
#define OP_LIST \
X(add, 1, 0, 0) \
X(assign_ident, 1, ARG_BSTR, 0) \
X(assign_member, 1, ARG_BSTR, 0) \
X(bool, 1, ARG_INT, 0) \
X(concat, 1, 0, 0) \
X(double, 1, ARG_DOUBLE, 0) \