Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

Thread::Backtrace::Location#syntax_tree

location.syntax_tree → Ruby::Prism::Node | RubyVM::AbstractSyntaxTree::Node | nil

Returns the AST node at this location, by re-parsing the source file. See RubyVM::InstructionSequence#syntax_tree for when nil is returned.

This method is experimental and might change without notice.