Skip to content

Commit

Permalink
Merge pull request #480 from florianessl/Fixes
Browse files Browse the repository at this point in the history
Code generation fix: Specifying new values for existing enums in a separate file might overwrite existing ones
  • Loading branch information
Ghabry authored Jul 31, 2024
2 parents 54dff22 + afe471d commit 505496c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion generator/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,12 @@ def get_enums(*filenames):
for k, v in merge_dicts(results).items():
new_result[k] = OrderedDict()
for kk, gg in groupby(v, operator.attrgetter("entry")):
new_result[k][kk] = list(map(lambda x: (x.value, x.index), gg))
list_of = list(map(lambda x: (x.value, x.index), gg))
if kk in new_result[k]:
for elem in list_of:
new_result[k][kk].append(elem)
else:
new_result[k][kk] = list_of

return new_result

Expand Down

0 comments on commit 505496c

Please sign in to comment.