Boo.Lang.Compiler.Steps.ConstantFolding.GetFoldedIntegerLiteral C# (CSharp) Метод

GetFoldedIntegerLiteral() статический приватный Метод

static private GetFoldedIntegerLiteral ( UnaryOperatorType @operator, long operand ) : LiteralExpression
@operator UnaryOperatorType
operand long
Результат Boo.Lang.Compiler.Ast.LiteralExpression
        static LiteralExpression GetFoldedIntegerLiteral(UnaryOperatorType @operator, long operand)
        {
            long result;

            switch (@operator)
            {
                case UnaryOperatorType.UnaryNegation:
                    result = -operand;
                    break;
                case UnaryOperatorType.OnesComplement:
                    result = ~operand;
                    break;

                default:
                    return null; //not supported
            }
            return new IntegerLiteralExpression(result);
        }

Same methods

ConstantFolding::GetFoldedIntegerLiteral ( BinaryOperatorType @operator, long lhs, long rhs ) : LiteralExpression
ConstantFolding::GetFoldedIntegerLiteral ( BinaryOperatorType @operator, ulong lhs, ulong rhs ) : LiteralExpression