Struct SourcePos
Represents a (line, col) position in an input stream
Assembly: Pidgin.dll
Syntax
public struct SourcePos : IEquatable<SourcePos>, IComparable<SourcePos>
Constructors
|
Improve this Doc
View Source
SourcePos(Int32, Int32)
Create a new SourcePos with the specified 1-indexed line and column number.
Declaration
public SourcePos(int line, int col)
Parameters
Type |
Name |
Description |
Int32 |
line |
The 1-indexed line number
|
Int32 |
col |
The 1-indexed column number
|
Properties
|
Improve this Doc
View Source
Col
Gets the column of the position in the input stream
The value is 1-indexed: a Col value of 1 refers to the first column of the line.
Declaration
Property Value
Type |
Description |
Int32 |
The column
|
|
Improve this Doc
View Source
Line
Gets the line of the position in the input stream.
The value is 1-indexed: a Line value of 1 refers to the first line of the input document.
Declaration
Property Value
Type |
Description |
Int32 |
The line
|
Methods
|
Improve this Doc
View Source
CompareTo(SourcePos)
Declaration
public int CompareTo(SourcePos other)
Parameters
Returns
|
Improve this Doc
View Source
Equals(SourcePos)
Declaration
public bool Equals(SourcePos other)
Parameters
Returns
|
Improve this Doc
View Source
Equals(Nullable<Object>)
Declaration
public override bool Equals(object? other)
Parameters
Returns
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
|
Improve this Doc
View Source
IncrementCol()
Creates a SourcePos with the column number incremented by one
Declaration
public SourcePos IncrementCol()
Returns
|
Improve this Doc
View Source
NewLine()
Creates a SourcePos with the line number incremented by one and the column number reset to 1
Declaration
public SourcePos NewLine()
Returns
Type |
Description |
SourcePos |
A SourcePos with the line number incremented by one and the column number reset to 1
|
Operators
|
Improve this Doc
View Source
Equality(SourcePos, SourcePos)
Declaration
public static bool operator ==(SourcePos left, SourcePos right)
Parameters
Returns
|
Improve this Doc
View Source
GreaterThan(SourcePos, SourcePos)
Declaration
public static bool operator>(SourcePos left, SourcePos right)
Parameters
Returns
|
Improve this Doc
View Source
GreaterThanOrEqual(SourcePos, SourcePos)
Declaration
public static bool operator >=(SourcePos left, SourcePos right)
Parameters
Returns
|
Improve this Doc
View Source
Inequality(SourcePos, SourcePos)
Declaration
public static bool operator !=(SourcePos left, SourcePos right)
Parameters
Returns
|
Improve this Doc
View Source
LessThan(SourcePos, SourcePos)
Declaration
public static bool operator <(SourcePos left, SourcePos right)
Parameters
Returns
|
Improve this Doc
View Source
LessThanOrEqual(SourcePos, SourcePos)
Declaration
public static bool operator <=(SourcePos left, SourcePos right)
Parameters
Returns
Implements
IEquatable<>
IComparable<>