experiment to convert an error from a primitive function to an exception
This commit is contained in:
parent
0f1df4684a
commit
90b6603567
15
lib/comp.c
15
lib/comp.c
@ -654,6 +654,14 @@ static int emit_indexed_variable_access (hcl_t* hcl, hcl_oow_t index, hcl_oob_t
|
||||
HCL_ASSERT (hcl, index < fbi->tmprcnt);
|
||||
for (i = hcl->c->fnblk.depth; i >= 0; i--)
|
||||
{
|
||||
#if 0
|
||||
if (i > 0 && hcl->c->fnblk.info[hcl->c->fnblk.info[i - 1].type == FNBLK_CLASS)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif
|
||||
hcl_oow_t parent_tmprcnt;
|
||||
|
||||
parent_tmprcnt = (i > 0)? hcl->c->fnblk.info[i - 1].tmprcnt: 0;
|
||||
@ -675,6 +683,11 @@ static int emit_indexed_variable_access (hcl_t* hcl, hcl_oow_t index, hcl_oob_t
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#if 0
|
||||
}
|
||||
#endif
|
||||
|
||||
//if (i > 0 && hcl->c->fnblk.info[hcl->c->fnblk.info[i - 1].type == FNBLK_CLASS) break;
|
||||
}
|
||||
|
||||
/* THIS PART MUST NOT BE REACHED */
|
||||
@ -1747,7 +1760,7 @@ printf ("22222222222\n");
|
||||
obj = HCL_CNODE_CONS_CDR(obj);
|
||||
}
|
||||
|
||||
if (push_clsblk(hcl, XXXX, 0, 0) <= -1) return -1;
|
||||
if (push_clsblk(hcl, HCL_CNODE_GET_LOC(cmd), 0, 0) <= -1) return -1;
|
||||
|
||||
/* TODO: emit make_class code...
|
||||
*/
|
||||
|
@ -3203,7 +3203,14 @@ static int execute (hcl_t* hcl)
|
||||
break;
|
||||
|
||||
case HCL_BRAND_PRIM:
|
||||
if (call_primitive(hcl, b1) <= -1) goto call_failed;
|
||||
if (call_primitive(hcl, b1) <= -1)
|
||||
{
|
||||
/*
|
||||
TODO: translate a certain primitive failure to a catchable exception. this seems to work . i need to capture the throw value instead of hcl->_nil .
|
||||
if (do_throw(hcl, hcl->_nil, fetched_instruction_pointer) <= -1)
|
||||
*/
|
||||
goto call_failed;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user