Skip to content

Commit

Permalink
[ruby/prism] Fix up void stmt generation in ripper translation
Browse files Browse the repository at this point in the history
  • Loading branch information
kddnewton authored and matzbot committed Mar 6, 2024
1 parent 6635657 commit f4d1a36
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion lib/prism/translation/ripper.rb
Expand Up @@ -1114,7 +1114,7 @@ def visit_def_node(node)

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)

Expand Down
10 changes: 0 additions & 10 deletions test/prism/ripper_test.rb
Expand Up @@ -57,10 +57,6 @@ class RipperTest < TestCase
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
Expand Down Expand Up @@ -179,16 +175,11 @@ class RipperTest < TestCase
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
Expand All @@ -214,7 +205,6 @@ class RipperTest < TestCase
whitequark/send_self.txt
whitequark/slash_newline_in_heredocs.txt
whitequark/string_concat.txt
whitequark/trailing_forward_arg.txt
]

relatives.each do |relative|
Expand Down

0 comments on commit f4d1a36

Please sign in to comment.