aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
blob: fa355c9de6590a75ff1f95755bacf84700cb7625 (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
29
#![warn(
    clippy::wildcard_imports,
    clippy::string_add,
    clippy::string_add_assign,
    clippy::manual_ok_or,
    unused_lifetimes
)]

pub mod ast;
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);
    }
}