Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Prism::Translation::Parser::Compiler#visit_when_node
visit_when_node(node)
lib/prism/translation/parser/compiler.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/lib/prism/translation/parser/compiler.rb, line 1839
def visit_when_node(node)
builder.when(
token(node.keyword_loc),
visit_all(node.conditions),
if (then_keyword_loc = node.then_keyword_loc)
token(then_keyword_loc)
else
srange_find(node.conditions.last.location.end_offset, node.statements&.location&.start_offset, ";")
end,
visit(node.statements)
)
end
case foo; when bar; end
^^^^^^^^^^^^^