Improve heredoc error message (#9048)
This commit is contained in:
committed by
Fernando Tapia Rico
parent
76a7aebc8e
commit
f44adfbeb0
@@ -879,7 +879,7 @@ extract_heredoc(Line0, Column0, Rest0, Marker, Scope) ->
|
||||
{error, {ErrorLine, ErrorColumn, Message, Token}}
|
||||
end;
|
||||
error ->
|
||||
Message = "heredoc start must be followed by a new line after ",
|
||||
Message = "heredoc allows only zero or more whitespace characters followed by a new line after ",
|
||||
{error, {Line0, Column0, io_lib:format(Message, []), [Marker, Marker, Marker]}}
|
||||
end.
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ defmodule Kernel.ErrorsTest do
|
||||
|
||||
test "heredoc start" do
|
||||
assert_eval_raise SyntaxError,
|
||||
"nofile:1: heredoc start must be followed by a new line after \"\"\"",
|
||||
"nofile:1: heredoc allows only zero or more whitespace characters followed by a new line after \"\"\"",
|
||||
'"""bar\n"""'
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user