vbscript: Suport + sign in exponential literals.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2019-08-26 17:04:32 +02:00 committed by Alexandre Julliard
parent 06c43eac6f
commit 0131a9c47b
2 changed files with 5 additions and 1 deletions

View File

@ -302,9 +302,12 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret)
if(*ctx->ptr == 'e' || *ctx->ptr == 'E') {
int e = 0, sign = 1;
if(*++ctx->ptr == '-') {
ctx->ptr++;
if(*ctx->ptr == '-') {
ctx->ptr++;
sign = -1;
}else if(*ctx->ptr == '+') {
ctx->ptr++;
}
if(!iswdigit(*ctx->ptr)) {

View File

@ -41,6 +41,7 @@ Call ok(10. = 10, "10. <> 10")
Call ok(&hffFFffFF& = -1, "&hffFFffFF& <> -1")
Call ok(&hffFFffFF& = -1, "&hffFFffFF& <> -1")
Call ok(34e5 = 3400000, "34e5 <> 3400000")
Call ok(34e+5 = 3400000, "34e+5 <> 3400000")
Call ok(56.789e5 = 5678900, "56.789e5 = 5678900")
Call ok(56.789e-2 = 0.56789, "56.789e-2 <> 0.56789")
Call ok(1e-94938484 = 0, "1e-... <> 0")