示例#1
0
        public static bool NeedsAsyncByItself(Expr expr)
        {
            var visitor = new NeedsAsyncByItselfVisitor();

            expr.Accept(visitor);
            return(visitor._needsAsyncByItself);
        }
示例#2
0
        public override void Visit(ChainExpr expr)
        {
            if (ReferencesRootVariableVisitor.ReferencesRootVariable(expr))
            {
                _needsAsync = true;
                return;
            }

            // Some things can't be simplified by themselves, but they can be in the
            // context of a chain. If this chain doesn't need to be asynchronous, then
            // the next key or index won't need it either.
            if (NeedsAsyncByItselfVisitor.NeedsAsyncByItself(expr.Next))
            {
                _needsAsync = true;
                return;
            }
        }