Bug #7559

Wrong line number with method call syntax

Added by Yui NARUSE over 1 year ago. Updated over 1 year ago.

[ruby-dev:46737]
Status:Closed
Priority:Normal
Assignee:Nobuyoshi Nakada
Category:core
Target version:2.0.0
ruby -v:ruby 2.0.0dev (2012-12-13 trunk 38361) [x86_64-freebsd9.0] Backport:

Description

以下のような場合に表示される行数がおかしくなります。

def foo(*args)
p caller[0][/\d+/].to_i #=> expected 4 but 8
end
foo "a
b
c
d
e"

def bar(a, b, line)
p a
p line #=> expected 14 but 19
end
def baz
bar LINE, <<eom, LINE
a
b
c
d
eom
end
baz

Associated revisions

Revision 38378
Added by Nobuyoshi Nakada over 1 year ago

parse.y: fix line number

  • parse.y (parserparams): parsertokline to track the line number at
    which token started. [Bug #7559]

  • parse.y (fcall): operation with starting line number.

  • parse.y (command, primary, method_call): point method name line.

  • parse.y (gettablegen): return token line for _LINE__.

Revision 38379
Added by Nobuyoshi Nakada over 1 year ago

parse.y: fix line number

  • parse.y (parserparams): parsertokline to track the line number at which token started. [Bug #7559]
  • parse.y (fcall): operation with starting line number.
  • parse.y (command, primary, method_call): point method name line.
  • parse.y (gettablegen): return token line for _LINE__.

History

#1 Updated by Nobuyoshi Nakada over 1 year ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r38378.
Yui, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


parse.y: fix line number

  • parse.y (parserparams): parsertokline to track the line number at
    which token started. [Bug #7559]

  • parse.y (fcall): operation with starting line number.

  • parse.y (command, primary, method_call): point method name line.

  • parse.y (gettablegen): return token line for _LINE__.

Also available in: Atom PDF