Fragment

References
public abstract class Fragment
A single categorised span of a string. Fragments are created only by Fragments and are immutable once that collection is built.

Properties

After

#
Gets the index of the character after this fragment.
public int After { get; }

Defect

#
Gets a description of what is wrong with this fragment, or null when no problem exists.
public string Defect { get; }

Kind

#
Gets the category of this fragment.
public abstract FragmentKind Kind { get; }

Length

#
Gets the number of characters covered by this fragment.
public int Length { get; }

NextMeaningful

#
Gets the following fragment, skipping whitespace and single line comments. Line breaks and multi line comments are boundaries rather than trivia, and are returned rather than skipped.
public Fragment NextMeaningful { get; }

PrevMeaningful

#
Gets the preceding fragment, skipping whitespace and single line comments. Line breaks and multi line comments are boundaries rather than trivia, and are returned rather than skipped.
public Fragment PrevMeaningful { get; }

Start

#
Gets the index of the first character of this fragment within Fragments.Source. This index is absolute, and remains valid in every view derived from the original collection.
public int Start { get; }

Text

#
Gets the characters covered by this fragment.
public string Text { get; }

Methods

IsAdjacentTo

#
Gets whether this fragment is directly adjacent to the given one, with no intervening characters. Used to match multi character operators.
public bool IsAdjacentTo(
other
)

IsAll

#
Tests whether this fragment matches all of the provided filter kinds. Note: this fragment may have additional kinds not covered by the filter, if you want an exact match, just compare against Kind.
public bool IsAll(
params FragmentKind[]
filter
)

IsAny

#
Tests whether this fragment is any of the provided filter kinds.
public bool IsAny(
params FragmentKind[]
filter
)

ToString

#
Gets a description of this fragment, for debugging purposes.
public override string ToString()
Object.ToString