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 c1a5b944268..dcdf53971a7 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -279,6 +279,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, FALSE, NULL); CHECK_ERROR; } diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c index d3aebff098a..e7bcc648634 100644 --- a/dlls/vbscript/tests/run.c +++ b/dlls/vbscript/tests/run.c @@ -2897,7 +2897,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