예제 #1
0
파일: Compr.cs 프로젝트: thisiscam/formula
        internal override Node ShallowClone(Node replace, int pos)
        {
            var cnode  = new Compr(this, true);
            int occurs = 0;

            cnode.Heads  = new ImmutableCollection <Node>(CloneCollection <Node>(heads, replace, pos, ref occurs, out cnode.heads));
            cnode.Bodies = new ImmutableCollection <Body>(CloneCollection <Body>(bodies, replace, pos, ref occurs, out cnode.bodies));
            return(cnode);
        }
예제 #2
0
파일: Compr.cs 프로젝트: thisiscam/formula
        internal override Node DeepClone(IEnumerable <Node> clonedChildren, bool keepCompilerData)
        {
            var cnode = new Compr(this, keepCompilerData);

            cnode.cachedHashCode = this.cachedHashCode;
            using (var cenum = clonedChildren.GetEnumerator())
            {
                cnode.Heads  = new ImmutableCollection <Node>(TakeClones <Node>(heads.Count, cenum, out cnode.heads));
                cnode.Bodies = new ImmutableCollection <Body>(TakeClones <Body>(bodies.Count, cenum, out cnode.bodies));
            }

            return(cnode);
        }
예제 #3
0
파일: Compr.cs 프로젝트: thisiscam/formula
 private Compr(Compr n, bool keepCompilerData)
     : base(n.Span)
 {
     CompilerData = keepCompilerData ? n.CompilerData : null;
 }