aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2012-06-10 13:01:50 +0200
committerAnthony Ramine <[email protected]>2012-06-10 13:01:50 +0200
commitd932ad582676f1593d917f222b1d8dec71fe88b3 (patch)
treeaf5c8a41cd32df0c13653059253c8611e66fba63 /lib/compiler
parent198ef4b41ce0b22898b7642354ea5062bc3cc896 (diff)
downloadotp-d932ad582676f1593d917f222b1d8dec71fe88b3.tar.gz
otp-d932ad582676f1593d917f222b1d8dec71fe88b3.tar.bz2
otp-d932ad582676f1593d917f222b1d8dec71fe88b3.zip
Fix messages ordering with column numbers
With L1, L2, C1, C2 integers such as L1 < L2 and C1 < C2, locations are ordered like this: L1 < {L1, C1} < {L1, C2} < L2
Diffstat (limited to 'lib/compiler')
-rw-r--r--lib/compiler/src/compile.erl12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl
index 8062ca59fa..d4d84e02fb 100644
--- a/lib/compiler/src/compile.erl
+++ b/lib/compiler/src/compile.erl
@@ -359,7 +359,17 @@ messages_per_file(Ms) ->
(_) -> false
end, A)
end, T, PrioMs),
- Prio = lists:sort(fun({_,{L1,_,_}}, {_,{L2,_,_}}) -> L1 =< L2 end,
+ Prio = lists:sort(fun({_,{As1,_,_}}, {_,{As2,_,_}}) ->
+ {location, Loc1} =
+ erl_scan:attributes_info(As1, location),
+ {location, Loc2} =
+ erl_scan:attributes_info(As2, location),
+ case {Loc1, Loc2} of
+ {{L1, _}, L2} when is_integer(L2) -> L1 < L2;
+ {L1, {L2, _}} when is_integer(L1) -> L1 =< L2;
+ {_, _} -> Loc1 =< Loc2
+ end
+ end,
lists:append(Prio0)),
flatmap(fun mpf/1, [Prio, Rest]).