Skip to content

Commit

Permalink
Fixed issue in code generator: merging enums from two different files…
Browse files Browse the repository at this point in the history
… might overwrite existing declarations in some cases
  • Loading branch information
florianessl committed May 6, 2024
1 parent 54dff22 commit afe471d
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 afe471d

Please sign in to comment.