Integrate package io into core library

This commit is contained in:
gingerBill
2020-12-03 10:45:26 +00:00
parent 334a8c46e8
commit 18da0b3418
9 changed files with 621 additions and 429 deletions
+3 -2
View File
@@ -14,7 +14,8 @@ Marshal_Error :: enum {
}
marshal :: proc(v: any, allocator := context.allocator) -> ([]byte, Marshal_Error) {
b := strings.make_builder(allocator);
b: strings.Builder;
strings.init_builder(&b, allocator);
err := marshal_arg(&b, v);
@@ -129,7 +130,7 @@ marshal_arg :: proc(b: ^strings.Builder, v: any) -> Marshal_Error {
case b32: val = bool(b);
case b64: val = bool(b);
}
write_string(b, val ? "true" : "false");
write_string_builder(b, val ? "true" : "false");
case Type_Info_Any:
return .Unsupported_Type;