Table of Contents

Struct TextLocation

Namespace
MuLang.Core.Text
Assembly
MuLang.Core.dll

Represents a materialized source span with line and column information.

public readonly struct TextLocation : IEquatable<TextLocation>
Implements
Inherited Members

Constructors

TextLocation(TextSpan, TextPosition, TextPosition, Uri?)

Initializes a new instance of the TextLocation struct.

public TextLocation(TextSpan span, TextPosition start, TextPosition end, Uri? sourceDocument = null)

Parameters

span TextSpan

The source span.

start TextPosition

The inclusive start position.

end TextPosition

The exclusive end position.

sourceDocument Uri

The source document URI, when available.

Exceptions

ArgumentException

Thrown when a position does not match the span or sourceDocument is not absolute.

Properties

End

Gets the exclusive end position.

public TextPosition End { get; }

Property Value

TextPosition

SourceDocument

Gets the source document URI, when available.

public Uri? SourceDocument { get; }

Property Value

Uri

Span

Gets the source span.

public TextSpan Span { get; }

Property Value

TextSpan

Start

Gets the inclusive start position.

public TextPosition Start { get; }

Property Value

TextPosition

Methods

Equals(TextLocation)

public bool Equals(TextLocation other)

Parameters

other TextLocation

Returns

bool

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(TextLocation, TextLocation)

public static bool operator ==(TextLocation left, TextLocation right)

Parameters

left TextLocation
right TextLocation

Returns

bool

operator !=(TextLocation, TextLocation)

public static bool operator !=(TextLocation left, TextLocation right)

Parameters

left TextLocation
right TextLocation

Returns

bool