private void readString()

in util/json/src/main/java/jetbrains/jetpad/json/JsonLexer.java [157:188]


  private void readString() {
    if (!(readString("\""))) {
      throw new JsonParsingException();
    }

    while (getCurrent() != '"' && getCurrent() != -1) {
      if (getCurrent() == '\\') {
        advance();
        if (JsonUtil.isUnescapedSpecialChar((char) getCurrent())) {
          advance();
        } else if (getCurrent() == 'u') {
          advance();
          for (int i = 0; i < 4; i++) {
            if (!(isHexDigit(getCurrent()))) {
              throw new JsonParsingException();
            }
            advance();
          }
        } else {
          throw new RuntimeException();
        }
      } else if (JsonUtil.isControlChar((char) getCurrent())) {
        throw new JsonParsingException();
      } else {
        advance();
      }
    }

    if (!(readString("\""))) {
      throw new JsonParsingException();
    }
  }