WordFragment
FragmentA run of letters, digits and underscores, starting with a letter or an underscore. Words are scanned greedily, so "point2" is a single word and the 'e' inside "Hello" cannot be mistaken for Euler's number.
Properties
Defect
Gets a description of what is wrong with this fragment, or null when no problem exists.
inherited fromFragment
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.
inherited fromFragment
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.
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.
Methods
Is
#Compare this word against several spellings, ignoring case, which is how a notation accepts both "point" and "pt".
Parameters:
| words (params string[]) |
Is
#public bool Is(string word, StringComparison comparison = StringComparison.InvariantCultureIgnoreCase)
Compare this word against the given one, ignoring case by default.
Parameters:
| word (string) | |
| comparison (StringComparison = StringComparison.InvariantCultureIgnoreCase) |
IsAdjacentTo
Gets whether this fragment is directly adjacent to the given one, with no intervening characters. Used to match multi character operators.
Parameters:
| other (Fragment) |
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 Fragment.Kind.
Parameters:
| filter (params FragmentKind[]) |
IsAny
Tests whether this fragment is any of the provided filter kinds.
Parameters:
| filter (params FragmentKind[]) |
ToString
Gets a description of this fragment, for debugging purposes.
Overrides: Object.ToString