diff --git a/core/fmt/fmt.odin b/core/fmt/fmt.odin index 39652e012..ff6657c0b 100644 --- a/core/fmt/fmt.odin +++ b/core/fmt/fmt.odin @@ -1329,8 +1329,10 @@ fmt_value :: proc(fi: ^Info, v: any, verb: rune) { return; } - strings.write_byte(fi.buf, '{'); - defer strings.write_byte(fi.buf, '}'); + is_soa := info.soa_base_type != nil; + + strings.write_byte(fi.buf, is_soa ? '[' : '{'); + defer strings.write_byte(fi.buf, is_soa ? '[' : '}'); fi.indent += 1; defer fi.indent -= 1; hash := fi.hash; defer fi.hash = hash; @@ -1339,26 +1341,70 @@ fmt_value :: proc(fi: ^Info, v: any, verb: rune) { if hash do strings.write_byte(fi.buf, '\n'); - for _, i in info.names { - if !hash && i > 0 do strings.write_string(fi.buf, ", "); - if hash { - for in 0.. 0 do strings.write_string(fi.buf, ", "); + + field_count := -1; + + if !hash && field_count > 0 do strings.write_string(fi.buf, ", "); + + strings.write_string(fi.buf, base_type_name); + strings.write_byte(fi.buf, '{'); + defer strings.write_byte(fi.buf, '}'); + + for name, i in info.names { + field_count += 1; + + if !hash && field_count > 0 do strings.write_string(fi.buf, ", "); + if hash do for in 0..