Go to repository

Class SourceSpan

A SourceSpan delimitates a span in a SourceReader.SourceInput. To do that, it has start and end positions, indicating where the span of input starts and ends, respectively.

REPRESENTATION INVARIANT: (not verified)

  • both start and end positions belongs to the same SourceReader
  • start position appears before end position, if both of them are not Unkwnown.

Properties start and end indicate where the span of input starts and ends, respectively. If the span only spans over 1 characters, the end position may not be specified. If the start position is unknown, the end position should also be unknown. Those conditions are guaranteed on construction.

Constructors

Properties

Constructors

A Span represents a span of a SourceInput. Either both start and end are known, or both are unknown. If end is unknown but not the start, they are made equal (the span is a single position). If start is unknown but not the end, the end is considered an incorrect value, and made unknown.

Parameters

Returns SourceSpan

Properties

Readonly
end: SourcePosition = ...

The end position of the span.

Readonly
start: SourcePosition = ...

The start position of the span.