generate parser enums stably: additionally sort on name

This commit is contained in:
Chris West (Faux) 2015-08-05 21:21:31 +01:00
parent 419b73be9e
commit e31896be0e
1 changed files with 1 additions and 1 deletions

View File

@ -112,7 +112,7 @@ for my $line (@lines) {
# We sort descendingly by length to be able to replace occurences of the state # We sort descendingly by length to be able to replace occurences of the state
# name even when one states name is included in another ones (like FOR_WINDOW # name even when one states name is included in another ones (like FOR_WINDOW
# is in FOR_WINDOW_COMMAND). # is in FOR_WINDOW_COMMAND).
my @keys = sort { length($b) <=> length($a) } keys %states; my @keys = sort { (length($b) <=> length($a)) or ($a cmp $b) } keys %states;
open(my $enumfh, '>', "GENERATED_${prefix}_enums.h"); open(my $enumfh, '>', "GENERATED_${prefix}_enums.h");