private IEnumerable <int> ParseParallel(ParallelState state) { using (state) { foreach (var batch in state.GetBatches()) { // If the collation of rows happened correctly, this should have a precise value. Contracts.Assert(batch.Total == _total + 1); _total = batch.Total - 1; for (int irow = batch.IrowMin; irow < batch.IrowLim; irow++) { ++_total; yield return(irow); } } if (state.ParsingException != null) { throw Ch.ExceptDecode(state.ParsingException, "Parsing failed with an exception: {0}", state.ParsingException.Message); } } }