This represents a location in the source.

Attributes

The byte offset from the beginning of the source where this location starts.

Read

The length of this location in bytes.

Read

The list of comments attached to this location

Class Methods

Create a new location object with the given source, start byte offset, and byte length.

Returns a null location that does not correspond to a source and points to the beginning of the file. Useful for when you want a location object but do not care where it points.

Instance Methods

Returns true if the given other location is equal to this location.

Create a new location object with the given options.

Implement the hash pattern matching interface for Location.

The column number in characters where this location ends from the start of the line.

The character offset from the beginning of the source where this location ends.

The column number in bytes where this location ends from the start of the line.

The line number where this location ends.

The byte offset from the beginning of the source where this location ends.

Returns a string representation of this location.

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.

Implement the pretty print interface for Location.

The source code that this location represents.

The column number in characters where this location ends from the start of the line.

The character offset from the beginning of the source where this location starts.

The column number in bytes where this location starts from the start of the line.

The line number where this location starts.

The content of the line where this location starts before this location.