From: Brendan Hansen Date: Fri, 31 Dec 2021 22:40:00 +0000 (-0600) Subject: added disabling custom formatting X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=aef3eca67cff2dc000092a930694df66c8d7de73;p=onyx.git added disabling custom formatting --- diff --git a/core/conv.onyx b/core/conv.onyx index 0749a0ef..a29fc0a1 100644 --- a/core/conv.onyx +++ b/core/conv.onyx @@ -262,6 +262,7 @@ Format :: struct { pretty_printing := false; quote_strings := false; dereference := false; + custom_format := true; digits_after_decimal := cast(u32) 4; indentation := cast(u32) 0; @@ -351,6 +352,11 @@ format_va :: (buffer: [] u8, format: str, va: [] any) -> str { formatting.minimum_width = ~~digits; } + case #char "!" { + i += 1; + formatting.custom_format = false; + } + case #char "}" { arg := va[vararg_index]; vararg_index += 1; @@ -397,7 +403,7 @@ format_any :: (output: ^Format_Output, formatting: ^Format, v: any) { } } - if custom_formatters->has(v.type) { + if formatting.custom_format && custom_formatters->has(v.type) { custom_formatters[v.type](output, formatting, v.data); return; }