From 842994356936ee2b8a14166b39052672eb2211d2 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Wed, 3 Nov 2021 11:27:21 +0000 Subject: [PATCH] Represent matrices in `fmt` as expected --- core/fmt/fmt.odin | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/core/fmt/fmt.odin b/core/fmt/fmt.odin index 21aa1efcf..10b62d51b 100644 --- a/core/fmt/fmt.odin +++ b/core/fmt/fmt.odin @@ -1929,23 +1929,23 @@ fmt_value :: proc(fi: ^Info, v: any, verb: rune) { if fi.hash { io.write_byte(fi.writer, '\n') // TODO(bill): Should this render it like in written form? e.g. tranposed - for row in 0.. 0 { io.write_string(fi.writer, ", ") } + for row in 0.. 0 { io.write_string(fi.writer, ", ") } offset := (col + row*info.elem_stride)*info.elem_size data := uintptr(v.data) + uintptr(offset) fmt_arg(fi, any{rawptr(data), info.elem.id}, verb) } - io.write_string(fi.writer, ";\n") + io.write_string(fi.writer, ",\n") } } else { - for row in 0.. 0 { io.write_string(fi.writer, "; ") } - for col in 0.. 0 { io.write_string(fi.writer, ", ") } + for col in 0.. 0 { io.write_string(fi.writer, "; ") } + for row in 0.. 0 { io.write_string(fi.writer, ", ") } offset := (col + row*info.elem_stride)*info.elem_size