Maybe types; value, ok := maybe_value(x)

This commit is contained in:
Ginger Bill
2016-10-06 23:30:22 +01:00
parent 50301557b2
commit f40482aa29
12 changed files with 309 additions and 118 deletions
+3
View File
@@ -36,6 +36,9 @@ Type_Info :: union {
Pointer: struct #ordered {
elem: ^Type_Info
}
Maybe: struct #ordered {
elem: ^Type_Info
}
Procedure: struct #ordered {
params: ^Type_Info // Type_Info.Tuple
results: ^Type_Info // Type_Info.Tuple
+7
View File
@@ -413,6 +413,13 @@ print_any_to_buffer :: proc(buf: ^[]byte, arg: any) {
print_pointer_to_buffer(buf, nil)
}
case Maybe:
if arg.data != nil {
} else {
print_string_to_buffer(buf, "<nil>")
}
case Enum:
value: i64 = 0
match type i : info.base {