class Location
Definitions
attr :line_index
The line that contains the @offset (base 0 indexing).
def line_number
The line index, but base-1.
Implementation
def line_number
@line_index + 1
end
attr :line_range
The byte offset to the start of that line.
def line_offset
The number of bytes from the start of the line to the given offset in the input.
Implementation
def line_offset
@offset - @line_range.min
end