Пример #1
0
            private IEnumerator <object> Grouper(IEnumerator iter, object curKey)
            {
                while (PythonContext.Equal(GetKey(iter.Current), curKey))
                {
                    yield return(iter.Current);

                    if (!MoveNextHelper(iter))
                    {
                        _fFinished = true;
                        yield break;
                    }
                }
            }
Пример #2
0
            private IEnumerator <object> Yielder(IEnumerator iter)
            {
                object curKey = _starterKey;

                if (MoveNextHelper(iter))
                {
                    while (!_fFinished)
                    {
                        while (PythonContext.Equal(GetKey(iter.Current), curKey))
                        {
                            if (!MoveNextHelper(iter))
                            {
                                _fFinished = true;
                                yield break;
                            }
                        }
                        curKey = GetKey(iter.Current);
                        yield return(PythonTuple.MakeTuple(curKey, Grouper(iter, curKey)));
                    }
                }
            }