Fix for showing lines in parser errors.
This commit is contained in:
parent
7749f4abce
commit
55f116124c
|
@ -151,18 +151,17 @@ end
|
|||
|
||||
# Show up to 5 lines before and after the offending line (if they exist).
|
||||
(-5..5).each do |offset|
|
||||
line = @lines[index + offset]
|
||||
|
||||
if line
|
||||
number = @line + offset
|
||||
line = @lines[index + offset]
|
||||
number = @line + offset
|
||||
|
||||
if line and number > 0
|
||||
if offset == 0
|
||||
prefix = '=> '
|
||||
else
|
||||
prefix = ' '
|
||||
end
|
||||
|
||||
lines << "#{prefix}#{number}: #{line}"
|
||||
lines << "#{prefix}#{number}: #{line.strip}\n"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue