- updated common with new compiler/builder trait to provide a common

interface for build tools
- updated editor and build tooling to use new system
This commit is contained in:
2026-02-22 21:43:22 +00:00
parent 4ed5da259e
commit 7117b927f3
9 changed files with 203 additions and 129 deletions
+16 -2
View File
@@ -1,4 +1,7 @@
use std::path::Path;
use std::path::{Path, PathBuf};
use common::{build::Builder, logging::log};
use compiler::Compiler;
fn main() {
// read from input file: syntax "c_compiler <src.c> [output.dsa]"
@@ -15,5 +18,16 @@ fn main() {
"output.dsa"
};
compiler::compile_file(Path::new(input_file), Path::new(output_file)).unwrap();
{
let mut builder = Compiler::new(PathBuf::from(input_file));
builder.start();
let result = builder.output().unwrap();
std::fs::write(output_file, &result).expect("Failed to write output");
log(&format!(
"Compilation Successful ✅ \n\tSource: {}\n\tOutput: {}\n",
input_file, output_file,
));
}
}