anchor.diff:    NameResolver scope();
   }
   
  -/// Converts a bound [AST] expression to an [Expression].
  +/// Converts a bound [AST] expression to an [o.Expression].
   ///
   /// If non-null, [boundType] is the type of the input to which [expression] is
   /// bound. This is used to support empty expressions for boolean inputs, and to
  
positive.code:   o.OutputType boundType,
  ) {
    assert(nameResolver != null);
    final visitor =
        _AstToIrVisitor(nameResolver, implicitReceiver, metadata, boundType);
    return _visit(expression, visitor, _Mode.Expression, expressionSourceSpan);
  }
  
  List<o.Statement> convertCdStatementToIr(
    NameResolver nameResolver,
    o.Expression implicitReceiver,
  
negative.code:   }
    return false;
  }
  
  class _AstToStatementVisitor
      implements compiler_ast.AstVisitor<List<o.Statement>, bool> {
    final _AstToExpressionVisitor _expressionVisitor;
  
    _AstToStatementVisitor(this._expressionVisitor);
  
    @override
    List<o.Statement> visitBinary(compiler_ast.Binary ast, bool visitingRoot) =>
        _visitExpression(ast, visitingRoot);
  
    @override
    List<o.Statement> visitChain(compiler_ast.Chain ast, _) {
      return _visitAll(ast.expressions, false /* visitingRoot */);
    }
  
    @override
    List<o.Statement> visitConditional(
            compiler_ast.Conditional ast, bool visitingRoot) =>
        _visitExpression(ast, visitingRoot);
  
    @override
    List<o.Statement> visitEmptyExpr(
            compiler_ast.EmptyExpr ast, bool visitingRoot) =>
        _visitExpression(ast, visitingRoot);
  
    @override
    List<o.Statement> visitPipe(
            compiler_ast.BindingPipe ast, bool visitingRoot) =>
        _visitExpression(ast, visitingRoot);
  
    @override
    List<o.Statement> visitFunctionCall(
            compiler_ast.FunctionCall ast, bool visitingRoot) =>
        _visitExpression(ast, visitingRoot);
  
    @override
    List<o.Statement> visitIfNull(compiler_ast.IfNull ast, bool visitingRoot) =>
        _visitExpression(ast, visitingRoot);
  
    @override
    List<o.Statement> visitImplicitReceiver(
        compiler_ast.ImplicitReceiver ast, _) {
      throw UnsupportedError('ImplicitReceiver not supported for statements.');
    }
  
    @override
    List<o.Statement> visitInterpolation(compiler_ast.Interpolation ast, _) {
      throw UnsupportedError('Interpolation not suported for statements.');
    }
  
    @override
    List<o.Statement> visitKeyedRead(
            compiler_ast.KeyedRead ast, bool visitingRoot) =>
        _visitExpression(ast, visitingRoot);
  
    @override
    List<o.Statement> visitKeyedWrite(
            compiler_ast.KeyedWrite ast, bool visitingRoot) =>
        _visitExpression(ast, visitingRoot);
  
    @override
    List<o.Statement> visitLiteralArray(
            compiler_ast.LiteralArray ast, bool visitingRoot) =>
        _visitExpression(ast, visitingRoot);
  
    @override
    List<o.Statement> visitLiteralMap(
            compiler_ast.LiteralMap ast, bool visitingRoot) =>
        _visitExpression(ast, visitingRoot);
  
    @override
    List<o.Statement> visitLiteralPrimitive(
            compiler_ast.LiteralPrimitive ast, bool visitingRoot) =>
        _visitExpression(ast, visitingRoot);
  
    @override
    List<o.Statement> visitMethodCall(
            compiler_ast.MethodCall ast, bool visitingRoot) =>
        _visitExpression(ast, visitingRoot);
  
    @override
    List<o.Statement> visitPrefixNot(
            compiler_ast.PrefixNot ast, bool visitingRoot) =>
        _visitExpression(ast, visitingRoot);
  
    @override
    List<o.Statement> visitPropertyRead(
            compiler_ast.PropertyRead ast, bool visitingRoot) =>
        _visitExpression(ast, visitingRoot);
  
    @override
    List<o.Statement> visitPropertyWrite(
            compiler_ast.PropertyWrite ast, bool visitingRoot) =>
        _visitExpression(ast, visitingRoot);
  
    @override
    List<o.Statement> visitSafePropertyRead(
            compiler_ast.SafePropertyRead ast, bool visitingRoot) =>
        _visitExpression(ast, visitingRoot);
  
    @override
    List<o.Statement> visitSafeMethodCall(
            compiler_ast.SafeMethodCall ast, bool visitingRoot) =>
        _visitExpression(ast, visitingRoot);
  
    @override
    List<o.Statement> visitStaticRead(
            compiler_ast.StaticRead ast, bool visitingRoot) =>
        _visitExpression(ast, visitingRoot);
  
    @override
    List<o.Statement> visitNamedExpr(
            compiler_ast.NamedExpr ast, bool visitingRoot) =>
        _visitExpression(ast, visitingRoot);
  
    List<o.Statement> _visitExpression(compiler_ast.AST ast, bool visitingRoot) =>
        [ast.visit(_expressionVisitor, visitingRoot).toStmt()];
  
    List<o.Statement> _visitAll(List<compiler_ast.AST> asts, bool visitingRoot) {
      final statements = <o.Statement>[];
      for (var ast in asts) {
        statements.addAll(ast.visit(this, visitingRoot));
      }
      return statements;
    }
  }
  