From 5a565d5c4df425c9c591099cf750f123d432ba7a Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 14 Dec 2012 08:11:00 +0000 Subject: parse.y: fix line number * parse.y (parser_params): parser_tokline to track the line number at which token started. [ruby-dev:46737] [Bug #7559] * parse.y (fcall): operation with starting line number. * parse.y (command, primary, method_call): point method name line. * parse.y (gettable_gen): return token line for __LINE__. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_syntax.rb | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'test') diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index ec3af712f4..f9f279d751 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -194,6 +194,36 @@ class TestSyntax < Test::Unit::TestCase end end + Bug7559 = '[ruby-dev:46737]' + + def test_lineno_command_call_quote + expected = __LINE__ + 1 + actual = caller_lineno "a +b +c +d +e" + assert_equal(expected, actual, "#{Bug7559}: ") + end + + def test_lineno_after_heredoc + bug7559 = '[ruby-dev:46737]' + expected, _, actual = __LINE__, <