diff options
author | Justin Collins <[email protected]> | 2024-03-23 15:20:52 -0700 |
---|---|---|
committer | git <[email protected]> | 2024-03-25 12:13:52 +0000 |
commit | f5a2f55aca5f229bb2a9dac62d96d85fc14ae718 (patch) | |
tree | 2f0fc1cb9c0d7efb4eca77e65fba1f0880b18906 | |
parent | daf1d7bfefa89a0473af9b304a3798ba1e67166a (diff) |
[ruby/prism] Use Sexp#line_max not Sexp#max_line
for RubyParser translation
https://github.com/ruby/prism/commit/a37169621a
-rw-r--r-- | lib/prism/translation/ruby_parser.rb | 10 | ||||
-rw-r--r-- | test/prism/ruby_parser_test.rb | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/prism/translation/ruby_parser.rb b/lib/prism/translation/ruby_parser.rb index 108e6c6928..5c59fe3181 100644 --- a/lib/prism/translation/ruby_parser.rb +++ b/lib/prism/translation/ruby_parser.rb @@ -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 diff --git a/test/prism/ruby_parser_test.rb b/test/prism/ruby_parser_test.rb index 1d22f0e7b8..952e493af9 100644 --- a/test/prism/ruby_parser_test.rb +++ b/test/prism/ruby_parser_test.rb @@ -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 ) |