public static bool NeedsAsyncByItself(Expr expr) { var visitor = new NeedsAsyncByItselfVisitor(); expr.Accept(visitor); return(visitor._needsAsyncByItself); }
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; } }