1
0
Fork 0
forked from AbleOS/ableos

fixing a bug in a disasm

Signed-off-by: Jakub Doka <jakub.doka2@gmail.com>
This commit is contained in:
Jakub Doka 2024-12-17 20:24:53 +01:00
parent 9a06b329f4
commit ad587fe464
No known key found for this signature in database
GPG key ID: C6E9A89936B8C143
3 changed files with 21 additions and 10 deletions

20
Cargo.lock generated
View file

@ -210,6 +210,10 @@ dependencies = [
"foldhash", "foldhash",
] ]
[[package]]
name = "hbbytecode"
version = "0.1.0"
[[package]] [[package]]
name = "hbbytecode" name = "hbbytecode"
version = "0.1.0" version = "0.1.0"
@ -218,20 +222,26 @@ source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#248bdf003aa991f4bad
[[package]] [[package]]
name = "hblang" name = "hblang"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#248bdf003aa991f4bad18ddcb084532d1bcb78d5"
dependencies = [ dependencies = [
"hashbrown", "hashbrown",
"hbbytecode", "hbbytecode 0.1.0",
"hbvm", "hbvm 0.1.0",
"log", "log",
] ]
[[package]]
name = "hbvm"
version = "0.1.0"
dependencies = [
"hbbytecode 0.1.0",
]
[[package]] [[package]]
name = "hbvm" name = "hbvm"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#248bdf003aa991f4bad18ddcb084532d1bcb78d5" source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#248bdf003aa991f4bad18ddcb084532d1bcb78d5"
dependencies = [ dependencies = [
"hbbytecode", "hbbytecode 0.1.0 (git+https://git.ablecorp.us/AbleOS/holey-bytes.git)",
] ]
[[package]] [[package]]
@ -391,7 +401,7 @@ dependencies = [
"crossbeam-queue", "crossbeam-queue",
"derive_more", "derive_more",
"hashbrown", "hashbrown",
"hbvm", "hbvm 0.1.0 (git+https://git.ablecorp.us/AbleOS/holey-bytes.git)",
"ktest_macro", "ktest_macro",
"limine", "limine",
"log", "log",

View file

@ -109,7 +109,7 @@ impl Package {
std::fs::write(format!("target/programs/{}.hbf", self.name), &out)?; std::fs::write(format!("target/programs/{}.hbf", self.name), &out)?;
out.clear(); out.clear();
hblang::run_compiler( let err = hblang::run_compiler(
&path, &path,
Options { Options {
resolver: Some(hblang::ABLEOS_PATH_RESOLVER), resolver: Some(hblang::ABLEOS_PATH_RESOLVER),
@ -119,9 +119,10 @@ impl Package {
}, },
out, out,
&mut warnings, &mut warnings,
)?; );
std::fs::write(format!("target/programs/{}.hba", self.name), &out)?; std::fs::write(format!("target/programs/{}.hba", self.name), &out)?;
out.clear(); out.clear();
return err;
} }
Ok(()) Ok(())
} }

View file

@ -253,10 +253,10 @@ TERM_BACKDROP={}
); );
match p.build(&mut out) { match p.build(&mut out) {
Ok(()) => {} Ok(()) => {}
Err(_) => { Err(e) => {
writeln!(errors, "========= while compiling {} =========", path) writeln!(errors, "========= while compiling {} {} =========", path, e)
.unwrap(); .unwrap();
errors.push_str(core::str::from_utf8(&out).expect("no")); errors.push_str(&String::from_utf8_lossy(&out));
out.clear(); out.clear();
} }
} }