Do not print column of a runtime.Source_Code_Location if the column == 0

This commit is contained in:
gingerBill
2024-04-19 13:32:55 +01:00
parent 20223345a4
commit 059175de3b
2 changed files with 16 additions and 8 deletions
+8 -4
View File
@@ -228,14 +228,18 @@ print_caller_location :: #force_no_inline proc "contextless" (loc: Source_Code_L
when ODIN_ERROR_POS_STYLE == .Default {
print_byte('(')
print_u64(u64(loc.line))
print_byte(':')
print_u64(u64(loc.column))
if loc.column != 0 {
print_byte(':')
print_u64(u64(loc.column))
}
print_byte(')')
} else when ODIN_ERROR_POS_STYLE == .Unix {
print_byte(':')
print_u64(u64(loc.line))
print_byte(':')
print_u64(u64(loc.column))
if loc.column != 0 {
print_byte(':')
print_u64(u64(loc.column))
}
print_byte(':')
} else {
#panic("unhandled ODIN_ERROR_POS_STYLE")