authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-05-31 13:58:11 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-05-31 13:58:11 -07:00
log94e0afff42bb49163e9af6cfc3e796bdb5a9aa99
tree833b0eea6972d2b1050f7be8c2d28a637c9230f5
parent06466b3e51778e19b37dbe4f9e1cb1fc6d5ef2af

gen- add stringToEnum that prints missing values


1 files changed, 6 insertions(+), 0 deletions(-)

scripts/_common.zig+6
......@@ -67,3 +67,9 @@ pub fn Main(comptime T: type) type {
6767 }
6868 };
6969}
70
71pub fn stringToEnum(comptime T: type, str: []const u8) !void {
72 if (std.meta.stringToEnum(T, str)) |_| {} else {
73 std.log.warn("{s} is not part of the type {s}", .{ str, @typeName(T) });
74 }
75}