diff options
author | Kevin Newton <kddnewton@gmail.com> | 2024-03-05 22:49:20 -0500 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2024-03-06 16:42:53 +0000 |
commit | f4d1a36ab3e7adfedb9011c1ee1758f1f2e62620 (patch) | |
tree | 4c413ef7177feece063eeedc78d54456f6a0899a | |
parent | 66356577d98b4e0f887d4593cdfaa135a83e972c (diff) |
[ruby/prism] Fix up void stmt generation in ripper translation
https://github.com/ruby/prism/commit/27a427bc22
-rw-r--r-- | lib/prism/translation/ripper.rb | 2 | ||||
-rw-r--r-- | test/prism/ripper_test.rb | 10 |
2 files changed, 1 insertions, 11 deletions
diff --git a/lib/prism/translation/ripper.rb b/lib/prism/translation/ripper.rb index 32afe7b523..1b2c93a975 100644 --- a/lib/prism/translation/ripper.rb +++ b/lib/prism/translation/ripper.rb @@ -1114,7 +1114,7 @@ module Prism bodystmt = if node.equal_loc.nil? - visit_body_node(node.body&.location || node.end_keyword_loc, node.body) + visit_body_node(node.rparen_loc || node.end_keyword_loc, node.body) else body = visit(node.body.body.first) diff --git a/test/prism/ripper_test.rb b/test/prism/ripper_test.rb index da13ce1d9e..d60758919d 100644 --- a/test/prism/ripper_test.rb +++ b/test/prism/ripper_test.rb @@ -57,10 +57,6 @@ module Prism seattlerb/case_in.txt seattlerb/case_in_else.txt seattlerb/class_comments.txt - seattlerb/defn_arg_forward_args.txt - seattlerb/defn_args_forward_args.txt - seattlerb/defn_forward_args.txt - seattlerb/defn_kwarg_lvar.txt seattlerb/defn_oneliner_eq2.txt seattlerb/defn_oneliner_rescue.txt seattlerb/defs_oneliner_eq2.txt @@ -179,16 +175,11 @@ module Prism whitequark/dedenting_non_interpolating_heredoc_line_continuation.txt whitequark/def.txt whitequark/empty_stmt.txt - whitequark/forward_arg.txt whitequark/forward_args_legacy.txt - whitequark/forwarded_argument_with_kwrestarg.txt - whitequark/forwarded_argument_with_restarg.txt - whitequark/forwarded_kwrestarg.txt whitequark/forwarded_kwrestarg_with_additional_kwarg.txt whitequark/forwarded_restarg.txt whitequark/if_elsif.txt whitequark/kwbegin_compstmt.txt - whitequark/kwoptarg_with_kwrestarg_and_forwarded_args.txt whitequark/lvar_injecting_match.txt whitequark/masgn.txt whitequark/masgn_attr.txt @@ -214,7 +205,6 @@ module Prism whitequark/send_self.txt whitequark/slash_newline_in_heredocs.txt whitequark/string_concat.txt - whitequark/trailing_forward_arg.txt ] relatives.each do |relative| |