anchor.diff:  ordinal(3) -> fmt("~!B3~!!rd");
   ordinal(N) when is_integer(N) -> fmt("~!B~w~!!th", [N]).
   
  -
  +%% Format a pattern ad highlight errorous part in red.
   bad_pat("pattern " ++ P) ->
       fmt("pattern ~!r~s",[P]);
   bad_pat("variable " ++ P) ->
  
positive.code: -module(rebar_dialyzer_format).
  
  -include("rebar.hrl").
  
  -export([format_warnings/1]).
  
  format_warnings(Warnings) ->
      {_, Res} = lists:foldl(fun format_warning_/2, {undefined, []}, Warnings),
      lists:reverse(Res).
  
  
  format_warning_(Warning = {_Tag, {File, Line}, Msg}, {File, Acc}) ->
      try
          String = message_to_string(Msg),
  
negative.code: 
  
  bad_arg(N, Args) ->
      colour_arg(N, r, Args).
  
  good_arg(N, Args) ->
      colour_arg(N, g, Args).
  
  %% colour one or more arg of an argument list, this unparses the args
  %% highlights one or more of them and puts them back together.
  colour_arg(N, C, Args) when is_integer(N) ->
      colour_arg([N], C, Args);
  colour_arg(Ns, C, Args) ->
      {Args1, Rest} =seperate_args(Args),
      Args2 = highlight(Ns, 1, C, Args1),
      join_args(Args2) ++ Rest.
  