@ enum type

This commit is contained in:
agra
2026-02-14 14:52:39 +02:00
parent fe7efeadb0
commit d61c6488f3
12 changed files with 164 additions and 41 deletions

View File

@@ -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, '.');