parse.y: remove an extra error message

* parse.y (parse_string): bail out when word-list meets end of
  input not to show an extra "unexpected" error message after the
  preceding error.

      $ ruby -e "%w["
      -e:1: unterminated string meets end of file
      -e:1: syntax error, unexpected terminator, expecting ' '

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2019-01-24 11:43:11 +00:00
parent c6fb7c1f33
commit 7e68efbc95
3 changed files with 9 additions and 2 deletions

View file

@ -351,6 +351,7 @@ class TestParse < Test::Unit::TestCase
def test_words
assert_equal([], %W( ))
assert_syntax_error('%w[abc', /unterminated list/)
end
def test_dstr