Skip to content

Commit 99d0f68

Browse files
kddnewtonmatzbot
authored andcommitted
[ruby/prism] Fix parser translator for pinned expression
ruby/prism@eeae07193b
1 parent af3145b commit 99d0f68

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/prism/translation/parser/compiler.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,8 @@ def visit_parentheses_node(node)
12711271
# foo => ^(bar)
12721272
# ^^^^^^
12731273
def visit_pinned_expression_node(node)
1274-
builder.pin(token(node.operator_loc), visit(node.expression))
1274+
expression = builder.begin(token(node.lparen_loc), visit(node.expression), token(node.rparen_loc))
1275+
builder.pin(token(node.operator_loc), expression)
12751276
end
12761277

12771278
# foo = 1 and bar => ^foo

0 commit comments

Comments
 (0)