Enhanced C#
Language of your choice: library documentation
|
A dummy implementation of ISourceFile that has only a filename, no source text. Used as the source file of synthetic syntax nodes. More...
A dummy implementation of ISourceFile that has only a filename, no source text. Used as the source file of synthetic syntax nodes.
Public static fields | |
static readonly EmptySourceFile | Default = new EmptySourceFile("") |
static readonly EmptySourceFile | Unknown = new EmptySourceFile("Unknown") |
Properties | |
string | FileName [get] |
ICharSource | Text [get] |
Properties inherited from Loyc.Syntax.ISourceFile | |
ICharSource | Text [get] |
string | FileName [get] |
Public Member Functions | |
EmptySourceFile (string fileName) | |
SourcePos | IndexToLine (int index) |
Returns the position in a source file of the specified index. More... | |
int | LineToIndex (int lineNo) |
Returns the index in a source file of the beginning of the specified line, where the first line is number 1, not 0. More... | |
int | LineToIndex (LineAndCol pos) |
|
inline |
Returns the position in a source file of the specified index.
If index is negative, this should return a SourcePos where Line and PosInLine are zero (signifying an unknown location). If index is beyond the end of the file, this should retun the final position in the file.
Implements Loyc.Syntax.IIndexToLine.
|
inline |
Returns the index in a source file of the beginning of the specified line, where the first line is number 1, not 0.
If lineNo is zero, this method should return -1 (signifying an unknown location). If lineNo is larger than the largest line number, this method should return the index of end-of-file.
Implements Loyc.Syntax.IIndexPositionMapper.