private ConDecl(ConDecl n, bool keepCompilerData) : base(n.Span) { IsNew = n.IsNew; IsSub = n.IsSub; Name = n.Name; CompilerData = keepCompilerData ? n.CompilerData : null; }
internal override Node ShallowClone(Node replace, int pos) { var cnode = new ConDecl(this, true); int occurs = 0; if (Config != null) { cnode.Config = CloneField <Config>(Config, replace, pos, ref occurs); } cnode.Fields = new ImmutableCollection <Field>(CloneCollection <Field>(fields, replace, pos, ref occurs, out cnode.fields)); return(cnode); }
internal override Node DeepClone(IEnumerable <Node> clonedChildren, bool keepCompilerData) { var cnode = new ConDecl(this, keepCompilerData); cnode.cachedHashCode = this.cachedHashCode; using (var cenum = clonedChildren.GetEnumerator()) { if (Config != null) { cnode.Config = TakeClone <Config>(cenum); } cnode.Fields = new ImmutableCollection <Field>(TakeClones <Field>(fields.Count, cenum, out cnode.fields)); } return(cnode); }