Begin supporting string16 across the core library

This commit is contained in:
gingerBill
2025-08-02 11:55:16 +01:00
parent 2561427dd3
commit ae02d3d02d
20 changed files with 230 additions and 32 deletions
+4 -4
View File
@@ -353,10 +353,10 @@ marshal_to_writer :: proc(w: io.Writer, v: any, opt: ^Marshal_Options) -> (err:
#partial switch info in ti.variant {
case runtime.Type_Info_String:
switch x in v {
case string:
return x == ""
case cstring:
return x == nil || x == ""
case string: return x == ""
case cstring: return x == nil || x == ""
case string16: return x == ""
case cstring16: return x == nil || x == ""
}
case runtime.Type_Info_Any:
return v.(any) == nil
+3 -1
View File
@@ -570,7 +570,9 @@ unmarshal_object :: proc(p: ^Parser, v: any, end_token: Token_Kind) -> (err: Unm
key_ptr: rawptr
#partial switch tk in t.key.variant {
case runtime.Type_Info_String:
case runtime.Type_Info_String:
assert(!tk.is_utf16)
key_ptr = rawptr(&key)
key_cstr: cstring
if reflect.is_cstring(t.key) {