Пример #1
0
		public static object Interpret(Expression expression)
		{
			var interpreter = new ExpressionInterpreter();

			var result = interpreter.Visit(expression);
			
			if (result == InterpretFailed)
			{
				result = ExpressionFastCompiler.CompileAndRun(expression);
			}

			return result;
		}
Пример #2
0
		public static object Interpret(Expression expression)
		{
			var interpreter = new ExpressionInterpreter();

			var result = interpreter.Visit(expression);
			
			if (result == InterpretFailed)
			{
				result = ExpressionFastCompiler.CompileAndRun(expression);
			}

			return result;
		}
Пример #3
0
        public static object Interpret(Expression expression)
        {
            var interpreter = new ExpressionInterpreter();

            try
            {
                var result = interpreter.Visit(expression);

                if (result == InterpretFailed)
                {
                    result = ExpressionFastCompiler.CompileAndRun(expression);
                }

                return(result);
            }
            catch (TargetInvocationException e)
            {
                throw e.InnerException;
            }
        }