Base pattern for matching one element.
abstract class one pattern[readonly value element type]
implement implicit boolean call(readonly list[element type] the list)
Check whether the given list can be a start of the sequence that matches this pattern.
implement boolean is viable prefix(readonly list[element type] the list)
Returns the maximum number of the elements of a given list that matches the pattern, or null if there is no prefix match. This is a greedy match: it mtaches the longest prefix.
implement nonnegative or null match prefix(readonly list[element type] the list)
Gets the first non-empty match for this pattern.
implement range or null find first(readonly list[element type] the list, nonnegative start index)
Gets the last non-empty match in the end-to-start direction. When end_index is specified, it defines the element index after the last element index after the one being matched. If end_index is null, it defaults to the_list.size.
implement range or null find last(readonly list[element type] the list, nonnegative or null end index)
implement void validate()