private static void GatherNodes(InternalSyntax.SyntaxNode node, HashSet<InternalSyntax.SyntaxNode> hashset)
 {
     hashset.Add(node);
     foreach (var child in node.Children)
     {
         GatherNodes(child, hashset);
     }
 }
            internal WithManyWeakChildren(InternalSyntax.SyntaxList.WithManyChildrenBase green, SyntaxNode parent, int position)
                : base(green, parent, position)
            {
                int count = green.SlotCount;
                _children = new ArrayElement<WeakReference<SyntaxNode>>[count];

                var childOffsets = new int[count];

                int childPosition = position;
                var greenChildren = green.children;
                for (int i = 0; i < childOffsets.Length; ++i)
                {
                    childOffsets[i] = childPosition;
                    childPosition += greenChildren[i].Value.FullWidth;
                }

                _childPositions = childOffsets;
            }
 internal SeparatedWithManyWeakChildren(InternalSyntax.SyntaxList green, SyntaxNode parent, int position)
     : base(green, parent, position)
 {
     _children = new ArrayElement<WeakReference<SyntaxNode>>[(((green.SlotCount + 1) >> 1) - 1)];
 }
 internal WithTwoChildren(InternalSyntax.SyntaxList green, SyntaxNode parent, int position)
     : base(green, parent, position)
 {
 }
 internal SeparatedWithManyChildren(InternalSyntax.SyntaxList green, SyntaxNode parent, int position)
     : base(green, parent, position)
 {
     _children = new ArrayElement<SyntaxNode>[(green.SlotCount + 1) >> 1];
 }
Exemplo n.º 6
0
 internal StructuredTriviaSyntax(InternalSyntax.CSharpSyntaxNode green, SyntaxNode parent, int position)
     : base(green, position, parent == null ? null : parent.SyntaxTree)
 {
     System.Diagnostics.Debug.Assert(parent == null || position >= 0);
 }