Dotty Documentation

0.15.0-bin-SNAPSHOT

final class Span
extends AnyVal

A span indicates a range between a start offset and an end offset. Spans can be synthetic or source-derived. A source-derived span has in addition a point lies somewhere between start and end. The point is roughly where the ^ would go if an error was diagnosed at that position. All quantities are encoded opaquely in a Long.

[-] Constructors

Span ( coords: Long )
Span ( encoding: Int )

[-] Members

[+] val coords : Long
[+] def != ( that: Span ) : Boolean
[+] def == ( that: Span ) : Boolean
[+] def contains ( that: Span ) : Boolean

Does the range of this span contain the one of that span?

[+] def end : Int

The end of this span

[+] def endPos : Span

The zero-extent span with start and end at the end of this span

[+] def exists : Boolean

Is this span different from NoSpan?

[+] def focus : Span

The zero-extent span with start and end at the point of this span

[+] def isIndex : Boolean
[+] def isSourceDerived : Boolean

Is this span source-derived?

[+] def isSpan : Boolean
[+] def isSynthetic : Boolean

Is this span synthetic?

[+] def isZeroExtent : Boolean

Is this a zero-extent span?

[+] def orElse ( that: Span ) : Span
[+] def point : Int

The point of this span, returns start for synthetic spans

[+] def pointDelta : Int

The difference between point and start in this span

[+] def shift ( offset: Int ) : Span

A span where all components are shifted by a given offset relative to this span.

[+] def start : Int

The start of this span.

[+] def startPos : Span

The zero-extent span with start and end at the start of this span

[+] def toIndex : Int
[+] def toSpan : Span
[+] override def toString : String
[+] def toSynthetic : Span

A synthetic copy of this span

[+] def union ( that: Span ) : Span

The union of two spans. This is the least range that encloses both spans. It is always a synthetic span.

[+] def withEnd ( end: Int ) : Span

A copy of this span with a different end

[+] def withPoint ( point: Int ) : Span

A copy of this span with a different point

[+] def withStart ( start: Int ) : Span

A copy of this span with a different start