Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Prism::Translation::RubyParser::Compiler#visit_or_node
visit_or_node(node)
lib/prism/translation/ruby_parser.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/lib/prism/translation/ruby_parser.rb, line 1171
def visit_or_node(node)
left = visit(node.left)
if left[0] == :or
# ruby_parser has the or keyword as right-associative as opposed to
# prism which has it as left-associative. We reverse that
# associativity here.
nest = left
nest = nest[2] while nest[2][0] == :or
nest[2] = s(node, :or, nest[2], visit(node.right))
left
else
s(node, :or, left, visit(node.right))
end
end
a or b ^^^^^^