public WhereContext where () { WhereContext _localctx = new WhereContext(Context, State); EnterRule(_localctx, 2, RULE_where); try { int _alt; EnterOuterAlt(_localctx, 1); { UseFullText(true); State = 43; ErrorHandler.Sync(this); _alt = Interpreter.AdaptivePredict(TokenStream, 2, Context); while (_alt != 1 && _alt != global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER) { if (_alt == 1 + 1) { { { State = 40; any(); } } } State = 45; ErrorHandler.Sync(this); _alt = Interpreter.AdaptivePredict(TokenStream, 2, Context); } UseFullText(false); } } catch (RecognitionException re) { _localctx.exception = re; ErrorHandler.ReportError(this, re); ErrorHandler.Recover(this, re); } finally { ExitRule(); } return(_localctx); }
private static async Task _enumerate(AsyncEnumerator <TSource> .Yield yield, WhereContext <TSource> context) { using (var enumerator = await context.Source.GetAsyncEnumeratorAsync(yield.CancellationToken).ConfigureAwait(false)) { while (await enumerator.MoveNextAsync(yield.CancellationToken).ConfigureAwait(false)) { if (context.Predicate(enumerator.Current)) { await yield.ReturnAsync(enumerator.Current).ConfigureAwait(false); } } } }
private static async Task _enumerate(AsyncEnumerator <TSource> .Yield yield, WhereContext <TSource> context) { try { while (await context.Source.MoveNextAsync(yield.CancellationToken).ConfigureAwait(false)) { if (context.Predicate(context.Source.Current)) { await yield.ReturnAsync(context.Source.Current).ConfigureAwait(false); } } } finally { if (context.DisposeSource) { context.Source.Dispose(); } } }