Fix issue #51; begin work on atomic types

This commit is contained in:
Ginger Bill
2017-04-28 11:01:46 +01:00
parent b78e970698
commit 99125dc743
12 changed files with 232 additions and 135 deletions
+7
View File
@@ -212,6 +212,10 @@ write_type :: proc(buf: ^String_Buffer, ti: ^Type_Info) {
}
case String: write_string(buf, "string");
case Boolean: write_string(buf, "bool");
case Atomic:
write_string(buf, "atomic ");
write_type(buf, info.elem);
case Pointer:
if info.elem == nil {
write_string(buf, "rawptr");
@@ -813,6 +817,9 @@ fmt_value :: proc(fi: ^Fmt_Info, v: any, verb: rune) {
fmt_pointer(fi, (cast(^rawptr)v.data)^, verb);
}
case Atomic:
fmt_arg(fi, any{v.data, info.elem}, verb);
case Array:
if verb != 'v' {
fmt_bad_verb(fi, verb);