Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Proc#syntax_tree
prc.syntax_tree → Ruby::Prism::Node | RubyVM::AbstractSyntaxTree::Node | nil
ast.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/ast.rb, line 428
def syntax_tree
RubyVM::InstructionSequence.of(self)&.syntax_tree
end
Returns the AST node that this proc was compiled from. See RubyVM::InstructionSequence#syntax_tree for details and for when nil is returned.
This method is experimental and might change without notice.