SourceSpan Struct

A textual source span.

public struct SourceSpan

Constructors

NameDescription
SourceSpan(string, TextPosition, TextPosition)Creates a source span.

SourceSpan(string, TextPosition, TextPosition)

SourceSpan.cs

Creates a source span.

public SourceSpan(string fileName, TextPosition start, TextPosition end)

Parameters

fileName string
start TextPosition
end TextPosition

Properties

NameDescription
LengthGets the length of this span.
OffsetGets the starting offset of this span.

Gets the length of this span.

public int Length { get; }

Property value

int

Gets the starting offset of this span.

public int Offset { get; }

Property value

int

Methods

NameDescription
ToString()Returns the fully qualified type name of this instance.
ToStringSimple()A string representation of this source span not including the SourceSpan.End position.

ToString()

SourceSpan.cs

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string The fully qualified type name.

ToStringSimple()

SourceSpan.cs

A string representation of this source span not including the SourceSpan.End position.

public string ToStringSimple()

Returns

string

Fields

NameDescription
EndGets or sets the ending text position.
FileNameGets or sets the filename.
StartGets or sets the starting text position.

End

Gets or sets the ending text position.

public TextPosition End

FileName

Gets or sets the filename.

public string FileName

Start

Gets or sets the starting text position.

public TextPosition Start