Example #1
0
            internal WithLotsOfChildren(SyntaxNode parent, Syntax.InternalSyntax.SyntaxList.WithManyChildren green, int position)
                : base(parent, green, position)
            {
                var childPositions = new int[green.SlotCount];

                int childPosition = position;
                var greenChildren = green.children;

                for (int i = 0; i < childPositions.Length; ++i)
                {
                    childPositions[i] = childPosition;
                    childPosition    += greenChildren[i].Value.FullWidth;
                }

                this.childPositions = childPositions;
            }
Example #2
0
            internal SeparatedWithLotsOfChildren(SyntaxNode parent, Syntax.InternalSyntax.SyntaxList.WithManyChildren green, int position)
                : base(parent, green, position)
            {
                var positions   = new int[(green.SlotCount + 1) >> 1];
                var curPosition = position;

                for (int i = 0, cnt = green.SlotCount; i < cnt; i++)
                {
                    if ((i & 1) == 0)
                    {
                        positions[i >> 1] = curPosition;
                    }

                    var child = green.GetSlot(i);
                    if (child != null)
                    {
                        curPosition += child.FullWidth;
                    }
                }

                this.positions = positions;
            }