working + fiddling

This commit is contained in:
koniifer 2024-12-19 19:07:54 +00:00
parent d2cb73c2ce
commit f8523f5b3e
3 changed files with 14 additions and 14 deletions

6
Cargo.lock generated
View file

@ -213,12 +213,12 @@ dependencies = [
[[package]] [[package]]
name = "hbbytecode" name = "hbbytecode"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#cfd3eac0a832b61abe57a047aeb14ff8290dd8e6" source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#969ea57e3f677ae12b0b5031ad1da8711c71d634"
[[package]] [[package]]
name = "hblang" name = "hblang"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#cfd3eac0a832b61abe57a047aeb14ff8290dd8e6" source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#969ea57e3f677ae12b0b5031ad1da8711c71d634"
dependencies = [ dependencies = [
"hashbrown", "hashbrown",
"hbbytecode", "hbbytecode",
@ -229,7 +229,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#cfd3eac0a832b61abe57a047aeb14ff8290dd8e6" source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#969ea57e3f677ae12b0b5031ad1da8711c71d634"
dependencies = [ dependencies = [
"hbbytecode", "hbbytecode",
] ]

View file

@ -154,7 +154,7 @@ fmt_enum := fn(v: @Any(), str: ^u8, opts: FormatOptions): uint {
*@as(^[u8; 2], @bitcast(str + len)) = *@bitcast(".(\0") *@as(^[u8; 2], @bitcast(str + len)) = *@bitcast(".(\0")
len += 2 len += 2
len += @inline(fmt_int, @as(usize(T), @bitcast(v)), str + len, 10); len += @inline(fmt_int, @as(usize(T), @bitcast(v)), str + len, 10);
*@as(^[u8; 2], @bitcast(str + len)) = *@bitcast(".)\0") *@as(^[u8; 2], @bitcast(str + len)) = *@bitcast(")\0")
return len + 2 return len + 2
} }

View file

@ -1,31 +1,31 @@
.{log, math} := @use("stn"); .{log, math} := @use("stn");
.{Color} := @use("lib:render") .{Color} := @use("lib:render")
Thingy := struct { StructThingy := struct {
a: uint, a: uint,
b: int, b: int,
c: SubThingy, c: SubStructThingy,
} }
SubThingy := struct { SubStructThingy := struct {
a: f32, a: f32,
b: bool, b: bool,
} }
OtherThingy := enum { EnumThingy := enum {
The,
TheOther, TheOther,
TheOtherer,
} }
test := fn(): uint { test := fn(): uint {
log.print("Hello, World!\0", .{log: .Error}) log.print(@nameof(?u8), .{log: .Error})
log.print(OtherThingy.TheOther, .{}) log.print(EnumThingy.The, .{})
log.print(Thingy.(-100, -100, .(-math.PI, true)), .{log: .Warn}) log.print(StructThingy.(-100, -100, .(-math.PI, true)), .{log: .Warn})
log.print(SubThingy.(-math.E, false), .{}) log.print(SubStructThingy.(-math.E, false), .{})
log.print(Color.{r: 255, g: 254, b: 253, a: 252}, .{radix: 2}) log.print(Color.{r: 255, g: 254, b: 253, a: 252}, .{radix: 2})
log.print(@as(f64, math.LN_2), .{radix: 16, decimal_digits: 1 << 32}) log.print(@as(f64, math.LN_2), .{radix: 16, decimal_digits: 1 << 32})
log.print([u8].(1, 2, 3), .{}) log.print([u8].(1, 2, 3), .{})
log.print(&SubThingy.(0.0, true), .{}) log.print(&SubStructThingy.(0.0, true), .{})
log.print(@as(?u32, null), .{}) log.print(@as(?u32, null), .{})
log.print(@as(?u32, 200), .{}) log.print(@as(?u32, 200), .{})