CreateWrap() public method

public CreateWrap ( Scope pCurrentScope, EXPR pOptionalExpression ) : Microsoft.CSharp.RuntimeBinder.Semantics.EXPRWRAP
pCurrentScope Scope
pOptionalExpression EXPR
return Microsoft.CSharp.RuntimeBinder.Semantics.EXPRWRAP
Example #1
0
        private static Expr CreateWraps(ExprBoundLambda anonmeth)
        {
            Expr sequence = null;

            for (Symbol sym = anonmeth.ArgumentScope.firstChild; sym != null; sym = sym.nextChild)
            {
                if (!(sym is LocalVariableSymbol local))
                {
                    continue;
                }

                Debug.Assert(anonmeth.Expression != null);
                Expr create = GenerateParameter(local.name.Text, local.GetType());
                local.wrap = ExprFactory.CreateWrap(create);
                Expr save = ExprFactory.CreateSave(local.wrap);
                if (sequence == null)
                {
                    sequence = save;
                }
                else
                {
                    sequence = ExprFactory.CreateSequence(sequence, save);
                }
            }

            return(sequence);
        }