fix: exiting repl on newline and weird behaviour in discord bot

This commit is contained in:
2024-10-27 23:21:13 -04:00
parent 83ac160a42
commit db6750c481
2 changed files with 1 additions and 18 deletions

View File

@@ -246,7 +246,7 @@ impl<R: BufRead> Iterator for CodeIter<R> {
self.column = 0;
self.pos += 1;
None
Some('\n')
},
c => {
self.column += 1;

View File

@@ -362,21 +362,4 @@ impl<R: BufRead> Iterator for Tokenizer<R> {
fn next(&mut self) -> Option<Self::Item> {
self.tokenize().transpose()
}
}
#[cfg(test)]
mod tests {
use super::*;
use std::io::Cursor;
#[test]
fn a() {
let program = ": f a * 12 a f 12\n\n";
let tokenizer = Tokenizer::new(Arc::new(Mutex::new(CodeIter::new(Cursor::new(program)))));
let t: Vec<_> = tokenizer.collect();
println!("{t:#?}");
}
}