Exemple #1
0
 public void EndObject()
 {
     if (currents.TryPop(out currCurr))
     {
         if (currents.TryPeek(out curr))
         {
             curr.Append(currCurr);
         }
         else
         {
             // We are first current
             root = currCurr;
         }
     }
 }
Exemple #2
0
        public void EndObject()
        {
            if (currents.TryPop(out currCurr))
            {
                if (currCurr.Type != 0)
                {
                    throw new ArithmeticException("Expected EndArray, got EndObject");
                }

                if (currents.TryPeek(out curr))
                {
                    curr.Append(currCurr);
                }
                else
                {
                    // We are first current
                    root = currCurr;
                }
            }
            else
            {
                throw new ArithmeticException("Invalid EndObject without BeginObject");
            }
        }