Use !?? to denote coroutines

This commit is contained in:
Nigel Tao committed 2018-07-29 13:57:13 +10:00
1 parent 0a47966e72
commit 2100a9f837
8 files changed
+149 -149

No files matched your search

+4 -4
View File
@@ -34,8 +34,8 @@ pub func decoder.set_ignore_checksum!(ic base.bool) {
this.ignore_checksum = args.ic
}
pub func decoder.decode?(dst base.io_writer, src base.io_reader) {
var x base.u16 = args.src.read_u16be?()
pub func decoder.decode!??(dst base.io_writer, src base.io_reader) {
var x base.u16 = args.src.read_u16be!??()
if ((x >> 8) & 0x0F) != 0x08 {
return error "bad compression method"
}
@@ -53,7 +53,7 @@ pub func decoder.decode?(dst base.io_writer, src base.io_reader) {
var checksum_got base.u32
while true {
args.dst.set_mark!()
var z base.status = try this.flate.decode?(dst:args.dst, src:args.src)
var z base.status = try this.flate.decode!??(dst:args.dst, src:args.src)
if not this.ignore_checksum {
checksum_got = this.checksum.update!(x:args.dst.since_mark())
}
@@ -62,7 +62,7 @@ pub func decoder.decode?(dst base.io_writer, src base.io_reader) {
}
yield z
}
var checksum_want base.u32 = args.src.read_u32be?()
var checksum_want base.u32 = args.src.read_u32be!??()
if (not this.ignore_checksum) and (checksum_got != checksum_want) {
return error "bad checksum"
}