aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
blob: 53347465e7c9d5cb8204d0337e442affa2c239e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#![warn(
    clippy::wildcard_imports,
    clippy::string_add,
    clippy::string_add_assign,
    clippy::manual_ok_or,
    unused_lifetimes
)]

pub mod lexer;

use lexer::Lexer;

const SOURCE: &str = r#"

val variable = 5;

if variable >= 7 {
    print "Hello World";
}

"#;

fn main() {
    let lexer = Lexer::new(SOURCE);
    for token in lexer {
        print!("({}) ", token.lexeme);
    }
}