Add an "iterate" keyword.

This commit is contained in:
Nigel Tao committed 2017-10-20 15:33:31 +11:00
1 parent 7b18295688
commit 51bd52239b
12 files changed
+253 -53

No files matched your search

+6
View File
@@ -65,6 +65,12 @@ pri func adler32.update(x[] u8)(checksum u32) {
}
}
iterate (p ptr u8:in.x) {
// TODO: uncomment this loop body, and delete the while loop below.
// s1 ~+= deref p as u32
// s2 ~+= s1
}
// TODO: can u64 be u32? Does it matter?
var i u64
while i < in.x.length(),