instance method
Prism::Location#join
join(other)
lib/prism/parse_result.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prism/parse_result.rb, line 490
def join(other)
raise "Incompatible sources" if source != other.source
raise "Incompatible locations" if start_offset > other.start_offset
Location.new(source, start_offset, other.end_offset - start_offset)
end
Returns a new location that stretches from this location to the given other location. Raises an error if this location is not before the other location or if they don’t share the same source.