Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Prism::Translation::RubyParser::Compiler#visit_and_node
visit_and_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 57
def visit_and_node(node)
left = visit(node.left)
if left[0] == :and
# ruby_parser has the and 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] == :and
nest[2] = s(node, :and, nest[2], visit(node.right))
left
else
s(node, :and, left, visit(node.right))
end
end
a and b ^^^^^^^