Example #1
0
        public static UnaryOperatorSymbol ClassifyOperation(UnaryOperatorKind kind, TypeSymbol expr)
        {
            int exprIdx = ConversionEasyOut.TypeToIndex(expr);

            if (exprIdx < 0)
            {
                return(null);
            }
            return(s_unOp[(int)kind][exprIdx]);
        }
Example #2
0
        public static BinaryOperatorSymbol ClassifyOperation(BinaryOperatorKind kind, TypeSymbol left, TypeSymbol right)
        {
            int leftIdx = ConversionEasyOut.TypeToIndex(left);

            if (leftIdx < 0)
            {
                return(null);
            }
            int rightIdx = ConversionEasyOut.TypeToIndex(right);

            if (rightIdx < 0)
            {
                return(null);
            }
            return(s_binOp[(int)kind][leftIdx, rightIdx]);
        }