enhanced the reader and compiler to treat characters and strings prefixed with b and u as a limited range character and a byte array with internal terminating null at the back
This commit is contained in:
@ -4436,11 +4436,20 @@ redo:
|
||||
lit = HCL_CHAR_TO_OOP(oprnd->u.charlit.v);
|
||||
goto literal;
|
||||
|
||||
case HCL_CNODE_BCHRLIT: /* byte character still converts to charcter */
|
||||
lit = HCL_CHAR_TO_OOP((hcl_ooch_t)oprnd->u.bchrlit.v);
|
||||
goto literal;
|
||||
|
||||
case HCL_CNODE_STRLIT:
|
||||
lit = hcl_makestring(hcl, HCL_CNODE_GET_TOKPTR(oprnd), HCL_CNODE_GET_TOKLEN(oprnd), 0);
|
||||
if (HCL_UNLIKELY(!lit)) return -1;
|
||||
goto literal;
|
||||
|
||||
case HCL_CNODE_BSTRLIT:
|
||||
lit = hcl_makebytestring(hcl, HCL_CNODE_GET_TOKPTR(oprnd), HCL_CNODE_GET_TOKLEN(oprnd), 0);
|
||||
if (HCL_UNLIKELY(!lit)) return -1;
|
||||
goto literal;
|
||||
|
||||
case HCL_CNODE_NUMLIT:
|
||||
lit = string_to_num(hcl, HCL_CNODE_GET_TOK(oprnd), HCL_CNODE_GET_LOC(oprnd), 0);
|
||||
if (HCL_UNLIKELY(!lit)) return -1;
|
||||
|
Reference in New Issue
Block a user