vbscript: Added support for hex literals not ending with '&'.

This commit is contained in:
Jacek Caban 2011-10-18 12:36:03 +02:00 committed by Alexandre Julliard
parent b5a031d804
commit 76eeca2255
2 changed files with 6 additions and 2 deletions

View File

@ -294,12 +294,14 @@ static int parse_hex_literal(parser_ctx_t *ctx, LONG *ret)
while((d = hex_to_int(*++ctx->ptr)) != -1)
l = l*16 + d;
if(begin + 9 /* max digits+1 */ < ctx->ptr || *ctx->ptr != '&') {
if(begin + 9 /* max digits+1 */ < ctx->ptr || (*ctx->ptr != '&' && is_identifier_char(*ctx->ptr))) {
FIXME("invalid literal\n");
return 0;
}
if(*ctx->ptr == '&')
ctx->ptr++;
*ret = l;
return (short)l == l ? tShort : tLong;
}

View File

@ -43,6 +43,8 @@ Call ok(--1 = 1, "--1 = " & --1)
Call ok(-empty = 0, "-empty = " & (-empty))
Call ok(true = -1, "! true = -1")
Call ok(false = 0, "false <> 0")
Call ok(&hff = 255, "&hff <> 255")
Call ok(&Hff = 255, "&Hff <> 255")
x = "xx"
Call ok(x = "xx", "x = " & x & " expected ""xx""")