[PATCH v5 0/1] MR10495: Draft: vbscript: Return error 1010 for keyword used where identifier expected in Dim.
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. -- v5: vbscript: Return error 1010 for keyword used where identifier expected in Dim. https://gitlab.winehq.org/wine/wine/-/merge_requests/10495
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 2ecc5870aac..f0b80c24058 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -311,6 +311,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 d05b46574bf..28a72e5f66c 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
participants (2)
-
Francis De Brabandere -
Francis De Brabandere (@francisdb)