Пример #1
0
            private void NeSeqObj(NeSeqObj obj)
            {
                int len  = obj.GetSize();
                int size = 2 * len;

                for (int i = 0; i < len; i++)
                {
                    size += ObjSize(obj.GetObjAt(i));
                }
                ConsumeSize(obj, size);
            }
Пример #2
0
        private void NeSeqObj(NeSeqObj obj)
        {
            int len = obj.GetSize();

            writer.Write('(');

            if (IsMultiline(obj))
            {
                writer.Indent();

                // If we are on a fresh line, we start writing the first element
                // after the opening bracket, with just a space in between
                // Otherwise we start on the next line
                if (writer.IsNewLine())
                {
                    writer.Write(' ');
                }
                else
                {
                    writer.NewLine();
                }

                for (int i = 0; i < len; i++)
                {
                    if (i > 0)
                    {
                        writer.Write(',');
                        writer.NewLine();
                    }
                    obj.GetObjAt(i).Visit(this);
                }

                writer.UnindentedNewLine();
            }
            else
            {
                for (int i = 0; i < len; i++)
                {
                    if (i > 0)
                    {
                        writer.Write(", ");
                    }
                    obj.GetObjAt(i).Visit(this);
                }
            }

            writer.Write(')');
        }