Pidgin

Struct SourcePosDelta

Represents a difference in textual lines and columns corresponding to a region of an input stream.

Implements
Inherited Members
Declaration
public readonly struct SourcePosDelta : IEquatable<SourcePosDelta>, IComparable<SourcePosDelta>

Constructors

SourcePosDelta(int, int)

Create a new SourcePosDelta with the specified number of lines and columns.

Declaration
public SourcePosDelta(int lines, int cols)
Parameters
Type Name Description

int

lines

The number of lines.

int

cols

The number of columns.

Properties

Cols

Gets the number of columns represented by the SourcePosDelta.

Declaration
public int Cols { get; }
Property Value
Type Description

int

The number of columns.

Lines

Gets the number of lines represented by the SourcePosDelta.

Declaration
public int Lines { get; }
Property Value
Type Description

int

The number of lines.

NewLine

A SourcePosDelta representing a newline being consumed.

Declaration
public static SourcePosDelta NewLine { get; }
Property Value
Type Description

SourcePosDelta

OneCol

A SourcePosDelta representing a single column being consumed.

Declaration
public static SourcePosDelta OneCol { get; }
Property Value
Type Description

SourcePosDelta

Zero

A SourcePosDelta representing no change in the source position.

Declaration
public static SourcePosDelta Zero { get; }
Property Value
Type Description

SourcePosDelta

Methods

Add(SourcePosDelta)

Add two SourcePosDeltas.

Declaration
public SourcePosDelta Add(SourcePosDelta other)
Parameters
Type Name Description

SourcePosDelta

other

The SourcePosDelta to add to this one.

Returns
Type Description

SourcePosDelta

A SourcePosDelta representing the composition of this and other.

CompareTo(SourcePosDelta)

Represents a difference in textual lines and columns corresponding to a region of an input stream.

Declaration
public int CompareTo(SourcePosDelta other)
Parameters
Type Name Description

SourcePosDelta

other

Returns
Type Description

int

Equals(SourcePosDelta)

Represents a difference in textual lines and columns corresponding to a region of an input stream.

Declaration
public bool Equals(SourcePosDelta other)
Parameters
Type Name Description

SourcePosDelta

other

Returns
Type Description

bool

Equals(object?)

Represents a difference in textual lines and columns corresponding to a region of an input stream.

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description

object

obj

Returns
Type Description

bool

Overrides
ValueType.Equals(object)

GetHashCode()

Represents a difference in textual lines and columns corresponding to a region of an input stream.

Declaration
public override int GetHashCode()
Returns
Type Description

int

Overrides
ValueType.GetHashCode()

Plus(SourcePosDelta)

Add two SourcePosDeltas.

Declaration
public SourcePosDelta Plus(SourcePosDelta other)
Parameters
Type Name Description

SourcePosDelta

other

The SourcePosDelta to add to this one.

Returns
Type Description

SourcePosDelta

A SourcePosDelta representing the composition of this and other.

Operators

operator +(SourcePosDelta, SourcePosDelta)

Add two SourcePosDeltas.

Declaration
public static SourcePosDelta operator +(SourcePosDelta left, SourcePosDelta right)
Parameters
Type Name Description

SourcePosDelta

left

The first SourcePosDelta.

SourcePosDelta

right

The SourcePosDelta to add to left.

Returns
Type Description

SourcePosDelta

A SourcePosDelta representing the composition of left and right.

operator ==(SourcePosDelta, SourcePosDelta)

Equality operator.

Declaration
public static bool operator ==(SourcePosDelta left, SourcePosDelta right)
Parameters
Type Name Description

SourcePosDelta

left

The left SourcePosDelta.

SourcePosDelta

right

The right SourcePosDelta.

Returns
Type Description

bool

operator >(SourcePosDelta, SourcePosDelta)

Comparison operator.

Declaration
public static bool operator >(SourcePosDelta left, SourcePosDelta right)
Parameters
Type Name Description

SourcePosDelta

left

The left SourcePosDelta.

SourcePosDelta

right

The right SourcePosDelta.

Returns
Type Description

bool

operator >=(SourcePosDelta, SourcePosDelta)

Comparison operator.

Declaration
public static bool operator >=(SourcePosDelta left, SourcePosDelta right)
Parameters
Type Name Description

SourcePosDelta

left

The left SourcePosDelta.

SourcePosDelta

right

The right SourcePosDelta.

Returns
Type Description

bool

operator !=(SourcePosDelta, SourcePosDelta)

Inequality operator.

Declaration
public static bool operator !=(SourcePosDelta left, SourcePosDelta right)
Parameters
Type Name Description

SourcePosDelta

left

The left SourcePosDelta.

SourcePosDelta

right

The right SourcePosDelta.

Returns
Type Description

bool

operator <(SourcePosDelta, SourcePosDelta)

Comparison operator.

Declaration
public static bool operator <(SourcePosDelta left, SourcePosDelta right)
Parameters
Type Name Description

SourcePosDelta

left

The left SourcePosDelta.

SourcePosDelta

right

The right SourcePosDelta.

Returns
Type Description

bool

operator <=(SourcePosDelta, SourcePosDelta)

Comparison operator.

Declaration
public static bool operator <=(SourcePosDelta left, SourcePosDelta right)
Parameters
Type Name Description

SourcePosDelta

left

The left SourcePosDelta.

SourcePosDelta

right

The right SourcePosDelta.

Returns
Type Description

bool

Implements

IEquatable<T>
IComparable<T>