Generate C code for "self.foo?()".

This commit is contained in:
Nigel Tao committed 2017-06-16 15:38:40 +10:00
1 parent e6f5fd7f53
commit cd526ccafe
5 files changed
+113 -55

No files matched your search

+5 -1
View File
@@ -10,7 +10,11 @@ pub struct decoder?(
)
pub func decoder.decode?(dst ptr buf1, src ptr buf1)() {
// Read either "GIF87a" or "GIF89a".
this.decode_header?(src:in.src)
}
// decode_header reads either "GIF87a" or "GIF89a".
pri func decoder.decode_header?(src ptr buf1)() {
if (in.src.read_u8?() != 0x47) or (in.src.read_u8?() != 0x49) or
(in.src.read_u8?() != 0x46) or (in.src.read_u8?() != 0x38) {
return error "bad GIF header"