Enhanced C#
Language of your choice: library documentation
Public fields | Public static fields | Properties | Public Member Functions | Static Public Member Functions | List of all members
Loyc.Syntax.SourceRange Struct Reference

Holds a reference to a source file (ISourceFile<char>) and the beginning and end indices of a range in that file. More...


Source file:
Inheritance diagram for Loyc.Syntax.SourceRange:
Loyc.Syntax.ISourceRange

Remarks

Holds a reference to a source file (ISourceFile<char>) and the beginning and end indices of a range in that file.

Public fields

UString SourceText => SourceRangeExt.SourceText(this)
 
ILineColumnFile Start => SourceRangeExt.Start(this)
 
ILineColumnFile End => SourceRangeExt.End(this)
 

Public static fields

static readonly SourceRange Nowhere = new SourceRange(EmptySourceFile.Synthetic, -1, 0)
 

Properties

ISourceFile Source [get]
 Returns the source file of which this range is a part. If this SourceRange represents a "synthetic" syntax tree (created programmatically), the source file may be an empty "dummy" object such as EmptySourceFile. In this case, the Length should be zero. More...
 
int StartIndex [get]
 
int EndIndex [get]
 
int Length [get]
 
char this[int subIndex] [get]
 
- Properties inherited from Loyc.Syntax.ISourceRange
ISourceFile Source [get]
 
int StartIndex [get]
 
int EndIndex [get]
 
int Length [get]
 

Public Member Functions

 SourceRange (ISourceFile source, int beginIndex=-1, int length=0)
 
 SourceRange (ISourceRange range)
 
bool Equals (SourceRange other)
 
override bool Equals (object obj)
 
override int GetHashCode ()
 
override string ToString ()
 
bool Contains (SourceRange inner)
 

Static Public Member Functions

static bool operator== (SourceRange a, SourceRange b)
 
static bool operator!= (SourceRange a, SourceRange b)
 

Property Documentation

◆ Source

ISourceFile Loyc.Syntax.SourceRange.Source
get

Returns the source file of which this range is a part. If this SourceRange represents a "synthetic" syntax tree (created programmatically), the source file may be an empty "dummy" object such as EmptySourceFile. In this case, the Length should be zero.

Referenced by Loyc.Syntax.LNode.MergeBinary().