code: public JsonElement parse(JsonReader json) throws JsonIOException, JsonSyntaxException {
      boolean lenient = json.isLenient();
      json.setLenient(true);
      try {
        return Streams.parse(json);
      } catch (StackOverflowError e) {
        throw new JsonParseException("Failed parsing JSON source: " + json + " to Json", e);
      } catch (OutOfMemoryError e) {
        throw new JsonParseException("Failed parsing JSON source: " + json + " to Json", e);
      } catch (JsonParseException e) {
        if (e.getCause() instanceof EOFException) {
          return JsonNull.INSTANCE;
        }
        throw e;
      } finally {
        json.setLenient(lenient);
      }
    }
docs: Returns the next value from the JSON stream as a parse tree.
  
  @throws JsonParseException if there is an IOException or if the specified
  text is not valid JSON
  @since 1.6