scmno****@osdn*****
scmno****@osdn*****
Tue Jun 5 02:52:10 JST 2018
changeset 0d8c126c26e1 in quipu/quipu details: http://hg.osdn.jp/view/quipu/quipu?cmd=changeset;node=0d8c126c26e1 user: Agustina Arzille <avarz****@riseu*****> date: Mon Jun 04 14:52:02 2018 -0300 description: Fix lexical variables in let forms diffstat: compiler.cpp | 18 ++++++++---------- io.cpp | 3 ++- 2 files changed, 10 insertions(+), 11 deletions(-) diffs (71 lines): diff -r a3a4a2ce7c55 -r 0d8c126c26e1 compiler.cpp --- a/compiler.cpp Mon Jun 04 13:57:06 2018 -0300 +++ b/compiler.cpp Mon Jun 04 14:52:02 2018 -0300 @@ -125,13 +125,6 @@ this->cdepth = min (this->cdepth, val); } - int add_inlet (int off) - { - int ret = this->inlet; - this->inlet += off; - return (ret); - } - int index (object val) { auto it = this->ctable.find (val); @@ -1813,7 +1806,7 @@ this->ct_env = t2.as_obj (); if (!seq_mode) - aarg = this->add_inlet (1); + ++this->inlet; for (; bindings != NIL; bindings = xcddr (bindings)) { @@ -1845,11 +1838,11 @@ { this->emit (OPX_(MKFRAME), intobj (0)); aarg = (int)this->code.size () - 1; + ++this->let_cnt; } else this->emit (OPX_(LOADNIL)); - ++this->let_cnt; first = false; } @@ -1883,7 +1876,12 @@ } } - this->add_inlet (-1); + if (!seq_mode) + { + --this->inlet; + ++this->let_cnt; + } + int r = this->compile_do (t1.as_obj (), tail && !seq_mode, xcdr (expr)); this->ct_env = t2.cdr; diff -r a3a4a2ce7c55 -r 0d8c126c26e1 io.cpp --- a/io.cpp Mon Jun 04 13:57:06 2018 -0300 +++ b/io.cpp Mon Jun 04 14:52:02 2018 -0300 @@ -1558,12 +1558,13 @@ instrm.bvec = bv.as_obj (); instrm.pos = intobj (0); - instrm.full = STRM_UTF8 | STRM_READ; + instrm.full = 0; instrm.type = typecode::STREAM; stream::xops ops; ops.read = read_fail; instrm.ops = ops; + instrm.io_flags = STRM_UTF8 | STRM_READ; rdstate rd (interp, instrm.as_obj ()); object ret = rd.read_sexpr (UNBOUND);