Struct ParsePositionDelta
Denotes a delta between parser positions
public record struct ParsePositionDelta : IComparable<ParsePositionDelta>, IEquatable<ParsePositionDelta>
- Implements
- Inherited Members
Constructors
ParsePositionDelta(int, int)
Denotes a delta between parser positions
public ParsePositionDelta(int Line, int Col)
Parameters
Properties
Col
the column delta
public int Col { readonly get; set; }
Property Value
Line
the line delta
public int Line { readonly get; set; }
Property Value
Methods
CompareTo(ParsePositionDelta)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(ParsePositionDelta other)
Parameters
otherParsePositionDeltaAn object to compare with this instance.
Returns
- int
A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value Meaning Less than zero This instance precedes otherin the sort order.Zero This instance occurs in the same position in the sort order as other.Greater than zero This instance follows otherin the sort order.
Larger(ParsePositionDelta, ParsePositionDelta)
Calculates the larger of two diffs
public static ParsePositionDelta Larger(ParsePositionDelta delta1, ParsePositionDelta delta2)
Parameters
delta1ParsePositionDeltathe first delta
delta2ParsePositionDeltathe second delta
Returns
- ParsePositionDelta
the larger delta of the two deltas
Smaller(ParsePositionDelta, ParsePositionDelta)
Calculates the smaller of two diffs
public static ParsePositionDelta Smaller(ParsePositionDelta delta1, ParsePositionDelta delta2)
Parameters
delta1ParsePositionDeltathe first delta
delta2ParsePositionDeltathe second delta
Returns
- ParsePositionDelta
the smaller delta of the two deltas
Operators
operator >(ParsePositionDelta, ParsePositionDelta)
Determines whether the first delta is larger than the second
public static bool operator >(ParsePositionDelta delta1, ParsePositionDelta delta2)
Parameters
delta1ParsePositionDeltathe first delta
delta2ParsePositionDeltathe second delta
Returns
- bool
true, if the first delta is larger than the second
operator <(ParsePositionDelta, ParsePositionDelta)
Determines whether the first delta is smaller than the second
public static bool operator <(ParsePositionDelta delta1, ParsePositionDelta delta2)
Parameters
delta1ParsePositionDeltathe first delta
delta2ParsePositionDeltathe second delta
Returns
- bool
true, if the first delta is smaller than the second