Module: wine Branch: master Commit: e06017b2a37ebfcc635641816229fd6a00641b02 URL: http://source.winehq.org/git/wine.git/?a=commit;h=e06017b2a37ebfcc6356418162...
Author: Jacek Caban jacek@codeweavers.com Date: Mon Sep 12 12:30:47 2011 +0200
vbscript: Added concatenation expression parser/compiler support.
---
dlls/vbscript/compile.c | 2 ++ dlls/vbscript/interp.c | 6 ++++++ dlls/vbscript/parse.h | 1 + dlls/vbscript/parser.y | 6 +++++- dlls/vbscript/vbscript.h | 1 + 5 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index b398d85..9e59fe1 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -236,6 +236,8 @@ static HRESULT compile_expression(compile_ctx_t *ctx, expression_t *expr) switch(expr->type) { case EXPR_BOOL: return push_instr_int(ctx, OP_bool, ((bool_expression_t*)expr)->value); + case EXPR_CONCAT: + return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_concat); case EXPR_DOUBLE: return push_instr_double(ctx, OP_double, ((double_expression_t*)expr)->value); case EXPR_EMPTY: diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index 1661700..7ee58a2 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -367,6 +367,12 @@ static HRESULT interp_equal(exec_ctx_t *ctx) return stack_push(ctx, &v); }
+static HRESULT interp_concat(exec_ctx_t *ctx) +{ + FIXME("\n"); + return E_NOTIMPL; +} + static const instr_func_t op_funcs[] = { #define X(x,n,a,b) interp_ ## x, OP_LIST diff --git a/dlls/vbscript/parse.h b/dlls/vbscript/parse.h index 82a60a9..b47360c 100644 --- a/dlls/vbscript/parse.h +++ b/dlls/vbscript/parse.h @@ -18,6 +18,7 @@
typedef enum { EXPR_BOOL, + EXPR_CONCAT, EXPR_DOUBLE, EXPR_EMPTY, EXPR_EQUAL, diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index ef12328..756cf6a 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -83,7 +83,7 @@ static statement_t *new_call_statement(parser_ctx_t*,member_expression_t*);
%type <statement> Statement StatementNl %type <expression> Expression LiteralExpression PrimaryExpression EqualityExpression CallExpression -%type <expression> ConcatExpression +%type <expression> ConcatExpression AdditiveExpression %type <expression> NotExpression %type <member> MemberExpression %type <expression> Arguments_opt ArgumentList_opt ArgumentList @@ -141,6 +141,10 @@ EqualityExpression | EqualityExpression '=' ConcatExpression { $$ = new_binary_expression(ctx, EXPR_EQUAL, $1, $3); CHECK_ERROR; }
ConcatExpression + : AdditiveExpression { $$ = $1; } + | ConcatExpression '&' AdditiveExpression { $$ = new_binary_expression(ctx, EXPR_CONCAT, $1, $3); CHECK_ERROR; } + +AdditiveExpression : LiteralExpression /* FIXME */ { $$ = $1; } | CallExpression /* FIXME */ { $$ = $1; }
diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index 7835eb2..2abbc9d 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -89,6 +89,7 @@ typedef enum {
#define OP_LIST \ X(bool, 1, ARG_INT, 0) \ + X(concat, 1, 0, 0) \ X(double, 1, ARG_DOUBLE, 0) \ X(empty, 1, 0, 0) \ X(equal, 1, 0, 0) \