Struct SourceRange
A contiguous span in a source document, from a Start position (inclusive) to an End position (exclusive).
public readonly record struct SourceRange : IEquatable<SourceRange>
- Implements
- Inherited Members
- Extension Methods
Constructors
SourceRange(SourcePosition, SourcePosition)
A contiguous span in a source document, from a Start position (inclusive) to an End position (exclusive).
public SourceRange(SourcePosition Start, SourcePosition End)
Parameters
StartSourcePositionThe inclusive start position of the range.
EndSourcePositionThe exclusive end position of the range.
SourceRange(int, int, int, int)
Creates a SourceRange from zero-based start/end line numbers and character offsets.
public SourceRange(int startLine, int startCharacter, int endLine, int endCharacter)
Parameters
Properties
End
The exclusive end position of the range.
public SourcePosition End { get; init; }
Property Value
IsEmpty
true if this range spans no characters (Start and End are the same position).
public bool IsEmpty { get; }
Property Value
Start
The inclusive start position of the range.
public SourcePosition Start { get; init; }