diff options
| author | Kevin Newton <kddnewton@gmail.com> | 2024-03-05 21:52:54 -0500 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-03-06 16:42:52 +0000 |
| commit | 75e24a74d984598aabccff6a6dabc35a3e67cd5a (patch) | |
| tree | de0260e1b91f095213d8ea101f91a6878f123b95 /lib | |
| parent | 8b721fcd06e10313b3faa4645cf2ec6b5d8bcbba (diff) | |
[ruby/prism] Implement call shorthand for ripper translation
https://github.com/ruby/prism/commit/4d08736bd5
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/prism/translation/ripper.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/prism/translation/ripper.rb b/lib/prism/translation/ripper.rb index 0c81e37fe7..9999e9261f 100644 --- a/lib/prism/translation/ripper.rb +++ b/lib/prism/translation/ripper.rb @@ -646,8 +646,13 @@ module Prism bounds(node.call_operator_loc) call_operator = visit_token(node.call_operator) - bounds(node.message_loc) - message = visit_token(node.message) + message = + if node.message_loc.nil? + :call + else + bounds(node.message_loc) + visit_token(node.message) + end if node.name.end_with?("=") && !node.message.end_with?("=") && !node.arguments.nil? && node.block.nil? bounds(node.arguments.location) |
