- `core.list.empty`
- `core.conv.parse`
- `core.conv.parse_with_allocator`
+- `core.encoding.json.encode_string_opt`
+- `core.encoding.json.as_any` overload
Removals:
- Compiler test cases are no longer shipped with toolchain.
return s, .None;
}
+encode_string_opt :: (v: $T, allocator := context.allocator) -> ? str {
+ s, err := encode_string(v, allocator);
+ if err != .None {
+ return .None;
+ }
+
+ return s;
+}
+
//
// This could be changed to use the "any" type now, which would allow for any type to be
// represented as a json value. However, this eliminates the control that you get from
as_any :: #match #local {}
+#overload
+as_any :: macro (value: Value, $T: type_expr) -> T {
+ x: T;
+ #this_package.as_any(value, &x);
+ return x;
+}
+
#overload
as_any :: macro (value: Value, out: ^$T) {
#this_package.to_any(value, T, out);