mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-26 09:23:48 +00:00
Source_Code_Location.hash; %#v printing for Source_Code_Location; allow typeid for map keys
This commit is contained in:
@@ -34,6 +34,7 @@ Fmt_Info :: struct {
|
||||
arg: any, // Temporary
|
||||
}
|
||||
|
||||
|
||||
string_buffer_from_slice :: proc(backing: []byte) -> String_Buffer {
|
||||
s := transmute(mem.Raw_Slice)backing;
|
||||
d := mem.Raw_Dynamic_Array{
|
||||
@@ -1281,6 +1282,20 @@ fmt_arg :: proc(fi: ^Fmt_Info, arg: any, verb: rune) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
custom_types: switch a in arg {
|
||||
case runtime.Source_Code_Location:
|
||||
if fi.hash && verb == 'v' {
|
||||
write_string(fi.buf, a.file_path);
|
||||
write_byte(fi.buf, '(');
|
||||
write_i64(fi.buf, i64(a.line), 10);
|
||||
write_byte(fi.buf, ':');
|
||||
write_i64(fi.buf, i64(a.column), 10);
|
||||
write_byte(fi.buf, ')');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
base_arg := arg;
|
||||
base_arg.id = runtime.typeid_base(base_arg.id);
|
||||
switch a in base_arg {
|
||||
|
||||
Reference in New Issue
Block a user