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 | 3 +++ dlls/vbscript/tests/run.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index ea025dbd81c..4a17a5704fa 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -297,6 +297,9 @@ ReDimDeclList DimDeclList : DimDecl { $$ = $1; } | DimDecl ',' DimDeclList { $1->next = $3; $$ = $1; } + | error { if(ctx->hres == MAKE_VBSERROR(VBSE_SYNTAX_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 19fa090aaac..303633cd1ff 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