From f8523f5b3e2f1782efe91bd64c6bf17d5be70909 Mon Sep 17 00:00:00 2001 From: koniifer Date: Thu, 19 Dec 2024 19:07:54 +0000 Subject: [PATCH] working + fiddling --- Cargo.lock | 6 +++--- sysdata/libraries/stn/src/fmt.hb | 2 +- sysdata/programs/test/src/tests/stn/fmt.hb | 20 ++++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eac0453..cec5c5f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -213,12 +213,12 @@ dependencies = [ [[package]] name = "hbbytecode" 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]] name = "hblang" 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 = [ "hashbrown", "hbbytecode", @@ -229,7 +229,7 @@ dependencies = [ [[package]] name = "hbvm" 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 = [ "hbbytecode", ] diff --git a/sysdata/libraries/stn/src/fmt.hb b/sysdata/libraries/stn/src/fmt.hb index 3adc1dd..6e6ff99 100644 --- a/sysdata/libraries/stn/src/fmt.hb +++ b/sysdata/libraries/stn/src/fmt.hb @@ -154,7 +154,7 @@ fmt_enum := fn(v: @Any(), str: ^u8, opts: FormatOptions): uint { *@as(^[u8; 2], @bitcast(str + len)) = *@bitcast(".(\0") len += 2 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 } diff --git a/sysdata/programs/test/src/tests/stn/fmt.hb b/sysdata/programs/test/src/tests/stn/fmt.hb index 02ff093..e365032 100644 --- a/sysdata/programs/test/src/tests/stn/fmt.hb +++ b/sysdata/programs/test/src/tests/stn/fmt.hb @@ -1,31 +1,31 @@ .{log, math} := @use("stn"); .{Color} := @use("lib:render") -Thingy := struct { +StructThingy := struct { a: uint, b: int, - c: SubThingy, + c: SubStructThingy, } -SubThingy := struct { +SubStructThingy := struct { a: f32, b: bool, } -OtherThingy := enum { +EnumThingy := enum { + The, TheOther, - TheOtherer, } test := fn(): uint { - log.print("Hello, World!\0", .{log: .Error}) - log.print(OtherThingy.TheOther, .{}) - log.print(Thingy.(-100, -100, .(-math.PI, true)), .{log: .Warn}) - log.print(SubThingy.(-math.E, false), .{}) + log.print(@nameof(?u8), .{log: .Error}) + log.print(EnumThingy.The, .{}) + log.print(StructThingy.(-100, -100, .(-math.PI, true)), .{log: .Warn}) + log.print(SubStructThingy.(-math.E, false), .{}) 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([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, 200), .{})