diff options
| author | Kevin Newton <kddnewton@gmail.com> | 2024-05-07 14:02:56 -0400 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-05-07 18:03:03 +0000 |
| commit | 21b94ae0d16d2d78035a081f0bcae06402e2c622 (patch) | |
| tree | bf61bcd36f57252604e2b13ac8fc0a2465a02fc6 | |
| parent | dcbe0edb836aa3be62b7b64f3c7f27e7ef6885fb (diff) | |
[ruby/prism] Extend error message for unterminated HEREDOC
https://github.com/ruby/prism/commit/c1b07ec11b
| -rw-r--r-- | prism/templates/src/diagnostic.c.erb | 2 | ||||
| -rw-r--r-- | test/prism/errors_test.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/prism/templates/src/diagnostic.c.erb b/prism/templates/src/diagnostic.c.erb index 5536b7b922..9406436c2b 100644 --- a/prism/templates/src/diagnostic.c.erb +++ b/prism/templates/src/diagnostic.c.erb @@ -212,7 +212,7 @@ static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = { [PM_ERR_HASH_TERM] = { "expected a `}` to close the hash literal", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_HASH_VALUE] = { "expected a value in the hash literal", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_HEREDOC_IDENTIFIER] = { "unterminated here document identifier", PM_ERROR_LEVEL_SYNTAX }, - [PM_ERR_HEREDOC_TERM] = { "unterminated heredoc; can't find string \"%.*s\"", PM_ERROR_LEVEL_SYNTAX }, + [PM_ERR_HEREDOC_TERM] = { "unterminated heredoc; can't find string \"%.*s\" anywhere before EOF", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_INCOMPLETE_QUESTION_MARK] = { "incomplete expression at `?`", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_INCOMPLETE_VARIABLE_CLASS_3_3] = { "`%.*s' is not allowed as a class variable name", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_INCOMPLETE_VARIABLE_CLASS] = { "'%.*s' is not allowed as a class variable name", PM_ERROR_LEVEL_SYNTAX }, diff --git a/test/prism/errors_test.rb b/test/prism/errors_test.rb index 280bf63a24..db4d2af5e1 100644 --- a/test/prism/errors_test.rb +++ b/test/prism/errors_test.rb @@ -1241,7 +1241,7 @@ module Prism expected = CallNode(0, receiver, Location(), :foo, Location(), nil, nil, nil, nil) assert_errors expected, "<<~FOO.foo\n", [ - ["unterminated heredoc; can't find string \"FOO\"", 3..6] + ["unterminated heredoc; can't find string \"FOO\" anywhere before EOF", 3..6] ] end |
