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); }
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); }
protected HashLiteralExpressionImpl(LexicalInfo lexicalInfo) : base(lexicalInfo) { _items = new ExpressionPairCollection(this); }
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; }
protected AttributeImpl(LexicalInfo lexicalInfo) : base(lexicalInfo) { _arguments = new ExpressionCollection(this); _namedArguments = new ExpressionPairCollection(this); }
protected AttributeImpl(string name) { _arguments = new ExpressionCollection(this); _namedArguments = new ExpressionPairCollection(this); Name = name; }
protected AttributeImpl() { _arguments = new ExpressionCollection(this); _namedArguments = new ExpressionPairCollection(this); }