writing code to implement return variables

This commit is contained in:
2021-05-09 15:32:54 +00:00
parent 01719d0056
commit 391d62511b
6 changed files with 139 additions and 30 deletions

View File

@ -1085,7 +1085,7 @@ retry:
hcl_iolxc_t sd;
hcl_ooci_t oldc2;
sd = hcl->c->lxc; /* back up '#' */
sd = hcl->c->lxc;
oldc2 = c;
GET_CHAR_TO (hcl, c);
@ -1117,10 +1117,40 @@ retry:
break;
case ':':
oldc = c;
GET_CHAR_TO (hcl, c);
if(c == ':')
{
hcl_iolxc_t sd;
hcl_ooci_t oldc2;
sd = hcl->c->lxc;
oldc2 = c;
GET_CHAR_TO (hcl, c);
if (c == ':')
{
SET_TOKEN_TYPE (hcl, HCL_IOTOK_TRPCOLONS);
ADD_TOKEN_CHAR (hcl, oldc);
ADD_TOKEN_CHAR (hcl, oldc2);
ADD_TOKEN_CHAR (hcl, c);
break;
}
unget_char (hcl, &hcl->c->lxc);
unget_char (hcl, &sd);
}
else
{
unget_char (hcl, &hcl->c->lxc);
}
c = oldc;
SET_TOKEN_TYPE (hcl, HCL_IOTOK_COLON);
ADD_TOKEN_CHAR (hcl, c);
break;
case '\"':
if (get_string(hcl, '\"', '\\', 0, 0) <= -1) return -1;
break;
@ -1943,6 +1973,10 @@ static hcl_cnode_t* read_object (hcl_t* hcl)
obj = hcl_makecnodeellipsis(hcl, TOKEN_LOC(hcl), TOKEN_NAME(hcl));
break;
case HCL_IOTOK_TRPCOLONS:
obj = hcl_makecnodetrpcolons(hcl, TOKEN_LOC(hcl), TOKEN_NAME(hcl));
break;
case HCL_IOTOK_SMPTRLIT:
{
hcl_oow_t i;