From 21c1abe15aa72a1619edaf8f8f390444e220b09f Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 5 Dec 2020 12:03:38 +0000 Subject: [PATCH] Add fmt formatting for runtime.Source_Code_Location --- core/fmt/fmt.odin | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/fmt/fmt.odin b/core/fmt/fmt.odin index 3241548a3..84cf4f160 100644 --- a/core/fmt/fmt.odin +++ b/core/fmt/fmt.odin @@ -1339,6 +1339,15 @@ fmt_value :: proc(fi: ^Info, v: any, verb: rune) { case runtime.Type_Info_Named: // Built-in Custom Formatters for core library types switch a in v { + case runtime.Source_Code_Location: + io.write_string(fi.writer, a.file_path); + io.write_byte(fi.writer, '('); + io.write_int(fi.writer, a.line); + io.write_byte(fi.writer, ':'); + io.write_int(fi.writer, a.column); + io.write_byte(fi.writer, ')'); + return; + case time.Duration: ffrac :: proc(buf: []byte, v: u64, prec: int) -> (nw: int, nv: u64) { v := v;