Class: Prism::NodeFind::LineBacktraceLocationFind
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Find
|
|
|
Instance Chain:
self,
Find
|
|
| Inherits: |
Prism::NodeFind::Find
|
| Defined in: | lib/prism/node_find.rb |
Overview
Finds the AST node for a Thread::Backtrace::Location using best-effort line matching. Used on non-CRuby implementations.
Instance Method Summary
-
#find(location)
Findthe node for the given backtrace location by matching on line.
Find - Inherited
| #parse_file | Parse the given file path, returning a |
Instance Method Details
#find(location)
Find the node for the given backtrace location by matching on line.
# File 'lib/prism/node_find.rb', line 176
def find(location) file = location.absolute_path || location.path return unless (result = parse_file(file)) start_line = location.lineno result.value.find { |node| node.location.start_line == start_line } end