output->write(istr);
}
+ case type_expr {
+ value := *(cast(^type_expr) v.data);
+
+ io :: package core.io
+
+ buf : [256] u8;
+
+ // This is a little gross but the only way to output the type name for a type_expr
+ // is through a io.Writer. That should maybe be changed in the future? Also, I think
+ // 256 bytes is enough for the name of a type but I'm not entirely sure...
+ stream := io.string_stream_make(~~buf);
+ writer := io.writer_make(^stream);
+ type_info.write_type_name(^writer, value);
+
+ output->write(io.string_stream_to_str(^stream));
+ }
+
case #default {
info := get_type_info(v.type);
};
}
+string_stream_to_str :: (use ss: ^StringStream) -> str {
+ return .{ data.data, curr_pos };
+}
#private
string_stream_vtable := Stream_Vtable.{
-123 Test {} false 12.3 12.34567
+123 Test {} false 12.3 12.34567 [..] Map(i32, [] u8)
use package core
main :: (args: [] cstr) {
- printf("{} {} {{}} {} {.1} {.5}\n", 123, "Test", false, 12.34, 12.3456789);
+ printf("{} {} {{}} {} {.1} {.5} {}\n", 123, "Test", false, 12.34, 12.3456789, #type [..] map.Map(i32, str));
}