Rename #partial[Enum]Type to #sparse[Enum]Type for non-contiguous enum fields
This commit is contained in:
1 parent
1553137c23
commit
97be867103
7 files changed
+22
-8
No files matched your search
@@ -472,6 +472,9 @@ write_type_writer :: proc(w: io.Writer, ti: ^Type_Info, n_written: ^int = nil) -
|
||||
write_type(w, info.elem, &n) or_return
|
||||
|
||||
case Type_Info_Enumerated_Array:
|
||||
if info.is_sparse {
|
||||
io.write_string(w, "#sparse", &n) or_return
|
||||
}
|
||||
io.write_string(w, "[", &n) or_return
|
||||
write_type(w, info.index, &n) or_return
|
||||
io.write_string(w, "]", &n) or_return
|
||||
|
||||
@@ -95,6 +95,7 @@ Type_Info_Enumerated_Array :: struct {
|
||||
count: int,
|
||||
min_value: Type_Info_Enum_Value,
|
||||
max_value: Type_Info_Enum_Value,
|
||||
is_sparse: bool,
|
||||
}
|
||||
Type_Info_Dynamic_Array :: struct {elem: ^Type_Info, elem_size: int}
|
||||
Type_Info_Slice :: struct {elem: ^Type_Info, elem_size: int}
|
||||
|
||||
@@ -260,6 +260,9 @@ print_type :: proc "contextless" (ti: ^Type_Info) {
|
||||
print_type(info.elem)
|
||||
|
||||
case Type_Info_Enumerated_Array:
|
||||
if info.is_sparse {
|
||||
print_string("#sparse")
|
||||
}
|
||||
print_byte('[')
|
||||
print_type(info.index)
|
||||
print_byte(']')
|
||||
|
||||
Reference in new issue
Block a user