Add io_reader.is_closed

This commit is contained in:
Nigel Tao committed 2020-02-19 12:22:00 +11:00
1 parent 27036043ae
commit a8406927ef
4 files changed
+23 -13

No files matched your search

+4
View File
@@ -160,6 +160,10 @@ func (g *gen) writeBuiltinIOReader(b *buffer, recv *a.Expr, method t.ID, args []
b.printf(", ((uint64_t)(%s%s - %s%s)))", iopPrefix, name, io0Prefix, name)
return nil
case t.IDIsClosed:
b.printf("(%s && %s->meta.closed)", name, name)
return nil
case t.IDMark:
b.printf("((uint64_t)(%s%s - %s%s))", iopPrefix, name, io0Prefix, name)
return nil