From: Francis De Brabandere <francisdb@gmail.com> When a reserved keyword like If appears after Dim where an identifier is expected (e.g. "Dim If"), Windows returns error 1010 ("expected identifier"). Add an error production in DimDeclList that sets the correct VBSE_EXPECTED_IDENTIFIER error code. --- dlls/vbscript/parser.y | 1 + dlls/vbscript/tests/run.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index f4b573e2d15..2b8db1749ba 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -282,6 +282,7 @@ ReDimDeclList DimDeclList : DimDecl { $$ = $1; } | DimDecl ',' DimDeclList { $1->next = $3; $$ = $1; } + | error { ctx->hres = MAKE_VBSERROR(VBSE_EXPECTED_IDENTIFIER); YYABORT; } DimDecl : Identifier { $$ = new_dim_decl(ctx, $1, @1, FALSE, NULL); CHECK_ERROR; } diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c index be71769d6de..a71be75ee4b 100644 --- a/dlls/vbscript/tests/run.c +++ b/dlls/vbscript/tests/run.c @@ -2929,7 +2929,7 @@ static void test_parse_errors(void) /* Expected identifier - error 1010 */ L"Dim If\n", 0, 4, - NULL, S_OK, -1010 + NULL, S_OK, 1010 }, { /* Invalid character - error 1032 */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10495