예제 #1
0
 internal MatchResult(MatchContext <T> context, int startIndex)
 {
     this._context = context;
     StartIndex    = startIndex;
     Elements      = context.GetSubsequence(StartIndex, Length).ToList();
     Groups        = new GroupContainer <T>(context);
 }
예제 #2
0
        internal override IEnumerable <MatchContext <T> > Match(MatchContext <T> context)
        {
            var groups = new GroupContainer <T>(context);

            if (!context.IsEndOfSequence && Predicate(context.CurrentItem, groups))
            {
                yield return(context.WithIndex(context.Index + 1));
            }
        }