fixed to print a character array
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
16
lib/print.c
16
lib/print.c
@ -662,6 +662,22 @@ next:
|
||||
break;
|
||||
}
|
||||
|
||||
case HCL_BRAND_CHARACTER_ARRAY:
|
||||
{
|
||||
hcl_oow_t i;
|
||||
if (hcl_bfmt_out(hcl, fmtout, opening_parens[HCL_CONCODE_CHARARRAY][json]) <= -1) return -1;
|
||||
if (HCL_OBJ_GET_SIZE(obj) > 0)
|
||||
{
|
||||
if (hcl_bfmt_out(hcl, fmtout, "'%jc'", ((hcl_oop_char_t)obj)->slot[0]) <= -1) return -1;
|
||||
for (i = 1; i < HCL_OBJ_GET_SIZE(obj); i++)
|
||||
{
|
||||
if (hcl_bfmt_out(hcl, fmtout, "%hs'%jc'", breakers[0][json], ((hcl_oop_char_t)obj)->slot[i]) <= -1) return -1;
|
||||
}
|
||||
}
|
||||
if (hcl_bfmt_out(hcl, fmtout, closing_parens[HCL_CONCODE_CHARARRAY][json]) <= -1) return -1;
|
||||
break;
|
||||
}
|
||||
|
||||
case HCL_BRAND_DIC:
|
||||
{
|
||||
hcl_oow_t bucidx, bucsize, buctally;
|
||||
|
||||
@ -2578,6 +2578,7 @@ static int flx_hmarked_token (hcl_t* hcl, hcl_ooci_t c)
|
||||
* #include
|
||||
* #[ ] array
|
||||
* #b[ ] byte array
|
||||
* #c[ ] character array
|
||||
* #( ) qlist
|
||||
* #{ } dictionary
|
||||
* #"..." symbol literal
|
||||
@ -2616,7 +2617,7 @@ static int flx_hmarked_token (hcl_t* hcl, hcl_ooci_t c)
|
||||
case 'B':
|
||||
case 'c': /* character array */
|
||||
case 'C':
|
||||
/* if #b is followed by [, it is a starter for a byte array */
|
||||
/* #b[ -> byte array, #c[ -> character array */
|
||||
init_flx_hbc(FLX_HBC(hcl), c);
|
||||
FEED_CONTINUE_WITH_CHAR(hcl, c, HCL_FLX_HMARKED_BC);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user