From 1790d6a9091167b8bcc5f9136480ff2659c0660a Mon Sep 17 00:00:00 2001 From: Cody Date: Sat, 17 Dec 2022 13:52:32 -0600 Subject: Improvements to lexer, add test and benchmarks to lexer - Change lexer functions to return a option - Return None variant instead of \u0000 in case of EOF - Test lexer against a sample program --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index fa355c9..8f3c001 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,4 @@ +#![feature(test, let_chains)] #![warn( clippy::wildcard_imports, clippy::string_add, @@ -24,6 +25,6 @@ if variable >= 7 { fn main() { let lexer = Lexer::new(SOURCE); for token in lexer { - print!("({}) ", token.lexeme); + print!("{} ", token.lexeme); } } -- cgit v1.2.3