GlueViewOfficialPlugins.Scripting.ExpressionParser.EvaluateUnaryOperatorExpression C# (CSharp) Method

EvaluateUnaryOperatorExpression() private method

private EvaluateUnaryOperatorExpression ( UnaryOperatorExpression unaryOperatorExpression, CodeContext context ) : object
unaryOperatorExpression UnaryOperatorExpression
context GlueView.Scripting.CodeContext
return object
        private object EvaluateUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression, CodeContext context)
        {
            ExpressionParseType referenceOrValue;
            var operatorType = unaryOperatorExpression.Operator;
            if(operatorType == UnaryOperatorType.PostDecrement ||
                operatorType == UnaryOperatorType.PostIncrement ||
                operatorType == UnaryOperatorType.Decrement ||
                operatorType == UnaryOperatorType.Increment)
            {
                referenceOrValue = ExpressionParseType.GetReference;
            }
            else
            {
                referenceOrValue = ExpressionParseType.Evaluate;
            }
            // We need to get referene so that the 
            object value = EvaluateExpression(unaryOperatorExpression.Expression, context, referenceOrValue);
            if (value == null)
            {
                return value;
            }
            else
            {

                return PrimitiveOperationManager.Self.ApplyUnaryOperation(unaryOperatorExpression.Operator, value, referenceOrValue);
            }

        }