Skip to content

Commit

Permalink
Merge pull request #2548 from koic/fix_incompatibility_ast_for_match_…
Browse files Browse the repository at this point in the history
…with_lvasgn

Fix incompatibility AST for regexp match in `Prism::Translation::Parser`
  • Loading branch information
kddnewton authored Mar 4, 2024
2 parents eebb648 + dccfd83 commit 663c8b7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/prism/translation/parser/compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ def visit_call_node(node)
end
when :!
return visit_block(builder.not_op(token(node.message_loc), token(node.opening_loc), visit(node.receiver), token(node.closing_loc)), block)
when :=~
if (receiver = node.receiver).is_a?(RegularExpressionNode)
return builder.match_op(visit(receiver), token(node.message_loc), visit(node.arguments.arguments.first))
end
when :[]
return visit_block(builder.index(visit(node.receiver), token(node.opening_loc), visit_all(arguments), token(node.closing_loc)), block)
when :[]=
Expand Down

0 comments on commit 663c8b7

Please sign in to comment.