Improve compiler message on unexpected end of line, closes #5137

This commit is contained in:
José Valim
2016-11-20 11:01:30 +01:00
parent e7babbfcd3
commit 6bb8f59b42
3 changed files with 12 additions and 7 deletions
+5
View File
@@ -67,6 +67,11 @@ parse_error(Line, File, Error, <<>>) ->
end,
do_raise(Line, File, 'Elixir.TokenMissingError', Message);
%% Show a nicer message for end of line
parse_error(Line, File, <<"syntax error before: ">>, <<"eol">>) ->
do_raise(Line, File, 'Elixir.SyntaxError',
<<"unexpectedly reached end of line. The current expression is invalid or incomplete">>);
%% Show a nicer message for missing end tokens
parse_error(Line, File, <<"syntax error before: ">>, <<"'end'">>) ->
do_raise(Line, File, 'Elixir.SyntaxError', <<"unexpected token: end">>);