Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Prism::Pattern#compile
compile
lib/prism/pattern.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/prism/pattern.rb, line 70
def compile
result = Prism.parse("case nil\nin #{query}\nend")
compile_node(result.value.statements.body.last.conditions.last.pattern)
end
Compile the query into a callable object that can be used to match against nodes.
See also
#combine_or
#compile_alternation_pattern_node
#combine_and
#compile_array_pattern_node
also in
4.0 · 3.4