Esempio n. 1
0
 private ConDecl(ConDecl n, bool keepCompilerData)
     : base(n.Span)
 {
     IsNew        = n.IsNew;
     IsSub        = n.IsSub;
     Name         = n.Name;
     CompilerData = keepCompilerData ? n.CompilerData : null;
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }