Skip to content

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

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.