diff options
author | Kevin Newton <kddnewton@gmail.com> | 2024-02-26 09:26:31 -0500 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2024-02-26 14:35:00 +0000 |
commit | 99d0f687fc4928e06196a695e553acb029d17b61 (patch) | |
tree | caeb119bc8256bc885561d367d9af9fe5f8a9fd9 /lib/prism/translation/parser | |
parent | af3145bb2446f27f895e78cfab49eea23fad8865 (diff) |
[ruby/prism] Fix parser translator for pinned expression
https://github.com/ruby/prism/commit/eeae07193b
Diffstat (limited to 'lib/prism/translation/parser')
-rw-r--r-- | lib/prism/translation/parser/compiler.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/prism/translation/parser/compiler.rb b/lib/prism/translation/parser/compiler.rb index c8ab3740bd..4edbae217d 100644 --- a/lib/prism/translation/parser/compiler.rb +++ b/lib/prism/translation/parser/compiler.rb @@ -1271,7 +1271,8 @@ module Prism # foo => ^(bar) # ^^^^^^ def visit_pinned_expression_node(node) - builder.pin(token(node.operator_loc), visit(node.expression)) + expression = builder.begin(token(node.lparen_loc), visit(node.expression), token(node.rparen_loc)) + builder.pin(token(node.operator_loc), expression) end # foo = 1 and bar => ^foo |