Class Range
A range within a document.
Analogous to TSRange
.
Functions
Range.new (start_point, end_point, start_byte, end_byte) | Create a new range. |
Range.pack (start_point, end_point, start_byte, end_byte) | Alias for new. |
Methods
Range:unpack () | Unpack the range. |
Range:start_point () | Get the start point of the range. |
Range:end_point () | Get the end point of the point. |
Range:start_byte () | Get the start byte of the range. |
Range:end_byte () | Get the end byte of the point. |
Metamethods
Range:__eq (other) | Check equality of two ranges by value. |
Functions
- Range.new (start_point, end_point, start_byte, end_byte)
-
Create a new range.
Parameters:
Returns:
- Range.pack (start_point, end_point, start_byte, end_byte)
-
Alias for new.
Parameters:
Returns:
Methods
- Range:unpack ()
-
Unpack the range.
Inverse of pack.
Returns:
- Range:start_point ()
-
Get the start point of the range.
Returns:
- Range:end_point ()
-
Get the end point of the point.
Returns:
-
integer
- Range:start_byte ()
-
Get the start byte of the range.
Returns:
- Range:end_byte ()
-
Get the end byte of the point.
Returns:
-
integer
Metamethods
- Range:__eq (other)
-
Check equality of two ranges by value.
Parameters:
- other Range
Returns:
-
boolean