Spans

dotty.tools.dotc.util.Spans
object Spans

The offsets part of a full position, consisting of 2 or 3 entries:

  • start: the start offset of the span, in characters from start of file
  • end : the end offset of the span
  • point: if given, the offset where a single ^ would be logically placed

Spans are encoded according to the following format in little endian: Start: unsigned 26 Bits (works for source files up to 64M) End: unsigned 26 Bits Point: unsigned 12 Bits relative to start NoSpan encoded as -1L (this is a normally invalid span because point would lie beyond end).

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Spans.type

Members list

Type members

Classlikes

final class Coord(val encoding: Int) extends AnyVal

The coordinate of a symbol. This is either an index or a zero-range span.

The coordinate of a symbol. This is either an index or a zero-range span.

Attributes

Supertypes
class AnyVal
trait Matchable
class Any
final class Span(val coords: Long) 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. The 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.

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. The 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.

Attributes

Supertypes
class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def Span(start: Int, end: Int): Span

A synthetic span with given start and end

A synthetic span with given start and end

Attributes

def Span(start: Int, end: Int, point: Int): Span

A source-derived span with given start, end, and point delta

A source-derived span with given start, end, and point delta

Attributes

def Span(start: Int): Span

A synthetic zero-extent span that starts and ends at given start.

A synthetic zero-extent span that starts and ends at given start.

Attributes

def offsetToInt(x: Int): Int

Convert offset x to an integer by sign extending the original field of StartEndBits width.

Convert offset x to an integer by sign extending the original field of StartEndBits width.

Attributes

Concrete fields

final val MaxOffset: 67108863

The maximal representable offset in a span

The maximal representable offset in a span

Attributes

val NoCoord: Coord

A sentinel for a missing coordinate

A sentinel for a missing coordinate

Attributes

val NoSpan: Span

A sentinel for a non-existing span

A sentinel for a non-existing span

Attributes

Implicits

Implicits

implicit def indexCoord(n: Int): Coord

An index coordinate

An index coordinate

Attributes

implicit def spanCoord(span: Span): Coord