@ enum type
This commit is contained in:
@@ -786,6 +786,7 @@ pub const Server = struct {
|
||||
.percent,
|
||||
.percent_equal,
|
||||
.ampersand,
|
||||
.at,
|
||||
.pipe,
|
||||
.arrow,
|
||||
.fat_arrow,
|
||||
@@ -1634,10 +1635,17 @@ pub const Server = struct {
|
||||
.enum_decl => |ed| {
|
||||
try buf.appendSlice(allocator, ed.name);
|
||||
if (ed.is_flags) {
|
||||
try buf.appendSlice(allocator, " :: enum flags { ");
|
||||
try buf.appendSlice(allocator, " :: enum flags ");
|
||||
} else {
|
||||
try buf.appendSlice(allocator, " :: enum { ");
|
||||
try buf.appendSlice(allocator, " :: enum ");
|
||||
}
|
||||
if (ed.backing_type) |bt| {
|
||||
if (bt.data == .type_expr) {
|
||||
try buf.appendSlice(allocator, bt.data.type_expr.name);
|
||||
try buf.appendSlice(allocator, " ");
|
||||
}
|
||||
}
|
||||
try buf.appendSlice(allocator, "{ ");
|
||||
for (ed.variant_names, 0..) |v, i| {
|
||||
if (i > 0) try buf.appendSlice(allocator, ", ");
|
||||
try buf.append(allocator, '.');
|
||||
|
||||
Reference in New Issue
Block a user