terminal: use LibEnum for the command keys

This commit is contained in:
Mitchell Hashimoto
2025-09-27 14:32:45 -07:00
parent a79e68ace1
commit 397e47c274
4 changed files with 38 additions and 3 deletions

View File

@@ -35,7 +35,8 @@ pub fn Enum(
fields_i += 1;
}
return @Type(.{ .@"enum" = .{
// Assigned to var so that the type name is nicer in stack traces.
const Result = @Type(.{ .@"enum" = .{
.tag_type = switch (target) {
.c => c_int,
.zig => std.math.IntFittingRange(0, fields_i - 1),
@@ -44,6 +45,7 @@ pub fn Enum(
.decls = &.{},
.is_exhaustive = true,
} });
return Result;
}
pub const Target = union(enum) {