Initial commit
- Implemented basic lexer - No spans implemented yet - No real error handling yet
This commit is contained in:
7
plang2/Cargo.toml
Normal file
7
plang2/Cargo.toml
Normal 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
23
plang2/src/main.rs
Normal 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);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user