The position type of this attachment
The position type of this attachment
The position indicates a column
and the line
in the source file.
The end of the position's range, error if not a range position.
The end of the position's range, or point if not a range position.
If this is a range position, the offset position of its point.
If this is a range position, the offset position of its point. Otherwise the position itself
If this is a range position, the offset position of its end.
If this is a range position, the offset position of its end. Otherwise the position itself
If this is a range position, the offset position of its start.
If this is a range position, the offset position of its start. Otherwise the position itself
Does this position include the given position pos
?
This holds if this
is a range position and its range [start.
Does this position include the given position pos
?
This holds if this
is a range position and its range [start..end]
is the same or covers the range of the given position, which may or may not be a range position.
Is this position neither a NoPosition nor a FakePosition? If isDefined is true, offset and source are both defined.
Is this position a non-transparent range position?
Is this position a range position?
Is this position a transparent position?
The position indicates a column
and the line
in the source file.
The content of the line this Position refers to.
If opaque range, make this position transparent.
Does this position overlap with that position? This holds if both positions are ranges and there is an interval of non-zero length that is shared by both position ranges.
The point (where the ^ is) of the position, which is easiest to access using the line and column values. The line content is also available.
The point (where the ^ is) of the position, or else default
if undefined.
The underlying position
The underlying position
Does this position precede that position? This holds if both positions are defined and the end point of this position is not larger than the start point of the given position.
Does this position properly include the given position pos
("properly" meaning their
ranges are not the same)?
Does this position properly precede the given position pos
("properly" meaning their ranges
do not share a common point).
Does this position cover the same range as that position? Holds only if both position are ranges
Show a textual representation of the position.
Java file corresponding to the source file of this position.
Java file corresponding to the source file of this position.
The return type is scala.reflect.io.AbstractFile
, which belongs to an experimental part of Scala reflection.
It should not be used unless you know what you are doing. In subsequent releases, this API will be refined
and exposed as a part of scala.reflect.api.
The start of the position's range, error if not a range position.
The start of the position's range, or point if not a range position.
Convert this to a position around point
that spans a single source line
If this is a range, the union with the other range, with the point of this position.
If this is a range, the union with the other range, with the point of this position. Otherwise, this position
The same position with a different end value (if a range).
The same position with a different point value (if a range or offset).
Creates a copy of this attachment with the position replaced by newPos
Creates a copy of this attachment with the position replaced by newPos
The same position with a different start value (if a range).
The underlying payload with the guarantee that no two elements have the same type.
The underlying payload with the guarantee that no two elements have the same type.
Returns string formatted according to given format
string.
Returns string formatted according to given format
string.
Format strings are as for String.format
(@see java.lang.String.format).
An underlying payload of the given class type T
.
An underlying payload of the given class type T
.
Creates a copy of this attachment with the payload of the given class type T
removed.
Creates a copy of this attachment with the payload of the given class type T
removed.
Creates a copy of this attachment with the payload slot of T added/updated with the provided value.
Creates a copy of this attachment with the payload slot of T added/updated with the provided value. Replaces an existing payload of the same type, if exists.
EXPERIMENTAL
Position tracks the origin of symbols and tree nodes. They are commonly used when displaying warnings and errors, to indicate the incorrect point in the program.
Please note that this trait may be refactored in future versions of the Scala reflection API.
For more information about
Position
s, see the Reflection Guide: Annotations, Names, Scopes, and More