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
+2 -1
View File
@@ -13,4 +13,5 @@ rand = "0.8.5"
serde_json = "1.0" serde_json = "1.0"
serde = "1.0.203" serde = "1.0.203"
serde_derive = "1.0.203" serde_derive = "1.0.203"
lsp-types = "0.97.0" lsp-types = "0.97.0"
zip = "2.1.3"
+5 -1
View File
@@ -1,6 +1,6 @@
use std::fs; use std::fs;
use crate::{transpiler::Transpiler, variable::Variables}; use crate::{dll_reader::read_dll, transpiler::Transpiler, variable::Variables};
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub struct Module { pub struct Module {
@@ -46,6 +46,10 @@ impl FileWriter {
} }
} }
pub fn add(&mut self, filepath: String, variables: &mut Variables) -> String { 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()) { if let Some(module) = self.check(filepath.clone()) {
return module.mod_rs.clone(); return module.mod_rs.clone();
} }
+3 -1
View File
@@ -1,4 +1,5 @@
mod compile; mod compile;
mod dll_reader;
mod file_writer; mod file_writer;
mod lexer; mod lexer;
mod lsp; mod lsp;
@@ -41,7 +42,8 @@ fn main() {
let mut trsp = Transpiler::default(); let mut trsp = Transpiler::default();
let mut vars = Variables::new(); let mut vars = Variables::new();
let mut transpiled_code = trsp.transpile(file_content, 0, &mut vars); 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 += vars.get_var("main".to_string(), &mut trsp).as_str();
transpiled_code += "())}"; transpiled_code += "())}";
for problem in trsp.problems { for problem in trsp.problems {
BIN
View File
Binary file not shown.