コード例 #1
0
 public override void print(Output @out)
 {
     table.print(@out);
     if (index.isIdentifier())
     {
         @out.print(".");
         @out.print(index.asName());
     }
     else
     {
         @out.print("[");
         index.print(@out);
         @out.print("]");
     }
 }
コード例 #2
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);
            }
        }