Module: wine Branch: master Commit: 1f5c56d1a85c3508e6ba271479c572da8aaf35dc URL: http://source.winehq.org/git/wine.git/?a=commit;h=1f5c56d1a85c3508e6ba271479...
Author: Jacek Caban jacek@codeweavers.com Date: Fri Sep 16 13:30:09 2011 +0200
vbscript: Added do while..loop statement implementation.
---
dlls/vbscript/compile.c | 1 + dlls/vbscript/parse.h | 3 ++- dlls/vbscript/parser.y | 2 ++ dlls/vbscript/tests/lang.vbs | 13 +++++++++++++ 4 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index 814d9ea..e29513b 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -661,6 +661,7 @@ static HRESULT compile_statement(compile_ctx_t *ctx, statement_t *stat) hres = push_instr(ctx, OP_stop) == -1 ? E_OUTOFMEMORY : S_OK; break; case STAT_WHILE: + case STAT_WHILELOOP: hres = compile_while_statement(ctx, (while_statement_t*)stat); break; default: diff --git a/dlls/vbscript/parse.h b/dlls/vbscript/parse.h index efd3d67..ff8c137 100644 --- a/dlls/vbscript/parse.h +++ b/dlls/vbscript/parse.h @@ -100,7 +100,8 @@ typedef enum { STAT_IF, STAT_SET, STAT_STOP, - STAT_WHILE + STAT_WHILE, + STAT_WHILELOOP } statement_type_t;
typedef struct _statement_t { diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index d06c84f..c73f368 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -156,6 +156,8 @@ Statement | IfStatement { $$ = $1; } | tWHILE Expression tNL StatementsNl_opt tWEND { $$ = new_while_statement(ctx, STAT_WHILE, $2, $4); CHECK_ERROR; } + | tDO tWHILE Expression tNL StatementsNl_opt tLOOP + { $$ = new_while_statement(ctx, STAT_WHILELOOP, $3, $5); CHECK_ERROR; } | FunctionDecl { $$ = new_function_statement(ctx, $1); CHECK_ERROR; } | tEXIT tFUNCTION { $$ = new_statement(ctx, STAT_EXITFUNC, 0); CHECK_ERROR; } | tEXIT tPROPERTY { $$ = new_statement(ctx, STAT_EXITPROP, 0); CHECK_ERROR; } diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index d3886d6..da1e5cb 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -212,6 +212,19 @@ call ok((x and y), "x or y is false after while") while false wend
+x = false +y = false +do while not (x and y) + if x then + y = true + end if + x = true +loop +call ok((x and y), "x or y is false after while") + +do while false +loop + if false then Sub testsub x = true