[ruby/yarp] Add a Location#to method for combining them
https://github.com/ruby/yarp/commit/1db2de98ac
This commit is contained in:
parent
55a8add304
commit
20cf9e3ae8
@ -112,6 +112,11 @@ module YARP
|
|||||||
other.end_offset == end_offset
|
other.end_offset == end_offset
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Returns a new location that is the union of this location and the other.
|
||||||
|
def to(other)
|
||||||
|
Location.new(source, start_offset, other.end_offset - start_offset)
|
||||||
|
end
|
||||||
|
|
||||||
def self.null
|
def self.null
|
||||||
new(0, 0)
|
new(0, 0)
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user