[PATCH 0/1] MR10394: vbscript: Report correct error character position for invalid parenthesized call.
When a call statement uses parentheses around multiple arguments without the Call keyword (e.g. strcomp("x", "y")), set error_loc to the current lexer position so that the error character is reported correctly. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10394
From: Francis De Brabandere <francisdb@gmail.com> When a call statement uses parentheses around multiple arguments without the Call keyword (e.g. strcomp("x", "y")), set error_loc to the current lexer position so that the error character is reported correctly. --- 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 42df9afaf8f..4977358b333 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -762,6 +762,7 @@ static call_expression_t *make_call_expression(parser_ctx_t *ctx, expression_t * if(call_expr->args->next) { FIXME("Invalid syntax: invalid use of parentheses for arguments\n"); ctx->hres = E_FAIL; + ctx->error_loc = ctx->ptr - ctx->code; return NULL; } diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c index 4b69bc18ffa..3f13d4f9b92 100644 --- a/dlls/vbscript/tests/run.c +++ b/dlls/vbscript/tests/run.c @@ -2780,7 +2780,7 @@ static void test_parse_errors(void) { /* invalid use of parentheses for call statement */ L"strcomp(\"x\", \"y\")", - 0, -17 + 0, 17 }, { L"\n\n\n cint _\n throwInt(&h80001234&)", -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10394
I plan to handle the actual error code FIXME after !10386 is merged -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10394#note_132965
This merge request was approved by Jacek Caban. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10394
participants (3)
-
Francis De Brabandere -
Francis De Brabandere (@francisdb) -
Jacek Caban (@jacek)