[PATCH 0/3] MR1534: vbscript: Handle another variant of LTE/GTE tokens.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53670 Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1534
From: Robert Wilhelm <robert.wilhelm(a)gmx.net> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53670 Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/vbscript/lex.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dlls/vbscript/lex.c b/dlls/vbscript/lex.c index 3374d4eafe1..f425b816cb0 100644 --- a/dlls/vbscript/lex.c +++ b/dlls/vbscript/lex.c @@ -422,7 +422,6 @@ static int parse_next_token(void *lval, unsigned *loc, parser_ctx_t *ctx) case ':': case ')': case ',': - case '=': case '+': case '*': case '/': @@ -477,6 +476,16 @@ static int parse_next_token(void *lval, unsigned *loc, parser_ctx_t *ctx) if(*++ctx->ptr == 'h' || *ctx->ptr == 'H') return parse_hex_literal(ctx, lval); return '&'; + case '=': + switch(*++ctx->ptr) { + case '<': + ctx->ptr++; + return tLTEQ; + case '>': + ctx->ptr++; + return tGTEQ; + } + return '='; case '<': switch(*++ctx->ptr) { case '>': -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/1534
From: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/vbscript/tests/lang.vbs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index 529f995e764..a2622f59bd9 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -167,6 +167,8 @@ call ok(false imp null, "false imp null is false?") Call ok(2 >= 1, "! 2 >= 1") Call ok(2 >= 2, "! 2 >= 2") +Call ok(2 => 1, "! 2 => 1") +Call ok(2 => 2, "! 2 => 2") Call ok(not(true >= 2), "true >= 2 ?") Call ok(2 > 1, "! 2 > 1") Call ok(false > true, "! false < true") @@ -177,6 +179,8 @@ Call ok(1 < 2, "! 1 < 2") Call ok(1 = 1 < 0, "! 1 = 1 < 0") Call ok(1 <= 2, "! 1 <= 2") Call ok(2 <= 2, "! 2 <= 2") +Call ok(1 =< 2, "! 1 =< 2") +Call ok(2 =< 2, "! 2 =< 2") Call ok(isNull(0 = null), "'(0 = null)' is not null") Call ok(isNull(null = 1), "'(null = 1)' is not null") -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/1534
From: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/vbscript/lex.c | 6 +++++- dlls/vbscript/tests/lang.vbs | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/vbscript/lex.c b/dlls/vbscript/lex.c index f425b816cb0..38ee4a5fd4b 100644 --- a/dlls/vbscript/lex.c +++ b/dlls/vbscript/lex.c @@ -500,9 +500,13 @@ static int parse_next_token(void *lval, unsigned *loc, parser_ctx_t *ctx) } return '<'; case '>': - if(*++ctx->ptr == '=') { + switch(*++ctx->ptr) { + case '=': ctx->ptr++; return tGTEQ; + case '<': + ctx->ptr++; + return tNEQ; } return '>'; default: diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index a2622f59bd9..0e8dae4049f 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -181,6 +181,10 @@ Call ok(1 <= 2, "! 1 <= 2") Call ok(2 <= 2, "! 2 <= 2") Call ok(1 =< 2, "! 1 =< 2") Call ok(2 =< 2, "! 2 =< 2") +Call ok(not (2 >< 2), "2 >< 2") +Call ok(2 >< 1, "! 2 >< 1") +Call ok(not (2 <> 2), "2 <> 2") +Call ok(2 <> 1, "! 2 <> 1") Call ok(isNull(0 = null), "'(0 = null)' is not null") Call ok(isNull(null = 1), "'(null = 1)' is not null") -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/1534
Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=126740 Your paranoid android. === w10pro64_en_AE_u8 (64 bit report) === vbscript: run.c:1206: Test failed: api.vbs: L"Err.number = 0" run.c:1206: Test failed: api.vbs: L"Err.description = " run.c:1206: Test failed: api.vbs: L"Err.number = 0"
This merge request was approved by Nikolay Sivov. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1534
On Thu Nov 24 05:57:51 2022 +0000, **** wrote:
Marvin replied on the mailing list: ``` Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=126740 Your paranoid android. === w10pro64_en_AE_u8 (64 bit report) === vbscript: run.c:1206: Test failed: api.vbs: L"Err.number = 0" run.c:1206: Test failed: api.vbs: L"Err.description = " run.c:1206: Test failed: api.vbs: L"Err.number = 0" ``` This is happening on utf-8 locale, in testChrError(). Needs to be fixed, but unrelated to this MR.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/1534#note_17303
Nikolay, Thank you for submitting my patch and adding test cases. Looks good to me. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1534#note_17307
Sure, thank you for the patch. I didn't want to wait until it's too close to pre-8.0 freeze period, and this patch is small enough. Also, as a bonus I found that "><" is an operator as well, who knows why. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1534#note_17308
This merge request was approved by Jacek Caban. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1534
This merge request was approved by Robert Wilhelm. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1534
Thanks @sloper42 and @nsivov for getting this fix! Much appreciated! -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1534#note_17336
participants (7)
-
Jacek Caban (@jacek) -
Jason Millard (@jsm174) -
Marvin -
Nikolay Sivov -
Nikolay Sivov (@nsivov) -
Robert Wilhelm -
Robert Wilhelm (@sloper42)