codegen alpha

This commit is contained in:
Leo
2024-04-10 18:32:47 +02:00
parent de2889c5d8
commit e2f87dc818
3 changed files with 29 additions and 22 deletions
+8 -11
View File
@@ -1,14 +1,11 @@
mod lexer;
use lexer::lex;
mod transpiler;
mod parser;
use parser::Parser;
mod lexer;
use std::fs;
fn main() {
let input = "int<x> mut x";
println!("\n\n\n\n");
let tokens = lex(input, false);
let mut ast = Parser::new(tokens.clone());
while ast.tokens.len() > ast.index as usize {
println!("{}\n\n", ast.next());
}
}
let contents = fs::read_to_string("code.ws").expect("cannot read for some reason");
let result = transpiler::transpile(contents, 0);
println!("{result}")
}