aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
new file mode 100644
index 0000000..361f76f
--- /dev/null
+++ b/src/main.rs
@@ -0,0 +1,18 @@
+mod lexer;
+
+use lexer::Lexer;
+use std::io::Read;
+
+fn main() {
+ println!("Lex stdin.");
+ println!("ENTER to lex current input.");
+ println!("C-c to exit.");
+ let mut lex = Lexer::new(std::io::stdin().bytes().filter_map(|v| {
+ let v = v.ok()?;
+ Some(v.into())
+ }));
+
+ loop {
+ println!("{:?}", lex.gettok());
+ }
+}