Initial commit

- Implemented basic lexer
- No spans implemented yet
- No real error handling yet
This commit is contained in:
2021-12-23 16:48:49 +01:00
commit f2a00e6560
9 changed files with 573 additions and 0 deletions

7
plang2/Cargo.toml Normal file
View File

@@ -0,0 +1,7 @@
[package]
name = "plang2"
version = "0.1.0"
edition = "2021"
[dependencies]
plang2_lib = { path = "../plang2_lib" }

23
plang2/src/main.rs Normal file
View File

@@ -0,0 +1,23 @@
#![allow(dead_code, unused)]
use plang2_lib::*;
fn main() {
let code = r#"
// This is the main function
fn main() {
let a = 5465;
let b = 8;
let c = a + b;
print_int(c);
}
"#;
let mut lexer = Lexer::new(code);
let tokens = lexer.tokenize().unwrap();
println!("Tokens: \n{}\n", tokens);
}