anchor.diff:    }
   }
   
  -dynamic /* o.Expression | o.Statement */ _convertToStatementIfNeeded(
  -    _Mode mode, o.Expression expr) {
  -  if (identical(mode, _Mode.Statement)) {
  -    return expr.toStmt();
  -  } else {
  -    return expr;
  -  }
  -}
  -
  -void _ensureStatementMode(_Mode mode, compiler_ast.AST ast) {
  -  if (!identical(mode, _Mode.Statement)) {
  -    throwFailure('Expected a statement, but saw "$ast"');
  -  }
  -}
  -
  -void _ensureExpressionMode(_Mode mode, compiler_ast.AST ast) {
  -  if (!identical(mode, _Mode.Expression)) {
  -    throwFailure('Expected an expression, but saw "$ast"');
  -  }
  -}
  -
  -void _flattenStatements(dynamic arg, List<o.Statement> output) {
  -  if (arg is List) {
  -    for (var entry in arg) {
  -      _flattenStatements(entry, output);
  -    }
  -  } else {
  -    output.add(arg as o.Statement);
  -  }
  -}
  -
   bool _isBoolType(o.OutputType type) {
     if (type == o.BOOL_TYPE) return true;
     if (type is o.ExternalType) {
  
positive.code:             ? _compressWhitespacePreceding(ast.strings[i])
              : replaceNgSpace(ast.strings[i]);
          args.add(o.literal(literalText));
          args.add(
              ast.expressions[i].visit<dynamic, _Mode>(this, _Mode.Expression));
        }
        args.add(o.literal(
            _compressWhitespaceFollowing(ast.strings[ast.strings.length - 1])));
  
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;
    }
  }
  