aboutsummaryrefslogtreecommitdiff
path: root/core/runtime
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-03-06 13:31:23 +0000
committergingerBill <bill@gingerbill.org>2023-03-06 13:33:29 +0000
commiteea92a3371037d97cb141656d58ff5e14e7e3efc (patch)
tree1d333d66aefc144fdf58db1fc6bd377a861623a4 /core/runtime
parentff275df5ea01d24960c60d43a14db274db4eefd8 (diff)
Add booleans to `print_any_single`
Diffstat (limited to 'core/runtime')
-rw-r--r--core/runtime/print.odin10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/runtime/print.odin b/core/runtime/print.odin
index 9696488a4..326a29667 100644
--- a/core/runtime/print.odin
+++ b/core/runtime/print.odin
@@ -6,7 +6,7 @@ _INTEGER_DIGITS :: "0123456789abcdefghijklmnopqrstuvwxyz"
_INTEGER_DIGITS_VAR := _INTEGER_DIGITS
when !ODIN_DISALLOW_RTTI {
- print_any_single :: proc(arg: any) {
+ print_any_single :: proc "contextless" (arg: any) {
x := arg
if loc, ok := x.(Source_Code_Location); ok {
print_caller_location(loc)
@@ -49,6 +49,12 @@ when !ODIN_DISALLOW_RTTI {
case uint: print_uint(v)
case uintptr: print_uintptr(v)
+ case bool: print_string("true" if v else "false")
+ case b8: print_string("true" if v else "false")
+ case b16: print_string("true" if v else "false")
+ case b32: print_string("true" if v else "false")
+ case b64: print_string("true" if v else "false")
+
case:
ti := type_info_of(x.id)
#partial switch v in ti.variant {
@@ -60,7 +66,7 @@ when !ODIN_DISALLOW_RTTI {
print_string("<invalid-value>")
}
}
- println_any :: proc(args: ..any) {
+ println_any :: proc "contextless" (args: ..any) {
loop: for arg, i in args {
if i != 0 {
print_string(" ")