aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorCody <cody@codyq.dev>2022-12-17 13:52:32 -0600
committerCody <cody@codyq.dev>2022-12-17 13:52:32 -0600
commit1790d6a9091167b8bcc5f9136480ff2659c0660a (patch)
treea319326a9073e8ffc316002314e6bb712159d743 /src/main.rs
parent82d00772f036a80e8875207e2a11bd8ef3d2d615 (diff)
downloadsloth-1790d6a9091167b8bcc5f9136480ff2659c0660a.tar.gz
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
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs3
1 files changed, 2 insertions, 1 deletions
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);
}
}