commit 6f2b7251db176241642f8b4dedc3c779a7c383bc
parent 8defb9051934d5d4965c230997010d5d3b5bd999
Author: Drew DeVault <sir@cmpwn.com>
Date: Fri, 22 Jan 2021 09:11:41 -0500
typedefs: implement str and pointer types
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/typedef.c b/src/typedef.c
@@ -87,14 +87,18 @@ emit_type(const struct type *type, FILE *out)
case TYPE_STORAGE_UINT:
case TYPE_STORAGE_UINTPTR:
case TYPE_STORAGE_VOID:
+ case TYPE_STORAGE_STRING:
fprintf(out, "%s", type_storage_unparse(type->storage));
break;
+ case TYPE_STORAGE_POINTER:
+ fprintf(out, "%s*", type->pointer.flags & PTR_NULLABLE
+ ? "nullable " : "");
+ emit_type(type->pointer.referent, out);
+ break;
case TYPE_STORAGE_ALIAS:
case TYPE_STORAGE_ARRAY:
case TYPE_STORAGE_FUNCTION:
- case TYPE_STORAGE_POINTER:
case TYPE_STORAGE_SLICE:
- case TYPE_STORAGE_STRING:
case TYPE_STORAGE_STRUCT:
case TYPE_STORAGE_TAGGED_UNION:
case TYPE_STORAGE_UNION: