From fbf1d07e27abce0c6cbdc5b4dfdba74b8f65afb7 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Tue, 20 Dec 2016 17:52:46 -0800 Subject: [PATCH] Iterate lexer --- src/lexer.rs | 2 ++ src/main.rs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/lexer.rs b/src/lexer.rs index ddc59e8..beaa8e6 100644 --- a/src/lexer.rs +++ b/src/lexer.rs @@ -28,6 +28,8 @@ impl Iterator for Lexer { type Item = Token; fn next(&mut self) -> Option { + let mut forward = self.index; + println!("Lexing '{}'", self.input); None } } diff --git a/src/main.rs b/src/main.rs index 66c9834..ebe58e4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,4 +6,7 @@ fn main() { lexer::hello("Emily"); let s = "Jonas".to_string(); lexer::hello(&s); + + let lexer = lexer::Lexer::new(String::from("((abc))")); + for t in lexer { } }