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 1a8ae2013c9..19cfccd6032 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -232,6 +232,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 37c8883fcd9..f269d1f571f 100644 --- a/dlls/vbscript/tests/run.c +++ b/dlls/vbscript/tests/run.c @@ -3206,6 +3206,12 @@ static void test_parse_errors(void) "End Class\n", 2, 11, NULL, S_OK, 1037 + }, + { + /* 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