Exemple #1
0
        protected override Value RealCalc(Scope scope)
        {
            if (Op != null)
            {
                ExprOp locus = null;
                try
                {
                    return(Op.Calc(scope, locus));
                }
                catch
                {
                    if (locus != null)
                    {
                        string currentContext = ErrorContext.Current.GetContext();

                        ErrorContext.Current.AddErrorContext("While evaluating value expression:");
                        ErrorContext.Current.AddErrorContext(ErrorContext.OpContext(Op, locus));

                        if (Logger.Current.ShowInfo())
                        {
                            ErrorContext.Current.AddErrorContext("The value expression tree was:");
                            ErrorContext.Current.AddErrorContext(Op.Dump());
                        }

                        if (!String.IsNullOrEmpty(currentContext))
                        {
                            ErrorContext.Current.AddErrorContext(currentContext);
                        }
                    }
                    throw;
                }
            }
            return(new Value());
        }