Table of Contents

Struct SourceRange

Namespace
RDCore.SDK.Model.Source
Assembly
RDCore.SDK.dll

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

Start SourcePosition

The inclusive start position of the range.

End SourcePosition

The 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

startLine int
startCharacter int
endLine int
endCharacter int

Properties

End

The exclusive end position of the range.

public SourcePosition End { get; init; }

Property Value

SourcePosition

IsEmpty

true if this range spans no characters (Start and End are the same position).

public bool IsEmpty { get; }

Property Value

bool

Start

The inclusive start position of the range.

public SourcePosition Start { get; init; }

Property Value

SourcePosition