aboutsummaryrefslogblamecommitdiffhomepage
path: root/src/main.rs
blob: 361f76fc1f44448556024db656100e6b7dbeda69 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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());
    }
}