docs: @SuppressWarnings("fallthrough")
    private void beforeValue() throws IOException {
      switch (peekScope()) {
        case NONEMPTY_DOCUMENT:
          if (!lenient) {
            throw new IllegalStateException(
                "JSON must have only one top-level value.");
          }
          // fall-through
        case EMPTY_DOCUMENT: // first in document
          replaceTop(NONEMPTY_DOCUMENT);
          break;
  
        case EMPTY_ARRAY: // first in array
          replaceTop(NONEMPTY_ARRAY);
          newline();
          break;
  
        case NONEMPTY_ARRAY: // another in array
          sink.writeByte(',');
          newline();
          break;
  
        case DANGLING_NAME: // value for name
          sink.writeUtf8(separator);
          replaceTop(NONEMPTY_OBJECT);
          break;
  
        default:
          throw new IllegalStateException("Nesting problem.");
      }
    }