removed some unneeded code.
changed the source input handler to set the name field for the main stream
This commit is contained in:
31
lib/exec.c
31
lib/exec.c
@ -3387,37 +3387,6 @@ else
|
||||
HCL_STACK_PUSH (hcl, t);
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (b1 == 1 || b1 == 3)
|
||||
{
|
||||
if (t3 == hcl->_nil)
|
||||
{
|
||||
((hcl_oop_oop_t)t2)->slot[0] = t1;
|
||||
if (b1 == 1) HCL_STACK_PUSH (hcl, t2); /* push self again */
|
||||
}
|
||||
else
|
||||
{
|
||||
hcl_oop_t t;
|
||||
|
||||
t = hcl_makecons(hcl, t1, hcl->_nil);
|
||||
if (HCL_UNLIKELY(!t)) goto oops;
|
||||
|
||||
((hcl_oop_oop_t)t3)->slot[1] = t;
|
||||
if (b1 == 1) HCL_STACK_PUSH (hcl, t);
|
||||
}
|
||||
}
|
||||
else if (b1 == 2)
|
||||
{
|
||||
if (t3 == hcl->_nil)
|
||||
{
|
||||
((hcl_oop_oop_t)t2)->slot[1] = t1;
|
||||
}
|
||||
else
|
||||
{
|
||||
((hcl_oop_oop_t)t3)->slot[1] = t1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1167,7 +1167,7 @@ struct hcl_ioinarg_t
|
||||
/**
|
||||
* [OUT] place data here for #HCL_IO_READ
|
||||
*/
|
||||
hcl_ooch_t buf[2048];
|
||||
hcl_ooch_t buf[2048]; /* TODO: resize this if necessary */
|
||||
|
||||
/**
|
||||
* [OUT] place the number of characters read here for #HCL_IO_READ
|
||||
|
43
lib/read.c
43
lib/read.c
@ -2066,6 +2066,26 @@ hcl_cnode_t* hcl_read (hcl_t* hcl)
|
||||
return read_object(hcl);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
hcl_iolxc_t* hcl_readchar (hcl_t* hcl)
|
||||
{
|
||||
int n = get_char(hcl);
|
||||
if (n <= -1) return HCL_NULL;
|
||||
return &hcl->c->lxc;
|
||||
}
|
||||
|
||||
int hcl_unreadchar (hcl_t* hcl, const hcl_iolxc_t* c)
|
||||
{
|
||||
if (hcl->c->nungots >= HCL_COUNTOF(hcl->c->ungot))
|
||||
{
|
||||
hcl_seterrbfmt (hcl, HCL_EBUFFULL, "character unread buffer full");
|
||||
return -1;
|
||||
}
|
||||
|
||||
unget_char (hcl, c);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* TODO:
|
||||
hcl_cnodetoobj (hcl_t* hcl, hcl_cnode_t* x)
|
||||
@ -2073,8 +2093,9 @@ hcl_cnodetoobj (hcl_t* hcl, hcl_cnode_t* x)
|
||||
* drop location information and compose object ??
|
||||
* is it doable? can convert a dotted symbol to a proper value?
|
||||
}
|
||||
*/
|
||||
|
||||
*/
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
/* TODO: rename compiler to something else that can include reader, printer, and compiler
|
||||
* move compiler intialization/finalization here to more common place */
|
||||
@ -2297,21 +2318,3 @@ void hcl_detachio (hcl_t* hcl)
|
||||
}
|
||||
}
|
||||
|
||||
hcl_iolxc_t* hcl_readchar (hcl_t* hcl)
|
||||
{
|
||||
int n = get_char(hcl);
|
||||
if (n <= -1) return HCL_NULL;
|
||||
return &hcl->c->lxc;
|
||||
}
|
||||
|
||||
int hcl_unreadchar (hcl_t* hcl, const hcl_iolxc_t* c)
|
||||
{
|
||||
if (hcl->c->nungots >= HCL_COUNTOF(hcl->c->ungot))
|
||||
{
|
||||
hcl_seterrbfmt (hcl, HCL_EBUFFULL, "character unread buffer full");
|
||||
return -1;
|
||||
}
|
||||
|
||||
unget_char (hcl, c);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user