public static Expression Quote(Expression expression, object hoistedLocals, object[] locals)
        {
            Debug.Assert(hoistedLocals != null && locals != null);
            var quoter = new ExpressionQuoter((HoistedLocals)hoistedLocals, locals);

            return(quoter.Visit(expression));
        }
예제 #2
0
        public override int Run(InterpretedFrame frame)
        {
            Expression operand = _operand;

            if (_hoistedVariables != null)
            {
                operand = new ExpressionQuoter(_hoistedVariables, frame).Visit(operand);
            }
            frame.Push(operand);
            return(1);
        }
        /// <summary>
        ///     Quotes the provided expression tree.
        /// </summary>
        /// <param name="expression">The expression to quote.</param>
        /// <param name="hoistedLocals">The hoisted local state provided by the compiler.</param>
        /// <param name="locals">The actual hoisted local values.</param>
        /// <returns>The quoted expression.</returns>
        // [Obsolete("do not use this method", true), EditorBrowsable(EditorBrowsableState.Never)]
        public static Expression Quote(Expression expression, object hoistedLocals, object[] locals)
        {
            if (hoistedLocals == null)
            {
                throw new ArgumentNullException(nameof(hoistedLocals));
            }
            if (locals == null)
            {
                throw new ArgumentNullException(nameof(locals));
            }
            var quoter = new ExpressionQuoter((HoistedLocals)hoistedLocals, locals);

            return(quoter.Visit(expression));
        }
예제 #4
0
        public static Expression Quote(Expression expression, object hoistedLocals, object[] locals)
        {
            ExpressionQuoter quoter = new ExpressionQuoter((HoistedLocals)hoistedLocals, locals);

            return(quoter.Visit(expression));
        }