This commit is contained in:
greg 2018-03-02 21:59:14 -08:00
parent 1056be12e7
commit 66cd51a355

View File

@ -92,18 +92,11 @@ type CharIter<I: Iterator<Item=(usize,usize,char)>> = Peekable<I>;
pub fn tokenize(input: &str) -> Vec<Token> { pub fn tokenize(input: &str) -> Vec<Token> {
let mut tokens: Vec<Token> = Vec::new(); let mut tokens: Vec<Token> = Vec::new();
//let b = input.clone();
//ound type `std::iter::Peekable<std::iter::FlatMap<std::iter::Enumerate<std::str::Lines<'_>>, std::iter::Map<std::iter::Enumerate<std::str::Chars<'_>>, [closure@src/schala_lang
// tokenizing.rs:99:40: 99:82 line_idx:_]>, [closure@src/schala_lang/tokenizing.rs:98:17: 100:8]>>`
let mut input = input.lines().enumerate() let mut input = input.lines().enumerate()
.flat_map(|(line_idx, ref line)| { .flat_map(|(line_idx, ref line)| {
line.chars().enumerate().map(move |(ch_idx, ch)| (line_idx, ch_idx, ch)) line.chars().enumerate().map(move |(ch_idx, ch)| (line_idx, ch_idx, ch))
}).peekable(); }).peekable();
//let mut input: CharIter = input.chars().enumerate().peekable();
while let Some((line_idx, ch_idx, c)) = input.next() { while let Some((line_idx, ch_idx, c)) = input.next() {
let cur_tok_type = match c { let cur_tok_type = match c {
'#' => { '#' => {