Rename #partial[Enum]Type to #sparse[Enum]Type for non-contiguous enum fields

This commit is contained in:
gingerBill
2022-02-05 13:01:15 +00:00
parent 1553137c23
commit 97be867103
7 changed files with 22 additions and 8 deletions

View File

@@ -221,6 +221,7 @@ struct TypeProc {
ExactValue *max_value; \
i64 count; \
TokenKind op; \
bool is_sparse; \
}) \
TYPE_KIND(Slice, struct { Type *elem; }) \
TYPE_KIND(DynamicArray, struct { Type *elem; }) \
@@ -3830,6 +3831,9 @@ gbString write_type_to_string(gbString str, Type *type) {
break;
case Type_EnumeratedArray:
if (type->EnumeratedArray.is_sparse) {
str = gb_string_appendc(str, "#sparse");
}
str = gb_string_append_rune(str, '[');
str = write_type_to_string(str, type->EnumeratedArray.index);
str = gb_string_append_rune(str, ']');