SourceLocation class

Reference to a location in a source file.

This is used in a SourceRange object to indicate the location of a BlobNode in the original source text.

Locations are given as offsets (in UTF-16 code units) into the decoded string.

See also:

Implemented types
Annotations

Constructors

SourceLocation(Object source, int offset)
Create a SourceLocation object.
const

Properties

hashCode int
The hash code for this object.
no setteroverride
offset int
The offset of the given source location, in UTF-16 code units.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source Object
An object that identifies the file or other origin of the source.
final

Methods

compareTo(SourceLocation other) int
Compares this object to another object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator <(SourceLocation other) bool
Whether this location is earlier in the file than other.
operator <=(SourceLocation other) bool
Whether this location is earlier in the file than other, or equal to other.
operator ==(Object other) bool
The equality operator.
override
operator >(SourceLocation other) bool
Whether this location is later in the file than other.
operator >=(SourceLocation other) bool
Whether this location is later in the file than other, or equal to other.