Sketch some not-quite-compiling code into comp/fe/lexer.rs.

This commit is contained in:
Graydon Hoare 2010-07-14 09:41:36 -07:00
parent 0fdad302b8
commit 872f588ccb
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
import std._io.buf_reader;
iter buffers(buf_reader rdr) -> vec[u8] {
while (true) {
let vec[u8] v = rdr.read();
if (std._vec.len[u8](v) == uint(0)) {
ret;
}
put v;
}
}
iter bytes(buf_reader rdr) -> u8 {
for each (vec[u8] buf in buffers(rdr)) {
for (u8 b in buf) {
// FIXME: doesn't compile at the moment.
// put b;
}
}
}