added a new identifier - self

This commit is contained in:
2022-02-05 17:35:10 +00:00
parent d1c12bc543
commit 495cea5704
7 changed files with 126 additions and 64 deletions

View File

@ -992,7 +992,8 @@ static hcl_iotok_type_t classify_ident_token (hcl_t* hcl, const hcl_oocs_t* v)
{
{ 4, { 'n','u','l','l' }, HCL_IOTOK_NIL },
{ 4, { 't','r','u','e' }, HCL_IOTOK_TRUE },
{ 5, { 'f','a','l','s','e' }, HCL_IOTOK_FALSE }
{ 5, { 'f','a','l','s','e' }, HCL_IOTOK_FALSE },
{ 4, { 's','e','l','f' }, HCL_IOTOK_SELF }
};
for (i = 0; i < HCL_COUNTOF(tab); i++)
@ -1990,6 +1991,10 @@ static hcl_cnode_t* read_object (hcl_t* hcl)
obj = hcl_makecnodefalse(hcl, TOKEN_LOC(hcl), TOKEN_NAME(hcl));
break;
case HCL_IOTOK_SELF:
obj = hcl_makecnodeself(hcl, TOKEN_LOC(hcl), TOKEN_NAME(hcl));
break;
case HCL_IOTOK_ELLIPSIS:
obj = hcl_makecnodeellipsis(hcl, TOKEN_LOC(hcl), TOKEN_NAME(hcl));
break;