Struct Position
- Namespace
- EzrSquared
- Assembly
- ezrSquared-lib.dll
The representation of a position in the script.
public readonly struct Position
Constructors
Position(int, int, string, string)
The representation of a position in the script.
public Position(int index, int line, string file, string script)
Parameters
indexintThe index of the Position in the script.
lineintThe line number of the Position in the script.
filestringThe file name/path of the script.
scriptstringThe script as text.
Fields
File
The file name/path of the script.
public readonly string File
Field Value
- string
Index
The index of the Position in the script.
public readonly int Index
Field Value
- int
Line
The line number of the Position in the script.
public readonly int Line
Field Value
- int
None
A position that does not exist.
public static readonly Position None
Field Value
Script
The script as text.
public readonly string Script
Field Value
- string
Methods
Advance()
public Position Advance()
Returns
Advance(char)
Advances the Position and increments Index by 1. If currentChar is a new-line character, Line is also incremented by 1.
public Position Advance(char currentChar)
Parameters
currentCharcharThe character associated with the Position before advancing.
Returns
ReverseTo(int, int)
Reverses to the given index.
public Position ReverseTo(int index, int lineDecrement)
Parameters
indexintThe index to reverse to.
lineDecrementintThe decrement for Line.