From: Francis De Brabandere <francisdb@gmail.com> Return "Expected 'While', 'Until' or end of statement" when 'Do' is followed by an unexpected keyword like 'For' or 'If'. --- dlls/vbscript/parser.y | 1 + dlls/vbscript/tests/run.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index ea025dbd81c..b8b317c2fcf 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -239,6 +239,7 @@ SimpleStatement { $$ = new_while_statement(ctx, @4, $5 ? STAT_DOWHILE : STAT_DOUNTIL, $6, $3); CHECK_ERROR; } | tDO StSep StatementsNl_opt tLOOP { $$ = new_while_statement(ctx, @$, STAT_DOWHILE, NULL, $3); CHECK_ERROR; } + | tDO error { ctx->hres = MAKE_VBSERROR(VBSE_EXPECTED_WHILE_UNTIL_EOS); YYABORT; } | FunctionDecl { $$ = new_function_statement(ctx, @$, $1); CHECK_ERROR; } | tEXIT tDO { $$ = new_statement(ctx, STAT_EXITDO, 0, @2); CHECK_ERROR; } | tEXIT tFOR { $$ = new_statement(ctx, STAT_EXITFOR, 0, @2); CHECK_ERROR; } diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c index 19fa090aaac..844722a241f 100644 --- a/dlls/vbscript/tests/run.c +++ b/dlls/vbscript/tests/run.c @@ -3236,6 +3236,12 @@ static void test_parse_errors(void) L"Dim [unclosed\n", 0, 13, NULL, S_OK, 1007 + }, + { + /* Do followed by wrong keyword - error 1028 */ + L"Do For\nLoop\n", + 0, 3, + NULL, S_OK, 1028 } }; HRESULT hres; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10637