Bring back enum but using iota

This commit is contained in:
Ginger Bill
2017-01-01 16:18:50 +00:00
parent 0c6775ca14
commit 6fef74317c
13 changed files with 314 additions and 46 deletions
+10
View File
@@ -292,6 +292,12 @@ proc bprint_type(buf ^[]byte, ti ^Type_Info) {
bprint_type(buf, info.fields[i].type_info);
}
bprint_string(buf, "}");
case Enum:
bprint_string(buf, "enum ");
bprint_type(buf, info.base);
bprint_string(buf, " {}");
}
}
@@ -463,6 +469,10 @@ proc bprint_any(buf ^[]byte, arg any) {
bprint_string(buf, "(union)");
case Raw_Union:
bprint_string(buf, "(raw_union)");
case Enum:
bprint_any(buf, make_any(info.base, arg.data));
case Procedure:
bprint_type(buf, arg.type_info);
bprint_string(buf, " @ ");