Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Method#syntax_tree
meth.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 443
def syntax_tree
RubyVM::InstructionSequence.of(self)&.syntax_tree
end
Returns the AST node that this method was compiled from. Returns nil for methods not written in Ruby. See RubyVM::InstructionSequence#syntax_tree for other cases where nil is returned.
This method is experimental and might change without notice.