This commit is contained in:
Able 2024-09-17 09:52:27 -05:00
parent fe70d81bd0
commit d2488689fe
5 changed files with 40 additions and 74 deletions

36
Cargo.lock generated
View file

@ -148,9 +148,9 @@ checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50"
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.1.19" version = "1.1.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d74707dde2ba56f86ae90effb3b43ddd369504387e718014de010cec7959800" checksum = "45bcde016d64c21da4be18b655631e5ab6d3107607e71a73a9f53eb48aae23fb"
dependencies = [ dependencies = [
"shlex", "shlex",
] ]
@ -390,33 +390,17 @@ dependencies = [
[[package]] [[package]]
name = "hbbytecode" name = "hbbytecode"
version = "0.1.0" version = "0.1.0"
<<<<<<< HEAD
<<<<<<< HEAD
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#4a9b9de87fd56a6bbd5d0ca2c622104d4807612b" source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#4a9b9de87fd56a6bbd5d0ca2c622104d4807612b"
=======
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#faf068885a42aedbb6a2bc50e21cb6d34f211cdb"
>>>>>>> 1f4fce0 (please bugs begone)
=======
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#254d5ed96234c8291770d84b2ac11ef7dd403b28"
>>>>>>> 41b339d (omfg it's fixed 🙏)
[[package]] [[package]]
name = "hbbytecode" name = "hbbytecode"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.ablecorp.us/ableos/holey-bytes.git#254d5ed96234c8291770d84b2ac11ef7dd403b28" source = "git+https://git.ablecorp.us/ableos/holey-bytes.git#4a9b9de87fd56a6bbd5d0ca2c622104d4807612b"
[[package]] [[package]]
name = "hblang" name = "hblang"
version = "0.1.0" version = "0.1.0"
<<<<<<< HEAD
<<<<<<< HEAD
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#4a9b9de87fd56a6bbd5d0ca2c622104d4807612b" source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#4a9b9de87fd56a6bbd5d0ca2c622104d4807612b"
=======
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#faf068885a42aedbb6a2bc50e21cb6d34f211cdb"
>>>>>>> 1f4fce0 (please bugs begone)
=======
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#254d5ed96234c8291770d84b2ac11ef7dd403b28"
>>>>>>> 41b339d (omfg it's fixed 🙏)
dependencies = [ dependencies = [
"hbvm 0.1.0 (git+https://git.ablecorp.us/AbleOS/holey-bytes.git)", "hbvm 0.1.0 (git+https://git.ablecorp.us/AbleOS/holey-bytes.git)",
] ]
@ -424,15 +408,7 @@ dependencies = [
[[package]] [[package]]
name = "hbvm" name = "hbvm"
version = "0.1.0" version = "0.1.0"
<<<<<<< HEAD
<<<<<<< HEAD
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#4a9b9de87fd56a6bbd5d0ca2c622104d4807612b" source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#4a9b9de87fd56a6bbd5d0ca2c622104d4807612b"
=======
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#faf068885a42aedbb6a2bc50e21cb6d34f211cdb"
>>>>>>> 1f4fce0 (please bugs begone)
=======
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#254d5ed96234c8291770d84b2ac11ef7dd403b28"
>>>>>>> 41b339d (omfg it's fixed 🙏)
dependencies = [ dependencies = [
"hbbytecode 0.1.0 (git+https://git.ablecorp.us/AbleOS/holey-bytes.git)", "hbbytecode 0.1.0 (git+https://git.ablecorp.us/AbleOS/holey-bytes.git)",
] ]
@ -440,7 +416,7 @@ dependencies = [
[[package]] [[package]]
name = "hbvm" name = "hbvm"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.ablecorp.us/ableos/holey-bytes.git#254d5ed96234c8291770d84b2ac11ef7dd403b28" source = "git+https://git.ablecorp.us/ableos/holey-bytes.git#4a9b9de87fd56a6bbd5d0ca2c622104d4807612b"
dependencies = [ dependencies = [
"hbbytecode 0.1.0 (git+https://git.ablecorp.us/ableos/holey-bytes.git)", "hbbytecode 0.1.0 (git+https://git.ablecorp.us/ableos/holey-bytes.git)",
] ]
@ -1307,9 +1283,9 @@ dependencies = [
[[package]] [[package]]
name = "toml_edit" name = "toml_edit"
version = "0.22.20" version = "0.22.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf"
dependencies = [ dependencies = [
"indexmap", "indexmap",
"serde", "serde",

View file

@ -1,14 +1,9 @@
acs := @use("rel:acs.hb") acs := @use("rel:acs.hb")
// Paths without a node-disk component are to be treated as local files. // Paths without a node-disk component are to be treated as local files.
// file_path := "DID:/test\0"; // file_path := "DID:/test\0";
Path := struct { Path := struct {// DiskID holds the host id
// DiskID holds the host id disk_id: acs.DiskID, length: u8, data: ^u8}
disk_id: acs.DiskID
length: u8,
data: ^u8
}
FileID := struct { FileID := struct {
host_id: int, host_id: int,

View file

@ -3,6 +3,8 @@ length := fn(ptr: ^u8): int {
loop if *(ptr + len) == 0 break else len += 1 loop if *(ptr + len) == 0 break else len += 1
return len return len
} }
// WTFFF is wrong with display_int
display_int := fn(num: int, p: ^u8): ^u8 { display_int := fn(num: int, p: ^u8): ^u8 {
ptr := p ptr := p
negative := num < 0 negative := num < 0
@ -10,42 +12,37 @@ display_int := fn(num: int, p: ^u8): ^u8 {
num = -num num = -num
} }
if num == 0 { if num == 0 {
*p = 48; *ptr = 48
*(p + 1) = 0 ptr += 1
return p } else {
loop if num == 0 break else {
*ptr = num % 10 + 48
ptr += 1
num /= 10
}
} }
if negative {
neg := false *ptr = 45
if num < 0 { ptr += 1
neg = true };
num = -num *ptr = 0
} @inline(reverse, p)
loop if num == 0 break else {
*(p + i) = num % 10 + 48
num /= 10
i += 1
}
if neg {
*(p + i) = 45
i += 1
}
reverse(p, i)
return p return p
} }
reverse := fn(p: ^u8, len: int): void { reverse := fn(s: ^u8): void {
start := 0 //reverse a string, don't remove digits
end := len - 1 len := 0
loop if start >= end break else { loop if *(s + len) == 0 break else len += 1
temp := *(p + start); i := 0
*(p + start) = *(p + end); j := len - 1
*(p + end) = temp temp := 0
start += 1 loop if i >= j break else {
end -= 1 temp = *(s + i);
*(s + i) = *(s + j);
*(s + j) = temp
i += 1
j -= 1
} }
return return
} }

View file

@ -45,13 +45,11 @@ main := fn(): int {
msg_type := 0 msg_type := 0
loop { loop {
// Open file // Open file
if msg_type == 0 { if msg_type == 0 {
// Paths without a node-disk component are to be treated as local files. // Paths without a node-disk component are to be treated as local files.
file_path := "node-disk:/test\0"; file_path := "node-disk:/test\0"
} else { } else {
// error // error
} }