'do' treated as a keyword
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-08-23 01:07:08 +09:00
parent 229d3b1f29
commit 8602a479d7
3 changed files with 12 additions and 1 deletions

View File

@ -2281,7 +2281,7 @@ static int compile_do (hcl_t* hcl, hcl_cnode_t* xlist)
*/
HCL_ASSERT (hcl, HCL_CNODE_IS_CONS(xlist));
HCL_ASSERT (hcl, HCL_CNODE_IS_SYMBOL_SYNCODED(HCL_CNODE_CONS_CAR(xlist), HCL_SYNCODE_DO));
HCL_ASSERT (hcl, HCL_CNODE_IS_SYMBOL_SYNCODED(HCL_CNODE_CONS_CAR(xlist), HCL_SYNCODE_DO) || HCL_CNODE_IS_TYPED(HCL_CNODE_CONS_CAR(xlist), HCL_CNODE_DO));
cmd = HCL_CNODE_CONS_CAR(xlist); /* do itself */
obj = HCL_CNODE_CONS_CDR(xlist); /* expression list after it */
@ -3915,6 +3915,10 @@ static int compile_cons_xlist_expression (hcl_t* hcl, hcl_cnode_t* obj, int nret
if (compile_fun(hcl, obj, 0) <= -1) return -1;
goto done;
case HCL_CNODE_DO:
if (compile_do(hcl, obj) <= -1) return -1;
goto done;
case HCL_CNODE_IF:
if (compile_if(hcl, obj) <= -1) return -1;
goto done;