Add an io_bind keyword

This commit is contained in:
Nigel Tao committed 2018-04-28 11:45:33 +10:00
1 parent 00f660af60
commit 395890c287
11 files changed
+127 -18

No files matched your search

+10 -7
View File
@@ -313,13 +313,16 @@ pri func decoder.decode_id?(dst base.io_writer, src base.io_reader)() {
// TODO: should "mark" be "set_mark"? Unlike "limit", "mark" does
// not return a different io_reader.
in.src.mark()
var r base.io_reader = in.src
// TODO: remove the dummy param. It's needed for now so that
// writeSaveExprDerivedVars updates e.g. the b_rptr_src derived
// variables.
//
// TODO: enforce that limit can only be called in a "foo?" call?
var z base.status = try this.lzw.decode?(dst:in.dst, src:r.limit(l:block_size), dummy:in.src)
io_bind (in.src) {
var r base.io_reader = in.src
// TODO: remove the dummy param. It's needed for now so that
// writeSaveExprDerivedVars updates e.g. the b_rptr_src derived
// variables.
//
// TODO: enforce that limit can only be called in a "foo?"
// call?
var z base.status = try this.lzw.decode?(dst:in.dst, src:r.limit(l:block_size), dummy:in.src)
}
if z.is_ok() {
break
}