public override ISqlNode VisitInfixOperation(SqlInfixOperationNode n)
 {
     // TODO: Can we assert a more specific requirement on Left and Right?
     _result.AssertNotNull(n, nameof(n.Left), n.Left);
     _result.AssertNotNull(n, nameof(n.Operator), n.Operator);
     _result.AssertNotNull(n, nameof(n.Right), n.Right);
     if (n.IsUnionOperation())
     {
         _result.AssertIsUnionStatement(n, nameof(n.Left), n.Left);
         _result.AssertIsUnionStatement(n, nameof(n.Right), n.Right);
     }
     else if (n.IsArithmeticOperation())
     {
         _result.AssertIsScalarExpression(n, nameof(n.Left), n.Left);
         _result.AssertIsScalarExpression(n, nameof(n.Right), n.Right);
     }
     else if (n.IsBooleanOperation())
     {
         _result.AssertIsBooleanExpression(n, nameof(n.Left), n.Left);
         _result.AssertIsBooleanExpression(n, nameof(n.Right), n.Right);
     }
     else if (n.IsComparisonOperation())
     {
         _result.AssertIsScalarExpression(n, nameof(n.Left), n.Left);
         _result.AssertIsScalarExpression(n, nameof(n.Right), n.Right);
     }
     else
     {
         _result.UnexpectedNodeType(n, nameof(n.Operator), n.Operator);
     }
     return(base.VisitInfixOperation(n));
 }
        public override ISqlNode VisitInfixOperation(SqlInfixOperationNode n)
        {
            n = base.VisitInfixOperation(n) as SqlInfixOperationNode;
            if (n.IsArithmeticOperation())
            {
                if (n.Left is SqlNumberNode nl && n.Right is SqlNumberNode nr)
                {
                    var newNode = n.Operator.Apply(nl, nr);
                    newNode.Location = n.Location;
                    return(newNode);
                }

                if (n.Left is SqlStringNode sl && n.Right is SqlStringNode a)
                {
                    var newNode = n.Operator.Apply(sl, a);
                    newNode.Location = n.Location;
                    return(newNode);
                }
            }
            // TODO: If the operation is AND or OR and both sides can reduce to one of (TRUE, FALSE), we can reduce the whole thing

            return(n);
        }