From 4d977b5bd8cdcdfb8f8a7ec438976cc79a0fa770 Mon Sep 17 00:00:00 2001 From: Veikka Tuominen Date: Wed, 25 Oct 2023 09:27:15 +0300 Subject: [PATCH] GenerateDef: fix last definition being dropped Closes #530 --- build/GenerateDef.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/GenerateDef.zig b/build/GenerateDef.zig index ee63c564..193db5ac 100644 --- a/build/GenerateDef.zig +++ b/build/GenerateDef.zig @@ -126,6 +126,11 @@ fn generate(self: *GenerateDef, input: []const u8) ![]const u8 { value_name = line; } + if (value_name) |name| { + const old = try values.fetchPut(name, try properties.toOwnedSlice()); + if (old != null) return self.step.fail("duplicate value \"{s}\"", .{name}); + } + { var sorted_list = try arena.dupe([]const u8, values.keys()); defer arena.free(sorted_list);