Example #1
0
        private void printEntry(int index, Output @out)
        {
            Entry      entry    = entries[index];
            Expression key      = entry.key;
            Expression @value   = entry.value;
            bool       isList   = entry.isList;
            bool       multiple = index + 1 >= entries.Count || @value.isMultiple();

            if (isList && key.isInteger() && listLength == key.asInteger())
            {
                if (multiple)
                {
                    @value.printMultiple(@out);
                }
                else
                {
                    @value.print(@out);
                }
                listLength++;
            }
            else if (isObject && key.isIdentifier())
            {
                @out.print(key.asName());
                @out.print(" = ");
                @value.print(@out);
            }
            else
            {
                @out.print("[");
                key.print(@out);
                @out.print("] = ");
                @value.print(@out);
            }
        }