parse.y: k_else in bodystmt

* parse.y (bodystmt): expand opt_else to show the error message at
  the right place.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-03-23 01:09:57 +00:00
parent 140512d222
commit f3fbf1dfad
2 changed files with 34 additions and 15 deletions

View file

@ -14,7 +14,7 @@ class TestParse < Test::Unit::TestCase
end
def test_else_without_rescue
assert_syntax_error(<<-END, /else without rescue/)
assert_syntax_error(<<-END, %r":#{__LINE__+2}: else without rescue"o, [__FILE__, __LINE__+1])
begin
else
42