Beispiel #1
0
        private bool CallFunction(FunctionCallExpression expression, InterpreterScope scope)
        {
            ExpressionBase result;
            bool           success = expression.Invoke(scope, out result);

            if (!success)
            {
                if (scope.GetInterpreterContext <FunctionCallExpression>() != null)
                {
                    var error = result as ParseErrorExpression;
                    result = new ParseErrorExpression(expression.FunctionName.Name + " call failed: " + error.Message, expression.FunctionName)
                    {
                        InnerError = error
                    };
                }

                Error = result as ParseErrorExpression;
                return(false);
            }

            scope.ReturnValue = result;
            return(true);
        }