jruby
jruby copied to clipboard
Wrong line number reported in backtrace of syntax error caused by '*/'
Environment
ruby 2.3.0p0 (2015-12-25 revision 53290) [i386-mingw32]
jruby 9.1.2.0 (2.3.0) 2016-05-26 7357c8f Java HotSpot(TM) Client VM 25.31-b07 on 1.8.0_31-b13 +jit [mswin32-x86]
$ systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name: Microsoft Windows 7 Enterprise
OS Version: 6.1.7601 Service Pack 1 Build 7601
Expected Behavior
Correct line number is reported in backtrace when raising syntax error.
Example code:
def a_method
123*/20
'padding'
'more padding'
end
Actual Behavior
Output in MRI 2.3.0
$ ruby test.rb
test.rb:2: unterminated regexp meets end of file
test.rb:2: syntax error, unexpected end-of-input, expecting keyword_end
Output in JRuby
$ jruby test.rb
SyntaxError: test.rb:7: unterminated string meets end of file
Cross referencing another linenum issue: https://github.com/jruby/jruby/issues/4154
This issue is unrelated to #4154