vbscript: Added support for hex literals not ending with '&'.
This commit is contained in:
parent
b5a031d804
commit
76eeca2255
|
@ -294,12 +294,14 @@ static int parse_hex_literal(parser_ctx_t *ctx, LONG *ret)
|
||||||
while((d = hex_to_int(*++ctx->ptr)) != -1)
|
while((d = hex_to_int(*++ctx->ptr)) != -1)
|
||||||
l = l*16 + d;
|
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");
|
FIXME("invalid literal\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->ptr++;
|
if(*ctx->ptr == '&')
|
||||||
|
ctx->ptr++;
|
||||||
|
|
||||||
*ret = l;
|
*ret = l;
|
||||||
return (short)l == l ? tShort : tLong;
|
return (short)l == l ? tShort : tLong;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,8 @@ Call ok(--1 = 1, "--1 = " & --1)
|
||||||
Call ok(-empty = 0, "-empty = " & (-empty))
|
Call ok(-empty = 0, "-empty = " & (-empty))
|
||||||
Call ok(true = -1, "! true = -1")
|
Call ok(true = -1, "! true = -1")
|
||||||
Call ok(false = 0, "false <> 0")
|
Call ok(false = 0, "false <> 0")
|
||||||
|
Call ok(&hff = 255, "&hff <> 255")
|
||||||
|
Call ok(&Hff = 255, "&Hff <> 255")
|
||||||
|
|
||||||
x = "xx"
|
x = "xx"
|
||||||
Call ok(x = "xx", "x = " & x & " expected ""xx""")
|
Call ok(x = "xx", "x = " & x & " expected ""xx""")
|
||||||
|
|
Loading…
Reference in New Issue