mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
[ruby/prism] Use Sexp#line_max not Sexp#max_line
for RubyParser translation
a37169621a
This commit is contained in:
parent
daf1d7bfef
commit
f5a2f55aca
2 changed files with 6 additions and 6 deletions
|
@ -192,19 +192,19 @@ module Prism
|
|||
|
||||
if node.opening == "("
|
||||
result.line = node.opening_loc.start_line
|
||||
result.max_line = node.closing_loc.end_line
|
||||
result.line_max = node.closing_loc.end_line
|
||||
shadow_loc = false
|
||||
end
|
||||
|
||||
if node.locals.any?
|
||||
shadow = s(node, :shadow).concat(visit_all(node.locals))
|
||||
shadow.line = node.locals.first.location.start_line
|
||||
shadow.max_line = node.locals.last.location.end_line
|
||||
shadow.line_max = node.locals.last.location.end_line
|
||||
result << shadow
|
||||
|
||||
if shadow_loc
|
||||
result.line = shadow.line
|
||||
result.max_line = shadow.max_line
|
||||
result.line_max = shadow.line_max
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1412,7 +1412,7 @@ module Prism
|
|||
|
||||
if node.heredoc?
|
||||
result.line = node.content_loc.start_line
|
||||
result.max_line = node.content_loc.end_line
|
||||
result.line_max = node.content_loc.end_line
|
||||
end
|
||||
|
||||
result
|
||||
|
@ -1439,7 +1439,7 @@ module Prism
|
|||
result = Sexp.new(*arguments)
|
||||
result.file = file
|
||||
result.line = node.location.start_line
|
||||
result.max_line = node.location.end_line
|
||||
result.line_max = node.location.end_line
|
||||
result
|
||||
end
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ end
|
|||
Sexp.prepend(
|
||||
Module.new do
|
||||
def ==(other)
|
||||
super && line == other.line && max_line == other.max_line && file == other.file
|
||||
super && line == other.line && line_max == other.line_max && file == other.file
|
||||
end
|
||||
end
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue