dll reader_alpha

This commit is contained in:
2024-06-21 11:57:28 +02:00
parent 387b247823
commit 472ee1cb81
4 changed files with 10 additions and 3 deletions
+5 -1
View File
@@ -1,6 +1,6 @@
use std::fs;
use crate::{transpiler::Transpiler, variable::Variables};
use crate::{dll_reader::read_dll, transpiler::Transpiler, variable::Variables};
#[derive(Clone, Debug)]
pub struct Module {
@@ -46,6 +46,10 @@ impl FileWriter {
}
}
pub fn add(&mut self, filepath: String, variables: &mut Variables) -> String {
if filepath.ends_with(".dll") {
read_dll(filepath.clone());
return "xyz".to_string();
}
if let Some(module) = self.check(filepath.clone()) {
return module.mod_rs.clone();
}
+3 -1
View File
@@ -1,4 +1,5 @@
mod compile;
mod dll_reader;
mod file_writer;
mod lexer;
mod lsp;
@@ -41,7 +42,8 @@ fn main() {
let mut trsp = Transpiler::default();
let mut vars = Variables::new();
let mut transpiled_code = trsp.transpile(file_content, 0, &mut vars);
transpiled_code += "\nfn main() {std::process::exit(";
transpiled_code += "\nfn main() {";
transpiled_code += "std::process::exit(";
transpiled_code += vars.get_var("main".to_string(), &mut trsp).as_str();
transpiled_code += "())}";
for problem in trsp.problems {