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:

  • start_point Point
  • end_point Point
  • start_byte integer
  • end_byte integer

Returns:

    Range
Range.pack (start_point, end_point, start_byte, end_byte)
Alias for new.

Parameters:

  • start_point Point
  • end_point Point
  • start_byte integer
  • end_byte integer

Returns:

    Range

Methods

Range:unpack ()
Unpack the range.

Inverse of pack.

Returns:

  1. Point start point
  2. Point end point
  3. integer start byte
  4. integer end byte
Range:start_point ()
Get the start point of the range.

Returns:

    Point
Range:end_point ()
Get the end point of the point.

Returns:

    integer
Range:start_byte ()
Get the start byte of the range.

Returns:

    Point
Range:end_byte ()
Get the end byte of the point.

Returns:

    integer

Metamethods

Range:__eq (other)
Check equality of two ranges by value.

Parameters:

Returns:

    boolean
generated by LDoc 1.5.0 Last updated 2024-04-16 14:22:44