Example #1
0
        protected virtual void CreateArguments(ResolveContext ec, Parameter parameter, ref Arguments args)
        {
            args = new Arguments(2);

            LambdaExpression selector = new LambdaExpression(loc);

            block.SetParameter(parameter);
            selector.Block = block;
            selector.Block.AddStatement(new ContextualReturn(expr));

            args.Add(new Argument(selector));
        }
Example #2
0
        protected override void CreateArguments(ResolveContext ec, Parameter parameter, ref Arguments args)
        {
            base.CreateArguments(ec, parameter, ref args);

            if (element_selector != null)
            {
                LambdaExpression lambda = new LambdaExpression(element_selector.Location);

                element_block.SetParameter(parameter.Clone());
                lambda.Block = element_block;
                lambda.Block.AddStatement(new ContextualReturn(element_selector));
                args.Add(new Argument(lambda));
            }
        }
Example #3
0
        protected override void CreateArguments(ResolveContext ec, Parameter parameter, ref Arguments args)
        {
            args = new Arguments(4);

            if (IdentifierType != null)
            {
                expr = CreateCastExpression(expr);
            }

            args.Add(new Argument(expr));

            outer_selector.SetParameter(parameter.Clone());
            var lambda = new LambdaExpression(outer_selector.StartLocation);

            lambda.Block = outer_selector;
            args.Add(new Argument(lambda));

            inner_selector.SetParameter(new ImplicitLambdaParameter(identifier.Name, identifier.Location));
            lambda       = new LambdaExpression(inner_selector.StartLocation);
            lambda.Block = inner_selector;
            args.Add(new Argument(lambda));

            base.CreateArguments(ec, parameter, ref args);
        }