ress 0.11.7

A scanner/tokenizer for JS files
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
fn main() {
    let mut args = std::env::args();
    let _ = args.next();
    let path = args.next().expect("First argument must be a file path");
    let path = std::path::Path::new(&path);
    if !path.exists() {
        panic!("First argument must be a file path");
    }
    let js = std::fs::read_to_string(path).expect("Couldn't read the path provide");
    for item in ress::Scanner::new(&js) {
        println!("{:?}", item.expect("failed to lex token"));
    }
}