예제 #1
0
        private ExpressionPairCollection VisitExpressionPairList(
            ref BoundSpillSequenceBuilder builder,
            ExpressionPairCollection args,
            bool forceSpill      = false,
            bool sideEffectsOnly = false)
        {
            var args1 = new ExpressionCollection();

            args1.AddRange(args.Select(p => p.First));
            var args2 = new ExpressionCollection();

            args2.AddRange(args.Select(p => p.Second));
            args1 = VisitExpressionList(ref builder, args1, null, forceSpill, sideEffectsOnly);
            args2 = VisitExpressionList(ref builder, args2, null, forceSpill, sideEffectsOnly);
            args.Clear();
            args.AddRange(args1.Zip(args2, (l, r) => new ExpressionPair(l.LexicalInfo, l, r)));
            return(args);
        }
예제 #2
0
        protected bool PropertiesToExpressionPairs(Expression expression,
                                                   ExpressionPairCollection pairs)
        {
            BinaryExpression assignment;

            if (!EnsureAssignment(expression, out assignment))
            {
                return(false);
            }

            ArrayLiteralExpression properties;

            if (MacroHelper.IsCompoundAssignment(assignment.Right, out properties))
            {
                foreach (Expression item in properties.Items)
                {
                    if (item == properties.Items[0])
                    {
                        pairs.Add(new ExpressionPair(assignment.Left, item));
                    }
                    else
                    {
                        BinaryExpression property;
                        if (!EnsureAssignment(item, out property))
                        {
                            return(false);
                        }

                        pairs.Add(new ExpressionPair(property.Left, property.Right));
                    }
                }
            }
            else
            {
                pairs.Add(new ExpressionPair(assignment.Left, assignment.Right));
            }

            return(true);
        }
예제 #3
0
 protected HashLiteralExpressionImpl(LexicalInfo lexicalInfo) : base(lexicalInfo)
 {
     _items = new ExpressionPairCollection(this);
 }
예제 #4
0
 protected HashLiteralExpressionImpl()
 {
     _items = new ExpressionPairCollection(this);
 }
 protected MethodInvocationExpressionImpl(LexicalInfo lexicalInfo) : base(lexicalInfo)
 {
     _arguments      = new ExpressionCollection(this);
     _namedArguments = new ExpressionPairCollection(this);
 }
 protected MethodInvocationExpressionImpl(Expression target)
 {
     _arguments      = new ExpressionCollection(this);
     _namedArguments = new ExpressionPairCollection(this);
     Target          = target;
 }
예제 #7
0
 protected AttributeImpl(LexicalInfo lexicalInfo) : base(lexicalInfo)
 {
     _arguments      = new ExpressionCollection(this);
     _namedArguments = new ExpressionPairCollection(this);
 }
예제 #8
0
 protected AttributeImpl(string name)
 {
     _arguments      = new ExpressionCollection(this);
     _namedArguments = new ExpressionPairCollection(this);
     Name            = name;
 }
예제 #9
0
 protected AttributeImpl()
 {
     _arguments      = new ExpressionCollection(this);
     _namedArguments = new ExpressionPairCollection(this);
 }