[ruby/prism] Use Sexp#line_max not Sexp#max_line

for RubyParser translation

a37169621a
This commit is contained in:
Justin Collins 2024-03-23 15:20:52 -07:00 committed by git
parent daf1d7bfef
commit f5a2f55aca
2 changed files with 6 additions and 6 deletions

View file

@ -192,19 +192,19 @@ module Prism
if node.opening == "(" if node.opening == "("
result.line = node.opening_loc.start_line 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 shadow_loc = false
end end
if node.locals.any? if node.locals.any?
shadow = s(node, :shadow).concat(visit_all(node.locals)) shadow = s(node, :shadow).concat(visit_all(node.locals))
shadow.line = node.locals.first.location.start_line 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 result << shadow
if shadow_loc if shadow_loc
result.line = shadow.line result.line = shadow.line
result.max_line = shadow.max_line result.line_max = shadow.line_max
end end
end end
@ -1412,7 +1412,7 @@ module Prism
if node.heredoc? if node.heredoc?
result.line = node.content_loc.start_line result.line = node.content_loc.start_line
result.max_line = node.content_loc.end_line result.line_max = node.content_loc.end_line
end end
result result
@ -1439,7 +1439,7 @@ module Prism
result = Sexp.new(*arguments) result = Sexp.new(*arguments)
result.file = file result.file = file
result.line = node.location.start_line result.line = node.location.start_line
result.max_line = node.location.end_line result.line_max = node.location.end_line
result result
end end

View file

@ -18,7 +18,7 @@ end
Sexp.prepend( Sexp.prepend(
Module.new do Module.new do
def ==(other) 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
end end
) )