From e31896be0e6301ea2da13c864c1ca009ae349ca2 Mon Sep 17 00:00:00 2001 From: "Chris West (Faux)" Date: Wed, 5 Aug 2015 21:21:31 +0100 Subject: [PATCH] generate parser enums stably: additionally sort on name --- generate-command-parser.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate-command-parser.pl b/generate-command-parser.pl index f40bb390..c0a9a4d4 100755 --- a/generate-command-parser.pl +++ b/generate-command-parser.pl @@ -112,7 +112,7 @@ for my $line (@lines) { # We sort descendingly by length to be able to replace occurences of the state # name even when one state’s name is included in another one’s (like FOR_WINDOW # 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"); -- 2.39.5