Add support for {Line,Column} in error reports

This commit is contained in:
Tuncer Ayaz 2012-06-05 20:54:05 +02:00
parent c3fc279ff9
commit 0716cf708c

View file

@ -234,6 +234,9 @@ format_errors(Source, Extra, Errors) ->
[lists:append([format_error(AbsSource, Extra, Desc) || Desc <- Descs]) [lists:append([format_error(AbsSource, Extra, Desc) || Desc <- Descs])
|| {_, Descs} <- Errors]. || {_, Descs} <- Errors].
format_error(AbsSource, Extra, {{Line, Column}, Mod, Desc}) ->
ErrorDesc = Mod:format_error(Desc),
?FMT("~s:~w:~w: ~s~s", [AbsSource, Line, Column, Extra, ErrorDesc]);
format_error(AbsSource, Extra, {Line, Mod, Desc}) -> format_error(AbsSource, Extra, {Line, Mod, Desc}) ->
ErrorDesc = Mod:format_error(Desc), ErrorDesc = Mod:format_error(Desc),
?FMT("~s:~b: ~s~s", [AbsSource, Line, Extra, ErrorDesc]). ?FMT("~s:~w: ~s~s", [AbsSource, Line, Extra, ErrorDesc]).