Example #1
0
        private BoundExpression BindCountAllExpression(CountAllExpressionSyntax node)
        {
            var aggregates = LookupAggregate(node.Name).ToImmutableArray();

            if (aggregates.Length == 0)
            {
                Diagnostics.ReportUndeclaredAggregate(node.Name);
                return(new BoundErrorExpression());
            }

            if (aggregates.Length > 1)
            {
                Diagnostics.ReportAmbiguousAggregate(node.Name, aggregates);
            }

            var aggregate         = aggregates[0];
            var boundArgument     = new BoundLiteralExpression(0);
            var boundAggregatable = BindAggregatable(node.Span, aggregate, boundArgument);
            var boundAggregate    = new BoundAggregateExpression(aggregate, boundAggregatable, boundArgument);

            return(BindAggregate(node, boundAggregate));
        }
Example #2
0
 protected virtual BoundExpression RewriteLiteralExpression(BoundLiteralExpression node)
 {
     return(node);
 }
Example #3
0
 protected virtual void VisitLiteralExpression(BoundLiteralExpression node)
 {
 }