Iterate lexer
This commit is contained in:
		
							parent
							
								
									7de54a9835
								
							
						
					
					
						commit
						fbf1d07e27
					
				
					 2 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -28,6 +28,8 @@ impl Iterator for Lexer {
 | 
			
		|||
    type Item = Token;
 | 
			
		||||
 | 
			
		||||
    fn next(&mut self) -> Option<Token> {
 | 
			
		||||
        let mut forward = self.index;
 | 
			
		||||
        println!("Lexing '{}'", self.input);
 | 
			
		||||
        None
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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 { }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue