diff options
Diffstat (limited to 'sloth/src/main.rs')
| -rw-r--r-- | sloth/src/main.rs | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/sloth/src/main.rs b/sloth/src/main.rs index 34aad51..5ce631a 100644 --- a/sloth/src/main.rs +++ b/sloth/src/main.rs @@ -16,7 +16,7 @@ pub mod symtable; use std::fs::File; use std::{env, fs}; -use codegen::Compiler; +use codegen::Codegen; use inkwell::context::Context; use inkwell::targets::FileType; use itertools::Itertools; @@ -25,7 +25,6 @@ use parser::AstParser; use symtable::{Symbol, SymbolTable}; use crate::analysis::analyze; - use crate::symtable::Type; fn main() { @@ -59,18 +58,11 @@ fn main() { return; } - // println!("{ast:#?}"); - // println!("Suces"); - + // Generating code for module let context = Context::create(); - let mut compiler = Compiler::new(&context, "s"); + let mut codegen = Codegen::new(&context, "s"); let mut output_file = File::create("output.o").unwrap(); - compiler.codegen(&ast); - compiler.write_obj(&mut output_file, FileType::Object); - - // Compiler::codegen(&context, "hi", &ast); - - // let graph = GraphBuilder::generate(Some(&source), &ast).unwrap(); - // println!("{graph}"); + codegen.codegen(&ast); + codegen.write_obj(&mut output_file, FileType::Object); } |
