private IElementType fixWrongTokenTypes(IElementType tokenType) {
    int state = getState() & 0x1f; // __XmlLexer.C_COMMENT_END is last state with value 30
    if (tokenType == XmlTokenType.XML_NAME) {
      if (state == __XmlLexer.TAG || state == __XmlLexer.END_TAG) {
        // translate XML names for tags into XmlTagName
        return XmlTokenType.XML_TAG_NAME;
      }
    } else if (tokenType == XmlTokenType.XML_WHITE_SPACE) {
      return switch (state) {
        case __XmlLexer.ATTR_LIST, __XmlLexer.ATTR -> XmlTokenType.TAG_WHITE_SPACE;
        default -> XmlTokenType.XML_REAL_WHITE_SPACE;
      };
    } else if (tokenType == XmlTokenType.XML_CHAR_ENTITY_REF ||
               tokenType == XmlTokenType.XML_ENTITY_REF_TOKEN
              ) {
      if (state == __XmlLexer.COMMENT) return XmlTokenType.XML_COMMENT_CHARACTERS;
    }
    return tokenType;
  }
private IElementType fixWrongTokenTypes(IElementType tokenType)