public override Variable Clone() { Identifier clone=new Identifier(_name); foreach (Variable v in _children) clone.Add(v.Clone()); return clone; }
void __add(CollectionVariable collection, List<_IndexVariablePair> pairs, string name, ref int addcount) { if (pairs.Count>0) { bool first=true; Identifier iden=new Identifier(name, collection); foreach (_IndexVariablePair pair in pairs) { collection.Children.RemoveAt(pair.i); if (first) { collection.Children.Insert(pair.i, iden); first=false; } iden.Add(pair.variable); // re-own to the new identifier } addcount++; } }